From dafef5d744f3f13ac0a15eae3f0f9913cffad53e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 11 Dec 2011 20:17:29 +0100 Subject: [PATCH] fhdl: fix list references (thanks Lars) --- migen/fhdl/structure.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index f531ff3e7..b5a87f2cf 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -147,7 +147,8 @@ class Assign: self.r = _cst(r) class StatementList: - def __init__(self, l=[]): + def __init__(self, l=None): + if l is None: l = [] self.l = l def _sl(x): @@ -194,7 +195,10 @@ class Instance: return id(self) class Fragment: - def __init__(self, comb=[], sync=[], instances=[], pads=set()): + def __init__(self, comb=None, sync=None, instances=None, pads=set()): + if comb is None: comb = [] + if sync is None: sync = [] + if instances is None: instances = [] self.comb = _sl(comb) self.sync = _sl(sync) self.instances = instances