diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2019-02-04 12:02:01 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2019-02-05 16:05:39 +0000 |
commit | 5de48ee56a5afb0045d40851a4a1dd79db82c772 (patch) | |
tree | c31cf09786dc327e833d5b60b4a05c45ee01f775 /src/qml/compiler/qv4compilerscanfunctions.cpp | |
parent | d27d896d8cb9d240138fe8ea69f1051f74ce1945 (diff) |
QMLJS: Have ScanFunctions iterate over ArrayPattern nodes
Like Codegen, have ScanFunctions iterate over the elements in an
ArrayPattern, instead of recursing over the tail of the element list.
This prevents running out of (native) stack, or hitting the recursion
check limiter.
Change-Id: I8203af3119ad50f19000a215af42649d9bcb3784
Fixes: QTBUG-73425
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compilerscanfunctions.cpp')
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index fc3ac769ae..e0eaa8867b 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -481,6 +481,14 @@ bool ScanFunctions::visit(FieldMemberExpression *ast) return true; } +bool ScanFunctions::visit(ArrayPattern *ast) +{ + for (PatternElementList *it = ast->elements; it; it = it->next) + Node::accept(it->element, this); + + return false; +} + bool ScanFunctions::enterFunction(FunctionExpression *ast, bool enterName) { if (_context->isStrict && (ast->name == QLatin1String("eval") || ast->name == QLatin1String("arguments"))) |