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

Method build_prev_op

uncompyle6/scanner.py:270–283  ·  view source on GitHub ↗

Compose 'list-map' which allows to jump to previous op, given offset of current op as index.

(self)

Source from the content-addressed store, hash-verified

268 return lines
269
270 def build_prev_op(self):
271 """
272 Compose 'list-map' which allows to jump to previous
273 op, given offset of current op as index.
274 """
275 code = self.code
276 codelen = len(code)
277 # 2.x uses prev 3.x uses prev_op. Sigh
278 # Until we get this sorted out.
279 self.prev = self.prev_op = [0]
280 for offset in self.op_range(0, codelen):
281 op = code[offset]
282 for _ in range(instruction_size(op, self.opc)):
283 self.prev_op.append(offset)
284
285 def is_jump_forward(self, offset: int) -> bool:
286 """

Callers 1

build_instructionsMethod · 0.95

Calls 2

op_rangeMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected