[Ruby] Avoid segfault when a method node has no parentNode (SF#3034054).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12237 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
045066e802
commit
eaada32f26
2 changed files with 13 additions and 2 deletions
|
|
@ -5,6 +5,10 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Version 2.0.1 (in progress)
|
||||
===========================
|
||||
|
||||
2010-10-01: olly
|
||||
[Ruby] Avoid segfault when a method node has no parentNode
|
||||
(SF#3034054).
|
||||
|
||||
2010-10-01: olly
|
||||
[Python] Allow reinitialisation to work with an embedded Python
|
||||
interpreter (patch from Jim Carroll in SF#3075178).
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue