From 1c013b0c2d95f8e136e9bba9834a5bf793c69d26 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 13 Dec 2018 05:00:44 +0000 Subject: [PATCH] fhdl.ast: fix Switch._?hs_signals() for switch without statements. --- nmigen/fhdl/ast.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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): -- 2.30.2