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
15
C/absmi.c
15
C/absmi.c
@ -794,6 +794,9 @@ Yap_absmi(int inp)
|
|||||||
{
|
{
|
||||||
CELL cut_b = LCL0-(CELL *)(SREG[E_CB]);
|
CELL cut_b = LCL0-(CELL *)(SREG[E_CB]);
|
||||||
|
|
||||||
|
#ifdef SHADOW_S
|
||||||
|
S = SREG;
|
||||||
|
#endif
|
||||||
saveregs();
|
saveregs();
|
||||||
/* do a garbage collection first to check if we can recover memory */
|
/* do a garbage collection first to check if we can recover memory */
|
||||||
if (!Yap_growheap(FALSE, 0, NULL)) {
|
if (!Yap_growheap(FALSE, 0, NULL)) {
|
||||||
@ -803,9 +806,13 @@ Yap_absmi(int inp)
|
|||||||
}
|
}
|
||||||
setregs();
|
setregs();
|
||||||
CACHE_A1();
|
CACHE_A1();
|
||||||
SREG = ASP;
|
#ifdef SHADOW_S
|
||||||
|
SREG = S;
|
||||||
|
#endif
|
||||||
|
if (SREG == ASP) {
|
||||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
goto reset_absmi;
|
goto reset_absmi;
|
||||||
|
|
||||||
#if !OS_HANDLES_TR_OVERFLOW
|
#if !OS_HANDLES_TR_OVERFLOW
|
||||||
@ -834,9 +841,13 @@ Yap_absmi(int inp)
|
|||||||
FAIL();
|
FAIL();
|
||||||
}
|
}
|
||||||
setregs();
|
setregs();
|
||||||
SREG = ASP;
|
#ifdef SHADOW_S
|
||||||
|
SREG = S;
|
||||||
|
#endif
|
||||||
|
if (SREG == ASP) {
|
||||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
goto reset_absmi;
|
goto reset_absmi;
|
||||||
|
|
||||||
#endif /* OS_HANDLES_TR_OVERFLOW */
|
#endif /* OS_HANDLES_TR_OVERFLOW */
|
||||||
|
Reference in New Issue
Block a user