changeset 29156:b3f34a22b3fe stable

Fix regression with superclass lookup in classdef constructors (bug #59602). * cdef-utils.cc (is_superclass): Avoid calling lookup_class (octave_value). Instead, use metaclass information from clsb to get the class name as a std::string and then call lookup_class (std::string).
author Rik <rik@octave.org>
date Mon, 07 Dec 2020 10:52:36 -0800
parents 5d7a651bf0bb
children b42c2c27a330 3d6a6faa9225
files libinterp/octave-value/cdef-utils.cc
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-utils.cc	Sun Dec 06 13:53:30 2020 +0100
+++ b/libinterp/octave-value/cdef-utils.cc	Mon Dec 07 10:52:36 2020 -0800
@@ -210,7 +210,9 @@
 
         for (int i = 0; ! retval && i < c.numel (); i++)
           {
-            cdef_class cls = lookup_class (c(i));
+            octave_classdef *metacls = c(i).classdef_object_value ();
+            std::string clsname = metacls->get_property (0, "Name").string_value ();
+            cdef_class cls = lookup_class (clsname);
 
             retval = is_superclass (clsa, cls, true,
                                     max_depth < 0 ? max_depth : max_depth-1);