summaryrefslogtreecommitdiff
path: root/Source/Modules/ruby.cxx
diff options
context:
space:
mode:
authorDerrick <a11426@users.sourceforge.net>2011-02-14 20:11:58 +0000
committerDerrick <a11426@users.sourceforge.net>2011-02-14 20:11:58 +0000
commit5815f7ec289e067e765fb8e893a2f337d8b48303 (patch)
treeebe9e0534a089fe431cedc6fdbc1a53ac523d70c /Source/Modules/ruby.cxx
parent3e1af1f698d5d02d7905431bcb3549c0f7bc9aa7 (diff)
parent1fab53b2046b97702e1de4cfab06cb8fa8fc129d (diff)
downloadswig-a11426-fortran.tar.gz
update fortran branch. merge of 12160:12460a11426-fortran
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/a11426-fortran@12461 626c5289-ae23-0410-ae9c-e8d60b6d4f22
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);
}