[ms-inline asm] Adjust the EndLoc to account for the ']'.
authorChad Rosier <mcrosier@apple.com>
Fri, 15 Feb 2013 21:58:13 +0000 (21:58 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 15 Feb 2013 21:58:13 +0000 (21:58 +0000)
llvm-svn: 175312

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

index dc15a11..8c4c447 100644 (file)
@@ -911,7 +911,8 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned SegReg,
 
       if (getLexer().isNot(AsmToken::RBrac))
         return ErrorOperand(Parser.getTok().getLoc(), "Expected ']' token!");
-      End = Parser.getTok().getEndLoc();
+      // Adjust the EndLoc due to the ']'.
+      End = SMLoc::getFromPointer(Parser.getTok().getEndLoc().getPointer()-1);
       Parser.Lex();
       return X86Operand::CreateMem(Disp, Start, End, Size);
     }