If a template is instantiated which has a -> operator overload, and the class wrapped by the template contains a "using" declaration for members inherited from a base class, SWIG segfaults. The problem appears to affect only ruby (seems to be in documentation generation code?) generation. Attached is the smallest example I could come up with. The bug is in 1.3.40 and 2.0.0.
sample illustrating crash
The issue is that the node for the method lacks a parent reference, so this code can't now get the classname in this case.
I've committed a change to trunk r12237 which avoids the segfault by leaving out the classname if the parent reference isn't present.
The generated string only seems to be used in an exception message, so it's largely cosmetic, but I suspect my "fix" is really just working around the issue - either the parent reference should be getting set on the method node, or the code should be finding the class name in a different way.
But I'm not familiar enough with how this should work to know what's wrong here - assigning to William for comments (if my change is suitable, please just close the ticket).
There's still no
parentNode
on thefun
nodes forOptionalDerived
but there is for those fromDerived
, so the exception messages for the former lack the classname:This is fixed in current git master which generates code with
Derived.fun
in both chunks of code shown above.git bisect
shows the commit fixing it as being:FIx should be in upcoming 4.2.0 release.