From 83916498b80c4349b21f612b3c6dabc739517ed5 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Wed, 8 Aug 2012 20:37:31 +0000 Subject: [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 --- clang/lib/Sema/SemaStmt.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/Sema/SemaStmt.cpp') 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 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 AsmToks, ArrayRef LineEnds) { + if (!AsmToks.size()) + return ""; + // Collect the tokens into a string SmallString<512> Asm; SmallString<512> TokenBuf; -- cgit v1.2.3