aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/dis.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/dis.py')
-rw-r--r--Lib/dis.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index c3d152b4de0..b39b2835330 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -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: