Mercurial > octave
changeset 28697:8d04d7c58d49
maint: merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 08 Sep 2020 23:45:14 -0400 |
parents | b3770a5f210d (current diff) 2a47fa406ed8 (diff) |
children | 61a089ada620 |
files | libinterp/parse-tree/pt-eval.cc |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc Tue Sep 08 13:42:23 2020 -0400 +++ b/libinterp/parse-tree/pt-eval.cc Tue Sep 08 23:45:14 2020 -0400 @@ -1729,6 +1729,12 @@ %!test <*58830> %! fail ("__undef_sym__ (end)", %! "invalid use of 'end': may only be used to index existing value"); + +%!test <58953> +%! x = 1:10; +%! assert (x(end), 10); +%! assert (x(minus (end, 1)), 9); +%! assert (x(minus (minus (end, 1), 1)), 8); */ namespace octave @@ -1742,10 +1748,8 @@ // need a different way of asking an octave_value object this // question? - bool stash_object = (arg_list->includes_magic_end () - && object - && ! (object->is_function () - || object->is_function_handle ())); + bool stash_object = (object && ! (object->is_function () + || object->is_function_handle ())); unwind_protect_var<const octave_value *> upv1 (m_indexed_object); unwind_protect_var<int> upv2 (m_index_position);