Mercurial > hg > octave-lyh
changeset 9368:ff612fdaee95
properly unshare variable in subsasgn
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sat, 20 Jun 2009 10:13:30 +0200 |
parents | 59559e71000e |
children | 14dca190857f |
files | src/ChangeLog src/ov.cc |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-06-20 Jaroslav Hajek <highegg@gmail.com> + + * ov.cc (Fsubsasgn): Uniquify shared value before assigning to it. + 2009-06-19 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTIONS/lookup.cc: Update docs.
--- a/src/ov.cc +++ b/src/ov.cc @@ -2704,8 +2704,12 @@ decode_subscripts ("subsasgn", args(1), type, idx); + octave_value arg0 = args(0); + + arg0.make_unique (); + if (! error_state) - retval = args(0).subsasgn (type, idx, args(2)); + retval = arg0.subsasgn (type, idx, args(2)); } else print_usage ();