fix parser overflow bug: vars should be reset even when addresses would not
change. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1466 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
253f5e7f9a
commit
03c1edcc90
4
C/grow.c
4
C/grow.c
@ -1336,6 +1336,10 @@ static int do_growtrail(long size, int contiguous_only, int in_parser, tr_fr_ptr
|
|||||||
execute_growstack(size, TRUE, in_parser, old_trp, tksp, vep);
|
execute_growstack(size, TRUE, in_parser, old_trp, tksp, vep);
|
||||||
} else {
|
} else {
|
||||||
YAPEnterCriticalSection();
|
YAPEnterCriticalSection();
|
||||||
|
if (in_parser) {
|
||||||
|
TrDiff = LDiff = GDiff = DelayDiff = XDiff = HDiff = 0;
|
||||||
|
AdjustScannerStacks(tksp, vep);
|
||||||
|
}
|
||||||
Yap_TrailTop += size;
|
Yap_TrailTop += size;
|
||||||
YAPLeaveCriticalSection();
|
YAPLeaveCriticalSection();
|
||||||
}
|
}
|
||||||
|
@ -350,9 +350,13 @@ ParseArgs(Atom a, JMPBUFF *FailBuff)
|
|||||||
else
|
else
|
||||||
t = Yap_MkApplTerm(Yap_MkFunctor(a, nargs), nargs, p);
|
t = Yap_MkApplTerm(Yap_MkFunctor(a, nargs), nargs, p);
|
||||||
#endif
|
#endif
|
||||||
|
if (H > ASP-4096) {
|
||||||
|
Yap_ErrorMessage = "Stack Overflow";
|
||||||
|
return TermNil;
|
||||||
|
}
|
||||||
/* check for possible overflow against local stack */
|
/* check for possible overflow against local stack */
|
||||||
checkfor((Term) ')', FailBuff);
|
checkfor((Term) ')', FailBuff);
|
||||||
return (t);
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user