From c48ede23bd15677de01531726dd762fda8feb7cc Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov Date: Sun, 19 Apr 2009 00:22:35 +0000 Subject: Add some assertions. Fixes segfaults in some corner cases. llvm-svn: 69494 --- llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm') diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp index bb4321c9b40..834fb9c14ab 100644 --- a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp @@ -1284,6 +1284,7 @@ void EmitCmdLineVecFill(const Init* CmdLine, const std::string& ToolName, 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 @@ void EmitCmdLineVecFill(const Init* CmdLine, const std::string& ToolName, for (; I != E; ++I) { const std::string& cmd = *I; - // std::cerr << cmd; + assert(!cmd.empty()); O << IndentLevel; if (cmd.at(0) == '$') { if (cmd == "$INFILE") { -- cgit v1.2.3