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
This can have some surprising effects, if NV = 0, but the solution array would be declared as Y(NPDE*NPTS + 1) in the calling program. Here's the initialization routine that exposes the issue:
SUBROUTINEUVINIT( NPDE, NPTS, X, U, NV, V)
IMPLICIT NONEINTEGER:: NPDE, NPTS, NV
DOUBLE PRECISION:: X(NPTS), U(NPDE,NPTS), TIME, V(NV)
U(1,:) =0
U(1,NPTS) =1
V(1) =0 ! <-- eliminates effect of previous line
ENDSUBROUTINE
In practice this should be flagged as an out-of-bounds violation (or produce a segfault).
The text was updated successfully, but these errors were encountered:
The problem is more obvious in INICHB where CSET gets called:
NVST = NPDE*NPTS + 1
C ...
IV = NPDE*NPTS
IF (NV.GT.0) THEN
IV = NVST
C ...
END IF
CALL CSET(NPDE,NPTS,U,WK(I6),WK,WK(I2),WK(I5),NEL,NPTL,WK(I4),
* WK(I12),XBK,IBK,WK(I3),U(IV),NV)
If NV = 0, the element U(IV) will be the alias for U(NPDE*NPTS) or U(1,NPTS) in the UVINIT routine.
The
V
argument is passed as an array of size 1.pdecheb/pdecheb/cset.f
Lines 1 to 11 in f429435
...
pdecheb/pdecheb/cset.f
Line 122 in f429435
This can have some surprising effects, if
NV = 0
, but the solution array would be declared asY(NPDE*NPTS + 1)
in the calling program. Here's the initialization routine that exposes the issue:In practice this should be flagged as an out-of-bounds violation (or produce a segfault).
The text was updated successfully, but these errors were encountered: