diff options
author | Lars Knoll <lars.knoll@digia.com> | 2012-11-26 23:26:39 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2012-11-27 11:51:28 +0100 |
commit | b32c10a8d36aef52c38ad8b51cef33c100c8df9e (patch) | |
tree | ba8c937b55d09d4b1ab85631161338bd7acfb630 /qv4isel_masm.cpp | |
parent | 102aff16a896e2e237a00843731e84ef3d824b25 (diff) |
Correctly instantiate variables in the local scope
This fixes cases where eval() would create variables
in the wrong scope.
Change-Id: Ie93ec2d1fb125e588c1b6ffa2ca8ca4b6e3112c9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'qv4isel_masm.cpp')
-rw-r--r-- | qv4isel_masm.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qv4isel_masm.cpp b/qv4isel_masm.cpp index f39c3b75b1..a0262c8079 100644 --- a/qv4isel_masm.cpp +++ b/qv4isel_masm.cpp @@ -279,6 +279,18 @@ void InstructionSelection::callActivationProperty(IR::Call *call, IR::Temp *resu case IR::Name::builtin_pop_with: generateFunctionCall(Void, __qmljs_builtin_pop_with, ContextRegister); break; + case IR::Name::builtin_declare_vars: { + if (!call->args) + return; + IR::Const *deletable = call->args->expr->asConst(); + assert(deletable->type == IR::BoolType); + for (IR::ExprList *it = call->args->next; it; it = it->next) { + IR::Name *arg = it->expr->asName(); + assert(arg != 0); + generateFunctionCall(Void, __qmljs_builtin_declare_var, ContextRegister, + TrustedImm32(deletable->value != 0), identifier(*arg->id)); + } + } } } |