Browse files

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
  • Loading branch information...
1 parent 65596b6 commit 4e738a719ef872cce9a99f539dd18394f94790fe Carl Shapiro committed May 10, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 vm/Intern.cpp
5 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);

0 comments on commit 4e738a7

Please sign in to comment.