# HG changeset patch # User John W. Eaton # Date 1599623114 14400 # Node ID 8d04d7c58d4970448cbac76f30834742cb534bb6 # Parent b3770a5f210d5438abc4700c3fede5c3ab54f9e2# Parent 2a47fa406ed8a02b0991e1ccaa9728da76d6fd52 maint: merge stable to default. diff -r b3770a5f210d -r 8d04d7c58d49 libinterp/parse-tree/pt-eval.cc --- 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 upv1 (m_indexed_object); unwind_protect_var upv2 (m_index_position);