From 4e738a719ef872cce9a99f539dd18394f94790fe Mon Sep 17 00:00:00 2001 From: Carl Shapiro Date: Tue, 10 May 2011 00:50:35 -0700 Subject: [PATCH] Remove an invalid assertion. There are three situtations where insertions are performed into one of the intern tables. Two cases perform an insertion when an key value pair is known to be absent. One case performs an insert when a key value pair might be present. An assertion was added that errantly checked that an insertion occured in the might be present case. This change leaves an assert in place for the absent cases and removes the assert in the might be present case. In addition, a comment has been improved to reinforce the condition of the might be present insertion. Change-Id: I84a9090a9ca338e164898e1d6893b2a23d74f5bc --- vm/Intern.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vm/Intern.cpp b/vm/Intern.cpp index 9faca45e0..7754bb3d7 100644 --- a/vm/Intern.cpp +++ b/vm/Intern.cpp @@ -65,7 +65,6 @@ static StringObject* insertString(HashTable* table, u4 key, StringObject* value) } void* entry = dvmHashTableLookup(table, key, (void*)value, dvmHashcmpStrings, true); - assert(entry == value); return (StringObject*)entry; } @@ -99,12 +98,14 @@ static StringObject* lookupInternedString(StringObject* strObj, bool isLiteral) */ dvmHashTableRemove(gDvm.internedStrings, key, interned); found = insertString(gDvm.literalStrings, key, interned); + assert(found == interned); } else { /* * No match in the literal table or the interned * table. Insert into the literal table. */ found = insertString(gDvm.literalStrings, key, strObj); + assert(found == strObj); } } } else { @@ -115,7 +116,7 @@ static StringObject* lookupInternedString(StringObject* strObj, bool isLiteral) if (found == NULL) { /* * No match was found in the literal table. Insert into - * the intern table. + * the intern table if it does not already exist. */ found = insertString(gDvm.internedStrings, key, strObj); } -- 2.11.0