fix bug in parser when concatenating stuff that isn't variables
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 11 Nov 2022 08:41:18 +0000 (00:41 -0800)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:16 +0000 (19:51 +0100)
src/openpower/decoder/pseudo/parser.py

index 1e6a330ffa455be8ad4dd7a437e83a0d0f60ea7c..42df81be96e83c43ac8bcac7fb0f7fee3c37e0eb 100644 (file)
@@ -170,8 +170,9 @@ def check_concat(node):  # checks if the comparison is already a concat
     print("check concat", node)
     if not isinstance(node, ast.Call):
         return [node]
-    print("func", node.func.id)
-    if node.func.id != 'concat':
+    node_func_id = getattr(node.func, "id", None)
+    print("func", node_func_id)
+    if node_func_id != 'concat':
         return [node]
     if node.keywords:  # a repeated list-constant, don't optimise
         return [node]