From 4efcd34b17c0abdec6849962cd71af078a654138 Mon Sep 17 00:00:00 2001 From: Dave Beazley Date: Tue, 25 Feb 2003 21:08:49 +0000 Subject: [PATCH] Fixed abstract_typedef2.i test (apparently). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4389 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/allocate.cxx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Source/Modules/allocate.cxx b/Source/Modules/allocate.cxx index f0a00cac4..1368c5408 100644 --- a/Source/Modules/allocate.cxx +++ b/Source/Modules/allocate.cxx @@ -36,14 +36,19 @@ static int check_implemented(Node *n) { while (n) { if (Strcmp(nodeType(n), "cdecl") == 0) { local_decl = Getattr(n,"decl"); - if (local_decl) local_decl = SwigType_typedef_resolve_all(local_decl); - if (local_decl && (Strcmp(local_decl, search_decl) == 0)) { - if (!Getattr(n,"abstract")) { - Delete(local_decl); - return 1; + if (SwigType_isfunction(local_decl)) { + SwigType *decl1 = SwigType_typedef_resolve_all(local_decl); + SwigType *decl2 = SwigType_pop_function(decl1); + if (Strcmp(decl2, search_decl) == 0) { + if (!Getattr(n,"abstract")) { + Delete(decl1); + Delete(decl2); + return 1; + } } + Delete(decl1); + Delete(decl2); } - Delete(local_decl); } n = Getattr(n,"csym:nextSibling"); } @@ -174,9 +179,12 @@ class Allocate : public Dispatcher { } assert(dn != 0); // Assertion of doom */ - search_decl = base_decl; + if (SwigType_isfunction(base_decl)) { + search_decl = SwigType_pop_function(base_decl); + } Node *dn = Swig_symbol_clookup_local_check(name,0,check_implemented); - + Delete(search_decl); + Delete(base_decl); /* while (dn && !implemented) { String *local_decl = Getattr(dn,"decl"); @@ -190,7 +198,7 @@ class Allocate : public Dispatcher { } */ - Delete(base_decl); + /* if (!implemented && (Getattr(nn,"abstract"))) { return 1;