oppc/code: fix subscript exprs
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Jan 2024 20:29:29 +0000 (23:29 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_code.py

index 97810acf9f56a72e407c9f58f5890417c3758792..eba5132355e2844a1ef9e606f5a65e11c855536f 100644 (file)
@@ -439,7 +439,9 @@ class CodeVisitor(pc_util.Visitor):
     @pc_util.Hook(pc_ast.SubscriptExpr)
     def SubscriptExpr(self, node):
         yield node
+        transient = self.transient()
         call = self.call(name="oppc_subscript", code=[
+            self[transient],
             self[node.subject],
             self[node.index],
         ])
@@ -449,7 +451,9 @@ class CodeVisitor(pc_util.Visitor):
     @pc_util.Hook(pc_ast.RangeSubscriptExpr)
     def RangeSubscriptExpr(self, node):
         yield node
-        call = self.call(name="oppc_subscript", code=[
+        transient = self.transient()
+        call = self.call(name="oppc_range_subscript", code=[
+            self[transient],
             self[node.subject],
             self[node.start],
             self[node.end],