From a6cf7a62a7adc45680597ae2630a268d8d548517 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 23 Oct 2012 23:42:06 +0000 Subject: [PATCH] [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 --- lib/Target/X86/AsmParser/X86AsmParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 1f4e8dae271..b82bbdf9130 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. }