fix boxing of unused but formerly mutated local binding

- an old bug exposed by a new optimization
This commit is contained in:
Matthew Flatt 2010-08-11 13:53:35 -06:00
parent 928dfd6fa2
commit 8dc38e9d84

View File

@ -2723,9 +2723,25 @@ Scheme_Object *bangboxenv_execute(Scheme_Object *data)
static Scheme_Object *bangboxenv_sfs(Scheme_Object *data, SFS_Info *info)
{
Scheme_Object *e;
int spos, drop;
spos = SCHEME_INT_VAL(SCHEME_CAR(data)) + info->stackpos;
if (info->pass
&& (info->max_used[spos] < info->ip))
/* Not used, so don't bother boxing. In fact, the original value
might be cleared already, so we wan't legally box anymore. */
drop = 1;
else
drop = 0;
e = scheme_sfs_expr(SCHEME_CDR(data), info, -1);
SCHEME_CDR(data) = e;
return data;
if (drop)
return e;
else {
SCHEME_CDR(data) = e;
return data;
}
}
static Scheme_Object *bangboxenv_jit(Scheme_Object *data)