summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james@8a072113-8704-0410-8d35-dd094bca7971>2011-06-21 18:59:51 +0000
committerjames <james@8a072113-8704-0410-8d35-dd094bca7971>2011-06-21 18:59:51 +0000
commitffd034b32b7f443988c8fb54274b97d5968dbd85 (patch)
tree4ba83d184b0de1fdc7d4ce039f8ca786160dc039
parentf82b1646d39a9d016fcaf90462bd42ebd4b86944 (diff)
downloadlapack-ffd034b32b7f443988c8fb54274b97d5968dbd85.tar.gz
lapack-ffd034b32b7f443988c8fb54274b97d5968dbd85.tar.bz2
lapack-ffd034b32b7f443988c8fb54274b97d5968dbd85.zip
Added IF statement to prevent potential out of range errors with "K+1" indices.
-rw-r--r--SRC/dlaed2.f7
-rw-r--r--SRC/slaed2.f7
2 files changed, 10 insertions, 4 deletions
diff --git a/SRC/dlaed2.f b/SRC/dlaed2.f
index 21e2c03f..055213c4 100644
--- a/SRC/dlaed2.f
+++ b/SRC/dlaed2.f
@@ -418,8 +418,11 @@
* The deflated eigenvalues and their corresponding vectors go back
* into the last N - K slots of D and Q respectively.
*
- CALL DLACPY( 'A', N, CTOT( 4 ), Q2( IQ1 ), N, Q( 1, K+1 ), LDQ )
- CALL DCOPY( N-K, Z( K+1 ), 1, D( K+1 ), 1 )
+ IF( K.LT.N ) THEN
+ CALL DLACPY( 'A', N, CTOT( 4 ), Q2( IQ1 ), N,
+ $ Q( 1, K+1 ), LDQ )
+ CALL DCOPY( N-K, Z( K+1 ), 1, D( K+1 ), 1 )
+ END IF
*
* Copy CTOT into COLTYP for referencing in DLAED3.
*
diff --git a/SRC/slaed2.f b/SRC/slaed2.f
index 4ff11833..d904d25d 100644
--- a/SRC/slaed2.f
+++ b/SRC/slaed2.f
@@ -418,8 +418,11 @@
* The deflated eigenvalues and their corresponding vectors go back
* into the last N - K slots of D and Q respectively.
*
- CALL SLACPY( 'A', N, CTOT( 4 ), Q2( IQ1 ), N, Q( 1, K+1 ), LDQ )
- CALL SCOPY( N-K, Z( K+1 ), 1, D( K+1 ), 1 )
+ IF( K.LT.N ) THEN
+ CALL SLACPY( 'A', N, CTOT( 4 ), Q2( IQ1 ), N,
+ $ Q( 1, K+1 ), LDQ )
+ CALL SCOPY( N-K, Z( K+1 ), 1, D( K+1 ), 1 )
+ END IF
*
* Copy CTOT into COLTYP for referencing in SLAED3.
*