diff --git a/gcc/cobol/genapi.cc b/gcc/cobol/genapi.cc index e179a260c4ef0744f65d035fab5c7767a9328007..a5f0c313ce28a16d3675f7acd4deb9db5b80097f 100644 --- a/gcc/cobol/genapi.cc +++ b/gcc/cobol/genapi.cc @@ -10771,9 +10771,9 @@ parser_call( cbl_refer_t name, arguments[i] = location; //gg_printf(">>>>>Calling %ld location is %p\n", build_int_cst_type(SIZE_T, i), arguments[i], NULL_TREE); - // BY REFERENCE variables might -- might! -- be going into an ANY LENGTH + // BY REFERENCE variables might be going into an ANY LENGTH // linkage variable in the called program. So, just in case, we need - // to provide a length through the global table. + // to provide a length through the global table. gg_assign(gg_array_value(var_decl_call_parameter_lengths, i), length); break; } @@ -10791,6 +10791,11 @@ parser_call( cbl_refer_t name, gg_memcpy(arguments[i], location, length); //gg_printf(">>>>>Calling %ld location is %p\n", build_int_cst_type(SIZE_T, i), arguments[i], NULL_TREE); + + // BY CONTENT variables might be going into an ANY LENGTH + // linkage variable in the called program. So, just in case, we need + // to provide a length through the global table. + gg_assign(gg_array_value(var_decl_call_parameter_lengths, i), length); break; }