Fix segfault in C# layer handling using declarations

Segfault was actually avoided in previous commit ab23cb29.
This commit makes handling more robust in the event of
using %ignore just on the derived method, not tested as it is not
what one should do with directors, and possibly other cases.

Go still segfaults with the new testcase director_using_member_scopes.i.

Issue #1441.
This commit is contained in:
William S Fulton 2022-03-07 18:23:05 +00:00
commit c88a9436bc
3 changed files with 35 additions and 2 deletions

View file

@ -2553,8 +2553,8 @@ public:
Replaceall(imcall, "$imfuncname", intermediary_function_name);
String *excode = NewString("");
Node *directorNode = Getattr(n, "directorNode");
if (directorNode) {
UpcallData *udata = Getattr(directorNode, "upcalldata");
UpcallData *udata = directorNode ? Getattr(directorNode, "upcalldata") : 0;
if (udata) {
String *methid = Getattr(udata, "class_methodidx");
if (!Cmp(return_type, "void"))