vala r895 - in trunk: . vala



Author: juergbi
Date: Wed Jan 23 16:05:43 2008
New Revision: 895
URL: http://svn.gnome.org/viewvc/vala?rev=895&view=rev

Log:
2008-01-23  Juerg Billeter  <j bitron ch>

	* vala/valasemanticanalyzer.vala: fix crash on invalid operand,
	  fixes bug 511546


Modified:
   trunk/ChangeLog
   trunk/vala/valasemanticanalyzer.vala

Modified: trunk/vala/valasemanticanalyzer.vala
==============================================================================
--- trunk/vala/valasemanticanalyzer.vala	(original)
+++ trunk/vala/valasemanticanalyzer.vala	Wed Jan 23 16:05:43 2008
@@ -2363,9 +2363,15 @@
 			return;
 		}
 
+		if (expr.left.static_type == null) {
+			Report.error (expr.source_reference, "invalid operand");
+			expr.error = true;
+			return;
+		}
+
 		if (expr.left.static_type.data_type == string_type.data_type
 		    && expr.operator == BinaryOperator.PLUS) {
-			if (expr.right.static_type.data_type != string_type.data_type) {
+			if (expr.right.static_type == null || expr.right.static_type.data_type != string_type.data_type) {
 				expr.error = true;
 				Report.error (expr.source_reference, "Operands must be strings");
 				return;



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