comparison src/oct-lvalue.cc @ 10544:9961fc022d9d

fix assignment to non-existing variables and octave_value::assign
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 23 Apr 2010 11:23:43 +0200
parents 57a59eae83cc
children d1194069e58c
comparison
equal deleted inserted replaced
10543:f41c6634d5af 10544:9961fc022d9d
33 void 33 void
34 octave_lvalue::assign (octave_value::assign_op op, const octave_value& rhs) 34 octave_lvalue::assign (octave_value::assign_op op, const octave_value& rhs)
35 { 35 {
36 if (val) 36 if (val)
37 { 37 {
38 octave_value tmp (idx.empty () 38 if (idx.empty ())
39 ? val->assign (op, rhs) 39 val->assign (op, rhs);
40 : val->assign (op, type, idx, rhs)); 40 else
41 41 val->assign (op, type, idx, rhs);
42 if (! error_state)
43 *val = tmp;
44 } 42 }
45 } 43 }
46 44
47 void 45 void
48 octave_lvalue::set_index (const std::string& t, 46 octave_lvalue::set_index (const std::string& t,