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 27 28 29 30
|
From 1d3056d12dbf676eb50e400f0233e1384b58976e Mon Sep 17 00:00:00 2001
From: Stuart Archibald <stuartarchibald@users.noreply.github.com>
Origin: https://github.com/numba/numba/pull/8639
Date: Mon, 28 Nov 2022 13:36:52 +0000
Subject: [PATCH 11/20] Add pop NULL to CALL_FUNCTION_EX byteflow analysis.
The cPython compiler seems to add a PUSH_NULL ahead of a CALL-like
instruction irrespective of whether it will be used. This causes
confusion in the byteflow analysis in the case of a loop containing
a CALL-like that doesn't consume the NULL as the state at the end
of the loop has the NULL on the stack and so it appears to be a
"new" state with the same PC offset.
---
numba/core/byteflow.py | 5 +++++
1 file changed, 5 insertions(+)
--- a/numba/core/byteflow.py
+++ b/numba/core/byteflow.py
@@ -1070,6 +1070,11 @@
varkwarg = None
vararg = state.pop()
func = state.pop()
+
+ if PYVERSION == (3, 11):
+ if "$null" in state.peek(1):
+ state.pop() # pop NULL, it's not used
+
res = state.make_temp()
state.append(inst, func=func, vararg=vararg, varkwarg=varkwarg, res=res)
state.push(res)
|