fix concat when the first argument is a FieldSelectableInt
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 27 Sep 2023 03:28:16 +0000 (20:28 -0700)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:20 +0000 (19:26 +0000)
src/openpower/decoder/selectable_int.py

index 1490a4531324054d831e4b9514107dd7ea42a073..30dddf657e3b9e92a66ff14bb0bcb157b6e59287 100644 (file)
@@ -562,7 +562,11 @@ def selectconcat(*args, repeat=1):
         for i in range(repeat):
             tmp += args
         args = tmp
-    res = copy(args[0])
+    if isinstance(args[0], FieldSelectableInt):
+        res = args[0].get_range()
+    else:
+        assert isinstance(args[0], SelectableInt), "can only concat SIs, sorry"
+        res = SelectableInt(args[0])
     for i in args[1:]:
         if isinstance(i, FieldSelectableInt):
             i = i.get_range()