diff -r e718b56aba78 -r f875ce723f2c src/BytecodeCompiler.cpp --- a/src/BytecodeCompiler.cpp Sat Sep 01 16:36:20 2012 -0700 +++ b/src/BytecodeCompiler.cpp Sat Sep 01 17:10:56 2012 -0700 @@ -228,10 +228,13 @@ // += etc is not allowed on arrays. assert(!var->type()->isArray()); + if (var->location() == Variable::ENVIRONMENT) + getEnvSlot(var); + if (var->type()->isReference()) { __ dup(); __ getref(var->type()->contained()); - } else { + } else if (var->location() != Variable::ENVIRONMENT) { __ get(var); } } @@ -287,6 +290,8 @@ if (var->type()->isReference()) __ setref(var->type()->contained()); + else if (var->location() == Variable::ENVIRONMENT) + setEnvSlot(var); else __ set(var); } else if (node->lvalue()->isFieldExpression()) {