diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-07-22 10:16:39 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-07-22 10:19:00 +0200 |
commit | d9971a8dd54dbacc4f97a0279abf0cb0751b3b79 (patch) | |
tree | 4e586c5805d765a4ec6e4e6b8acaa65df99bb465 /tests/methods | |
parent | 4818502d49ba510f099a6ff248fca6c53aecdae4 (diff) | |
download | vala-d9971a8dd54dbacc4f97a0279abf0cb0751b3b79.tar.gz |
codegen: Check param for null before using it
Regression of 5490b0b21a4089d803d51c91311430d60d266f7b
This caused criticals like:
vala_get_ccode_array_length: assertion 'node != NULL' failed
See https://gitlab.gnome.org/GNOME/vala/issues/929
Diffstat (limited to 'tests/methods')
-rw-r--r-- | tests/methods/varargs-ref.vala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/methods/varargs-ref.vala b/tests/methods/varargs-ref.vala new file mode 100644 index 000000000..9c3f5fa74 --- /dev/null +++ b/tests/methods/varargs-ref.vala @@ -0,0 +1,14 @@ +void set_foo_varg (string s, ...) { + var args = va_list (); + string** ref_s1 = args.arg (); + *ref_s1 = "bar"; + string** ref_s2 = args.arg (); + *ref_s2 = "manam"; +} + +void main () { + unowned string bar = "", manam = ""; + set_foo_varg ("foo", ref bar, ref manam); + assert (bar == "bar"); + assert (manam == "manam"); +} |