SREG and S could be different; also S might be in use if there is an

overflow and the index code is jumping to the middle.
This commit is contained in:
Vitor Santos Costa 2009-04-18 15:22:51 -05:00
parent 0695a8f8b3
commit c92765d962

View File

@ -794,6 +794,9 @@ Yap_absmi(int inp)
{
CELL cut_b = LCL0-(CELL *)(SREG[E_CB]);
#ifdef SHADOW_S
S = SREG;
#endif
saveregs();
/* do a garbage collection first to check if we can recover memory */
if (!Yap_growheap(FALSE, 0, NULL)) {
@ -803,9 +806,13 @@ Yap_absmi(int inp)
}
setregs();
CACHE_A1();
SREG = ASP;
#ifdef SHADOW_S
SREG = S;
#endif
if (SREG == ASP) {
SREG[E_CB] = (CELL)(LCL0-cut_b);
}
}
goto reset_absmi;
#if !OS_HANDLES_TR_OVERFLOW
@ -834,9 +841,13 @@ Yap_absmi(int inp)
FAIL();
}
setregs();
SREG = ASP;
#ifdef SHADOW_S
SREG = S;
#endif
if (SREG == ASP) {
SREG[E_CB] = (CELL)(LCL0-cut_b);
}
}
goto reset_absmi;
#endif /* OS_HANDLES_TR_OVERFLOW */