]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix crash on invalid cast expressions
authorJürg Billeter <j@bitron.ch>
Sat, 19 Dec 2009 14:30:17 +0000 (15:30 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 19 Dec 2009 14:30:17 +0000 (15:30 +0100)
Fixes bug 601614.

vala/valacastexpression.vala

index c0415b7f4ba7f560cc4fa02f61fc6c90b288aa3d..864c409258546e3fb1abcc0e4602ab68462b9f84 100644 (file)
@@ -119,6 +119,12 @@ public class Vala.CastExpression : Expression {
                        return false;
                }
 
+               if (inner.value_type == null) {
+                       Report.error (source_reference, "Invalid cast expression");
+                       error = true;
+                       return false;
+               }
+
                if (is_non_null_cast) {
                        // (!) non-null cast
                        value_type = inner.value_type.copy ();