You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
?LARF1F and ?LARF1L have no quick return for M = 0 (SIDE = 'L') or N = 0 (SIDE = 'R') #1430
Called with SIDE = 'L' and M = 0, SLARF1F should do nothing. It has no quick return for that case, so it goes on with LASTV = 0. The loop on line 175 then indexes V(0), and ILASLC, called with M = 0, indexes C(0,N). Both are out of bounds. Next SGEMV is called with -1 rows, and it calls XERBLA.
SIDE = 'R' with N = 0 is the same with rows and columns swapped. DLARF1F, CLARF1F and ZLARF1F do exactly the same. ?LARF1L does not index V(0), since its loop condition is false at once, but it makes the same ILA?LC call and the same ?GEMV call. DLARF1L alone skips its BLAS calls when LASTV is 0 and returns with C unchanged, but it still indexes C(0,N).
Here is a small example that should print C = 1. Instead SGEMV calls XERBLA.
program larf1f_empty
real:: v(1) =1, c(1) =1, work(1) =0call slarf1f('L', 0, 1, v, 1, 1.0, c, 1, work)
print*, 'C =', c
end program
One fix is to start with IF( M.LE.0 .OR. N.LE.0 ) RETURN, as ?LARFB does.
Activity
langou commentedon Oct 1, 2026
Thanks for pointing to this. Can you send a PR for all eight routines?
langou commentedon Oct 19, 2026
Fixed by #1435. Thanks @kyungminlee !
BUG: Port upstream LAPACK fixes for wrong results in xSYTRF/xHETRF, x…