MCPcopy
hub / github.com/rocky/python-uncompyle6 / is_jump_forward

Method is_jump_forward

uncompyle6/scanner.py:285–296  ·  view source on GitHub ↗

Return True if the code at offset is some sort of jump forward. That is, it is ether "JUMP_FORWARD" or an absolute jump that goes forward.

(self, offset: int)

Source from the content-addressed store, hash-verified

283 self.prev_op.append(offset)
284
285 def is_jump_forward(self, offset: int) -> bool:
286 """
287 Return True if the code at offset is some sort of jump forward.
288 That is, it is ether "JUMP_FORWARD" or an absolute jump that
289 goes forward.
290 """
291 opname = self.get_inst(offset).opname
292 if opname == "JUMP_FORWARD":
293 return True
294 if opname != "JUMP_ABSOLUTE":
295 return False
296 return offset < self.get_target(offset)
297
298 def ingest(self, co, classname=None, code_objects={}, show_asm=None):
299 """

Callers 3

detect_control_flowMethod · 0.80
detect_control_flowMethod · 0.80
detect_control_flowMethod · 0.80

Calls 2

get_instMethod · 0.95
get_targetMethod · 0.95

Tested by

no test coverage detected