Re: [PATCH 3/3] fort_dyn_array: Use value constructor instead of raw-buffer manipulation.

Heckel, Bernhard
2016-04-05T09:31:15Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8"; format="flowed", Size: 1131 bytes --]

On 04/04/2016 15:54, Yao Qi wrote:
> Bernhard Heckel <bernhard.heckel@intel.com> writes:
>
>> Instead of pre-computing indices into a fortran array re-use
>> the value_* interfaces to subscript a fortran array.
> Hi, can you elaborate a little please? It looks like change to new
> interface, but why does this fix the bug? because value_* interfaces
> have been aware of dynamic type?
>
Yes, you are right. value_* interface (value_field) takes care about
types with dynamic locations. This means the contents
for dynamic field types of structures are not at "Addr_of (type) +
TYPE_FIELD_BITPOS (type, index) / 8" but at the value
of the dynamic location attribute which is already resolved.
So, switching to the new interfaces solves the issue mentioned in the
commit message.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
\x16º&Öéj×!zÊÞ¶êç×}:÷ib²Ö«r\x18\x1dn–­r\x17¬