From f44782d0cdbdb800d9c31d5aff712fbf29d52edc Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 21 Jun 2018 16:13:00 +0200 Subject: Variables declared in strict eval code don't all escape eval() calls in strict mode code create their own context, so even though we don't have a parent context, those variables do not escape, and can be allocated on the stack. Change-Id: Iea1853452fe1f792468fd6108851f04a1acf9b66 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4compilerscanfunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp') diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index 68cb58da46..7506b238f8 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -554,7 +554,7 @@ void ScanFunctions::calcEscapingVariables() for (Context *c : qAsConst(m->contextMap)) { if (c->allVarsEscape && c->contextType == ContextType::Block && c->members.isEmpty()) c->allVarsEscape = false; - if (!c->parent || m->debugMode) + if (c->contextType == ContextType::Global || (!c->isStrict && c->contextType == ContextType::Eval) || m->debugMode) c->allVarsEscape = true; if (c->allVarsEscape) { if (c->parent) { -- cgit v1.2.1