aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-19 22:57:33 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-19 22:57:33 +0000
commitab450e42f1ae00d221a86cd41361834dd2ab95bc (patch)
treed0c17fdde2646ec67b60733e32b568c1a0a14e61 /lib/MC
parent30580cea43ac9108627e0616df6a30518ee7c0ef (diff)
downloadexternal_llvm-ab450e42f1ae00d221a86cd41361834dd2ab95bc.zip
external_llvm-ab450e42f1ae00d221a86cd41361834dd2ab95bc.tar.gz
external_llvm-ab450e42f1ae00d221a86cd41361834dd2ab95bc.tar.bz2
[ms-inline asm] Reset the opcode prior to parsing a statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 6669780..690684f 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -319,6 +319,7 @@ private:
// MS-style inline assembly parsing.
bool isInstruction() { return Opcode != (unsigned)~0x0; }
unsigned getOpcode() { return Opcode; }
+ void setOpcode(unsigned Value) { Opcode = Value; }
};
/// \brief Generic implementations of directive handling, etc. which is shared
@@ -3615,7 +3616,11 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
unsigned InputIdx = 0;
unsigned OutputIdx = 0;
while (getLexer().isNot(AsmToken::Eof)) {
- if (ParseStatement()) return true;
+ // Clear the opcode.
+ setOpcode(~0x0);
+
+ if (ParseStatement())
+ return true;
if (isInstruction()) {
const MCInstrDesc &Desc = MII->get(getOpcode());