aboutsummaryrefslogtreecommitdiffstats
path: root/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2012-12-13 12:09:04 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-12-13 12:38:11 +0100
commit9edd6967753c16512c8c589f3dedcae02687070a (patch)
treea8c4460d5c556fa9b087c229ba88dd68980ce9ef /qv4codegen.cpp
parentd6fcbdbf5182dcd549ef685cfeb2e3e90d3e81c7 (diff)
Correctly set up nested functions
Make sure we have the correct set of nested functions in both IR::Function and VM::Function. This is required so that closures can work correctly. Change-Id: I42493d5ee503090653b71650c8d19e06c4bcfdda Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'qv4codegen.cpp')
-rw-r--r--qv4codegen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qv4codegen.cpp b/qv4codegen.cpp
index 7409a54bc6..1cbdc843a6 100644
--- a/qv4codegen.cpp
+++ b/qv4codegen.cpp
@@ -1650,14 +1650,14 @@ IR::Function *Codegen::defineFunction(const QString &name, AST::Node *ast,
TryCleanup *tryCleanup = 0;
enterEnvironment(ast);
- IR::Function *function = _module->newFunction(name);
+ IR::Function *function = _module->newFunction(name, _function);
+
if (_debugger)
_debugger->addFunction(function);
IR::BasicBlock *entryBlock = function->newBasicBlock();
IR::BasicBlock *exitBlock = function->newBasicBlock(IR::Function::DontInsertBlock);
IR::BasicBlock *throwBlock = function->newBasicBlock();
function->hasDirectEval = _env->hasDirectEval;
- function->hasNestedFunctions = _env->hasNestedFunctions;
function->maxNumberOfArguments = _env->maxNumberOfArguments;
function->isStrict = _env->isStrict;