diff src/ov-class.cc @ 9581:3d0d2bda3a0f

fix previous change, avoid duplicate loads of methods in descendant classes
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 27 Aug 2009 16:08:23 +0200
parents 8bf27324a9d0
children 318e0cdd31bd
line wrap: on
line diff
--- a/src/ov-class.cc	Thu Aug 27 13:46:34 2009 +0200
+++ b/src/ov-class.cc	Thu Aug 27 16:08:23 2009 +0200
@@ -94,7 +94,7 @@
     }
 
   if (! error_state)
-    load_path::add_to_parent_map (id, parent_list);
+    symbol_table::add_to_parent_map (id, parent_list);
 }
 
 octave_base_value *
@@ -123,7 +123,8 @@
 
   octave_function *fcn = octave_call_stack::current ();
 
-  retval = fcn->dispatch_class ();
+  if (fcn->is_class_method () || fcn->is_class_constructor ())
+    retval = fcn->dispatch_class ();
 
   return retval;
 }
@@ -1574,7 +1575,7 @@
 }
 
 bool
-octave_class::in_class_method (void) const
+octave_class::in_class_method (void)
 {
   octave_function *fcn = octave_call_stack::current ();
 
@@ -1582,7 +1583,7 @@
 	  && (fcn->is_class_method ()
 	      || fcn->is_class_constructor ()
 	      || fcn->is_private_function_of_class (class_name ()))
-	  && fcn->dispatch_class () == class_name ());
+	  && find_parent_class (fcn->dispatch_class ()));
 }
 
 octave_class::exemplar_info::exemplar_info (const octave_value& obj)