Mercurial > hg > octave-lojdl
changeset 8301:f7d44b6a74df
fix out-of-bounds checks in null assignments
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sun, 02 Nov 2008 06:15:11 +0100 |
parents | 4b9bce36109b |
children | f2e050b62199 |
files | liboctave/ChangeLog liboctave/idx-vector.cc |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2008-11-02 Jaroslav Hajek <highegg@gmail.com> + + * idx-vector.cc (idx_vector::is_complement): Set resulting extent + correctly. + 2008-10-31 Jaroslav Hajek <highegg@gmail.com> * idx-vector.h (idx_vector::idx_range_rep::extent): Don't change
--- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -518,7 +518,9 @@ for (octave_idx_type i = 0, j = 0; i < n; i++) if (left[i]) data[j++] = i; - return new idx_vector_rep (data, len, data[len-1], dim_vector (1, len), DIRECT); + return new idx_vector_rep (data, len, + len ? data[len-1]+1 : 0, + dim_vector (1, len), DIRECT); } octave_idx_type