Mercurial > hg > octave-nkf
diff src/data.cc @ 6883:037c8b622a01
[project @ 2007-09-10 20:13:27 by jwe]
author | jwe |
---|---|
date | Mon, 10 Sep 2007 20:15:17 +0000 |
parents | 83619ae96c1d |
children | 86e6cf1f998a |
line wrap: on
line diff
--- a/src/data.cc +++ b/src/data.cc @@ -759,10 +759,14 @@ if (error_state) return retval; - Array<octave_idx_type> ra_idx (dv.length (), 0); + int dv_len = dv.length (); + Array<octave_idx_type> ra_idx (dv_len, 0); for (int j = i; j < n_args; j++) { + if (args (j). all_zero_dims ()) + continue; + tmp = do_cat_op (tmp, args (j), ra_idx); if (error_state) @@ -770,7 +774,15 @@ dim_vector dv_tmp = args (j).dims (); - ra_idx (dim) += (dim < dv_tmp.length () ? dv_tmp (dim) : 1); + if (dim >= dv_len) + { + if (j > i) + error ("%s: indexing error", fname.c_str ()); + break; + } + else + ra_idx (dim) += (dim < dv_tmp.length () ? + dv_tmp (dim) : 1); } retval = tmp;