Mercurial > jwe > octave
view test/bug-54490.tst @ 25792:cc9da21511c1
use consistent eval order in simple and multi assignment (bug #54490)
* pt-eval.cc (tree_evaluator::visit_simple_assignment): Create lvalue
object before evaluating RHS of assignment expression.
* test/bug-54490.tst: New test.
* test/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 14 Aug 2018 15:25:21 -0400 |
parents | |
children | 2838bbd84b87 |
line wrap: on
line source
%!function out = bug54490 () %! global k; %! k = 1; %! out = 3; %!endfunction %!test %! global k; %! k = 2; %! a = [5, 6]; %! a(k) = bug54490 (); %! assert (a, [5, 3]); %! k = 2; %! a = [5, 6]; %! [a(k)] = bug54490 (); %! assert (a, [5, 3]); %! clear -global k; # cleanup after test