summaryrefslogtreecommitdiff
path: root/Source/Modules/ruby.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Modules/ruby.cxx')
-rw-r--r--Source/Modules/ruby.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx
index bcdfd69d3..8461b8bef 100644
--- a/Source/Modules/ruby.cxx
+++ b/Source/Modules/ruby.cxx
@@ -2054,8 +2054,15 @@ public:
// Construct real method name
String* methodName = NewString("");
- if ( isMethod )
- Printv( methodName, Getattr(parentNode(sibl),"sym:name"), ".", NIL );
+ if ( isMethod ) {
+ // Sometimes a method node has no parent (SF#3034054).
+ // This value is used in an exception message, so just skip the class
+ // name in this case so at least we don't segfault. This is probably
+ // just working around a problem elsewhere though.
+ Node *parent_node = parentNode(sibl);
+ if (parent_node)
+ Printv( methodName, Getattr(parent_node,"sym:name"), ".", NIL );
+ }
Append( methodName, Getattr(sibl,"sym:name" ) );
if ( isCtor ) Append( methodName, ".new" );
@@ -2395,7 +2402,7 @@ public:
}
String *proxyclassname = SwigType_str(Getattr(n, "classtypeobj"), 0);
String *baseclassname = SwigType_str(Getattr(base.item, "name"), 0);
- Swig_warning(WARN_RUBY_MULTIPLE_INHERITANCE, input_file, line_number,
+ Swig_warning(WARN_RUBY_MULTIPLE_INHERITANCE, Getfile(n), Getline(n),
"Warning for %s proxy: Base %s ignored. Multiple inheritance is not supported in Ruby.\n", proxyclassname, baseclassname);
base = Next(base);
}