forked from M-Labs/artiq
LocalAccessValidator: fix validation of closures with no outer variables.
This commit is contained in:
parent
6f11fa6bb1
commit
e299801c0f
|
@ -99,12 +99,14 @@ class LocalAccessValidator:
|
||||||
|
|
||||||
if isinstance(insn, ir.Closure):
|
if isinstance(insn, ir.Closure):
|
||||||
env = insn.environment()
|
env = insn.environment()
|
||||||
for var_name in block_state[env]:
|
# Make sure this environment has any interesting variables.
|
||||||
if not block_state[env][var_name]:
|
if env in block_state:
|
||||||
# A closure would capture this variable while it is not always
|
for var_name in block_state[env]:
|
||||||
# initialized. Note that this check is transitive.
|
if not block_state[env][var_name]:
|
||||||
self._uninitialized_access(insn, var_name,
|
# A closure would capture this variable while it is not always
|
||||||
pred_at_fault(env, var_name))
|
# initialized. Note that this check is transitive.
|
||||||
|
self._uninitialized_access(insn, var_name,
|
||||||
|
pred_at_fault(env, var_name))
|
||||||
|
|
||||||
# Save the state.
|
# Save the state.
|
||||||
state[block] = block_state
|
state[block] = block_state
|
||||||
|
|
Loading…
Reference in New Issue