transforms.interleaver: don't assume all delay expressions are folded.

This commit is contained in:
whitequark 2015-11-21 17:24:00 +08:00
parent 5cd12ffd28
commit a01e328b4a
1 changed files with 3 additions and 2 deletions

View File

@ -65,8 +65,9 @@ class Interleaver:
terminator = block.terminator()
if isinstance(terminator, ir.Delay):
# We should be able to fold everything without free variables.
assert iodelay.is_const(terminator.expr)
return terminator.expr.value
folded_expr = terminator.expr.fold()
assert iodelay.is_const(folded_expr)
return folded_expr.value
else:
return 0