diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-09-22 13:44:35 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-09-22 13:44:35 +0200 |
commit | d07258653abe9ea6ac26ffd1655b3f70290a91ba (patch) | |
tree | 4cc4b0f1b53070238b0318a29621d731bab908e0 /vala/valaparameter.vala | |
parent | 15380150e63402e41609346537825d64d1458eea (diff) | |
download | vala-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.vala | 14 |
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) { |