aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4reflect.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2023-10-11 16:01:30 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2023-10-11 16:01:30 +0300
commit105e610548a62d943301153afb337a49f14e9e25 (patch)
tree34d8e322f1161f4a8eafabdbc721af42ea960075 /src/qml/jsruntime/qv4reflect.cpp
parent960a980dc885622cb84990c4da75d5060318302d (diff)
parent94fd52dbb83a4982e4a70e621f431b0bd0945b5d (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.12' into tqtc/lts-5.15-opensourcev5.15.12-lts-lgpl
Diffstat (limited to 'src/qml/jsruntime/qv4reflect.cpp')
-rw-r--r--src/qml/jsruntime/qv4reflect.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4reflect.cpp b/src/qml/jsruntime/qv4reflect.cpp
index 2a6c61f044..39a0b03dec 100644
--- a/src/qml/jsruntime/qv4reflect.cpp
+++ b/src/qml/jsruntime/qv4reflect.cpp
@@ -76,7 +76,10 @@ struct CallArgs {
static CallArgs createListFromArrayLike(Scope &scope, const Object *o)
{
- int len = o->getLength();
+ int len = scope.engine->safeForAllocLength(o->getLength());
+ if (scope.engine->hasException)
+ return {nullptr, 0};
+
Value *arguments = scope.alloc(len);
for (int i = 0; i < len; ++i) {