forked from M-Labs/artiq
1
0
Fork 0

LocalAccessValidator: fix validation of closures with no outer variables.

This commit is contained in:
whitequark 2015-07-21 13:16:18 +03:00
parent 6f11fa6bb1
commit e299801c0f
1 changed files with 8 additions and 6 deletions

View File

@ -99,6 +99,8 @@ class LocalAccessValidator:
if isinstance(insn, ir.Closure): if isinstance(insn, ir.Closure):
env = insn.environment() env = insn.environment()
# Make sure this environment has any interesting variables.
if env in block_state:
for var_name in block_state[env]: for var_name in block_state[env]:
if not block_state[env][var_name]: if not block_state[env][var_name]:
# A closure would capture this variable while it is not always # A closure would capture this variable while it is not always