Mercurial > octave
changeset 26565:50439c2e8bbf stable
Fix uninitialized argument value found by clang static analysis (bug #55440).
* dSparse.cc (bsolve): Initialize anorm to 0.0. For consistency, initialize atmp to "0.0" rather than "0.".
author | Rik <rik@octave.org> |
---|---|
date | Wed, 16 Jan 2019 20:32:15 -0800 |
parents | c40b3b671513 |
children | f8d380d04b01 |
files | liboctave/array/dSparse.cc |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/dSparse.cc Wed Jan 16 23:38:19 2019 +0100 +++ b/liboctave/array/dSparse.cc Wed Jan 16 20:32:15 2019 -0800 @@ -4717,9 +4717,10 @@ double anorm; if (calc_cond) { + anorm = 0.0; for (octave_idx_type j = 0; j < nr; j++) { - double atmp = 0.; + double atmp = 0.0; for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) atmp += fabs (data (i)); if (atmp > anorm) @@ -5056,9 +5057,10 @@ double anorm; if (calc_cond) { + anorm = 0.0; for (octave_idx_type j = 0; j < nr; j++) { - double atmp = 0.; + double atmp = 0.0; for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) atmp += fabs (data (i)); if (atmp > anorm) @@ -5410,9 +5412,10 @@ double anorm; if (calc_cond) { + anorm = 0.0; for (octave_idx_type j = 0; j < nr; j++) { - double atmp = 0.; + double atmp = 0.0; for (octave_idx_type i = cidx (j); i < cidx (j+1); i++) atmp += fabs (data (i)); if (atmp > anorm)