[llvm-commits] [llvm] r142503 - /llvm/trunk/include/llvm/TableGen/Record.h

David Greene greened at obbligato.org
Wed Oct 19 06:02:49 PDT 2011


Author: greened
Date: Wed Oct 19 08:02:48 2011
New Revision: 142503

URL: http://llvm.org/viewvc/llvm-project?rev=142503&view=rev
Log:
Fix Name Check

Avoid a potential assert by asking for record names as strings explicitly.

Modified:
    llvm/trunk/include/llvm/TableGen/Record.h

Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=142503&r1=142502&r2=142503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Wed Oct 19 08:02:48 2011
@@ -1629,12 +1629,12 @@
     return I == Defs.end() ? 0 : I->second;
   }
   void addClass(Record *R) {
-    assert(getClass(R->getName()) == 0 && "Class already exists!");
-    Classes.insert(std::make_pair(R->getName(), R));
+    assert(getClass(R->getNameInitAsString()) == 0 && "Class already exists!");
+    Classes.insert(std::make_pair(R->getNameInitAsString(), R));
   }
   void addDef(Record *R) {
-    assert(getDef(R->getName()) == 0 && "Def already exists!");
-    Defs.insert(std::make_pair(R->getName(), R));
+    assert(getDef(R->getNameInitAsString()) == 0 && "Def already exists!");
+    Defs.insert(std::make_pair(R->getNameInitAsString(), R));
   }
 
   /// removeClass - Remove, but do not delete, the specified record.





More information about the llvm-commits mailing list