Mercurial > octave
diff src/tc-rep-ass.cc @ 1086:75fc98220389
[project @ 1995-01-31 04:17:15 by jwe]
author | jwe |
---|---|
date | Tue, 31 Jan 1995 04:17:15 +0000 |
parents | 7dbf5bb19bde |
children | b6360f2d4fa6 |
line wrap: on
line diff
--- a/src/tc-rep-ass.cc Tue Jan 31 04:17:15 1995 +0000 +++ b/src/tc-rep-ass.cc Tue Jan 31 04:17:15 1995 +0000 @@ -357,7 +357,15 @@ case complex_scalar_constant: case scalar_constant: { - int i = NINT (tmp_i.double_value ()); + double dval = tmp_i.double_value (); + + if (xisnan (dval)) + { + error ("NaN is invalid as a matrix index"); + return; + } + + int i = NINT (dval); int idx = i - 1; if (rhs_nr == 0 && rhs_nc == 0)