Dear all,
functions such as
function func() result(res)
type(tx), allocatable :: res
produced code such as:
struct tx * res;
res.i.data = 0B; /*<<<< WRONG. */
res = 0B;
where the component is initialized although the pointer "res" is not associated.
If one simply swaps the "if (alloc_comp) {...} else if (dimension == 0 &&
allocatable) { ... } the result is OK but there are two
res = 0B;
res = 0B;
if there is a separate result variable and one if the function name matches the
result variable; thus, I added the extra "sym == sym->result" check.
Note that I failed for some reason to generate a failing test case. Thus, I did
not include one. (I found the bug when trying a patch for P4-regression PR 47455
- thus, that PR might contain a test case.)
Build and regtested on x86-64-linux.
OK for the trunk?