Skip to content

Commit 98f34fd

Browse files
authored
Merge pull request #1145 from martin-frbg/issue1144
Have LAPACKE_STRSEN/DTRSEN allocate IWORK to at least one element in all job types
2 parents efbd2fd + 2d56b7e commit 98f34fd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

LAPACKE/src/lapacke_dtrsen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ lapack_int API_SUFFIX(LAPACKE_dtrsen)( int matrix_layout, char job, char compq,
7878
info = LAPACK_WORK_MEMORY_ERROR;
7979
goto exit_level_0;
8080
}
81+
} else {
82+
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) );
83+
if( iwork == NULL ) {
84+
info = LAPACK_WORK_MEMORY_ERROR;
85+
goto exit_level_0;
86+
}
8187
}
8288
work = (double*)LAPACKE_malloc( sizeof(double) * lwork );
8389
if( work == NULL ) {

LAPACKE/src/lapacke_strsen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ lapack_int API_SUFFIX(LAPACKE_strsen)( int matrix_layout, char job, char compq,
7777
info = LAPACK_WORK_MEMORY_ERROR;
7878
goto exit_level_0;
7979
}
80+
} else {
81+
iwork = (lapack_int*)LAPACKE_malloc( sizeof(lapack_int) );
82+
if( iwork == NULL ) {
83+
info = LAPACK_WORK_MEMORY_ERROR;
84+
goto exit_level_0;
85+
}
8086
}
8187
work = (float*)LAPACKE_malloc( sizeof(float) * lwork );
8288
if( work == NULL ) {

0 commit comments

Comments
 (0)