diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-08-08 20:37:31 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-08-08 20:37:31 +0000 |
commit | 83916498b80c4349b21f612b3c6dabc739517ed5 (patch) | |
tree | 9ff8c12cbfb35ef8739d37c067eac7d6651dade9 /clang/lib/Sema/SemaStmt.cpp | |
parent | 4c65c505e0903836980242291bc4913858d5ad7d (diff) | |
download | bcm5719-llvm-83916498b80c4349b21f612b3c6dabc739517ed5.tar.gz bcm5719-llvm-83916498b80c4349b21f612b3c6dabc739517ed5.zip |
[ms-inline asm] Add a very simple test case. Basically, we're only testing for
crashers at the moment (and coincidentally this case was causing a crash).
llvm-svn: 161520
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index a8a06a93fcf..be905781637 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -2786,6 +2786,9 @@ static std::string PatchMSAsmString(Sema &SemaRef, bool &IsSimple, SourceLocation AsmLoc, ArrayRef<Token> AsmToks, const TargetInfo &TI) { + if (!AsmToks.size()) + return ""; + std::string Res; IdentifierInfo *II = AsmToks[0].getIdentifierInfo(); Res = II->getName().str(); @@ -2841,6 +2844,9 @@ static std::string PatchMSAsmString(Sema &SemaRef, bool &IsSimple, static std::string buildMSAsmString(Sema &SemaRef, ArrayRef<Token> AsmToks, ArrayRef<unsigned> LineEnds) { + if (!AsmToks.size()) + return ""; + // Collect the tokens into a string SmallString<512> Asm; SmallString<512> TokenBuf; |