(code)
| 592 | _INT_OVERFLOW = 2 ** (_INT_BITS - 1) |
| 593 | |
| 594 | def _unpack_opargs(code): |
| 595 | extended_arg = 0 |
| 596 | caches = 0 |
| 597 | for i in range(0, len(code), 2): |
| 598 | # Skip inline CACHE entries: |
| 599 | if caches: |
| 600 | caches -= 1 |
| 601 | continue |
| 602 | op = code[i] |
| 603 | deop = _deoptop(op) |
| 604 | caches = _inline_cache_entries[deop] |
| 605 | if deop >= HAVE_ARGUMENT: |
| 606 | arg = code[i+1] | extended_arg |
| 607 | extended_arg = (arg << 8) if deop == EXTENDED_ARG else 0 |
| 608 | # The oparg is stored as a signed integer |
| 609 | # If the value exceeds its upper limit, it will overflow and wrap |
| 610 | # to a negative integer |
| 611 | if extended_arg >= _INT_OVERFLOW: |
| 612 | extended_arg -= 2 * _INT_OVERFLOW |
| 613 | else: |
| 614 | arg = None |
| 615 | extended_arg = 0 |
| 616 | yield (i, op, arg) |
| 617 | |
| 618 | def findlabels(code): |
| 619 | """Detect all offsets in a byte code which are jump targets. |
no test coverage detected