mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-103046: Display current line correctly for dis.disco() with CACHE entries (#103047)
This commit is contained in:
parent
3606753246
commit
34eb6f7276
3 changed files with 36 additions and 1 deletions
|
|
@ -581,7 +581,12 @@ def _disassemble_bytes(code, lasti=-1, varname_from_oparg=None,
|
|||
instr.offset > 0)
|
||||
if new_source_line:
|
||||
print(file=file)
|
||||
is_current_instr = instr.offset == lasti
|
||||
if show_caches:
|
||||
is_current_instr = instr.offset == lasti
|
||||
else:
|
||||
# Each CACHE takes 2 bytes
|
||||
is_current_instr = instr.offset <= lasti \
|
||||
<= instr.offset + 2 * _inline_cache_entries[_deoptop(instr.opcode)]
|
||||
print(instr._disassemble(lineno_width, is_current_instr, offset_width),
|
||||
file=file)
|
||||
if exception_entries:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue