pagereader: skip empty dynamic and static operands
authorDmitry Selyutin <ghostmansd@gmail.com>
Thu, 1 Sep 2022 14:20:02 +0000 (17:20 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 1 Sep 2022 14:37:01 +0000 (17:37 +0300)
src/openpower/decoder/pseudo/pagereader.py

index 79e47597b88511bbdb89c6c51d9fcb6b8ab848df..5263285853712362aed4ef660b021ddc9cc8b448 100644 (file)
@@ -271,12 +271,14 @@ class ISA:
                 (dynamic, _, rest) = map(str.strip, rest.partition(" "))
                 if regex_dynamic.match(dynamic) is None and dynamic:
                     raise IOError(f"{l!r}: {dynamic!r}")
-                opcode.append(dynamic.split(","))
+                if dynamic:
+                    opcode.append(dynamic.split(","))
 
                 static = rest
                 if regex_static.match(static) is None and static:
                     raise IOError(f"{l!r}: {static!r}")
-                opcode.extend(static[1:-1].split(" "))
+                if static:
+                    opcode.extend(static[1:-1].split(" "))
 
                 opcodes.append(opcode)