mirror of
https://github.com/keystone-engine/keystone
synced 2026-06-08 15:15:30 +00:00
x86: accept insensitive string 'ptr' for memory operands
This commit is contained in:
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user