GNOME Bugzilla – Bug 734925
Extending null-terminated array without length results in assertion in valac
Last modified: 2018-05-22 15:15:12 UTC
Code: [CCode (array_length = false, array_null_terminated = true)] internal uint[]? sizes; ... sizes += 0; Results in assertion error: ERROR:valaccodearraymodule.c:1105:vala_ccode_array_module_real_get_array_length_cvalue: assertion failed: (size != null && size.size >= dim) (Probably dynamic guess of length and assumption that size == length or just erroring out would be better).
For that matter following code is also running into similar problem: [CCode (array_length = false, array_null_terminated = true)] internal uint[]? sizes; // ... var tmp = foo(); tmp += 0 sizes = (owned)tmp; // Or sizes = tmp; This makes GLib.OptionArg default arguments awkward to use.
(In reply to comment #1) > For that matter following code is also running into similar problem: > > [CCode (array_length = false, array_null_terminated = true)] > internal uint[]? sizes; > // ... > var tmp = foo(); > tmp += 0 > sizes = (owned)tmp; > // Or sizes = tmp; > > This makes GLib.OptionArg default arguments awkward to use. Ups. Sorry - I had the same problem in the same file in different place.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/467.