llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behavio...
authorNAKAMURA Takumi <geek4civic@gmail.com>
Fri, 11 Jan 2013 00:37:35 +0000 (00:37 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Fri, 11 Jan 2013 00:37:35 +0000 (00:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172153 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/AsmParser.cpp

index ecf35fff6614699935c790fed6926e0a7aaafe48..00c16e12749364d8e09dc2f03ffcb5ea6b2b50fe 100644 (file)
@@ -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(),