X86 MC: Don't crash on empty memory operand parens
Instead, create an absolute memory operand. Fixes PR20504. llvm-svn: 214457
This commit is contained in:
parent
0c5da97dd0
commit
b7e2f6015a
|
@ -1880,8 +1880,10 @@ std::unique_ptr<X86Operand> X86AsmParser::ParseMemOperand(unsigned SegReg,
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SegReg || BaseReg || IndexReg)
|
||||||
return X86Operand::CreateMem(SegReg, Disp, BaseReg, IndexReg, Scale,
|
return X86Operand::CreateMem(SegReg, Disp, BaseReg, IndexReg, Scale,
|
||||||
MemStart, MemEnd);
|
MemStart, MemEnd);
|
||||||
|
return X86Operand::CreateMem(Disp, MemStart, MemEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
|
||||||
|
|
|
@ -52,6 +52,11 @@
|
||||||
call *%eax
|
call *%eax
|
||||||
# CHECK: calll *4(%eax)
|
# CHECK: calll *4(%eax)
|
||||||
call *4(%eax)
|
call *4(%eax)
|
||||||
|
foo:
|
||||||
|
calll foo()
|
||||||
|
# CHECK: calll foo{{$}}
|
||||||
|
calll foo(,)
|
||||||
|
# CHECK: calll foo{{$}}
|
||||||
|
|
||||||
# CHECK: movl %gs:8, %eax
|
# CHECK: movl %gs:8, %eax
|
||||||
movl %gs:8, %eax
|
movl %gs:8, %eax
|
||||||
|
|
Loading…
Reference in New Issue