File: 0044-Use-_FIXED_OFFSET-instead-of-a-inline-literal-number.patch

package info (click to toggle)
numba 0.56.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,672 kB
  • sloc: python: 183,651; ansic: 15,370; cpp: 2,259; javascript: 424; sh: 308; makefile: 174
file content (26 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download
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