We need to allow storing the value of UINT_MAX as an identifier
authorLars Knoll <lars.knoll@digia.com>
Fri, 28 Jun 2013 09:09:35 +0000 (11:09 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 28 Jun 2013 12:56:38 +0000 (14:56 +0200)
As this number is not a valid array index, setting it on an
object will store it in the property table.

Avoids a crash in tst_qjsengine.

Change-Id: Idfacde241609e4818d9da79c35705219c733e50d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/v4/qv4identifiertable.cpp

index d3e0f4c..5de2f89 100644 (file)
@@ -74,7 +74,7 @@ void IdentifierTable::addEntry(String *str)
 {
     uint hash = str->hashValue();
 
-    if (str->subtype >= String::StringType_UInt)
+    if (str->subtype == String::StringType_ArrayIndex)
         return;
 
     str->identifier = new Identifier;
@@ -137,7 +137,7 @@ Identifier *IdentifierTable::identifier(String *str)
     if (str->identifier)
         return str->identifier;
     uint hash = str->hashValue();
-    if (str->subtype >= String::StringType_UInt)
+    if (str->subtype == String::StringType_ArrayIndex)
         return 0;
 
     uint idx = hash % alloc;