changeset 22450:2fb86778f78d

Return correct status from mexCallMATLAB when mexSetTrapFlag is 1 (bug #48949). * mex.cc (mexCallMATLAB): If try block fails, set execution_error to true.
author Rik <rik@octave.org>
date Thu, 08 Sep 2016 15:03:26 -0700
parents e337b8e3592c
children ad5439817753
files libinterp/corefcn/mex.cc
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/mex.cc	Thu Sep 08 14:46:12 2016 -0700
+++ b/libinterp/corefcn/mex.cc	Thu Sep 08 15:03:26 2016 -0700
@@ -3078,7 +3078,11 @@
   catch (const octave::execution_exception&)
     {
       if (mex_context->trap_feval_error)
-        recover_from_exception ();
+        {
+          recover_from_exception ();
+
+          execution_error = true;
+        }
       else
         {
           args.resize (0);
@@ -3099,7 +3103,7 @@
       // but there is no way to steal memory from a matrix, never mind
       // that matrix memory is allocated by new[] and mxArray memory
       // is allocated by malloc().
-      argout[i] = mex_context->make_value (retval (i));
+      argout[i] = mex_context->make_value (retval(i));
     }
 
   while (num_to_copy < nargout)