From 30132bf77730addafb6150ecd751b855c05394f3 Mon Sep 17 00:00:00 2001 From: Karl Wette Date: Fri, 1 May 2020 21:29:41 +1000 Subject: [PATCH] octrun.swg: remove octave_value type-id from octave_swig_bound_func - The {DECLARE|DEFINE}_OV_TYPEID_FUNCTIONS_AND_DATA declarations attached to this class cause a seg-fault in the module_load Octave example. Removing these declarations fixes the seg-fault. - While cause of seg-fault is unknown, note that (in Octave 5.1.0) the declaration of octave_function, which is the base class for octave_swig_bound_func, does not use these declarations. So it's possible they simply are not required for this type of subclass. --- Lib/octave/octrun.swg | 4 ---- Lib/octave/octruntime.swg | 7 ------- 2 files changed, 11 deletions(-) diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg index 325a4cca3..162772d98 100644 --- a/Lib/octave/octrun.swg +++ b/Lib/octave/octrun.swg @@ -203,11 +203,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); std::set dispatch_classes; - private: - - DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA }; - DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_swig_bound_func, "octave_swig_bound_func", "octave_swig_bound_func"); #else #define SWIG_OCTAVE_BOUND_FUNC(func, args) octave_value(func) #endif diff --git a/Lib/octave/octruntime.swg b/Lib/octave/octruntime.swg index f98bf4fe4..6e07aaa70 100644 --- a/Lib/octave/octruntime.swg +++ b/Lib/octave/octruntime.swg @@ -376,7 +376,6 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { string_vector types = typeinfo.installed_type_names(); bool register_octave_swig_ref = true; bool register_octave_swig_packed = true; - bool register_octave_swig_bound_func = true; for (int i = 0; i < types.numel(); ++i) { if (types(i) == octave_swig_ref::static_type_name()) { register_octave_swig_ref = false; @@ -384,9 +383,6 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { if (types(i) == octave_swig_packed::static_type_name()) { register_octave_swig_packed = false; } - if (types(i) == octave_swig_bound_func::static_type_name()) { - register_octave_swig_bound_func = false; - } } if (register_octave_swig_ref) { octave_swig_ref::register_type(); @@ -394,9 +390,6 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { if (register_octave_swig_packed) { octave_swig_packed::register_type(); } - if (register_octave_swig_bound_func) { - octave_swig_bound_func::register_type(); - } } #else octave_swig_ref::register_type();