valac critical and odd error assigning va_args to class member
With current vala master, this class declaration:
public class Test {
public string message;
public va_list args;
[PrintfFormat]
public void set(string message, ...) {
this.message = message;
this.args = va_list();
}
...
}
Produces the following error from gcc:
mjog@blanchefort:~/Projects/GNOME/geary$ valac -gv --save-temps vala-va-list.vala
Loaded package `/home/mjog/.local/vala/share/vala-0.48/vapi/glib-2.0.vapi'
Loaded package `/home/mjog/.local/vala/share/vala-0.48/vapi/gobject-2.0.vapi'
(valac:16952): vala-ccodegen-CRITICAL **: 09:32:45.893: vala_ccode_array_module_real_destroy_value: assertion 'value != NULL' failed
(valac:16952): vala-ccode-CRITICAL **: 09:32:45.893: vala_ccode_function_add_expression: assertion 'expression != NULL' failed
cc -g -o '/home/mjog/Projects/GNOME/geary/vala-va-list' '/home/mjog/Projects/GNOME/geary/vala-va-list.c' -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgobject-2.0 -lglib-2.0
vala-va-list.vala: In function ‘test_set’:
vala-va-list.vala:10:13: error: assignment to expression with array type
10 | this.args = va_list();
| ^
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
The generated code for line 10 is pretty odd:
#line 10 "vala-va-list.vala"
va_start (self->args, message);
#line 10 "vala-va-list.vala"
va_end (self->args);
#line 10 "vala-va-list.vala"
self->args = self->args;
#line 90 "vala-va-list.c"