From: whitequark Date: Thu, 13 Dec 2018 05:00:44 +0000 (+0000) Subject: fhdl.ast: fix Switch._?hs_signals() for switch without statements. X-Git-Tag: working~315 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b8708017e5215a08d08d220f746e4758e51ef67;p=nmigen.git fhdl.ast: fix Switch._?hs_signals() for switch without statements. --- diff --git a/nmigen/fhdl/ast.py b/nmigen/fhdl/ast.py index 123e2ae..2e1942b 100644 --- a/nmigen/fhdl/ast.py +++ b/nmigen/fhdl/ast.py @@ -649,10 +649,11 @@ class Switch(Statement): self.cases[key] = Statement.wrap(stmts) def _lhs_signals(self): - return union(s._lhs_signals() for ss in self.cases.values() for s in ss ) + signals = union(s._lhs_signals() for ss in self.cases.values() for s in ss) or ValueSet() + return signals def _rhs_signals(self): - signals = union(s._rhs_signals() for ss in self.cases.values() for s in ss) + signals = union(s._rhs_signals() for ss in self.cases.values() for s in ss) or ValueSet() return self.test._rhs_signals() | signals def __repr__(self):