fix gc handling from deallocate

This commit is contained in:
Vítor Santos Costa 2016-01-06 12:30:33 +00:00
parent c56b822cba
commit c8addfd509
2 changed files with 9 additions and 6 deletions

View File

@ -1109,7 +1109,7 @@ interrupt_deallocate( USES_REGS1 )
}
return interrupt_handler( pe PASS_REGS );
}
if (!Yap_locked_gc(0, ENV, CP)) {
if (!Yap_locked_gc(0, ENV, YESCODE)) {
Yap_NilError(RESOURCE_ERROR_STACK,LOCAL_ErrorMessage);
}
S = ASP;

View File

@ -426,6 +426,10 @@
Op(deallocate, p);
CACHE_Y_AS_ENV(YREG);
check_trail(TR);
#ifndef NO_CHECKING
/* check stacks */
check_stack(NoStackDeallocate, HR);
#endif
PREG = NEXTOP(PREG, p);
/* other instructions do depend on S being set by deallocate
:-( */
@ -452,24 +456,23 @@
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CPREG));
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
#ifndef NO_CHECKING
/* check stacks */
check_stack(NoStackDeallocate, HR);
#endif
ENDCACHE_Y_AS_ENV();
GONext();
NoStackDeallocate:
BEGD(d0);
#ifdef SHADOW_S
Yap_REGS.S_ = SREG;
Yap_REGS.S_ = YREG;
#endif
PREG = NEXTOP(PREG,p);
saveregs();
d0 = interrupt_deallocate( PASS_REGS1 );
setregs();
PREG = PREVOP(PREG,p);
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
// return to original deallocate
if (!d0) FAIL();
JMPNext();
ENDD(d0);