diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-23 11:01:33 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-23 12:45:07 +0100 |
commit | 31d05c6734057bed56ac783d4f9d03d3c2ecbcbb (patch) | |
tree | f33ebf3a68d34568cbc2a26cdac0f4f782d55e3f /src | |
parent | 6597d990147d21d55449302cb3201e4769e15a2a (diff) |
ArrayPrototype::method_filter: Check for exception after callback
If there was an exception we cannot assume the returned value holds
anything sensible. Also, we should immediately return.
Fixes: QTBUG-81581
Change-Id: I822c204c476e05d6de78124b66ab2f939ca38ffd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4arrayobject.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 7b38bf34b1..47fd39a8a7 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -1382,6 +1382,7 @@ ReturnedValue ArrayPrototype::method_filter(const FunctionObject *b, const Value arguments[1] = Value::fromDouble(k); arguments[2] = instance; selected = callback->call(that, arguments, 3); + CHECK_EXCEPTION(); if (selected->toBoolean()) { a->arraySet(to, arguments[0]); ++to; |