changeset 25450:66b72fbf2845 stable

Backed out changeset 97e64c23fd07 (bug #54096) This change was an attempt to fix bug 51725 but it caused other trouble. Backing out and making another attempt.
author John W. Eaton <jwe@octave.org>
date Mon, 11 Jun 2018 13:25:40 -0400
parents 97e64c23fd07
children f84755f24ccd
files libinterp/corefcn/mex.cc
diffstat 1 files changed, 2 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/mex.cc	Mon Jun 11 12:55:59 2018 -0400
+++ b/libinterp/corefcn/mex.cc	Mon Jun 11 13:25:40 2018 -0400
@@ -2469,27 +2469,18 @@
   return ptr;
 }
 
-static mxArray *
-make_empty_matrix (void)
-{
-  static const mwSize zero = 0;
-
-  return new mxArray (mxDOUBLE_CLASS, zero, zero, mxREAL);
-}
-
 void
 mxArray_struct::set_field_by_number (mwIndex index, int key_num, mxArray *val)
 {
   if (key_num >= 0 && key_num < nfields)
-    data[nfields * index + key_num]
-      = val ? maybe_unmark_array (val) : make_empty_matrix ();
+    data[nfields * index + key_num] = maybe_unmark_array (val);
 }
 
 void
 mxArray_cell::set_cell (mwIndex idx, mxArray *val)
 {
   if (idx >= 0 && idx < get_number_of_elements ())
-    data[idx] = val ? maybe_unmark_array (val) : make_empty_matrix ();
+    data[idx] = maybe_unmark_array (val);
 }
 
 // ------------------------------------------------------------------