链接已复制
Are you referring to /heap-arrays? The value you specify, other than 0 (when in Visual Studio), isn't meaningful.
I would not expect the behavior you describe. Please provide a small but complete test case we can look at.
Sorry to have taken so long on this, but it turns out that this is a programming error. The TRANSFER in effect is:
X_D=TRANSFER(X_C,0D0,2)
where X_D is a 10000 element array of REAL(8).
The "2" in the TRANSFER is the SIZE argument, which specifies the number of elements in the "physical result" of the TRANSFER. So the TRANSFER result is a 2-element array of type REAL(8) and assigning a 2-element array to a 10000 element array is a shape mismatch. Unfortunately, we don't have shape checking implemented so we didn't give a more reasonable error for this.
The use of heap_arrays was a bit of a red herring - what happens in this case is that the compiler picks one side or the other for determining the amount of data to move, and with heap arrays, this ran off the end of allocated address space.