[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects |
Date: |
Mon, 14 Aug 2017 20:26:17 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 |
Follow-up Comment #2, bug #51754 (project octave):
Octave usually just issues a warning, rather than a full error for this
situation. Even if an error was to be printed, it should be something
reasonable rather than something strange about wrong_type_argument.
I tried this, but unfortunately it didn't work.
diff -r adf580507691 libinterp/corefcn/mex.cc
--- a/libinterp/corefcn/mex.cc Mon Aug 14 16:55:52 2017 -0700
+++ b/libinterp/corefcn/mex.cc Mon Aug 14 17:23:13 2017 -0700
@@ -3196,8 +3196,13 @@ call_mex (octave_mex_function& mex_fcn,
retval.resize (nargout);
+ int j = 0;
for (int i = 0; i < nargout; i++)
- retval(i) = mxArray::as_octave_value (argout[i]);
+ {
+ if (argout[i])
+ retval(j++) = mxArray::as_octave_value (argout[i]);
+ }
+ retval.resize (j);
return retval;
}
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51754>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, Rik, 2017/08/14
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, Piotr Held, 2017/08/14
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects,
Rik <=
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, Piotr Held, 2017/08/14
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, John W. Eaton, 2017/08/15
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, Rik, 2017/08/15
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, John W. Eaton, 2017/08/15
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, John W. Eaton, 2017/08/15
- [Octave-bug-tracker] [bug #51754] MEX interface returns odd NULL objects, Rik, 2017/08/15