rocky / python-xdis

Python cross-version bytecode library and disassembler
GNU General Public License v2.0
292 stars 95 forks source link

3.11 Fix calculation of JUMP_BACKWARD jump target. #109

Closed 2elli closed 1 year ago

2elli commented 1 year ago

Previously JUMP_BACKWARD jump targets were not being calculated in the correct spot. This would result in these instructions acting as a JUMP_FORWARD.

Example

148 JUMP_BACKWARD (to 184)

# now

148 JUMP_BACKWARD (to 112) 

Also added JUMP_BACKWARD to the unconditional jumps table for 3.11.

rocky commented 1 year ago

Thanks!