aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-10-14 12:39:52 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-16 08:20:12 +0200
commitd1047887a6fd4f890484203a01ee5f1eefc1a20a (patch)
tree51d7d0be382644c2a6551652adb366d20d865205 /src
parent03196c9a0f1635ce78cf53addb6b688108f66fae (diff)
Make ScopedValue's CHECK_EXCEPTION also check isInterrupted
While there should be no way to generate an infinite loop from any of the affected methods, you can certainly generate a really long loop, for example with Array(1E9).join(). We should be able to interrupt this. Also, the various call()s could return with isInterrupted set. We should respect that and immediately return. Fixes: QTBUG-78955 Change-Id: I7e18b24db0bf39df03134027b2b5dba452ac7c1c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index e4aceef3ee..12a6381e6f 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -70,7 +70,7 @@ struct ScopedValue;
#define CHECK_EXCEPTION() \
do { \
- if (scope.hasException()) { \
+ if (scope.hasException() || scope.engine->isInterrupted.loadAcquire()) { \
return QV4::Encode::undefined(); \
} \
} while (false)