[vala] Fix crash on invalid binary expressions



commit 91093cf994f69862364e44222fb30991436140d8
Author: Levi Bard <taktaktaktaktaktaktaktaktaktak gmail com>
Date:   Wed Apr 15 22:32:17 2009 +0200

    Fix crash on invalid binary expressions
    
    Fixes bug 571960.
---
 vala/valabinaryexpression.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/vala/valabinaryexpression.vala b/vala/valabinaryexpression.vala
index 8b3f099..8497056 100644
--- a/vala/valabinaryexpression.vala
+++ b/vala/valabinaryexpression.vala
@@ -182,6 +182,7 @@ public class Vala.BinaryExpression : Expression {
 			insert_statement (analyzer.insert_block, if_stmt);
 
 			if (!if_stmt.check (analyzer)) {
+				error = true;
 				return false;
 			}
 			analyzer.insert_block = old_insert_block;
@@ -357,7 +358,8 @@ public class Vala.BinaryExpression : Expression {
 				var contains_call = new MethodCall (new MemberAccess (right, "contains"));
 				contains_call.add_argument (left);
 				parent_node.replace_expression (this, contains_call);
-				return contains_call.check (analyzer);
+				error = !contains_call.check (analyzer);
+				return !error;
 			}
 			
 			value_type = analyzer.bool_type;



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