summaryrefslogtreecommitdiffstats
path: root/lib
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
parentd4d96acb9117574510390af700ec0eca375f58f2 (diff)
downloadexternal_llvm-a6cf7a62a7adc45680597ae2630a268d8d548517.zip
external_llvm-a6cf7a62a7adc45680597ae2630a268d8d548517.tar.gz
external_llvm-a6cf7a62a7adc45680597ae2630a268d8d548517.tar.bz2
[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')
-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 1f4e8da..b82bbdf 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.
}