You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where the dimension of the dummy variable is not explicitly defined. Since all that's passed over the C++ side is the pointer to the array, it is very easy for the array to be under-allocated and go out of bounds.
In particular, if we choose to change the length of array_vals on the C++ side, we have no way of alerting the Fortran host codes that the length has changed and they need to allocate more space.
I think it would be better if our interface dummy arguments use explicit lengths so that fortran can do length checking at compile time. Then the interface will look like
Much (if not all) of the fortran interface currently uses function signatures that look like
where the dimension of the dummy variable is not explicitly defined. Since all that's passed over the C++ side is the pointer to the array, it is very easy for the array to be under-allocated and go out of bounds.
In particular, if we choose to change the length of array_vals on the C++ side, we have no way of alerting the Fortran host codes that the length has changed and they need to allocate more space.
I think it would be better if our interface dummy arguments use explicit lengths so that fortran can do length checking at compile time. Then the interface will look like
This will produce a compile-time error if the host code tries to pass an array in that doesn't comply with the API we've defined:
@dholladay00 this would fix some UB I saw in the xRAGE interface
The text was updated successfully, but these errors were encountered: