2008-01-23 Juerg Billeter <j@bitron.ch>
* vala/valasemanticanalyzer.vala: fix crash on invalid operand,
fixes bug 511546
svn path=/trunk/; revision=895
2008-01-23 Jürg Billeter <j@bitron.ch>
+ * vala/valasemanticanalyzer.vala: fix crash on invalid operand,
+ fixes bug 511546
+
+2008-01-23 Jürg Billeter <j@bitron.ch>
+
* vala/Makefile.am, vala/valabasicblock.vala, vala/valacfgbuilder.vala,
vala/valadostatement.vala, vala/valaforstatement.vala,
vala/valaifstatement.vala, vala/valamemorymanager.vala,
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;