ovfl
This commit is contained in:
parent
8c3c3f921c
commit
e7535dd2ee
6
C/qlyr.c
6
C/qlyr.c
@ -1117,8 +1117,11 @@ YAP_file_type_t Yap_Restore(const char *s) {
|
|||||||
const char *tmp = Yap_AbsoluteFile(s, true);
|
const char *tmp = Yap_AbsoluteFile(s, true);
|
||||||
|
|
||||||
FILE *stream = Yap_OpenRestore(tmp);
|
FILE *stream = Yap_OpenRestore(tmp);
|
||||||
if (!stream)
|
if (!stream)
|
||||||
return -1;
|
return -1;
|
||||||
|
#define BUFSIX 4096*256
|
||||||
|
char *buf = malloc(BUFSIZ);
|
||||||
|
setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
|
||||||
GLOBAL_RestoreFile = s;
|
GLOBAL_RestoreFile = s;
|
||||||
if (do_header(stream) == NIL) {
|
if (do_header(stream) == NIL) {
|
||||||
pop_text_stack(lvl);
|
pop_text_stack(lvl);
|
||||||
@ -1127,6 +1130,7 @@ YAP_file_type_t Yap_Restore(const char *s) {
|
|||||||
read_module(stream);
|
read_module(stream);
|
||||||
setBooleanGlobalPrologFlag(SAVED_PROGRAM_FLAG, true);
|
setBooleanGlobalPrologFlag(SAVED_PROGRAM_FLAG, true);
|
||||||
fclose(stream);
|
fclose(stream);
|
||||||
|
free(buf);
|
||||||
GLOBAL_RestoreFile = NULL;
|
GLOBAL_RestoreFile = NULL;
|
||||||
LOCAL_SourceModule = CurrentModule = USER_MODULE;
|
LOCAL_SourceModule = CurrentModule = USER_MODULE;
|
||||||
pop_text_stack(lvl);
|
pop_text_stack(lvl);
|
||||||
|
@ -163,7 +163,8 @@ ignore(Goal) :- (Goal->true;true).
|
|||||||
* it is both more efficient and more portable.
|
* it is both more efficient and more portable.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if(X,Y,Z) :-
|
if(X0,Y,Z) :-
|
||||||
|
'$yap_strip_module'(X0,M,X),
|
||||||
(
|
(
|
||||||
'$$save_by'(CP),
|
'$$save_by'(CP),
|
||||||
'$call'(X,CP,if(X,Y,Z),M),
|
'$call'(X,CP,if(X,Y,Z),M),
|
||||||
|
Reference in New Issue
Block a user