recover arg vector
This commit is contained in:
parent
3a9ecf929e
commit
c0db3d4e18
@ -1341,6 +1341,7 @@ do_prolog_flag_property(Term tflag,
|
|||||||
Term modt = CurrentModule;
|
Term modt = CurrentModule;
|
||||||
tflag = Yap_YapStripModule(tflag, &modt);
|
tflag = Yap_YapStripModule(tflag, &modt);
|
||||||
} else {
|
} else {
|
||||||
|
free(args);
|
||||||
Yap_Error(TYPE_ERROR_ATOM, tflag, "yap_flag/2");
|
Yap_Error(TYPE_ERROR_ATOM, tflag, "yap_flag/2");
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
@ -1397,6 +1398,7 @@ do_prolog_flag_property(Term tflag,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// UNLOCK(GLOBAL_Prolog_Flag[sno].prolog_flaglock);
|
// UNLOCK(GLOBAL_Prolog_Flag[sno].prolog_flaglock);
|
||||||
|
free(args);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1501,8 +1503,10 @@ static Int do_create_prolog_flag(USES_REGS1) {
|
|||||||
fv = GetFlagProp(AtomOfTerm(tflag));
|
fv = GetFlagProp(AtomOfTerm(tflag));
|
||||||
if (fv) {
|
if (fv) {
|
||||||
if (args[PROLOG_FLAG_PROPERTY_KEEP].used &&
|
if (args[PROLOG_FLAG_PROPERTY_KEEP].used &&
|
||||||
args[PROLOG_FLAG_PROPERTY_KEEP].tvalue == TermTrue)
|
args[PROLOG_FLAG_PROPERTY_KEEP].tvalue == TermTrue) {
|
||||||
|
free(args);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
newFlag(tflag, tval);
|
newFlag(tflag, tval);
|
||||||
fv = GetFlagProp(AtomOfTerm(tflag));
|
fv = GetFlagProp(AtomOfTerm(tflag));
|
||||||
@ -1530,6 +1534,7 @@ static Int do_create_prolog_flag(USES_REGS1) {
|
|||||||
fv->type = isground;
|
fv->type = isground;
|
||||||
} break;
|
} break;
|
||||||
case PROLOG_FLAG_PROPERTY_SCOPE:
|
case PROLOG_FLAG_PROPERTY_SCOPE:
|
||||||
|
free(args);
|
||||||
return false;
|
return false;
|
||||||
case PROLOG_FLAG_PROPERTY_END:
|
case PROLOG_FLAG_PROPERTY_END:
|
||||||
break;
|
break;
|
||||||
@ -1537,6 +1542,7 @@ static Int do_create_prolog_flag(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// UNLOCK(GLOBAL_Prolog_Flag[sno].prolog_flaglock);
|
// UNLOCK(GLOBAL_Prolog_Flag[sno].prolog_flaglock);
|
||||||
|
free(args);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,6 @@ restart:
|
|||||||
#endif
|
#endif
|
||||||
LOCAL_PrologMode |= ConsoleGetcMode;
|
LOCAL_PrologMode |= ConsoleGetcMode;
|
||||||
ch = fgetc(s->file);
|
ch = fgetc(s->file);
|
||||||
printf("got %d\n", ch);
|
|
||||||
#if HAVE_SIGINTERRUPT
|
#if HAVE_SIGINTERRUPT
|
||||||
siginterrupt(SIGINT, FALSE);
|
siginterrupt(SIGINT, FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
@ -351,7 +351,7 @@ static bool fill_pads(int sno, int sno0, int total, format_info *fg USES_REGS) {
|
|||||||
/* last gap??*/
|
/* last gap??*/
|
||||||
if (padi-fg->gap == fg->gapi) {
|
if (padi-fg->gap == fg->gapi) {
|
||||||
for (j=0; j < fill_space; j++)
|
for (j=0; j < fill_space; j++)
|
||||||
f_putc(sno0, padi->filler);
|
f_putc(sno0, (padi-1)->filler);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
14
os/iopreds.c
14
os/iopreds.c
@ -1194,17 +1194,21 @@ do_open(Term file_name, Term t2,
|
|||||||
}
|
}
|
||||||
/* done */
|
/* done */
|
||||||
sno = GetFreeStreamD();
|
sno = GetFreeStreamD();
|
||||||
if (sno < 0)
|
if (sno < 0) {
|
||||||
|
free(args);
|
||||||
return PlIOError(RESOURCE_ERROR_MAX_STREAMS, TermNil, "open/3");
|
return PlIOError(RESOURCE_ERROR_MAX_STREAMS, TermNil, "open/3");
|
||||||
|
}
|
||||||
st = &GLOBAL_Stream[sno];
|
st = &GLOBAL_Stream[sno];
|
||||||
st->user_name = file_name;
|
st->user_name = file_name;
|
||||||
flags = s;
|
flags = s;
|
||||||
// user requested encoding?
|
// user requested encoding?
|
||||||
if (args[OPEN_ALIAS].used) {
|
if (args[OPEN_ALIAS].used) {
|
||||||
Atom al = AtomOfTerm(args[OPEN_ALIAS].tvalue);
|
Atom al = AtomOfTerm(args[OPEN_ALIAS].tvalue);
|
||||||
if (!Yap_AddAlias(al, sno))
|
if (!Yap_AddAlias(al, sno)) {
|
||||||
|
free(args);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (args[OPEN_ENCODING].used) {
|
if (args[OPEN_ENCODING].used) {
|
||||||
tenc = args[OPEN_ENCODING].tvalue;
|
tenc = args[OPEN_ENCODING].tvalue;
|
||||||
s_encoding = RepAtom(AtomOfTerm(tenc))->StrOfAE;
|
s_encoding = RepAtom(AtomOfTerm(tenc))->StrOfAE;
|
||||||
@ -1277,10 +1281,11 @@ do_open(Term file_name, Term t2,
|
|||||||
free((void *)fname);
|
free((void *)fname);
|
||||||
fname = LOCAL_FileNameBuf;
|
fname = LOCAL_FileNameBuf;
|
||||||
UNLOCK(st->streamlock);
|
UNLOCK(st->streamlock);
|
||||||
if (errno == ENOENT)
|
if (errno == ENOENT) {
|
||||||
|
free(args);
|
||||||
return (PlIOError(EXISTENCE_ERROR_SOURCE_SINK, file_name, "%s: %s", fname,
|
return (PlIOError(EXISTENCE_ERROR_SOURCE_SINK, file_name, "%s: %s", fname,
|
||||||
strerror(errno)));
|
strerror(errno)));
|
||||||
else {
|
} else {
|
||||||
return (PlIOError(PERMISSION_ERROR_OPEN_SOURCE_SINK, file_name, "%s: %s",
|
return (PlIOError(PERMISSION_ERROR_OPEN_SOURCE_SINK, file_name, "%s: %s",
|
||||||
fname, strerror(errno)));
|
fname, strerror(errno)));
|
||||||
}
|
}
|
||||||
@ -1310,6 +1315,7 @@ do_open(Term file_name, Term t2,
|
|||||||
if (script)
|
if (script)
|
||||||
open_header(sno, open_mode);
|
open_header(sno, open_mode);
|
||||||
|
|
||||||
|
free(args);
|
||||||
UNLOCK(st->streamlock);
|
UNLOCK(st->streamlock);
|
||||||
{
|
{
|
||||||
Term t = Yap_MkStream(sno);
|
Term t = Yap_MkStream(sno);
|
||||||
|
14
os/streams.c
14
os/streams.c
@ -670,6 +670,7 @@ static Int cont_stream_property(USES_REGS1) { /* current_stream */
|
|||||||
// done
|
// done
|
||||||
det = (p == STREAM_PROPERTY_END);
|
det = (p == STREAM_PROPERTY_END);
|
||||||
}
|
}
|
||||||
|
free( args );
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (det)
|
if (det)
|
||||||
cut_succeed();
|
cut_succeed();
|
||||||
@ -720,9 +721,11 @@ static Int stream_property(USES_REGS1) { /* Init current_stream */
|
|||||||
}
|
}
|
||||||
if (do_stream_property(i, args PASS_REGS)) {
|
if (do_stream_property(i, args PASS_REGS)) {
|
||||||
UNLOCK(GLOBAL_Stream[i].streamlock);
|
UNLOCK(GLOBAL_Stream[i].streamlock);
|
||||||
|
free( args );
|
||||||
cut_succeed();
|
cut_succeed();
|
||||||
} else {
|
} else {
|
||||||
UNLOCK(GLOBAL_Stream[i].streamlock);
|
UNLOCK(GLOBAL_Stream[i].streamlock);
|
||||||
|
free( args );
|
||||||
cut_fail();
|
cut_fail();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -912,17 +915,6 @@ static void CloseStream(int sno) {
|
|||||||
close(GLOBAL_Stream[sno].u.pipe.fd);
|
close(GLOBAL_Stream[sno].u.pipe.fd);
|
||||||
} else if (GLOBAL_Stream[sno].status & (InMemory_Stream_f)) {
|
} else if (GLOBAL_Stream[sno].status & (InMemory_Stream_f)) {
|
||||||
Yap_CloseMemoryStream(sno);
|
Yap_CloseMemoryStream(sno);
|
||||||
if (GLOBAL_Stream[sno].file == NULL) {
|
|
||||||
char *s = GLOBAL_Stream[sno].u.mem_string.buf;
|
|
||||||
if (s == LOCAL_FileNameBuf ||
|
|
||||||
s == LOCAL_FileNameBuf2)
|
|
||||||
return;
|
|
||||||
if (GLOBAL_Stream[sno].u.mem_string.src == MEM_BUF_CODE)
|
|
||||||
Yap_FreeAtomSpace(s);
|
|
||||||
else if (GLOBAL_Stream[sno].u.mem_string.src == MEM_BUF_MALLOC) {
|
|
||||||
free(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
GLOBAL_Stream[sno].status = Free_Stream_f;
|
GLOBAL_Stream[sno].status = Free_Stream_f;
|
||||||
Yap_DeleteAliases(sno);
|
Yap_DeleteAliases(sno);
|
||||||
|
@ -290,11 +290,14 @@ static Int write_term2(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
int output_stream = LOCAL_c_output_stream;
|
int output_stream = LOCAL_c_output_stream;
|
||||||
if (output_stream == -1)
|
if (output_stream == -1) {
|
||||||
|
free( args );
|
||||||
output_stream = 1;
|
output_stream = 1;
|
||||||
|
}
|
||||||
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
write_term(output_stream, ARG1, args PASS_REGS);
|
write_term(output_stream, ARG1, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -313,11 +316,14 @@ static Int write_term3(USES_REGS1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
||||||
if (output_stream < 0)
|
if (output_stream < 0) {
|
||||||
|
free( args );
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
write_term(output_stream, ARG2, args PASS_REGS);
|
write_term(output_stream, ARG2, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -346,6 +352,7 @@ static Int write2(USES_REGS1) {
|
|||||||
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
||||||
write_term(output_stream, ARG2, args PASS_REGS);
|
write_term(output_stream, ARG2, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -372,6 +379,7 @@ static Int write1(USES_REGS1) {
|
|||||||
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
write_term(output_stream, ARG1, args PASS_REGS);
|
write_term(output_stream, ARG1, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -400,6 +408,7 @@ static Int write_canonical1(USES_REGS1) {
|
|||||||
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
write_term(output_stream, ARG1, args PASS_REGS);
|
write_term(output_stream, ARG1, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -418,8 +427,10 @@ static Int write_canonical(USES_REGS1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
||||||
if (output_stream < 0)
|
if (output_stream < 0) {
|
||||||
|
free( args );
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
args[WRITE_IGNORE_OPS].used = true;
|
args[WRITE_IGNORE_OPS].used = true;
|
||||||
args[WRITE_IGNORE_OPS].tvalue = TermTrue;
|
args[WRITE_IGNORE_OPS].tvalue = TermTrue;
|
||||||
@ -427,6 +438,7 @@ static Int write_canonical(USES_REGS1) {
|
|||||||
args[WRITE_QUOTED].tvalue = TermTrue;
|
args[WRITE_QUOTED].tvalue = TermTrue;
|
||||||
write_term(output_stream, ARG2, args PASS_REGS);
|
write_term(output_stream, ARG2, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -446,15 +458,17 @@ static Int writeq1(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
int output_stream = LOCAL_c_output_stream;
|
int output_stream = LOCAL_c_output_stream;
|
||||||
if (output_stream == -1)
|
if (output_stream == -1) {
|
||||||
|
free( args );
|
||||||
output_stream = 1;
|
output_stream = 1;
|
||||||
|
}
|
||||||
args[WRITE_NUMBERVARS].used = true;
|
args[WRITE_NUMBERVARS].used = true;
|
||||||
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
||||||
args[WRITE_QUOTED].used = true;
|
args[WRITE_QUOTED].used = true;
|
||||||
args[WRITE_QUOTED].tvalue = TermTrue;
|
args[WRITE_QUOTED].tvalue = TermTrue;
|
||||||
write_term(output_stream, ARG1, args PASS_REGS);
|
write_term(output_stream, ARG1, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -473,8 +487,10 @@ static Int writeq(USES_REGS1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
||||||
if (output_stream < 0)
|
if (output_stream < 0) {
|
||||||
|
free( args );
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
args[WRITE_NUMBERVARS].used = true;
|
args[WRITE_NUMBERVARS].used = true;
|
||||||
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
||||||
@ -482,6 +498,7 @@ static Int writeq(USES_REGS1) {
|
|||||||
args[WRITE_QUOTED].tvalue = TermTrue;
|
args[WRITE_QUOTED].tvalue = TermTrue;
|
||||||
write_term(output_stream, ARG2, args PASS_REGS);
|
write_term(output_stream, ARG2, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -501,8 +518,10 @@ static Int print1(USES_REGS1) {
|
|||||||
}
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
int output_stream = LOCAL_c_output_stream;
|
int output_stream = LOCAL_c_output_stream;
|
||||||
if (output_stream == -1)
|
if (output_stream == -1) {
|
||||||
|
free( args );
|
||||||
output_stream = 1;
|
output_stream = 1;
|
||||||
|
}
|
||||||
args[WRITE_PORTRAY].used = true;
|
args[WRITE_PORTRAY].used = true;
|
||||||
args[WRITE_PORTRAY].tvalue = TermTrue;
|
args[WRITE_PORTRAY].tvalue = TermTrue;
|
||||||
args[WRITE_NUMBERVARS].used = true;
|
args[WRITE_NUMBERVARS].used = true;
|
||||||
@ -510,6 +529,7 @@ static Int print1(USES_REGS1) {
|
|||||||
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
write_term(output_stream, ARG1, args PASS_REGS);
|
write_term(output_stream, ARG1, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -528,8 +548,10 @@ static Int print(USES_REGS1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "write/2");
|
||||||
if (output_stream < 0)
|
if (output_stream < 0) {
|
||||||
|
free( args );
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
args[WRITE_PORTRAY].used = true;
|
args[WRITE_PORTRAY].used = true;
|
||||||
args[WRITE_PORTRAY].tvalue = TermTrue;
|
args[WRITE_PORTRAY].tvalue = TermTrue;
|
||||||
@ -537,6 +559,7 @@ static Int print(USES_REGS1) {
|
|||||||
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
||||||
write_term(output_stream, ARG2, args PASS_REGS);
|
write_term(output_stream, ARG2, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -563,6 +586,7 @@ static Int writeln1(USES_REGS1) {
|
|||||||
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
write_term(output_stream, ARG1, args PASS_REGS);
|
write_term(output_stream, ARG1, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
@ -579,8 +603,10 @@ static Int writeln(USES_REGS1) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "writeln/2");
|
int output_stream = Yap_CheckTextStream(ARG1, Output_Stream_f, "writeln/2");
|
||||||
if (output_stream < 0)
|
if (output_stream < 0) {
|
||||||
return false;
|
free( args );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
yhandle_t mySlots = Yap_StartSlots();
|
yhandle_t mySlots = Yap_StartSlots();
|
||||||
args[WRITE_NL].used = true;
|
args[WRITE_NL].used = true;
|
||||||
args[WRITE_NL].tvalue = TermTrue;
|
args[WRITE_NL].tvalue = TermTrue;
|
||||||
@ -588,6 +614,7 @@ static Int writeln(USES_REGS1) {
|
|||||||
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
args[WRITE_NUMBERVARS].tvalue = TermTrue;
|
||||||
write_term(output_stream, ARG2, args PASS_REGS);
|
write_term(output_stream, ARG2, args PASS_REGS);
|
||||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||||
|
free( args );
|
||||||
Yap_CloseSlots(mySlots);
|
Yap_CloseSlots(mySlots);
|
||||||
Yap_RaiseException();
|
Yap_RaiseException();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
|
Reference in New Issue
Block a user