Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/scopes.cc b/src/scopes.cc
- index c961257..f33d81a 100644
- --- a/src/scopes.cc
- +++ b/src/scopes.cc
- @@ -1292,6 +1292,25 @@ void Scope::AllocateNonParameterLocals() {
- vars.Sort(VarAndOrder::Compare);
- int var_count = vars.length();
- +
- + {
- + bool has_context_allocation = false;
- + for (int i = 0; i < var_count; i++) {
- + if (MustAllocateInContext(vars[i].var())) {
- + has_context_allocation = true;
- + break;
- + }
- + }
- + if (has_context_allocation) {
- + for (int i = 0; i < var_count; i++) {
- + Variable* v = vars[i].var();
- + if (v->mode() != TEMPORARY && !v->is_this() && !v->is_arguments()) {
- + v->ForceContextAllocation();
- + }
- + }
- + }
- + }
- +
- for (int i = 0; i < var_count; i++) {
- AllocateNonParameterLocal(vars[i].var());
- }
Advertisement
Add Comment
Please, Sign In to add comment