]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error on invalid array creation expressions for stacked arrays
authorJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 16:42:00 +0000 (17:42 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 20 Mar 2010 16:42:00 +0000 (17:42 +0100)
Fixes bug 540730.

vala/valaparser.vala

index ed3a469e88e3876abc8b0be53d293b749b295faf..e42286d77eb01f38010af4230b6abb3d85781c69 100644 (file)
@@ -831,6 +831,11 @@ public class Vala.Parser : CodeVisitor {
                do {
                        if (!first) {
                                // array of arrays: new T[][42]
+
+                               if (size_specified) {
+                                       throw new ParseError.SYNTAX (get_error ("size of inner arrays must not be specified in array creation expression"));
+                               }
+
                                element_type = new ArrayType (element_type, size_specifier_list.size, element_type.source_reference);
                        } else {
                                first = false;