diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index e72495fc7b0..347b34f78a3 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -2902,6 +2902,15 @@ StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, std::string PatchedAsmString = PatchMSAsmString(*this, IsSimple, AsmLoc, AsmToks, Context.getTargetInfo()); + // PatchMSAsmString doesn't correctly patch non-simple asm statements. + if (!IsSimple) { + MSAsmStmt *NS = + new (Context) MSAsmStmt(Context, AsmLoc, /* IsSimple */ true, + /* IsVolatile */ true, AsmToks, LineEnds, + AsmString, Clobbers, EndLoc); + return Owned(NS); + } + // Initialize targets and assembly printers/parsers. llvm::InitializeAllTargetInfos(); llvm::InitializeAllTargetMCs(); |

