src/BytecodeCompiler.cpp
changeset 175 f875ce723f2c
parent 174 e718b56aba78
child 182 c52ca323063f
     1.1 --- a/src/BytecodeCompiler.cpp	Sat Sep 01 16:36:20 2012 -0700
     1.2 +++ b/src/BytecodeCompiler.cpp	Sat Sep 01 17:10:56 2012 -0700
     1.3 @@ -228,10 +228,13 @@
     1.4              // += etc is not allowed on arrays.
     1.5              assert(!var->type()->isArray());
     1.6  
     1.7 +            if (var->location() == Variable::ENVIRONMENT)
     1.8 +                getEnvSlot(var);
     1.9 +
    1.10              if (var->type()->isReference()) {
    1.11                  __ dup();
    1.12                  __ getref(var->type()->contained());
    1.13 -            } else {
    1.14 +            } else if (var->location() != Variable::ENVIRONMENT) {
    1.15                  __ get(var);
    1.16              }
    1.17          }
    1.18 @@ -287,6 +290,8 @@
    1.19  
    1.20          if (var->type()->isReference())
    1.21              __ setref(var->type()->contained());
    1.22 +        else if (var->location() == Variable::ENVIRONMENT)
    1.23 +            setEnvSlot(var);
    1.24          else
    1.25              __ set(var);
    1.26      } else if (node->lvalue()->isFieldExpression()) {