File: 206-Fix-f-string-const-name-interp.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 (28 lines) | stat: -rw-r--r-- 1,070 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
27
28
From c031e05aa2fccafd39319b59e7987402040af3aa Mon Sep 17 00:00:00 2001
From: Stuart Archibald <stuartarchibald@users.noreply.github.com>
Origin: https://github.com/numba/numba/pull/8639
Date: Fri, 25 Nov 2022 13:24:57 +0000
Subject: [PATCH 06/20] Fix f-string const name interp.

As title.
---
 numba/core/interpreter.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/numba/core/interpreter.py
+++ b/numba/core/interpreter.py
@@ -2905,10 +2905,10 @@
 
         op = BINOPS_TO_OPERATORS["is"]
 
-        constnone = self.store(value=ir.Const(None, loc=self.loc),
-                         name="${inst.offset}constnone")
-        pred = self.get(pred)
-        isnone = ir.Expr.binop(op, lhs=pred, rhs=constnone, loc=self.loc)
+        lhs = self.store(value=ir.Const(None, loc=self.loc),
+                         name=f"${inst.offset}constnone")
+        rhs = self.get(pred)
+        isnone = ir.Expr.binop(op, lhs=lhs, rhs=rhs, loc=self.loc)
 
         pname = "$%spred" % (inst.offset)
         predicate = self.store(value=isnone, name=pname)