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 | b64f3101e65e6931a1b3b3479ca6357624b37667 (patch) | |
tree | dd60cfc21906bc14695d5ad79afd220c80916898 /lib/Sema/SemaStmt.cpp | |
parent | 62f22b87801882646418bae85111e565f7a53ddb (diff) |
[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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index a8a06a93fc..be90578163 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/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; |