]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Ignore conflicting closure/destroy indexes
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 28 Jan 2018 22:00:03 +0000 (23:00 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 29 Jan 2018 16:46:15 +0000 (17:46 +0100)
Reverse references from closure/destroy parameters back to the callback
break our later logic, so skip this additional information.

vala/valagirparser.vala

index 2c94e249a1e086f0d70edf6b512d100e30044fe4..617aaf0803df56bd5a130947d5a22da4b9cddb29 100644 (file)
@@ -3262,13 +3262,17 @@ public class Vala.GirParser : CodeVisitor {
                                        if (instance_idx > -2 && instance_idx < closure_idx) {
                                                closure_idx--;
                                        }
-                                       current.closure_parameters.add (closure_idx);
+                                       if (current.closure_parameters.index_of (current_parameter_idx) < 0) {
+                                               current.closure_parameters.add (closure_idx);
+                                       }
                                }
                                if (destroy_idx != -1) {
                                        if (instance_idx > -2 && instance_idx < destroy_idx) {
                                                destroy_idx--;
                                        }
-                                       current.destroy_parameters.add (destroy_idx);
+                                       if (current.destroy_parameters.index_of (current_parameter_idx) < 0) {
+                                               current.destroy_parameters.add (destroy_idx);
+                                       }
                                }
                                if (param_comment != null) {
                                        if (comment == null) {