[vala] Fix critical when accessing implicit result variable



commit 50ea1b35c83dc703509a6a1bae68d646f6d82b3b
Author: Jürg Billeter <j bitron ch>
Date:   Sat Mar 20 12:56:59 2010 +0100

    Fix critical when accessing implicit result variable
    
    The implicit result variable is used in postconditions and in the
    dova profile.
    
    Fixes bug 601346.

 vala/valamemberaccess.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/vala/valamemberaccess.vala b/vala/valamemberaccess.vala
index ebb60d9..99b4819 100644
--- a/vala/valamemberaccess.vala
+++ b/vala/valamemberaccess.vala
@@ -420,8 +420,8 @@ public class Vala.MemberAccess : Expression {
 
 		if (member is LocalVariable) {
 			var local = (LocalVariable) member;
-			var block = (Block) local.parent_symbol;
-			if (analyzer.find_parent_method (block) != analyzer.current_method) {
+			var block = local.parent_symbol as Block;
+			if (block != null && analyzer.find_parent_method (block) != analyzer.current_method) {
 				// mark all methods between current method and the captured
 				// block as closures (to support nested closures)
 				Symbol sym = analyzer.current_method;



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