another fix to bytecode compiler's propoagation of local-type info
This one is related to shifting type info when the closure is made smaller due to lifting of something that used to be in the closure. The `games/pousse/robot' module exposed the bug.
This commit is contained in:
parent
afca33b78b
commit
345fce71d5
|
@ -1739,6 +1739,7 @@ resolve_closure_compilation(Scheme_Object *_data, Resolve_Info *info,
|
||||||
{
|
{
|
||||||
Scheme_Closure_Data *data;
|
Scheme_Closure_Data *data;
|
||||||
int i, closure_size, offset, np, num_params, expanded_already = 0, captured_typed;
|
int i, closure_size, offset, np, num_params, expanded_already = 0, captured_typed;
|
||||||
|
int no_map_shift_needed;
|
||||||
int has_tl, convert_size, need_lift;
|
int has_tl, convert_size, need_lift;
|
||||||
mzshort *oldpos, *closure_map, *new_closure_map;
|
mzshort *oldpos, *closure_map, *new_closure_map;
|
||||||
Closure_Info *cl;
|
Closure_Info *cl;
|
||||||
|
@ -1938,7 +1939,9 @@ resolve_closure_compilation(Scheme_Object *_data, Resolve_Info *info,
|
||||||
closure_map[cp] = old_pos;
|
closure_map[cp] = old_pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
no_map_shift_needed = 1;
|
||||||
|
} else
|
||||||
|
no_map_shift_needed = 0;
|
||||||
|
|
||||||
if (convert
|
if (convert
|
||||||
&& (offset || !has_tl) /* either need args, or treat as convert because it's fully closed */
|
&& (offset || !has_tl) /* either need args, or treat as convert because it's fully closed */
|
||||||
|
@ -1982,7 +1985,8 @@ resolve_closure_compilation(Scheme_Object *_data, Resolve_Info *info,
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!convert && !just_compute_lift && (offset < data->closure_size) && expanded_already) {
|
if (!convert && !just_compute_lift && (offset < data->closure_size)
|
||||||
|
&& expanded_already && !no_map_shift_needed) {
|
||||||
/* shift boxmap down, since we're dropping closure elements */
|
/* shift boxmap down, since we're dropping closure elements */
|
||||||
int bsz;
|
int bsz;
|
||||||
bsz = boxmap_size(data->num_params + offset);
|
bsz = boxmap_size(data->num_params + offset);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user