diff --git a/artiq/compiler/iodelay.py b/artiq/compiler/iodelay.py index bdf96b46a..3a3283199 100644 --- a/artiq/compiler/iodelay.py +++ b/artiq/compiler/iodelay.py @@ -208,6 +208,7 @@ class Max(Expr): def __init__(self, operands): assert isinstance(operands, list) assert all([isinstance(operand, Expr) for operand in operands]) + assert operands != [] self.operands = operands def __str__(self): diff --git a/artiq/compiler/transforms/iodelay_estimator.py b/artiq/compiler/transforms/iodelay_estimator.py index 21d2d9616..4170094c0 100644 --- a/artiq/compiler/transforms/iodelay_estimator.py +++ b/artiq/compiler/transforms/iodelay_estimator.py @@ -220,7 +220,8 @@ class IODelayEstimator(algorithm.Visitor): delays.append(self.current_delay) self.current_delay = old_delay - self.current_delay += iodelay.Max(delays) + if any(delays): + self.current_delay += iodelay.Max(delays) except _IndeterminateDelay as error: # Interleave failures inside `with` statements are hard failures, # since there's no chance that the code will never actually execute