aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-01-25 12:33:51 +0100
committerLars Knoll <lars.knoll@qt.io>2017-01-25 14:16:40 +0000
commit68bd6fcc8a71400138f92a6454b850104b9da88c (patch)
treea3b5bef47d64ed1229d9eb99a49e2216893fd4a5 /src/qml/jsruntime/qv4value_p.h
parent7adf9caa6fd7886e2eead6e8fdc20dea2152a30b (diff)
UINT_MAX is not a valid array index in JS
Fix a regression, where we'd accept UINT_MAX as a valid array index. Change-Id: I5ae8874d590f5e99da2e12d367b6f3c65b2bad0b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 816b8fb11b..64f0f3a86f 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -544,7 +544,7 @@ inline bool Value::asArrayIndex(uint &idx) const
}
double d = doubleValue();
idx = (uint)d;
- return (idx == d);
+ return (idx == d && idx != UINT_MAX);
}
#endif