oppc/parser: check for regs in trailerlist
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 12 Jan 2024 20:47:00 +0000 (23:47 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_parser.py

index cb60282b22c5eb3ff5ea4cd206888464290be74c..8f385d6deedb5d8b0957ace81046c3916bbed22a 100644 (file)
@@ -429,6 +429,9 @@ class Parser:
                     name = pc_ast.Call.Name(str(p[1]))
                     node.subject = pc_ast.Call(name=name, args=node.subject)
                 else:
+                    if (isinstance(p[1], pc_ast.Symbol) and
+                            (str(p[1]) in self.__class__.REGS)):
+                        p[1] = self.__class__.REGS[str(p[1])](p[1])
                     node.subject = p[1]
                 p[0] = p[2]
             elif isinstance(p[2], pc_ast.Call.Arguments):