From 407e2769c7b7909fdb2979090e71fa636f109a04 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 19 Feb 2019 11:17:17 +0100 Subject: [PATCH] Fix PropertyKey::isArrayIndex PropertyKey::asArrayIndex has a hole at UINT_MAX, so make isArrayIndex have the same hole. Change-Id: I85d0f14680c27d018644056960d75d94aee68646 Reviewed-by: Ulf Hermann Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4propertykey_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/jsruntime/qv4propertykey_p.h b/src/qml/jsruntime/qv4propertykey_p.h index cb2661f244..47867765db 100644 --- a/src/qml/jsruntime/qv4propertykey_p.h +++ b/src/qml/jsruntime/qv4propertykey_p.h @@ -114,7 +114,7 @@ public: static PropertyKey fromArrayIndex(uint idx) { PropertyKey key; key.val = ArrayIndexMask | static_cast(idx); return key; } bool isStringOrSymbol() const { return isManaged() && val != 0; } uint asArrayIndex() const { return (isManaged() || val == 0) ? std::numeric_limits::max() : static_cast(val & 0xffffffff); } - uint isArrayIndex() const { return !isManaged() && val != 0; } + uint isArrayIndex() const { return !isManaged() && val != 0 && static_cast(val & 0xffffffff) != std::numeric_limits::max(); } bool isValid() const { return val != 0; } static PropertyKey fromStringOrSymbol(Heap::StringOrSymbol *b) { PropertyKey key; key.setM(b); return key; }