Skip to content

Reject NB=0 in DLASWLQ argument validation - #1275

Merged
langou merged 1 commit into
Reference-LAPACK:masterfrom
kyungminlee:fix-dlaswlq-nb
May 11, 2026
Merged

langou merged 1 commit into
Reference-LAPACK:masterfrom
kyungminlee:fix-dlaswlq-nb

Conversation

@kyungminlee

Copy link
Copy Markdown
Contributor

DLASWLQ tested NB.LT.0 instead of NB.LE.0, accepting NB=0 silently and falling into the divide-by-(NB-M) path on line 255 (KK = MOD((N-M),(NB-M))) when M=0. The single/complex/double-complex siblings all use NB.LE.0.

lapack/SRC/slaswlq.f

Lines 219 to 225 in 5da5348

INFO = -2
ELSE IF( MB.LT.1 .OR. ( MB.GT.M .AND. M.GT.0 ) ) THEN
INFO = -3
ELSE IF( NB.LE.0 ) THEN
INFO = -4
ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
INFO = -6

DLASWLQ tested NB.LT.0 instead of NB.LE.0, accepting NB=0 silently and
falling into the divide-by-(NB-M) path on line 255 (KK = MOD((N-M),(NB-M)))
when M=0. The single/complex/double-complex siblings all use NB.LE.0.
@langou
langou merged commit e014d6c into Reference-LAPACK:master May 11, 2026
11 checks passed
@kyungminlee
kyungminlee deleted the fix-dlaswlq-nb branch May 11, 2026 16:20
ilayn added a commit to ilayn/semicolon-lapack that referenced this pull request Jun 21, 2026
?LASWLQ tested NB<0 instead of NB<=0, accepting NB=0 and falling into a divide-by-(NB-M) path. Port of Reference-LAPACK f51069fa (Reference-LAPACK/lapack#1275).
ilayn added a commit to ilayn/semicolon-lapack that referenced this pull request Jun 21, 2026
?LASWLQ tested NB<0 instead of NB<=0, accepting NB=0 and falling into a divide-by-(NB-M) path. Port of Reference-LAPACK f51069fa (Reference-LAPACK/lapack#1275).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants