[PATCH] D19731: Parse PDB Name Hash Table

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 14:50:15 PDT 2016


zturner added inline comments.

================
Comment at: lib/DebugInfo/PDB/Raw/NameHashTable.cpp:132
@@ +131,3 @@
+  }
+  return 0; // 0 is an invalid name index
+}
----------------
majnemer wrote:
> If we are going to use `0` as our sentinel, can we assert that `NameIndex` isn't `0`?
I think it would be better to just skip over 0 values.  If the number of buckets is larger than the number of strings (because say you added a string and then removed it) then you could have 0 values in the `IDs` array.  So I should probably fix `getStringForID` to check for an ID of 0 and also fix `getIDForString` to skip the entry if it finds a 0 id.


http://reviews.llvm.org/D19731





More information about the llvm-commits mailing list