Commit 757a097a authored by Luca Bruno's avatar Luca Bruno

Enable control flow analysis for variable declarations

Fixes bug 651311.
parent 732443e3
......@@ -517,6 +517,8 @@ public class Vala.FlowAnalyzer : CodeVisitor {
}
public override void visit_declaration_statement (DeclarationStatement stmt) {
stmt.accept_children (this);
if (unreachable (stmt)) {
stmt.declaration.unreachable = true;
return;
......@@ -534,6 +536,12 @@ public class Vala.FlowAnalyzer : CodeVisitor {
}
}
public override void visit_local_variable (LocalVariable local) {
if (local.initializer != null) {
local.initializer.accept (this);
}
}
public override void visit_expression_statement (ExpressionStatement stmt) {
stmt.accept_children (this);
......
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