]> granicus.if.org Git - clang/commitdiff
[ms-inline asm] Fix an illegal index and an 80-column violation.
authorChad Rosier <mcrosier@apple.com>
Tue, 4 Sep 2012 16:36:26 +0000 (16:36 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 4 Sep 2012 16:36:26 +0000 (16:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163143 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Stmt.cpp

index dfe61f24298f3b6f552791a541cbfc5baa3239f7..8d93a261791604c91f6ef84e167ca776e11456e0 100644 (file)
@@ -678,9 +678,9 @@ MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
                      ArrayRef<Expr*> inputexprs, ArrayRef<Expr*> outputexprs,
                      StringRef asmstr, ArrayRef<StringRef> constraints,
                      ArrayRef<StringRef> clobbers, SourceLocation endloc)
-  : AsmStmt(MSAsmStmtClass, asmloc, issimple, isvolatile, outputs.size(), inputs.size(),
-            clobbers.size()), LBraceLoc(lbraceloc), EndLoc(endloc),
-    AsmStr(asmstr.str()), NumAsmToks(asmtoks.size()) {
+  : AsmStmt(MSAsmStmtClass, asmloc, issimple, isvolatile, outputs.size(),
+            inputs.size(), clobbers.size()), LBraceLoc(lbraceloc),
+            EndLoc(endloc), AsmStr(asmstr.str()), NumAsmToks(asmtoks.size()) {
   assert (inputs.size() == inputexprs.size() && "Input expr size mismatch!");
   assert (outputs.size() == outputexprs.size() && "Input expr size mismatch!");
 
@@ -689,14 +689,14 @@ MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc,
   Names = new (C) IdentifierInfo*[NumExprs];
   for (unsigned i = 0, e = NumOutputs; i != e; ++i)
     Names[i] = outputs[i];
-  for (unsigned i = NumOutputs, e = NumExprs; i != e; ++i)
-    Names[i] = inputs[i];
+  for (unsigned i = NumOutputs, j = 0, e = NumExprs; i != e; ++i, ++j)
+    Names[i] = inputs[j];
 
   Exprs = new (C) Stmt*[NumExprs];
   for (unsigned i = 0, e = NumOutputs; i != e; ++i)
     Exprs[i] = outputexprs[i];
-  for (unsigned i = NumOutputs, e = NumExprs; i != e; ++i)
-    Exprs[i] = inputexprs[i];
+  for (unsigned i = NumOutputs, j = 0, e = NumExprs; i != e; ++i, ++j)
+    Exprs[i] = inputexprs[j];
 
   AsmToks = new (C) Token[NumAsmToks];
   for (unsigned i = 0, e = NumAsmToks; i != e; ++i)