From 2af92f495df4c6634022959f6b03b1cd208145d4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 22 Jan 2013 14:53:46 +0100 Subject: [PATCH] Fix bug in property table When inserting a new entry in the property table and we're reusing an entry from the free-list, make sure to assign the name correctly to ensure we calculate the correct bucket according to the _new_ name and not the name from the old re-used property. Also removed unused isEmpty() method that doesn't return the correct thing anyway (_propertyCount is never decreased). Change-Id: Ifc4f2f6b1c5fe975e30bdc81386061d6215ad3e3 Reviewed-by: Lars Knoll --- qv4propertytable.h | 3 +-- tests/TestExpectations | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/qv4propertytable.h b/qv4propertytable.h index 6ee7f92..3bd4767 100644 --- a/qv4propertytable.h +++ b/qv4propertytable.h @@ -87,8 +87,6 @@ public: delete[] _buckets; } - inline bool isEmpty() const { return _propertyCount == 0; } - typedef PropertyTableEntry **iterator; inline iterator begin() const { return _properties; } inline iterator end() const { return _properties + _propertyCount; } @@ -156,6 +154,7 @@ public: PropertyTableEntry *prop; if (_freeList) { prop = _freeList; + prop->name = name; _freeList = _freeList->next; } else { prop = new PropertyTableEntry(name); diff --git a/tests/TestExpectations b/tests/TestExpectations index dfbf08b..fe7f7b8 100644 --- a/tests/TestExpectations +++ b/tests/TestExpectations @@ -106,7 +106,6 @@ S11.3.2_A4_T4 failing 11.4.1-5-2 failing S11.4.1_A1 failing S11.4.1_A2.1 failing -S11.4.1_A3.3 failing 11.4.4-2-1-s failing 11.4.4-2-2-s failing 11.4.5-2-1-s failing @@ -499,7 +498,6 @@ S15.1.3.2_A5.3 failing 15.2.3.3-4-13 failing 15.2.3.3-4-9 failing 15.2.3.6-2-17-1 failing -15.2.3.5-4-315 failing 15.2.3.6-4-291-1 failing 15.2.3.6-4-292-1 failing 15.2.3.6-4-293-2 failing @@ -512,7 +510,6 @@ S15.1.3.2_A5.3 failing 15.2.3.6-4-300-1 failing 15.2.3.6-4-360-3 failing 15.2.3.6-4-360-7 failing -15.2.3.7-6-a-110 failing 15.2.3.7-6-a-280 failing 15.2.3.7-6-a-286 failing 15.2.3.7-6-a-288 failing -- 2.7.4