Fix optimizer slot clash during inlining and correct closure reduction
order
- Add new_for_inlining to SubstitutionMap to preserve the next_slot
counter, preventing local slot collisions when merging
scopes.
- Update Inliner to request fresh slots for parameters during beta
reduction instead of forcing identity mappings.
- Fix execution order in Optimizer::visit_node for closure inlining
to run prepare_beta_reduction before visiting the function
body, preventing corrupted upvalue captures.
- Fix CLI --no-opt flag to correctly disable the optimizer in the ast
binary.
- Add integration test to prevent future slot clash regressions.
This commit is contained in:
@@ -128,8 +128,7 @@ impl<'a> Inliner<'a> {
|
||||
}
|
||||
|
||||
if let Address::Local(slot) = addr {
|
||||
sub.slot_mapping.insert(*slot, *slot);
|
||||
sub.next_slot = sub.next_slot.max(slot.0 + 1);
|
||||
sub.map_slot(*slot);
|
||||
}
|
||||
*offset += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user