diff options
Diffstat (limited to 'Source/Modules/ruby.cxx')
-rw-r--r-- | Source/Modules/ruby.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index ab1210a79..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" ); |