minor changes

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@142 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2001-08-27 14:44:07 +00:00
parent 5390e2e92f
commit 41cc6c0f4e
5 changed files with 27 additions and 9 deletions

View File

@@ -399,9 +399,12 @@ void rebind_variables(tr_fr_ptr rebind_tr, tr_fr_ptr end_tr) {
TABLING_ERROR_MESSAGE("rebind_tr < end_tr (function rebind_variables)");
#endif /* TABLING_ERRORS */
/* rebind loop */
printf("LCL0 is %p TR %p\n", LCL0, TR);
NEW_MAHASH((ma_h_inner_struct *)H);
printf("new cicle from %p at %p\n", rebind_tr, end_tr);
while (rebind_tr != end_tr) {
CELL ref = (CELL) TrailTerm(--rebind_tr);
printf("doing %x at %p\n", ref, rebind_tr);
/* check for global or local variables */
if (IsVarTerm(ref)) {
/* rebind variable */
@@ -421,15 +424,13 @@ void rebind_variables(tr_fr_ptr rebind_tr, tr_fr_ptr end_tr) {
#ifdef MULTI_ASSIGNMENT_VARIABLES
} else {
CELL *cell_ptr = RepAppl(ref);
CELL *trp;
if (!lookup_ma_var(cell_ptr)) {
/* first time we found the variable, let's put the new value */
*cell_ptr = TrailVal(rebind_tr);
}
/* skip the old value */
trp = (CELL *)rebind_tr;
rebind_tr = (tr_fr_ptr)(trp-1);
rebind_tr--;
#endif
}
}