[llvm-commits] [llvm] r69494 - /llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp

Mikhail Glushenkov foldr at codedgers.com
Sat Apr 18 17:22:37 PDT 2009


Author: foldr
Date: Sat Apr 18 19:22:35 2009
New Revision: 69494

URL: http://llvm.org/viewvc/llvm-project?rev=69494&view=rev
Log:
Add some assertions.

Fixes segfaults in some corner cases.

Modified:
    llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp

Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=69494&r1=69493&r2=69494&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Sat Apr 18 19:22:35 2009
@@ -1284,6 +1284,7 @@
   StrVector::const_iterator I = StrVec.begin(), E = StrVec.end();
 
   // If there is a hook invocation on the place of the first command, skip it.
+  assert(!StrVec[0].empty());
   if (StrVec[0][0] == '$') {
     while (I != E && (*I)[0] != ')' )
       ++I;
@@ -1297,7 +1298,7 @@
 
   for (; I != E; ++I) {
     const std::string& cmd = *I;
-    //    std::cerr << cmd;
+    assert(!cmd.empty());
     O << IndentLevel;
     if (cmd.at(0) == '$') {
       if (cmd == "$INFILE") {





More information about the llvm-commits mailing list