]> granicus.if.org Git - clang/commitdiff
avoid a crash when we encounter a implicit cast of the paren expr due to
authorChris Lattner <sabre@nondot.org>
Sun, 3 May 2009 06:50:40 +0000 (06:50 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 3 May 2009 06:50:40 +0000 (06:50 +0000)
promotions.  This should be fixed by not modeling asm operands (which
require the ()'s according to the grammar) as not being paren exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70668 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaStmt.cpp

index ac5cef10f4271dce7cf555b9af494e1743d004c6..02f6840415c46d08a9eb33444c05946bec44bd9b 100644 (file)
@@ -1040,7 +1040,7 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
     
     unsigned TiedTo = Info.getTiedOperand();
     Expr *OutputExpr     = Exprs[TiedTo];
-    ParenExpr *InputExpr = cast<ParenExpr>(Exprs[i+NumOutputs]);
+    Expr *InputExpr = Exprs[i+NumOutputs];
     QualType InTy = InputExpr->getType();
     QualType OutTy = OutputExpr->getType();
     if (Context.hasSameType(InTy, OutTy))
@@ -1057,7 +1057,7 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc,
         continue;
     }
     
-    Diag(InputExpr->getSubExpr()->getLocStart(),
+    Diag(InputExpr->getLocStart(),
          diag::err_asm_tying_incompatible_types)
       << InTy << OutTy << OutputExpr->getSourceRange()
       << InputExpr->getSourceRange();