diff options
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 362f41affe..a2137ee849 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -200,10 +200,17 @@ inline bool Value::toBoolean() const inline uint Value::asArrayIndex() const { +#if QT_POINTER_SIZE == 8 + if (!isNumber()) + return UINT_MAX; + if (isInteger()) + return int_32 >= 0 ? (uint)int_32 : UINT_MAX; +#else if (isInteger() && int_32 >= 0) return (uint)int_32; if (!isDouble()) return UINT_MAX; +#endif double d = doubleValue(); uint idx = (uint)d; if (idx != d) |