octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54096] mxCreateStructMatrix with a NULL argum


From: Rik
Subject: [Octave-bug-tracker] [bug #54096] mxCreateStructMatrix with a NULL argument creates a "corrupt" structure
Date: Mon, 11 Jun 2018 15:05:43 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #11, bug #54096 (project octave):

Actually, I concluded in comment #12 that NULL was interpreted as [] in
Octave.  Further testing showed that this was not the behavior in Matlab.  In
Comment #18 in bug #51725:


Yes. NULL values should be converted to undefined, rather than to empty
matrix.

After that change it might be necessary to check whether some of the MEX
routines have been relying on that behavior to actually return an empty
matrix. 


It seems that the second paragraph was prescient.  In some cases we need NULL
to indicate an empty matrix and in other cases it should mean undefined.

The particular case in bug #51725 was the variable plhs which is of type
mxArray, but is also very special.  Maybe the correct way to handle this is to
revert cset 23914 and then for plhs avoid calling mxArray:as_octave_value ()
if the ptr is NULL?  This would introduce a loop over the number of lhs
variables, but that number is usually very small.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54096>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]