Merge branch 'interface-using-declaration'

* interface-using-declaration:
  Fix seg fault with %interface and using declarations
This commit is contained in:
William S Fulton 2017-09-18 18:09:30 +01:00
commit 20521eae68

View file

@ -151,6 +151,7 @@ void Swig_interface_propagate_methods(Node *n) {
for (Node *child = firstChild(n); child; child = nextSibling(child)) { for (Node *child = firstChild(n); child; child = nextSibling(child)) {
if (Getattr(child, "interface:owner")) if (Getattr(child, "interface:owner"))
break; // at the end of the list are newly appended methods break; // at the end of the list are newly appended methods
if (Cmp(nodeType(child), "cdecl") == 0) {
if (checkAttribute(child, "name", name)) { if (checkAttribute(child, "name", name)) {
String *decl = SwigType_typedef_resolve_all(Getattr(child, "decl")); String *decl = SwigType_typedef_resolve_all(Getattr(child, "decl"));
identically_overloaded_method = Strcmp(decl, this_decl_resolved) == 0; identically_overloaded_method = Strcmp(decl, this_decl_resolved) == 0;
@ -160,6 +161,7 @@ void Swig_interface_propagate_methods(Node *n) {
} }
} }
} }
}
Delete(this_decl_resolved); Delete(this_decl_resolved);
if (!identically_overloaded_method) { if (!identically_overloaded_method) {
// TODO: Fix if the method is overloaded with different arguments / has default args // TODO: Fix if the method is overloaded with different arguments / has default args