summaryrefslogtreecommitdiff
path: root/vala/valaparameter.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-09-22 13:44:35 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2021-09-22 13:44:35 +0200
commitd07258653abe9ea6ac26ffd1655b3f70290a91ba (patch)
tree4cc4b0f1b53070238b0318a29621d731bab908e0 /vala/valaparameter.vala
parent15380150e63402e41609346537825d64d1458eea (diff)
downloadvala-d07258653abe9ea6ac26ffd1655b3f70290a91ba.tar.gz
vala: Multi-dimensional params-array not allowed
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1230
Diffstat (limited to 'vala/valaparameter.vala')
-rw-r--r--vala/valaparameter.vala14
1 files changed, 10 insertions, 4 deletions
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala
index 41a59da61..7bbb2cedb 100644
--- a/vala/valaparameter.vala
+++ b/vala/valaparameter.vala
@@ -152,10 +152,16 @@ public class Vala.Parameter : Variable {
if (!ellipsis) {
variable_type.check (context);
- if (params_array && !(variable_type is ArrayType)) {
- error = true;
- Report.error (source_reference, "parameter array expected");
- return false;
+ if (params_array) {
+ if (!(variable_type is ArrayType)) {
+ error = true;
+ Report.error (source_reference, "parameter array expected");
+ return false;
+ } else if (((ArrayType) variable_type).rank != 1) {
+ error = true;
+ Report.error (source_reference, "multi-dimensional parameter array not allowed");
+ return false;
+ }
}
if (has_attribute_argument ("CCode", "scope") && variable_type is DelegateType) {