From: Jürg Billeter Date: Sun, 1 Feb 2009 23:25:44 +0000 (+0000) Subject: Fix crash on invalid error expressions X-Git-Tag: 0.5.7~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d652b521983eb05d633391c0fccc75cb256d922d;p=thirdparty%2Fvala.git Fix crash on invalid error expressions 2009-02-02 Jürg Billeter * vala/valathrowstatement.vala: Fix crash on invalid error expressions svn path=/trunk/; revision=2416 --- diff --git a/ChangeLog b/ChangeLog index 7fb3bdd59..abf1698f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-02 Jürg Billeter + + * vala/valathrowstatement.vala: + + Fix crash on invalid error expressions + 2009-02-01 Jürg Billeter * vala/valaproperty.vala: diff --git a/vala/valathrowstatement.vala b/vala/valathrowstatement.vala index 4b4da01fa..4ff77241b 100644 --- a/vala/valathrowstatement.vala +++ b/vala/valathrowstatement.vala @@ -89,6 +89,12 @@ public class Vala.ThrowStatement : CodeNode, Statement { return false; } + if (error_expression.value_type == null) { + Report.error (error_expression.source_reference, "invalid error expression"); + error = true; + return false; + } + if (!(error_expression.value_type is ErrorType)) { Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ())); error = true;