summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-01-11 00:37:35 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-01-11 00:37:35 +0000
commit84f349397ce61aedac1906ca7a7d6bbc0fd7bf0e (patch)
treec6c7bf78c6bdb5f727f71e6dd98f9778bcc116a8 /llvm/lib/MC/MCParser
parenta237126fc678292baaf18473618cbc5a1487ace2 (diff)
downloadbcm5719-llvm-84f349397ce61aedac1906ca7a7d6bbc0fd7bf0e.tar.gz
bcm5719-llvm-84f349397ce61aedac1906ca7a7d6bbc0fd7bf0e.zip
llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg().
llvm-svn: 172153
Diffstat (limited to 'llvm/lib/MC/MCParser')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index ecf35fff661..00c16e12749 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -3934,7 +3934,8 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
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 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
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(),
OpenPOWER on IntegriCloud