sim/core: truncate evaluated values before test in If
This commit is contained in:
parent
ec80f0fa7e
commit
28962ff438
|
@ -181,7 +181,7 @@ class Evaluator:
|
||||||
if isinstance(s, _Assign):
|
if isinstance(s, _Assign):
|
||||||
self.assign(s.l, self.eval(s.r))
|
self.assign(s.l, self.eval(s.r))
|
||||||
elif isinstance(s, If):
|
elif isinstance(s, If):
|
||||||
if self.eval(s.cond):
|
if self.eval(s.cond) & (2**len(s.cond) - 1):
|
||||||
self.execute(s.t)
|
self.execute(s.t)
|
||||||
else:
|
else:
|
||||||
self.execute(s.f)
|
self.execute(s.f)
|
||||||
|
|
Loading…
Reference in New Issue