if (type is ValueType && !type.nullable) {
// normal value type, no null check
+ // use temp-var for upcoming address-of operator
+ var temp_cvalue = create_temp_value (type, false, node);
+ store_value (temp_cvalue, value);
+ cexpr = get_cvalue_ (temp_cvalue);
+
var temp_value = create_temp_value (type, true, node, true);
var ctemp = get_cvalue_ (temp_value);
ccode.add_else ();
// g_value_init/copy must not be called for uninitialized values
- store_value (temp_value, value);
+ store_value (temp_value, temp_cvalue);
ccode.close ();
} else {
ccode.add_expression (copy_call);
methods/printf-invalid.test \
methods/printf-constructor.vala \
methods/printf-constructor-invalid.test \
+ methods/varargs-gvalue.vala \
methods/varargs-out.vala \
control-flow/assigned-local-variable.vala \
control-flow/break.vala \
--- /dev/null
+void foo (int first_arg, ...) {
+ var args = va_list ();
+ Value val = args.arg ();
+
+ assert (first_arg == 42);
+ assert (val.holds (typeof (string)));
+ assert (val.get_string () == "foo");
+}
+
+void main () {
+ Value val = Value (typeof (string));
+ val.set_string ("foo");
+
+ foo (42, val);
+}