Commit 0a93ccb4 authored by Vitja Makarov's avatar Vitja Makarov

CF: fix locals_expressions_T430 issue

parent 42fa1f43
......@@ -169,6 +169,7 @@ class ControlFlow(object):
if self.block and self.is_tracked(entry):
self.block.stats.append(NameReference(node, entry))
# Local variable is definitely bound after this reference
if not node.allow_null:
self.block.bounded.add(entry)
self.entries.add(entry)
......@@ -402,8 +403,10 @@ def check_definitions(flow, compiler_directives):
references[stat.node] = stat.entry
stat.entry.cf_references.append(stat)
stat.node.cf_state.update(state[stat.entry])
if not stat.node.allow_null:
state[stat.entry].discard(Uninitialized)
for assmt in state[stat.entry]:
if assmt is not Uninitialized:
assmt.refs.add(stat)
# Check variable usage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment