aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-01-23 11:01:33 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-04-08 13:30:33 +0000
commit74bdd7b588528ecdbffa3872706a9ada2b83b716 (patch)
treed4c223344313d32bdbd33e194580507447382f5c /src
parent77c76ab4778b923e8bb5c30c12a6b64edcb34bba (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. (cherry-picked from commit 31d05c6734057bed56ac783d4f9d03d3c2ecbcbb) Fixes: QTBUG-81581 Change-Id: I822c204c476e05d6de78124b66ab2f939ca38ffd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 27fc278506..b67eceb7f7 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -1383,6 +1383,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;