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:
parent
0695a8f8b3
commit
c92765d962
19
C/absmi.c
19
C/absmi.c
@ -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,8 +806,12 @@ Yap_absmi(int inp)
|
||||
}
|
||||
setregs();
|
||||
CACHE_A1();
|
||||
SREG = ASP;
|
||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||
#ifdef SHADOW_S
|
||||
SREG = S;
|
||||
#endif
|
||||
if (SREG == ASP) {
|
||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||
}
|
||||
}
|
||||
goto reset_absmi;
|
||||
|
||||
@ -834,8 +841,12 @@ Yap_absmi(int inp)
|
||||
FAIL();
|
||||
}
|
||||
setregs();
|
||||
SREG = ASP;
|
||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||
#ifdef SHADOW_S
|
||||
SREG = S;
|
||||
#endif
|
||||
if (SREG == ASP) {
|
||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||
}
|
||||
}
|
||||
goto reset_absmi;
|
||||
|
||||
|
Reference in New Issue
Block a user