# HG changeset patch # User John W. Eaton # Date 1604598038 18000 # Node ID ba5a0edff85ebbfb731cf27953a52b309d6a8408 # Parent c01950bc7290dfc6d1d60c643f6a72df1dee69ca# Parent 7c9a40fb3337abbee1ce586d76af06af90330db6 maint: merge stable to default. diff -r c01950bc7290 -r ba5a0edff85e libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Thu Nov 05 18:08:55 2020 +0100 +++ b/libinterp/corefcn/cellfun.cc Thu Nov 05 12:40:38 2020 -0500 @@ -80,19 +80,20 @@ { tmp = octave::feval (func, inputlist, nargout); } - catch (const octave::execution_exception& e) + catch (const octave::execution_exception& ee) { if (error_handler.is_defined ()) { octave::interpreter& interp = octave::__get_interpreter__ ("get_output_list"); + es.save_exception (ee); interp.recover_from_exception (); execution_error = true; } else - throw e; + throw; } if (execution_error) @@ -987,6 +988,17 @@ %!error cellfun (@sin, {[]}, "BadParam", false) %!error cellfun (@sin, {[]}, "UniformOuput") %!error cellfun (@sin, {[]}, "ErrorHandler") + +%!function retval = __errfcn (S, varargin) +%! global __errmsg; +%! __errmsg = S.message; +%! retval = NaN; +%!endfunction +%!test <58411> +%! global __errmsg; +%! assert (cellfun (@factorial, {1, 2, -3}, "ErrorHandler", @__errfcn), [1, 2, NaN]); +%! assert (! isempty (__errmsg)); +%! clear -global __errmsg; */ // Arrayfun was originally a .m file written by Bill Denney and Jaroslav diff -r c01950bc7290 -r ba5a0edff85e libinterp/dldfcn/__init_gnuplot__.cc --- a/libinterp/dldfcn/__init_gnuplot__.cc Thu Nov 05 18:08:55 2020 +0100 +++ b/libinterp/dldfcn/__init_gnuplot__.cc Thu Nov 05 12:40:38 2020 -0500 @@ -47,6 +47,8 @@ #include "defun-dld.h" #include "error.h" #include "graphics.h" +#include "interpreter-private.h" +#include "interpreter.h" #include "ov.h" #include "ovl.h" #include "parse.h" @@ -211,7 +213,12 @@ } } catch (octave::execution_exception&) - { } + { + octave::interpreter& interp + = octave::__get_interpreter__ ("have_gnuplot_binary"); + + interp.recover_from_exception (); + } return retval; } diff -r c01950bc7290 -r ba5a0edff85e libinterp/parse-tree/oct-lvalue.cc --- a/libinterp/parse-tree/oct-lvalue.cc Thu Nov 05 18:08:55 2020 +0100 +++ b/libinterp/parse-tree/oct-lvalue.cc Thu Nov 05 12:40:38 2020 -0500 @@ -29,6 +29,8 @@ #include "error.h" #include "errwarn.h" +#include "interpreter-private.h" +#include "interpreter.h" #include "ovl.h" #include "oct-lvalue.h" #include "ov.h" @@ -235,6 +237,11 @@ // could happen because there is an index is out of range // and we will be resizing a cell array. + interpreter& interp + = __get_interpreter__ ("octave_lvalue::eval_for_numel"); + + interp.recover_from_exception (); + retval = octave_value (); }