fhdl/namer: fix object aliasing bug
authorSebastien Bourdeauducq <sb@m-labs.hk>
Thu, 22 Oct 2015 09:14:51 +0000 (17:14 +0800)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Thu, 22 Oct 2015 09:14:51 +0000 (17:14 +0800)
migen/fhdl/namer.py

index e6c18cb08ebebecec322a3305ba1384c6ff67b18..8e0f450dd64666cd8e305801e1a528b916a084b5 100644 (file)
@@ -182,9 +182,10 @@ def _build_signal_groups(signals):
             related_list.insert(0, cur_signal)
             cur_signal = cur_signal.related
         # add to groups
-        r += [set()]*(len(related_list) - len(r))
-        for target_set, source_set in zip(r, related_list):
-            target_set.add(source_set)
+        for _ in range(len(related_list) - len(r)):
+            r.append(set())
+        for target_set, source_signal in zip(r, related_list):
+            target_set.add(source_signal)
     # with the algorithm above and a list of all signals,
     # a signal appears in all groups of a lower number than its.
     # make signals appear only in their group of highest number.