1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From: Siu Kwan Lam <1929845+sklam@users.noreply.github.com>
Origin: https://github.com/numba/numba/pull/8545
Date: Mon, 21 Nov 2022 15:19:33 -0600
Subject: Use _FIXED_OFFSET instead of a inline literal number
---
numba/core/bytecode.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/numba/core/bytecode.py b/numba/core/bytecode.py
index 2098173..410fb4c 100644
--- a/numba/core/bytecode.py
+++ b/numba/core/bytecode.py
@@ -313,8 +313,11 @@ class ByteCodePy311(ByteCode):
def fixup_eh(ent):
from dis import _ExceptionTableEntry
+ # Patch up the exception table offset
+ # because we add a NOP in _patched_opargs
out = _ExceptionTableEntry(
- start=ent.start + 2, end=ent.end + 2, target=ent.target + 2,
+ start=ent.start + _FIXED_OFFSET, end=ent.end + _FIXED_OFFSET,
+ target=ent.target + _FIXED_OFFSET,
depth=ent.depth, lasti=ent.lasti,
)
return out
|