diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-04-19 00:22:35 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-04-19 00:22:35 +0000 |
commit | 0941b0f655b8db94fedc53e343cdcef2259d636a (patch) | |
tree | eb78a91a064264056c77319010990e2b8d96ced8 /utils | |
parent | 5a22d6a6a09bd58b77b2e3ace8bc8ef459de9dad (diff) | |
download | external_llvm-0941b0f655b8db94fedc53e343cdcef2259d636a.zip external_llvm-0941b0f655b8db94fedc53e343cdcef2259d636a.tar.gz external_llvm-0941b0f655b8db94fedc53e343cdcef2259d636a.tar.bz2 |
Add some assertions.
Fixes segfaults in some corner cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/LLVMCConfigurationEmitter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/TableGen/LLVMCConfigurationEmitter.cpp b/utils/TableGen/LLVMCConfigurationEmitter.cpp index bb4321c..834fb9c 100644 --- a/utils/TableGen/LLVMCConfigurationEmitter.cpp +++ b/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") { |