This commit is contained in:
Vitor Santos Costa 2018-06-18 10:51:01 +01:00
parent ca814eef07
commit 41bea46575
7 changed files with 86 additions and 80 deletions

View File

@ -633,8 +633,10 @@ type_of_verb(rest,passive).
*/ */
#include <Yatom.h>
#include "absmi.h" #include "absmi.h"
#include <Yatom.h>
#include "YapCompile.h" #include "YapCompile.h"
#if DEBUG #if DEBUG
#include "yapio.h" #include "yapio.h"

116
C/stack.c
View File

@ -1391,12 +1391,12 @@ void Yap_dump_code_area_for_profiler(void) {
while (pp != NULL) { while (pp != NULL) {
/* if (pp->ArityOfPE) { /* if (pp->ArityOfPE) {
fprintf(stderr,"\%s/%d %p\n", fprintf(stderr,"%%s/%d %p\n",
RepAtom(NameOfFunctor(pp->FunctorOfPred))->StrOfAE, RepAtom(NameOfFunctor(pp->FunctorOfPred))->StrOfAE,
pp->ArityOfPE, pp->ArityOfPE,
pp); pp);
} else { } else {
fprintf(stderr,"\%s %p\n", fprintf(stderr,"%%s %p\n",
RepAtom((Atom)(pp->FunctorOfPred))->StrOfAE, RepAtom((Atom)(pp->FunctorOfPred))->StrOfAE,
pp); pp);
}*/ }*/
@ -1797,82 +1797,83 @@ void Yap_dump_stack(void) {
if (handled_exception(PASS_REGS1)) if (handled_exception(PASS_REGS1))
return; return;
#if DEBU #if DEBU
fprintf(stderr, "\% YAP regs: P=%p, CP=%p, ASP=%p, H=%p, TR=%p, HeapTop=%p\n", fprintf(stderr, "%% YAP regs: P=%p, CP=%p, ASP=%p, H=%p, TR=%p, HeapTop=%p\n",
P, CP, ASP, HR, TR, HeapTop); P, CP, ASP, HR, TR, HeapTop);
#endif #endif
fprintf(stderr, "\% \n% =====================================\n\%\n"); fprintf(stderr, "%% \n%% =====================================\n%%\n");
fprintf(stderr, "\% \n% YAP Status:\n"); fprintf(stderr, "%% \n%% YAP Status:\n");
fprintf(stderr, "\% \n\% -------------------------------------\n\%\n"); fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
yap_error_descriptor_t errno = LOCAL_Error_TYPE; yap_error_number errnbr = LOCAL_Error_TYPE;
yap_error_class_number classno = Yap_errorClass(errno); yap_error_class_number classno = Yap_errorClass(errnbr);
fprintf(stderr, "\% Error STATUS: %s/%s\n\n", Yap_errorName(errno), fprintf(stderr, "%% Error STATUS: %s/%s\n\n", Yap_errorName(errnbr),
Yap_errorName(classno)); Yap_errorName(classno));
fprintf(stderr, "\% Execution mode\n"); fprintf(stderr, "%% Execution mode\n");
if (LOCAL_PrologMode & BootMode) if (LOCAL_PrologMode & BootMode)
fprintf(stderr, "\% Bootstrap\n"); fprintf(stderr, "%% Bootstrap\n");
if (LOCAL_PrologMode & UserMode) if (LOCAL_PrologMode & UserMode)
fprintf(stderr, "\% User Prolo\n"); fprintf(stderr, "%% User Prolo\n");
if (LOCAL_PrologMode & CritMode) if (LOCAL_PrologMode & CritMode)
fprintf(stderr, "\% Exclusive Access Mode\n"); fprintf(stderr, "%% Exclusive Access Mode\n");
if (LOCAL_PrologMode & AbortMode) if (LOCAL_PrologMode & AbortMode)
fprintf(stderr, "\% Abort\n"); fprintf(stderr, "%% Abort\n");
if (LOCAL_PrologMode & InterruptMode) if (LOCAL_PrologMode & InterruptMode)
fprintf(stderr, "\% Interrupt\n"); fprintf(stderr, "%% Interrupt\n");
if (LOCAL_PrologMode & InErrorMode) if (LOCAL_PrologMode & InErrorMode)
fprintf(stderr, "\% Error\n"); fprintf(stderr, "%% Error\n");
if (LOCAL_PrologMode & ConsoleGetcMode) if (LOCAL_PrologMode & ConsoleGetcMode)
fprintf(stderr, "\% Prompt Console\n"); fprintf(stderr, "%% Prompt Console\n");
if (LOCAL_PrologMode & ExtendStackMode) if (LOCAL_PrologMode & ExtendStackMode)
fprintf(stderr, "\% Stack expansion \n"); fprintf(stderr, "%% Stack expansion \n");
if (LOCAL_PrologMode & GrowHeapMode) if (LOCAL_PrologMode & GrowHeapMode)
fprintf(stderr, "\% Data Base Expansion\n"); fprintf(stderr, "%% Data Base Expansion\n");
if (LOCAL_PrologMode & GrowStackMode) if (LOCAL_PrologMode & GrowStackMode)
fprintf(stderr, "\% User Prolog\n"); fprintf(stderr, "%% User Prolog\n");
if (LOCAL_PrologMode & GCMode) if (LOCAL_PrologMode & GCMode)
fprintf(stderr, "\% Garbage Collection\n"); fprintf(stderr, "%% Garbage Collection\n");
if (LOCAL_PrologMode & ErrorHandlingMode) if (LOCAL_PrologMode & ErrorHandlingMode)
fprintf(stderr, "\% Error handler\n"); fprintf(stderr, "%% Error handler\n");
if (LOCAL_PrologMode & CCallMode) if (LOCAL_PrologMode & CCallMode)
fprintf(stderr, "\% System Foreign Code\n"); fprintf(stderr, "%% System Foreign Code\n");
if (LOCAL_PrologMode & UnifyMode) if (LOCAL_PrologMode & UnifyMode)
fprintf(stderr, "\% Off-line Foreign Code\n"); fprintf(stderr, "%% Off-line Foreign Code\n");
if (LOCAL_PrologMode & UserCCallMode) if (LOCAL_PrologMode & UserCCallMode)
fprintf(stderr, "\% User Foreig C\n"); fprintf(stderr, "%% User Foreig C\n");
if (LOCAL_PrologMode & MallocMode) if (LOCAL_PrologMode & MallocMode)
fprintf(stderr, "\% Heap Allocaror\n"); fprintf(stderr, "%% Heap Allocaror\n");
if (LOCAL_PrologMode & SystemMode) if (LOCAL_PrologMode & SystemMode)
fprintf(stderr, "\% Prolog Internals\n"); fprintf(stderr, "%% Prolog Internals\n");
if (LOCAL_PrologMode & AsyncIntMode) if (LOCAL_PrologMode & AsyncIntMode)
fprintf(stderr, "\% Async Interruot mode\n"); fprintf(stderr, "%% Async Interruot mode\n");
if (LOCAL_PrologMode & InReadlineMode) if (LOCAL_PrologMode & InReadlineMode)
fprintf(stderr, "\% Readline Console\n"); fprintf(stderr, "%% Readline Console\n");
if (LOCAL_PrologMode & TopGoalMode) if (LOCAL_PrologMode & TopGoalMode)
fprintf(stderr, "\% Creating new query\n"); fprintf(stderr, "%% Creating new query\n");
fprintf(stderr, "\% \n\% -------------------------------------\n\%\n"); fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "\% \n% YAP Program :\n"); fprintf(stderr, "%% \n%% YAP Program:\n");
fprintf(stderr, "\% \n\% -------------------------------------\n\%\n"); fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "\% Program Position\n\n", Yap_errorName(errno), fprintf(stderr, "%% Program Position\n\n", Yap_errorName(errno) );
Yap_errorName(classno); fprintf(stderr, "%% PC: %s\n", (char *)HR);
Yap_detect_bug_location(CP, FIND_PRED_FROM_ANYWHERE, 256); Yap_detect_bug_location(CP, FIND_PRED_FROM_ANYWHERE, 256);
fprintf(stderr, "\% PC: %s\n", (char *)HR); fprintf(stderr, "%% Continuation: %s\n", (char *)HR);
Yap_detect_bug_location(CP, FIND_PRED_FROM_ANYWHERE, 256);
fprintf(stderr, "\% Continuation: %s\n", (char *)HR);
Yap_detect_bug_location(B->cp_ap, FIND_PRED_FROM_ANYWHERE, 256); Yap_detect_bug_location(B->cp_ap, FIND_PRED_FROM_ANYWHERE, 256);
fprintf(stderr, "\% Alternative: %s\n", (char *)HR); fprintf(stderr, "%% Alternative: %s\n", (char *)HR);
fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "%% \n%% YAP Stack Usage:\n");
fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
if (HR > ASP || HR > LCL0) { if (HR > ASP || HR > LCL0) {
fprintf(stderr, "\% YAP ERROR: Global Collided against Local (%p--%p)\n", fprintf(stderr, "%% YAP ERROR: Global Collided against Local (%p--%p)\n",
HR, ASP); HR, ASP);
} else if (HeapTop > (ADDR)LOCAL_GlobalBase) { } else if (HeapTop > (ADDR)LOCAL_GlobalBase) {
fprintf(stderr, fprintf(stderr,
"\% YAP ERROR: Code Space Collided against Global (%p--%p)\n", "%% YAP ERROR: Code Space Collided against Global (%p--%p)\n",
HeapTop, LOCAL_GlobalBase); HeapTop, LOCAL_GlobalBase);
} else { } else {
#if !USE_SYSTEM_MALLOC #if !USE_SYSTEM_MALLOC
fprintf(stderr, "\%ldKB of Code Space (%p--%p)\n", fprintf(stderr, "%%ldKB of Code Space (%p--%p)\n",
(long int)((CELL)HeapTop - (CELL)Yap_HeapBase) / 1024, Yap_HeapBase, (long int)((CELL)HeapTop - (CELL)Yap_HeapBase) / 1024, Yap_HeapBase,
HeapTop); HeapTop);
#if USE_DL_MALLOC #if USE_DL_MALLOC
@ -1885,14 +1886,14 @@ void Yap_dump_stack(void) {
} }
#endif #endif
#endif #endif
fprintf(stderr, "\% %luKB of Global Stack (%p--%p)\n", fprintf(stderr, "%% %luKB of Global Stack (%p--%p)\n",
(unsigned long int)(sizeof(CELL) * (HR - H0)) / 1024, H0, HR); (unsigned long int)(sizeof(CELL) * (HR - H0)) / 1024, H0, HR);
fprintf(stderr, "\% %luKB of Local Stack (%p--%p)\n", fprintf(stderr, "%% %luKB of Local Stack (%p--%p)\n",
(unsigned long int)(sizeof(CELL) * (LCL0 - ASP)) / 1024, ASP, LCL0); (unsigned long int)(sizeof(CELL) * (LCL0 - ASP)) / 1024, ASP, LCL0);
fprintf(stderr, "\% %luKB of Trail (%p--%p)\n", fprintf(stderr, "%% %luKB of Trail (%p--%p)\n",
(unsigned long int)((ADDR)TR - LOCAL_TrailBase) / 1024, (unsigned long int)((ADDR)TR - LOCAL_TrailBase) / 1024,
LOCAL_TrailBase, TR); LOCAL_TrailBase, TR);
fprintf(stderr, "\% Performed %ld garbage collections\n", fprintf(stderr, "%% Performed %ld garbage collections\n",
(unsigned long int)LOCAL_GcCalls); (unsigned long int)LOCAL_GcCalls);
#if LOW_LEVEL_TRACER #if LOW_LEVEL_TRACER
{ {
@ -1907,20 +1908,23 @@ void Yap_dump_stack(void) {
} }
} }
#endif #endif
fprintf(stderr, "\% All Active Calls and\n"); fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "\% Goals With Alternatives Open (Global In " fprintf(stderr, "%% \n%% YAP Stack:\n");
fprintf(stderr, "%% \n%% -------------------------------------\n%%\n");
fprintf(stderr, "%% All Active Calls and\n");
fprintf(stderr, "%% Goals With Alternatives Open (Global In "
"Use--Local In Use)\n%%\n"); "Use--Local In Use)\n%%\n");
while (b_ptr != NULL) { while (b_ptr != NULL) {
while (env_ptr && env_ptr <= (CELL *)b_ptr) { while (env_ptr && env_ptr <= (CELL *)b_ptr) {
Yap_detect_bug_location(ipc, FIND_PRED_FROM_ENV, 256); Yap_detect_bug_location(ipc, FIND_PRED_FROM_ENV, 256);
if (env_ptr == (CELL *)b_ptr && (choiceptr)env_ptr[E_CB] > b_ptr) { if (env_ptr == (CELL *)b_ptr && (choiceptr)env_ptr[E_CB] > b_ptr) {
b_ptr = b_ptr->cp_b; b_ptr = b_ptr->cp_b;
fprintf(stderr, "\% %s\n", tp); fprintf(stderr, "%% %s\n", tp);
} else { } else {
fprintf(stderr, "%% %s\n", tp); fprintf(stderr, "%% %s\n", tp);
} }
if (!max_count--) { if (!max_count--) {
fprintf(stderr, "\% .....\n"); fprintf(stderr, "%% .....\n");
return; return;
} }
ipc = (yamop *)(env_ptr[E_CP]); ipc = (yamop *)(env_ptr[E_CP]);
@ -1928,7 +1932,7 @@ void Yap_dump_stack(void) {
} }
if (b_ptr) { if (b_ptr) {
if (!max_count--) { if (!max_count--) {
fprintf(stderr, "\%\** .....\n"); fprintf(stderr, "%%\** .....\n");
return; return;
} }
if (b_ptr->cp_ap && /* tabling */ if (b_ptr->cp_ap && /* tabling */
@ -1937,7 +1941,7 @@ void Yap_dump_stack(void) {
b_ptr->cp_ap->opc != Yap_opcode(_Nstop)) { b_ptr->cp_ap->opc != Yap_opcode(_Nstop)) {
/* we can safely ignore ; because there is always an upper env */ /* we can safely ignore ; because there is always an upper env */
Yap_detect_bug_location(b_ptr->cp_ap, FIND_PRED_FROM_CP, 256); Yap_detect_bug_location(b_ptr->cp_ap, FIND_PRED_FROM_CP, 256);
fprintf(stderr, "\% %s (%luKB--%luKB)\n", tp, fprintf(stderr, "%% %s (%luKB--%luKB)\n", tp,
(unsigned long int)((b_ptr->cp_h - H0) * sizeof(CELL) / 1024), (unsigned long int)((b_ptr->cp_h - H0) * sizeof(CELL) / 1024),
(unsigned long int)((ADDR)LCL0 - (ADDR)b_ptr) / 1024); (unsigned long int)((ADDR)LCL0 - (ADDR)b_ptr) / 1024);
} }
@ -2002,7 +2006,7 @@ void DumpActiveGoals(USES_REGS1) {
op_numbers opnum; op_numbers opnum;
if (!ONLOCAL(b_ptr) || b_ptr->cp_b == NULL) if (!ONLOCAL(b_ptr) || b_ptr->cp_b == NULL)
break; break;
fprintf(stderr, "\%p ", b_ptr); fprintf(stderr, "%%p ", b_ptr);
pe = Yap_PredForChoicePt(b_ptr, &opnum); pe = Yap_PredForChoicePt(b_ptr, &opnum);
if (opnum == _Nstop) { if (opnum == _Nstop) {
fprintf(stderr, " ********** C-Code Interface Boundary ***********\n"); fprintf(stderr, " ********** C-Code Interface Boundary ***********\n");
@ -2090,15 +2094,15 @@ void Yap_detect_bug_location(yamop *yap_pc, int where_from, int psize) {
if ((cl = Yap_PredForCode(yap_pc, where_from, &pred_name, &pred_arity, if ((cl = Yap_PredForCode(yap_pc, where_from, &pred_name, &pred_arity,
&pred_module)) == 0) { &pred_module)) == 0) {
/* system predicate */ /* system predicate */
fprintf(stderr, "\%s", "meta-call"); fprintf(stderr, "%%s", "meta-call");
} else if (pred_module == 0) { } else if (pred_module == 0) {
fprintf(stderr, "in prolog:%s/%lu", RepAtom(pred_name)->StrOfAE, fprintf(stderr, "in prolog:%s/%lu", RepAtom(pred_name)->StrOfAE,
(unsigned long int)pred_arity); (unsigned long int)pred_arity);
} else if (cl < 0) { } else if (cl < 0) {
fprintf(stderr, "\%s:%s/%lu", RepAtom(AtomOfTerm(pred_module))->StrOfAE, fprintf(stderr, "%%s:%s/%lu", RepAtom(AtomOfTerm(pred_module))->StrOfAE,
RepAtom(pred_name)->StrOfAE, (unsigned long int)pred_arity); RepAtom(pred_name)->StrOfAE, (unsigned long int)pred_arity);
} else { } else {
fprintf(stderr, "\%s:%s/%lu at clause %lu", fprintf(stderr, "%%s:%s/%lu at clause %lu",
RepAtom(AtomOfTerm(pred_module))->StrOfAE, RepAtom(AtomOfTerm(pred_module))->StrOfAE,
RepAtom(pred_name)->StrOfAE, (unsigned long int)pred_arity, RepAtom(pred_name)->StrOfAE, (unsigned long int)pred_arity,
(unsigned long int)cl); (unsigned long int)cl);

View File

@ -34,9 +34,9 @@
#endif #endif
#include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <stddef.h>
#ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */ #ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
@ -316,7 +316,7 @@ static void Yap_set_locations(YAP_init_args *iap) {
/// BOOTPLDIR: where we can find Prolog bootstrap files /// BOOTPLDIR: where we can find Prolog bootstrap files
Yap_BOOTSTRAP = sel(true, iap->BOOTSTRAP != NULL, iap->BOOTSTRAP, true, Yap_BOOTSTRAP = sel(true, iap->BOOTSTRAP != NULL, iap->BOOTSTRAP, true,
#if __ANDROID__ #if __ANDROID__
"/assets/Yap/pl/boot.yap", "/assets/Yap/pl/boot,yap",
#else #else
join(getenv("DESTDIR"), YAP_BOOTSTRAP), join(getenv("DESTDIR"), YAP_BOOTSTRAP),
#endif #endif
@ -976,6 +976,8 @@ static void end_init(YAP_init_args *iap) {
YAP_initialized = true; YAP_initialized = true;
if (iap->HaltAfterBoot) Yap_exit(0); if (iap->HaltAfterBoot) Yap_exit(0);
LOCAL_PrologMode &= ~BootMode; LOCAL_PrologMode &= ~BootMode;
CurrentModule = USER_MODULE;
} }
static void start_modules(void) { static void start_modules(void) {
@ -1044,12 +1046,7 @@ X_API void YAP_Init(YAP_init_args *yap_init) {
init_globals(yap_init); init_globals(yap_init);
start_modules(); start_modules();
setAtomicGlobalPrologFlag(RESOURCE_DATABASE_FLAG, consult(Yap_BOOTFILE PASS_REGS);
MkAtomTerm(Yap_LookupAtom(Yap_INPUT_STARTUP)));
setBooleanGlobalPrologFlag(SAVED_PROGRAM_FLAG, true);
}
YAP_RunGoalOnce(TermInitProlog);
if (yap_init->install && Yap_OUTPUT_STARTUP) { if (yap_init->install && Yap_OUTPUT_STARTUP) {
Term t = MkAtomTerm(Yap_LookupAtom(Yap_OUTPUT_STARTUP)); Term t = MkAtomTerm(Yap_LookupAtom(Yap_OUTPUT_STARTUP));
Term g = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("qsave_program"), 1), Term g = Yap_MkApplTerm(Yap_MkFunctor(Yap_LookupAtom("qsave_program"), 1),
@ -1057,6 +1054,7 @@ X_API void YAP_Init(YAP_init_args *yap_init) {
YAP_RunGoalOnce(g); YAP_RunGoalOnce(g);
} }
}
end_init(yap_init); end_init(yap_init);
} }

View File

@ -99,9 +99,9 @@ protected:
/// Just do nothing. /// Just do nothing.
inline YAPPredicate() { inline YAPPredicate() {
} }
YAPPredicate(Term &to, Term &tmod, CELL * &ts, const char *pname); YAPPredicate(Term &to, Term &tmod, CELL * &ts, const char *pname);
/// Term constructor for predicates /// Term constructor for predicates
/// ///
/// It is just a call to getPred /// It is just a call to getPred

View File

@ -152,6 +152,11 @@ E(SYSTEM_ERROR_FATAL, SYSTEM_ERROR_CLASS, "fatal")
E(SYSTEM_ERROR_GET_FAILED, SYSTEM_ERROR_CLASS, "get_failed") E(SYSTEM_ERROR_GET_FAILED, SYSTEM_ERROR_CLASS, "get_failed")
E(SYSTEM_ERROR_PUT_FAILED, SYSTEM_ERROR_CLASS, "put_failed") E(SYSTEM_ERROR_PUT_FAILED, SYSTEM_ERROR_CLASS, "put_failed")
E(SYSTEM_ERROR_JIT_NOT_AVAILABLE, SYSTEM_ERROR_CLASS, "jit_not_available") E(SYSTEM_ERROR_JIT_NOT_AVAILABLE, SYSTEM_ERROR_CLASS, "jit_not_available")
E(SYSTEM_ERROR_RUNTIME_ANDROID, SYSTEM_ERROR_CLASS, "android_runtime error")
E(SYSTEM_ERROR_RUNTIME_JAVA, SYSTEM_ERROR_CLASS, "java_runtime error")
E(SYSTEM_ERROR_RUNTIME_JS, SYSTEM_ERROR_CLASS, "javascript_runtime error")
E(SYSTEM_ERROR_RUNTIME_PYTHON, SYSTEM_ERROR_CLASS, "python_runtime error")
E(SYSTEM_ERROR_RUNTIME_R, SYSTEM_ERROR_CLASS, "r_runtime error")
E(SYSTEM_ERROR_OPERATING_SYSTEM, SYSTEM_ERROR_CLASS, "operating_system_error") E(SYSTEM_ERROR_OPERATING_SYSTEM, SYSTEM_ERROR_CLASS, "operating_system_error")
E(SYSTEM_ERROR_SAVED_STATE, SYSTEM_ERROR_CLASS, "saved_state_error") E(SYSTEM_ERROR_SAVED_STATE, SYSTEM_ERROR_CLASS, "saved_state_error")

View File

@ -132,13 +132,9 @@ static bool py_close(int sno) {
static bool getLine(StreamDesc *rl_iostream, int sno) { static bool getLine(StreamDesc *rl_iostream, int sno) {
char *myrl_line = NULL; char *myrl_line = NULL;
term_t ctk = python_acquire_GIL(); term_t ctk = python_acquire_GIL();
Py_ssize_t size;
PyObject *prompt = PyUnicode_FromString("?- "),
*msg = PyUnicode_FromString(" **input** "),
*o = PyObject_GetAttrString(rl_iostream->u.private_data, "read");
/* window of vulnerability opened */ /* window of vulnerability opened */
myrl_line = PyUnicode_AsUTF8AndSize( myrl_line = PyUnicode_AsUTF8(PyObject_CallFunctionObjArgs(rl_iostream->u.private_data, NULL));
PyObject_CallFunctionObjArgs(o, msg, prompt, NULL), &size);
python_release_GIL(ctk); python_release_GIL(ctk);
PyObject *err; PyObject *err;
if ((err = PyErr_Occurred())) { if ((err = PyErr_Occurred())) {
@ -147,6 +143,7 @@ static bool getLine(StreamDesc *rl_iostream, int sno) {
"Error in getLine\n"); "Error in getLine\n");
Yap_ThrowError(SYSTEM_ERROR_GET_FAILED, YAP_MkIntTerm(sno), err); Yap_ThrowError(SYSTEM_ERROR_GET_FAILED, YAP_MkIntTerm(sno), err);
} }
size_t size = strlen (myrl_line)+1;
rl_iostream->u.irl.ptr = rl_iostream->u.irl.buf = rl_iostream->u.irl.ptr = rl_iostream->u.irl.buf =
(const unsigned char *)malloc(size); (const unsigned char *)malloc(size);
memcpy((void *)rl_iostream->u.irl.buf, myrl_line, size); memcpy((void *)rl_iostream->u.irl.buf, myrl_line, size);