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-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c013b0c2d95f8e136e9bba9834a5bf793c69d26;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):