From: Chad Rosier Date: Tue, 4 Sep 2012 16:36:26 +0000 (+0000) Subject: [ms-inline asm] Fix an illegal index and an 80-column violation. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12603e259170cd02084f51b17b43e9c9c4fce354;p=clang [ms-inline asm] Fix an illegal index and an 80-column violation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163143 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index dfe61f2429..8d93a26179 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -678,9 +678,9 @@ MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc, ArrayRef inputexprs, ArrayRef outputexprs, StringRef asmstr, ArrayRef constraints, ArrayRef 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)