[llvm-commits] [llvm] r172153 - /llvm/trunk/lib/MC/MCParser/AsmParser.cpp
NAKAMURA Takumi
geek4civic at gmail.com
Thu Jan 10 16:37:35 PST 2013
Author: chapuni
Date: Thu Jan 10 18:37:35 2013
New Revision: 172153
URL: http://llvm.org/viewvc/llvm-project?rev=172153&view=rev
Log:
llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg().
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=172153&r1=172152&r2=172153&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Thu Jan 10 18:37:35 2013
@@ -3934,7 +3934,8 @@
std::string Constraint = "=";
++InputIdx;
OutputDecls.push_back(OpDecl);
- OutputDeclsAddressOf.push_back(Operand->needAddressOf());
+ OutputDeclsAddressOf.push_back(Operand->isReg() &&
+ Operand->needAddressOf());
Constraint += Operand->getConstraint().str();
OutputConstraints.push_back(Constraint);
AsmStrRewrites.push_back(AsmRewrite(AOK_Output,
@@ -3942,7 +3943,8 @@
Operand->getNameLen()));
} else {
InputDecls.push_back(OpDecl);
- InputDeclsAddressOf.push_back(Operand->needAddressOf());
+ InputDeclsAddressOf.push_back(Operand->isReg() &&
+ Operand->needAddressOf());
InputConstraints.push_back(Operand->getConstraint().str());
AsmStrRewrites.push_back(AsmRewrite(AOK_Input,
Operand->getStartLoc(),
More information about the llvm-commits
mailing list