aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/AsmParser/X86AsmParser.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-23 23:42:06 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-23 23:42:06 +0000
commita6cf7a62a7adc45680597ae2630a268d8d548517 (patch)
treebb48fde0700e9ab0340eea07db51ed85765cdb85 /lib/Target/X86/AsmParser/X86AsmParser.cpp
parentd4d96acb9117574510390af700ec0eca375f58f2 (diff)
[ms-inline asm] Offset operator - the size should be based on the size of a
pointer, not the size of the variable. Part of rdar://12470317 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmParser/X86AsmParser.cpp')
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 1f4e8dae27..b82bbdf913 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -774,6 +774,10 @@ X86Operand *X86AsmParser::ParseIntelMemOperand(unsigned SegReg, SMLoc Start) {
Tok.getString() == "OFFSET")) {
OffsetOf = true;
OffsetOfLoc = Parser.getTok().getLoc();
+
+ // Size is based on the size of a pointer, not the size of the variable.
+ assert (!Size && "Unexpected size!");
+ Size = is64BitMode() ? 64 : 32;
Parser.Lex(); // Eat offset.
}