fix stack calculation (ricardo rocha)
This commit is contained in:
parent
b21603ac89
commit
ecce575a0a
18
C/absmi.c
18
C/absmi.c
@ -1545,7 +1545,11 @@ Yap_absmi(int inp)
|
|||||||
LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG);
|
LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG);
|
||||||
Term t;
|
Term t;
|
||||||
|
|
||||||
ASP = YREG+E_CB;
|
if (YREG > (CELL *) PROTECT_FROZEN_B(B)) {
|
||||||
|
ASP = (CELL *) PROTECT_FROZEN_B(B);
|
||||||
|
} else {
|
||||||
|
ASP = YREG+E_CB;
|
||||||
|
}
|
||||||
saveregs();
|
saveregs();
|
||||||
while ((t = Yap_FetchTermFromDB(cl->ClSource)) == 0L) {
|
while ((t = Yap_FetchTermFromDB(cl->ClSource)) == 0L) {
|
||||||
if (Yap_Error_TYPE == OUT_OF_ATTVARS_ERROR) {
|
if (Yap_Error_TYPE == OUT_OF_ATTVARS_ERROR) {
|
||||||
@ -2665,6 +2669,8 @@ Yap_absmi(int inp)
|
|||||||
if (SREG <= ASP) {
|
if (SREG <= ASP) {
|
||||||
ASP = SREG-EnvSizeInCells;
|
ASP = SREG-EnvSizeInCells;
|
||||||
}
|
}
|
||||||
|
if (ASP > (CELL *)PROTECT_FROZEN_B(B))
|
||||||
|
ASP = (CELL *)PROTECT_FROZEN_B(B);
|
||||||
if (ActiveSignals & YAP_CDOVF_SIGNAL) {
|
if (ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||||
goto noheapleft;
|
goto noheapleft;
|
||||||
}
|
}
|
||||||
@ -7745,7 +7751,11 @@ Yap_absmi(int inp)
|
|||||||
ENDCACHE_Y();
|
ENDCACHE_Y();
|
||||||
|
|
||||||
Yap_PrologMode = UserCCallMode;
|
Yap_PrologMode = UserCCallMode;
|
||||||
ASP = YREG;
|
if (YREG > (CELL *) PROTECT_FROZEN_B(B)) {
|
||||||
|
ASP = (CELL *) PROTECT_FROZEN_B(B);
|
||||||
|
} else {
|
||||||
|
ASP = YREG;
|
||||||
|
}
|
||||||
/* for slots to work */
|
/* for slots to work */
|
||||||
Yap_StartSlots();
|
Yap_StartSlots();
|
||||||
saveregs();
|
saveregs();
|
||||||
@ -13780,6 +13790,8 @@ Yap_absmi(int inp)
|
|||||||
PP = PredMetaCall;
|
PP = PredMetaCall;
|
||||||
SREG = (CELL *) pen;
|
SREG = (CELL *) pen;
|
||||||
ASP = ENV_YREG;
|
ASP = ENV_YREG;
|
||||||
|
if (ASP > (CELL *)PROTECT_FROZEN_B(B))
|
||||||
|
ASP = (CELL *)PROTECT_FROZEN_B(B);
|
||||||
/* setup GB */
|
/* setup GB */
|
||||||
WRITEBACK_Y_AS_ENV();
|
WRITEBACK_Y_AS_ENV();
|
||||||
YREG[E_CB] = (CELL) B;
|
YREG[E_CB] = (CELL) B;
|
||||||
@ -13977,6 +13989,8 @@ Yap_absmi(int inp)
|
|||||||
PP = PredMetaCall;
|
PP = PredMetaCall;
|
||||||
SREG = (CELL *) pen;
|
SREG = (CELL *) pen;
|
||||||
ASP = ENV_YREG;
|
ASP = ENV_YREG;
|
||||||
|
if (ASP > (CELL *)PROTECT_FROZEN_B(B))
|
||||||
|
ASP = (CELL *)PROTECT_FROZEN_B(B);
|
||||||
/* setup GB */
|
/* setup GB */
|
||||||
WRITEBACK_Y_AS_ENV();
|
WRITEBACK_Y_AS_ENV();
|
||||||
YREG[E_CB] = (CELL) B;
|
YREG[E_CB] = (CELL) B;
|
||||||
|
Reference in New Issue
Block a user