Mercurial > octave
changeset 29209:403a9f626ba2
maint: merge stable to default.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sun, 20 Dec 2020 18:48:41 +0100 |
parents | a0a892829b6d (current diff) 370b5ded5e6a (diff) |
children | 649920d8a5bf |
files | libinterp/octave-value/ov-fcn-handle.cc test/module.mk |
diffstat | 5 files changed, 44 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-fcn-handle.cc Sun Dec 20 18:08:57 2020 +0100 +++ b/libinterp/octave-value/ov-fcn-handle.cc Sun Dec 20 18:48:41 2020 +0100 @@ -449,7 +449,11 @@ // Cache this value so that the pointer will be valid as long as the // function handle object is valid. - m_fcn = symtab.find_method (m_name, m_dispatch_class); + // FIXME: This should probably dispatch to the respective class method. + // But that breaks if a function handle is used in a class method with + // e.g. bsxfun with arguments of a different class (see bug #59661). + // m_fcn = symtab.find_method (m_name, m_dispatch_class); + m_fcn = symtab.find_function (m_name, octave_value_list ()); return m_fcn.is_defined () ? m_fcn.function_value () : nullptr; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-59661/bug-59661.tst Sun Dec 20 18:48:41 2020 +0100 @@ -0,0 +1,4 @@ +%!test +%! a = bug59661 (1); +%! b = bug59661 (1, 2); +%! assert (a == b, [true, false])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-59661/bug59661.m Sun Dec 20 18:48:41 2020 +0100 @@ -0,0 +1,29 @@ +classdef bug59661 < handle + + properties + p = []; + endproperties + + methods + + function o = bug59661 (varargin) + o.p = [varargin{:}]; + endfunction + + function res = eq (a, b) + + if (numel (a.p) > 1 && numel (b.p) > 1 && ! isequal (size (a.p), size (b.p))) + res = false; + return; + endif + + if (isequal (size (a.p), size (b.p))) + res = eq (a.p, b.p); + else + res = bsxfun (@eq, a.p, b.p); + endif + + endfunction + + endmethods +endclassdef
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-59661/module.mk Sun Dec 20 18:48:41 2020 +0100 @@ -0,0 +1,5 @@ +bug_59661_TEST_FILES = \ + %reldir%/bug59661.m \ + %reldir%/bug-59661.tst + +TEST_FILES += $(bug_59661_TEST_FILES)
--- a/test/module.mk Sun Dec 20 18:08:57 2020 +0100 +++ b/test/module.mk Sun Dec 20 18:48:41 2020 +0100 @@ -88,6 +88,7 @@ include %reldir%/bug-58593/module.mk include %reldir%/bug-59451/module.mk include %reldir%/bug-59617/module.mk +include %reldir%/bug-59661/module.mk include %reldir%/class-concat/module.mk include %reldir%/classdef/module.mk include %reldir%/classdef-multiple-inheritance/module.mk