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	Fri Jun 19 08:01:54 2009 +0200
+++ b/src/ChangeLog	Sat Jun 20 10:13:30 2009 +0200
@@ -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	Fri Jun 19 08:01:54 2009 +0200
+++ b/src/ov.cc	Sat Jun 20 10:13:30 2009 +0200
@@ -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 ();