Found by -Werror=address with GCC 12
See https://gitlab.gnome.org/GNOME/vala/issues/1282
innercexpr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, innercexpr);
}
set_cvalue (expr, new CCodeCastExpression (innercexpr, get_ccode_name (expr.type_reference)));
+ //TODO Use get_non_null (expr.inner.target_value)
+ ((GLibValue) expr.target_value).non_null = expr.is_non_null ();
if (expr.type_reference is DelegateType) {
var target = get_delegate_target (expr.inner);
return inner.is_accessible (sym);
}
+ public override bool is_non_null () {
+ return inner.is_non_null ();
+ }
+
public override bool check (CodeContext context) {
if (checked) {
return !error;
if (c != null) {
return (c is EnumValue || !c.type_reference.nullable);
} else if (l != null) {
- return (l.variable_type is ArrayType && ((ArrayType) l.variable_type).inline_allocated);
+ unowned DataType type = l.variable_type;
+ if (type is ArrayType) {
+ return ((ArrayType) type).inline_allocated;
+ } else {
+ return type.is_real_non_null_struct_type () || type.is_non_null_simple_type ();
+ }
} else if (m != null) {
return (m.binding == MemberBinding.STATIC || prototype_access);
} else {