-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
I encountered an inconsistency when working with E-T. When parsing negative code offsets, conditional jumps will happily accept this, however normal jumps throw a parser error.
Example:
; Valid
jgt r0, r11, +-5
; Invalid
ja +-5
This also leads to an issue in Ebpf.Display where displayProgram generates code it cannot parse:
>>> displayProgram [Jmp (-3)]
"ja +-3\n"
>>> parse "ja +-3\n"
Left "\"<input>\" (line 1, column 5):\nunexpected \"-\"\nexpecting \"0\" or digit"
You seem to have noticed this here: AsmParser.hs:139
IMO the easiest patch would be to include the required '+' in jmp parsing. This syntax is how Ken presented it in the Software Security course.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers