Mercurial > hg > octave-max
changeset 12623:b0e60ad4ae26
merge stable to default
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 19 Apr 2011 21:23:28 -0400 |
parents | 32d5186266ab (current diff) 6f3f18957851 (diff) |
children | b1f4f0eba971 |
files | |
diffstat | 2 files changed, 18 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ov-class.cc +++ b/src/ov-class.cc @@ -121,12 +121,15 @@ { std::string retval = class_name (); - octave_function *fcn = octave_call_stack::current (); + if (nparents () > 0) + { + octave_function *fcn = octave_call_stack::current (); - // Here we are just looking to see if FCN is a method or constructor - // for any class, not specifically this one. - if (fcn->is_class_method () || fcn->is_class_constructor ()) - retval = fcn->dispatch_class (); + // Here we are just looking to see if FCN is a method or constructor + // for any class, not specifically this one. + if (fcn && (fcn->is_class_method () || fcn->is_class_constructor ())) + retval = fcn->dispatch_class (); + } return retval; }
--- a/src/ov-class.h +++ b/src/ov-class.h @@ -127,10 +127,18 @@ size_t nparents (void) const { return parent_list.size (); } octave_value reshape (const dim_vector& new_dims) const - { return map.reshape (new_dims); } + { + octave_class retval = octave_class (*this); + retval.map = retval.map_value().reshape (new_dims); + return octave_value (new octave_class (retval)); + } octave_value resize (const dim_vector& dv, bool = false) const - { octave_map tmap = map; tmap.resize (dv); return tmap; } + { + octave_class retval = octave_class (*this); + retval.map.resize (dv); + return octave_value (new octave_class (retval)); + } bool is_defined (void) const { return true; }