fix an optimizer bug

Optimization of an identifier in a test position passed a
pre-optimization offset to a function that expects a
post-optimization offset.
This commit is contained in:
Matthew Flatt 2015-04-11 21:38:25 -06:00
parent 7fb5e69bc6
commit 16ce8fd90d

View File

@ -7228,16 +7228,19 @@ Scheme_Object *scheme_optimize_expr(Scheme_Object *expr, Optimize_Info *info, in
}
} else if (is_mutated) {
info->vclock += 1;
} else if (context & OPT_CONTEXT_BOOLEAN) {
}
delta = optimize_info_get_shift(info, pos);
if (context & OPT_CONTEXT_BOOLEAN) {
Scheme_Object *pred;
pred = optimize_get_predicate(pos, info);
pred = optimize_get_predicate(pos + delta, info);
if (pred) {
/* all predicates recognize non-#f things */
return scheme_true;
}
}
delta = optimize_info_get_shift(info, pos);
if (delta)
expr = scheme_make_local(scheme_local_type, pos + delta, 0);
@ -8340,6 +8343,7 @@ static Scheme_Object *optimize_info_mutated_lookup(Optimize_Info *info, int pos,
}
Scheme_Object *optimize_get_predicate(int pos, Optimize_Info *info)
/* pos is in new-frame counts */
{
Scheme_Object *pred;