Merge pull request #62 from jdomke/attfix

att parser: workaround for crash with "jg,pt" mnemonic
For now we will ignore the branch taken/not-taken indication and will only keep the condition in the mnemonic.
This commit is contained in:
Jan
2021-01-07 10:23:39 +01:00
committed by GitHub

View File

@@ -158,7 +158,7 @@ class ParserX86ATT(BaseParser):
# Instructions
# Mnemonic
mnemonic = pp.ZeroOrMore(pp.Literal('data16') | pp.Literal('data32')) + pp.Word(
pp.alphanums
pp.alphanums + ','
).setResultsName('mnemonic')
# Combine to instruction form
operand_first = pp.Group(
@@ -288,7 +288,7 @@ class ParserX86ATT(BaseParser):
operands.append(self.process_operand(result['operand4']))
return_dict = AttrDict(
{
self.INSTRUCTION_ID: result['mnemonic'],
self.INSTRUCTION_ID: result['mnemonic'].split(',')[0],
self.OPERANDS_ID: operands,
self.COMMENT_ID: ' '.join(result[self.COMMENT_ID])
if self.COMMENT_ID in result