back.rtlil: don't crash legalizing values with no branches.
Fixes #239.
This commit is contained in:
parent
964c67453f
commit
2512a9a12d
|
@ -731,6 +731,7 @@ class _StatementCompiler(xfrm.StatementVisitor):
|
||||||
src=src(legalize.src_loc)) as switch:
|
src=src(legalize.src_loc)) as switch:
|
||||||
width, signed = legalize.value.shape()
|
width, signed = legalize.value.shape()
|
||||||
tests = ["{:0{}b}".format(v, width) for v in legalize.branches]
|
tests = ["{:0{}b}".format(v, width) for v in legalize.branches]
|
||||||
|
if tests:
|
||||||
tests[-1] = "-" * width
|
tests[-1] = "-" * width
|
||||||
for branch, test in zip(legalize.branches, tests):
|
for branch, test in zip(legalize.branches, tests):
|
||||||
with self.case(switch, (test,)):
|
with self.case(switch, (test,)):
|
||||||
|
|
Loading…
Reference in a new issue