aboutsummaryrefslogtreecommitdiff
path: root/SRC/claqr5.f
diff options
context:
space:
mode:
authorlangou <langou@users.noreply.github.com>2010-08-17 15:45:24 +0000
committerlangou <langou@users.noreply.github.com>2010-08-17 15:45:24 +0000
commit150cd6266c7d887da544f7f23bfd7fd610044f66 (patch)
tree7308322b129bfc0ade8fc01794ffdb308aaa6c22 /SRC/claqr5.f
parent4ff24babc1c98305f30b50c4f363fdef3ac7f446 (diff)
Array out-of-bounds reference in xLAQR5.
Bug report and fix from Mathew Cross (NAG) on Sat Aug 14 2010: In the section of the code "Special case: 2-by-2 reflection (if needed)" the logical test IF( BMP22 .AND. ( V( 1, M22 ).NE.ZERO ) ) must be split into a nested test IF (BMP22) THEN, IF (V(1,M22).NE.ZERO) THEN... If .NOT. BMP22 then M22 can exceed the second extent of V (and recall that logical expressions can be evaluated in any order in Fortran). See http://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=1949.
Diffstat (limited to 'SRC/claqr5.f')
-rw-r--r--SRC/claqr5.f52
1 files changed, 27 insertions, 25 deletions
diff --git a/SRC/claqr5.f b/SRC/claqr5.f
index c7b00f7d..9395c1ea 100644
--- a/SRC/claqr5.f
+++ b/SRC/claqr5.f
@@ -441,32 +441,34 @@
* ==== Special case: 2-by-2 reflection (if needed) ====
*
K = KRCOL + 3*( M22-1 )
- IF( BMP22 .AND. ( V( 1, M22 ).NE.ZERO ) ) THEN
- DO 90 J = JTOP, MIN( KBOT, K+3 )
- REFSUM = V( 1, M22 )*( H( J, K+1 )+V( 2, M22 )*
- $ H( J, K+2 ) )
- H( J, K+1 ) = H( J, K+1 ) - REFSUM
- H( J, K+2 ) = H( J, K+2 ) -
- $ REFSUM*CONJG( V( 2, M22 ) )
- 90 CONTINUE
-*
- IF( ACCUM ) THEN
- KMS = K - INCOL
- DO 100 J = MAX( 1, KTOP-INCOL ), KDU
- REFSUM = V( 1, M22 )*( U( J, KMS+1 )+V( 2, M22 )*
- $ U( J, KMS+2 ) )
- U( J, KMS+1 ) = U( J, KMS+1 ) - REFSUM
- U( J, KMS+2 ) = U( J, KMS+2 ) -
- $ REFSUM*CONJG( V( 2, M22 ) )
- 100 CONTINUE
- ELSE IF( WANTZ ) THEN
- DO 110 J = ILOZ, IHIZ
- REFSUM = V( 1, M22 )*( Z( J, K+1 )+V( 2, M22 )*
- $ Z( J, K+2 ) )
- Z( J, K+1 ) = Z( J, K+1 ) - REFSUM
- Z( J, K+2 ) = Z( J, K+2 ) -
+ IF( BMP22 ) THEN
+ IF ( V( 1, M22 ).NE.ZERO ) THEN
+ DO 90 J = JTOP, MIN( KBOT, K+3 )
+ REFSUM = V( 1, M22 )*( H( J, K+1 )+V( 2, M22 )*
+ $ H( J, K+2 ) )
+ H( J, K+1 ) = H( J, K+1 ) - REFSUM
+ H( J, K+2 ) = H( J, K+2 ) -
$ REFSUM*CONJG( V( 2, M22 ) )
- 110 CONTINUE
+ 90 CONTINUE
+*
+ IF( ACCUM ) THEN
+ KMS = K - INCOL
+ DO 100 J = MAX( 1, KTOP-INCOL ), KDU
+ REFSUM = V( 1, M22 )*( U( J, KMS+1 )+
+ $ V( 2, M22 )*U( J, KMS+2 ) )
+ U( J, KMS+1 ) = U( J, KMS+1 ) - REFSUM
+ U( J, KMS+2 ) = U( J, KMS+2 ) -
+ $ REFSUM*CONJG( V( 2, M22 ) )
+ 100 CONTINUE
+ ELSE IF( WANTZ ) THEN
+ DO 110 J = ILOZ, IHIZ
+ REFSUM = V( 1, M22 )*( Z( J, K+1 )+V( 2, M22 )*
+ $ Z( J, K+2 ) )
+ Z( J, K+1 ) = Z( J, K+1 ) - REFSUM
+ Z( J, K+2 ) = Z( J, K+2 ) -
+ $ REFSUM*CONJG( V( 2, M22 ) )
+ 110 CONTINUE
+ END IF
END IF
END IF
*