[vala/0.12] Enable control flow analysis for variable declarations



commit d7e4926ec6d1cf972a41a4383090f22bdf487f91
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat May 28 10:49:02 2011 +0200

    Enable control flow analysis for variable declarations
    
    Fixes bug 651311.

 vala/valaflowanalyzer.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaflowanalyzer.vala b/vala/valaflowanalyzer.vala
index c57ade7..c17b77b 100644
--- a/vala/valaflowanalyzer.vala
+++ b/vala/valaflowanalyzer.vala
@@ -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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]