Mercurial > jwe > octave
changeset 29875:79fe39e852db
mxArray_octave_value::get_data: fix mutation for non-interleaved complex data
* mex.cc (mxArray_octave_value::get_data): Request mutation if value
is complex and complex mxArray data does not use interleaved storage.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 12 Jul 2021 23:28:50 -0400 |
parents | 5411391a4cc0 |
children | b24567df50ab |
files | libinterp/corefcn/mex.cc |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/mex.cc Mon Jul 12 16:22:33 2021 -0400 +++ b/libinterp/corefcn/mex.cc Mon Jul 12 23:28:50 2021 -0400 @@ -647,12 +647,14 @@ { void *retval = val.mex_get_data (); - if (retval) - maybe_mark_foreign (retval); - else - request_mutation (); - - return retval; + if (retval && (val.isreal () || m_interleaved)) + { + maybe_mark_foreign (retval); + return retval; + } + + request_mutation (); + return nullptr; } template <typename T>