summaryrefslogtreecommitdiff
path: root/SRC/dla_gbamv.f
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2009-01-16 22:27:20 +0000
committerjulie <julielangou@users.noreply.github.com>2009-01-16 22:27:20 +0000
commitef145621404f97fc38ea3cc89432148563df4e9a (patch)
treeb9857916875ef897665d54e8a1d8eccf7cf45f68 /SRC/dla_gbamv.f
parent1a86352338086d1a2b3b5d5b01061c07e49e67ba (diff)
downloadlapack-ef145621404f97fc38ea3cc89432148563df4e9a.tar.gz
lapack-ef145621404f97fc38ea3cc89432148563df4e9a.tar.bz2
lapack-ef145621404f97fc38ea3cc89432148563df4e9a.zip
Fix out of bound access in LIN TESTING with XBLAS found with -fcheck-bounds with gfortran.
"Error in DLA_GBAMV.f line 226: forrtl: severe (408): fort: (2): Subscript #1 of the array AB has value 2 which is greater than the upper bound of 1" Reported in http://icl.cs.utk.edu/trac/lapack-dev/ticket/45
Diffstat (limited to 'SRC/dla_gbamv.f')
-rw-r--r--SRC/dla_gbamv.f19
1 files changed, 10 insertions, 9 deletions
diff --git a/SRC/dla_gbamv.f b/SRC/dla_gbamv.f
index cab0a645..64f29be5 100644
--- a/SRC/dla_gbamv.f
+++ b/SRC/dla_gbamv.f
@@ -1,7 +1,7 @@
SUBROUTINE DLA_GBAMV( TRANS, M, N, KL, KU, ALPHA, AB, LDAB, X,
$ INCX, BETA, Y, INCY )
*
-* -- LAPACK routine (version 3.2) --
+* -- LAPACK routine (version 3.2.1) --
* -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and --
* -- Jason Riedy of Univ. of California Berkeley. --
* -- November 2008 --
@@ -22,7 +22,7 @@
* Purpose
* =======
*
-* DLA_GEAMV performs one of the matrix-vector operations
+* DLA_GBAMV performs one of the matrix-vector operations
*
* y := alpha*abs(A)*abs(x) + beta*abs(y),
* or y := alpha*abs(A)'*abs(x) + beta*abs(y),
@@ -126,7 +126,7 @@
* .. Local Scalars ..
LOGICAL SYMB_ZERO
DOUBLE PRECISION TEMP, SAFE1
- INTEGER I, INFO, IY, J, JX, KX, KY, LENX, LENY, KD
+ INTEGER I, INFO, IY, J, JX, KX, KY, LENX, LENY, KD, KE
* ..
* .. External Subroutines ..
EXTERNAL XERBLA, DLAMCH
@@ -152,9 +152,9 @@
INFO = 2
ELSE IF( N.LT.0 )THEN
INFO = 3
- ELSE IF( KL.LT.0 ) THEN
+ ELSE IF( KL.LT.0 .OR. KL.GT.M-1 ) THEN
INFO = 4
- ELSE IF( KU.LT.0 ) THEN
+ ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN
INFO = 5
ELSE IF( LDAB.LT.KL+KU+1 )THEN
INFO = 6
@@ -208,6 +208,7 @@
* to per-column.
*
KD = KU + 1
+ KE = KL + 1
IY = KY
IF ( INCX.EQ.1 ) THEN
DO I = 1, LENY
@@ -221,11 +222,11 @@
Y( IY ) = BETA * ABS( Y( IY ) )
END IF
IF ( ALPHA .NE. ZERO ) THEN
- DO J = MAX( I-KU, 1 ), MIN( I+KL, LENX )
+ DO J = MAX( I-KL, 1 ), MIN( I+KU, LENX )
IF( TRANS.EQ.ILATRANS( 'N' ) )THEN
TEMP = ABS( AB( KD+I-J, J ) )
ELSE
- TEMP = ABS( AB( J, KD+I-J ) )
+ TEMP = ABS( AB( KE-I+J, I ) )
END IF
SYMB_ZERO = SYMB_ZERO .AND.
@@ -252,12 +253,12 @@
END IF
IF ( ALPHA .NE. ZERO ) THEN
JX = KX
- DO J = MAX( I-KU, 1 ), MIN( I+KL, LENX )
+ DO J = MAX( I-KL, 1 ), MIN( I+KU, LENX )
IF( TRANS.EQ.ILATRANS( 'N' ) )THEN
TEMP = ABS( AB( KD+I-J, J ) )
ELSE
- TEMP = ABS( AB( J, KD+I-J ) )
+ TEMP = ABS( AB( KE-I+J, I ) )
END IF
SYMB_ZERO = SYMB_ZERO .AND.