mirror of
https://github.com/angr/pyvex
synced 2026-06-21 13:47:01 +00:00
20c97ff8b9
* remove nose dependencies * resolve lint error * fix lint errors * fix lint errors * fix lint error
19 lines
528 B
Python
19 lines
528 B
Python
import archinfo
|
|
import pyvex
|
|
|
|
|
|
def test_ud2():
|
|
|
|
# On x86 and amd64, ud2 is a valid 2-byte instruction that means "undefined instruction". Upon decoding a basic
|
|
# block that ends with ud2, we should treat it as an explicit NoDecode, instead of skipping the instruction and
|
|
# resume lifting.
|
|
|
|
b = pyvex.block.IRSB(b"\x90\x90\x0f\x0b\x90\x90", 0x20, archinfo.ArchAMD64())
|
|
assert b.jumpkind == "Ijk_NoDecode"
|
|
assert b.next.con.value == 0x22
|
|
assert b.size == 4
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test_ud2()
|