Skip to content

Commit a5bfdf8

Browse files
committed
Fix bounds-violation in SLASET
These have been grandfathered in by compilers based on an ancient version of the language definition, but would invoke undefined behaviour per the standard. For more details, see the following: #438 (comment) Suggested-By: Serguei Patchkovskii <Serguei.Patchkovskii@gmail.com>
1 parent 7744f9e commit a5bfdf8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

TESTING/EIG/cchkhb2stg.f

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,8 +680,8 @@ SUBROUTINE CCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE,
680680
* the one from above. Compare it with D1 computed
681681
* using the DSBTRD.
682682
*
683-
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 )
684-
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 )
683+
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
684+
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
685685
CALL CLACPY( ' ', K+1, N, A, LDA, U, LDU )
686686
LH = MAX(1, 4*N)
687687
LW = LWORK - LH
@@ -753,8 +753,8 @@ SUBROUTINE CCHKHB2STG( NSIZES, NN, NWDTHS, KK, NTYPES, DOTYPE,
753753
* the one from above. Compare it with D1 computed
754754
* using the DSBTRD.
755755
*
756-
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, 1 )
757-
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, 1 )
756+
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
757+
CALL SLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
758758
CALL CLACPY( ' ', K+1, N, A, LDA, U, LDU )
759759
LH = MAX(1, 4*N)
760760
LW = LWORK - LH

0 commit comments

Comments
 (0)