diff libinterp/parse-tree/pt-eval.cc @ 33432:83352d86f20d

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 18 Apr 2024 21:03:51 +0200
parents 79cfa1b7a813 af2b017a5a7a
children 066a27297ba3 5fded8395daa
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc	Thu Apr 18 18:29:36 2024 +0200
+++ b/libinterp/parse-tree/pt-eval.cc	Thu Apr 18 21:03:51 2024 +0200
@@ -3035,7 +3035,13 @@
 
           cdef_class cls = cdm.find_class (dispatch_type, false);
           if (cls.ok () && cls.get_name () == dispatch_type)
-            fcn = cls.find_method (method).get_function ();
+            {
+              cdef_method meth = cls.find_method (method);
+              if (meth.ok () && meth.get_name () == method)
+                fcn = meth.get_function ();
+              else
+                return nullptr;
+            }
 
           // If there is no classdef method, then try legacy classes.
           if (fcn.is_undefined ())