Mercurial > hg > octave-nkf
diff src/ov-fcn-handle.cc @ 10961:2cc9b08bfd39
fixes in binders code
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sun, 12 Sep 2010 21:10:35 +0200 |
parents | 409ceee18acc |
children | 4ab04ea74b08 |
line wrap: on
line diff
--- a/src/ov-fcn-handle.cc +++ b/src/ov-fcn-handle.cc @@ -1900,6 +1900,11 @@ if (! bad) { + // Stash proper name tags. + std::list<string_vector> arg_names = idx_expr->arg_names (); + assert (arg_names.size () == 1); + arg_template.stash_name_tags (arg_names.front ()); + retval = new octave_fcn_binder (f, root_val, arg_template, arg_mask, npar); } @@ -1933,10 +1938,13 @@ { int j = arg_mask[i]; if (j >= 0) - arg_template.xelem(i) = args(j); + arg_template(i) = args(j); // May force a copy... } - retval = root_handle.do_multi_index_op (nargout, arg_template, lvalue_list); + // Make a shallow copy of arg_template, to ensure consistency throughout the following + // call even if we happen to get back here. + octave_value_list tmp (arg_template); + retval = root_handle.do_multi_index_op (nargout, tmp, lvalue_list); } else retval = octave_fcn_handle::do_multi_index_op (nargout, args, lvalue_list);