Mercurial > octave-nkf
diff src/ov-base.cc @ 12171:d08901c05c1b
fix bug in class assignment to undefined object with index
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 26 Jan 2011 20:39:15 -0500 |
parents | 12df7854fa7c |
children | f39436e14734 |
line wrap: on
line diff
--- a/src/ov-base.cc Wed Jan 26 17:58:07 2011 -0500 +++ b/src/ov-base.cc Wed Jan 26 20:39:15 2011 -0500 @@ -278,16 +278,27 @@ else { // Create new object of appropriate type for given index and rhs - // types and then call subsasgn again for that object. + // types and then call undef_subsasgn for that object. octave_value tmp = octave_value::empty_conv (type, rhs); - retval = tmp.subsasgn (type, idx, rhs); + retval = tmp.undef_subsasgn (type, idx, rhs); } return retval; } +octave_value +octave_base_value::undef_subsasgn (const std::string& type, + const std::list<octave_value_list>& idx, + const octave_value& rhs) +{ + // In most cases, undef_subsasgn is handled the sams as subsasgn. One + // exception is octave_class objects. + + return subsasgn (type, idx, rhs); +} + octave_idx_type octave_base_value::nnz (void) const {