SWI emulation: it is unsafe to keep arguments in regs.

This commit is contained in:
Vitor Santos Costa 2010-12-30 22:42:30 -06:00
parent 7c86b244b9
commit 5feb6a9dc5
2 changed files with 7 additions and 2 deletions

View File

@ -1413,8 +1413,13 @@ YAP_Execute(PredEntry *pe, CPredicate exec_code)
if (pe->PredFlags & SWIEnvPredFlag) { if (pe->PredFlags & SWIEnvPredFlag) {
CPredicateV codev = (CPredicateV)exec_code; CPredicateV codev = (CPredicateV)exec_code;
struct foreign_context ctx; struct foreign_context ctx;
UInt i;
Int sl = 0;
ctx.engine = NULL; ctx.engine = NULL;
return ((codev)((&ARG1)-LCL0,0,&ctx)); for (i=pe->ArityOfPE; i > 0; i--) {
sl = Yap_InitSlot(XREGS[i]);
}
return ((codev)(sl,0,&ctx));
} }
if (pe->PredFlags & CArgsPredFlag) { if (pe->PredFlags & CArgsPredFlag) {
Int out = execute_cargs(pe, exec_code); Int out = execute_cargs(pe, exec_code);

@ -1 +1 @@
Subproject commit 73e4e086d06c54210100f0faaeccbea276c707eb Subproject commit 29151b2fe68f2dc727cdc07040e1fa1ad4fcca20