Please sign in to comment.
Fix issue with type-bound function with pointer return value
newargs_for_entry() generates descriptor arguments for subprograms. Re-use (or preserve) a previously created descriptor for a function result. That's because the function could be used with a type bound procedure where the compiler relies on the previously created descriptor to get the order of the passed object's type descriptor correct. Otherwise, the function result will probably not have a previously created descriptor. Code existed that covered this case for derived type results but not simple variable results. To fully cover this case, add a call to needs_descriptor() as part of the check in the call to set_preserve_descriptor().
- Loading branch information...