var array_type = (ArrayType) param.variable_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
CCodeExpression clength;
- if (get_ccode_array_null_terminated (d_param)) {
+ if (get_ccode_array_null_terminated (d_param) && !get_ccode_array_length (d_param)) {
requires_array_length = true;
var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
len_call.add_argument (new CCodeIdentifier (d_param.name));
} else {
array_type = prop.property_type as ArrayType;
if (array_type != null) {
- if (get_ccode_array_null_terminated (prop)) {
+ if (get_ccode_array_null_terminated (prop) && !get_ccode_array_length (prop)) {
requires_array_length = true;
var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
len_call.add_argument (ctemp);
set_cvalue (expr, ctemp);
- if (get_ccode_array_null_terminated (prop)) {
+ if (get_ccode_array_null_terminated (prop) && !get_ccode_array_length (prop)) {
requires_array_length = true;
var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
len_call.add_argument (ctemp);
result.array_length_cvalues = null;
result.append_array_length_cvalue (get_ccodenode (array_type.length));
result.lvalue = false;
- } else if (get_ccode_array_null_terminated (variable)) {
+ } else if (get_ccode_array_null_terminated (variable) && !get_ccode_array_length (variable)) {
requires_array_length = true;
var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
len_call.add_argument (result.cvalue);
if (m != null && m.return_type is ArrayType && async_call != ccall) {
var array_type = (ArrayType) m.return_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
- if (get_ccode_array_null_terminated (m)) {
+ if (get_ccode_array_null_terminated (m) && !get_ccode_array_length (m)) {
// handle calls to methods returning null-terminated arrays
var temp_var = get_temp_variable (itype.get_return_type (), true, null, false);
var temp_ref = get_variable_cexpression (temp_var.name);
if (deleg != null && deleg.return_type is ArrayType) {
var array_type = (ArrayType) deleg.return_type;
for (int dim = 1; dim <= array_type.rank; dim++) {
- if (get_ccode_array_null_terminated (deleg)) {
+ if (get_ccode_array_null_terminated (deleg) && !get_ccode_array_length (deleg)) {
// handle calls to methods returning null-terminated arrays
var temp_var = get_temp_variable (itype.get_return_type (), true, null, false);
var temp_ref = get_variable_cexpression (temp_var.name);
// handle ref null terminated arrays
if (unary != null && unary.operator == UnaryOperator.REF
&& unary.inner.symbol_reference != null && get_ccode_array_length (unary.inner.symbol_reference)) {
- if (param != null && get_ccode_array_null_terminated (param)
+ if (param != null && get_ccode_array_null_terminated (param) && !get_ccode_array_length (param)
&& param.variable_type is ArrayType && ((ArrayType) param.variable_type).rank == 1) {
requires_array_length = true;
var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));
store_value (unary.inner.target_value, transform_value (unary.target_value, unary.inner.value_type, arg), expr.source_reference);
// handle out null terminated arrays
- if (param != null && get_ccode_array_null_terminated (param)
+ if (param != null && get_ccode_array_null_terminated (param) && !get_ccode_array_length (param)
&& unary.inner.symbol_reference != null && get_ccode_array_length (unary.inner.symbol_reference)) {
requires_array_length = true;
var len_call = new CCodeFunctionCall (new CCodeIdentifier ("_vala_array_length"));