x86: accept insensitive string 'ptr' for memory operands

This commit is contained in:
Nguyen Anh Quynh
2016-04-30 23:03:26 +08:00
parent ddf5df6e7e
commit e7fbb3513c
@@ -1807,11 +1807,11 @@ std::unique_ptr<X86Operand> X86AsmParser::ParseIntelOperand() {
Parser.Lex(); // Eat operand size (e.g., byte, word).
if (KsSyntax == KS_OPT_SYNTAX_NASM) {
// Nasm do not accept 'PTR' in memory operands
if (Tok.getString() == "PTR" && Tok.getString() == "ptr")
if (strcasecmp(Tok.getString().str().c_str(), "ptr") == 0)
return ErrorOperand(Tok.getLoc(), "Do not expected 'PTR' or 'ptr' token!");
} else {
// LLVM requires 'PTR' in memory operand
if (Tok.getString() != "PTR" && Tok.getString() != "ptr")
if (strcasecmp(Tok.getString().str().c_str(), "ptr") != 0)
return ErrorOperand(Tok.getLoc(), "Expected 'PTR' or 'ptr' token!");
Parser.Lex(); // Eat ptr.
}