diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-11 00:37:35 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-01-11 00:37:35 +0000 |
commit | 51873db5af7267e757cd1c65cae43df48588bccf (patch) | |
tree | 0ecc22788e6f04f3503ec8dc8542ea7783efc697 /lib/MC/MCParser/AsmParser.cpp | |
parent | 805141e5043b7bd2fade62102c79b2beb2e3aec4 (diff) |
llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index ecf35fff66..00c16e1274 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/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(), |