aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-09-04 16:36:26 +0000
committerChad Rosier <mcrosier@apple.com>2012-09-04 16:36:26 +0000
commit12603e259170cd02084f51b17b43e9c9c4fce354 (patch)
treed6a5d11080e889632a5b04393ca17ca37d8ddf63 /lib/AST/Stmt.cpp
parentd5eb585a02d6905b5e6f83fd03a90d583a39ac82 (diff)
[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
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp14
1 files changed, 7 insertions, 7 deletions
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<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)