fix interface bug with external c-code.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1893 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2007-06-04 12:11:47 +00:00
parent b1d0de4266
commit 85f82a22d4
2 changed files with 12 additions and 1 deletions

View File

@@ -747,7 +747,17 @@ p_execute_nonstop(void)
return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->cs.p_code.TrueCodeOfPred);
} else if ((RepPredProp(pe)->PredFlags & (AsmPredFlag|CPredFlag)) &&
RepPredProp(pe)->OpcodeOfPred != Yap_opcode(_call_bfunc_xx)) {
return RepPredProp(pe)->cs.f_code();
/* USER C-Code may walk over registers */
if (RepPredProp(pe)->PredFlags & UserCPredFlag) {
save_machine_regs();
}
if (RepPredProp(pe)->PredFlags & UserCPredFlag) {
Int out = RepPredProp(pe)->cs.f_code();
restore_machine_regs();
return out;
} else {
return RepPredProp(pe)->cs.f_code();
}
} else {
return CallPredicate(RepPredProp(pe), B, RepPredProp(pe)->CodeOfPred);
}