expand_index was broken for long_ints

This commit is contained in:
Vítor Santos Costa II 2010-03-12 18:03:15 +00:00
parent 8497905876
commit ff97f53a24

View File

@ -3448,7 +3448,7 @@ install_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack)
if (IsExtensionFunctor(f)) { if (IsExtensionFunctor(f)) {
if (f == FunctorDBRef) { if (f == FunctorDBRef) {
if (cls->u.t_ptr != sp->extra) break; if (cls->u.t_ptr != sp->extra) break;
} else { } else if (f == FunctorDouble) {
CELL *pt = RepAppl(sp->extra); CELL *pt = RepAppl(sp->extra);
if (cls->u.t_ptr) { if (cls->u.t_ptr) {
CELL *pt1 = RepAppl(cls->u.t_ptr); CELL *pt1 = RepAppl(cls->u.t_ptr);
@ -3461,6 +3461,12 @@ install_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack)
#endif #endif
if (t != t1) break; if (t != t1) break;
} }
} else {
CELL *pt = RepAppl(sp->extra);
CELL *pt1 = RepAppl(cls->u.t_ptr);
Term t = MkIntTerm(pt[1] & (MAX_ABS_INT-1)),
t1 = MkIntTerm(pt1[1] & (MAX_ABS_INT-1));
if (t != t1) break;
} }
} }
} }
@ -3610,7 +3616,7 @@ install_log_upd_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack)
if (IsExtensionFunctor(f)) { if (IsExtensionFunctor(f)) {
if (f == FunctorDBRef) { if (f == FunctorDBRef) {
if (cls->u.t_ptr != sp->extra) break; if (cls->u.t_ptr != sp->extra) break;
} else { } else if (f == FunctorDouble) {
CELL *pt = RepAppl(sp->extra); CELL *pt = RepAppl(sp->extra);
CELL *pt1 = RepAppl(cls->u.t_ptr); CELL *pt1 = RepAppl(cls->u.t_ptr);
#if SIZEOF_DOUBLE == 2*SIZEOF_LONG_INT #if SIZEOF_DOUBLE == 2*SIZEOF_LONG_INT
@ -3621,6 +3627,12 @@ install_log_upd_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack)
t1 = MkIntTerm(pt1[1]); t1 = MkIntTerm(pt1[1]);
#endif #endif
if (t != t1) break; if (t != t1) break;
} else {
CELL *pt = RepAppl(sp->extra);
CELL *pt1 = RepAppl(cls->u.t_ptr);
Term t = MkIntTerm(pt[1] & (MAX_ABS_INT-1)),
t1 = MkIntTerm(pt1[1] & (MAX_ABS_INT-1));
if (t != t1) break;
} }
} }
} }