diff --git a/Source/Modules/lang.cxx b/Source/Modules/lang.cxx index 95531a237..cf64963f5 100644 --- a/Source/Modules/lang.cxx +++ b/Source/Modules/lang.cxx @@ -1710,7 +1710,7 @@ String *vtable_method_id(Node *n) * ---------------------------------------------------------------------- */ int Language::unrollVirtualMethods(Node *n, Node *parent, - Hash *vm, + List *vm, int default_director, int &virtual_destructor, int protectedbase) { @@ -1750,20 +1750,21 @@ int Language::unrollVirtualMethods(Node *n, if ((Cmp(nodeType, "cdecl") == 0)|| is_destructor) { decl = Getattr(ni, "decl"); /* extra check for function type and proper access */ - if (SwigType_isfunction(decl) - && (((!protectedbase || dirprot_mode()) && is_public(ni)) - || need_nonpublic_member(ni))) { + if (SwigType_isfunction(decl) && (((!protectedbase || dirprot_mode()) && is_public(ni)) || need_nonpublic_member(ni))) { String *name = Getattr(ni, "name"); - Node *method_id = is_destructor ? - NewStringf("~destructor") : vtable_method_id(ni); + Node *method_id = is_destructor ? NewStringf("~destructor") : vtable_method_id(ni); /* Make sure that the new method overwrites the existing: */ - Hash *exists_item = Getattr(vm, method_id); - if (exists_item) { - /* maybe we should check for precedence here, ie, only - delete the previous method if 'n' is derived from the - previous method parent node. This is almost always true, - so by now, we just delete the entry. */ - Delattr(vm, method_id); + int len = Len(vm); + const int DO_NOT_REPLACE = -1; + int replace = DO_NOT_REPLACE; + for (int i=0; i 0) { @@ -2366,16 +2367,15 @@ int Language::classHandler(Node *n) { /* Emit additional protected virtual methods - only needed if the language module * codes logic in the C++ layer instead of the director proxy class method - primarily - * to catch public use of protected methods by the sripting languages. */ + * to catch public use of protected methods by the scripting languages. */ if (dirprot_mode() && extraDirectorProtectedCPPMethodsRequired()) { Node *vtable = Getattr(n, "vtable"); String* symname = Getattr(n, "sym:name"); - Node *item; - Iterator k; AccessMode old_mode = cplus_mode; cplus_mode = PROTECTED; - for (k = First(vtable); k.key; k = Next(k)) { - item = k.item; + int len = Len(vtable); + for (int i=0; i