avoid assert when finding a recursive scope inheritance, emit a warning in the worst case, reported by Nitro

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8832 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-02-17 22:13:37 +00:00
commit cb80d44fa6
4 changed files with 24 additions and 3 deletions

View file

@ -236,10 +236,16 @@ class TypePass : private Dispatcher {
SwigType_inherit_scope(scopes);
}
/* Set up inheritance in the symbol table */
Symtab *s = Swig_symbol_current();
Symtab *st = Getattr(cls,"symtab");
Symtab *bst = Getattr(bclass,"symtab");
if (st == bst) {
Swig_warning(WARN_PARSE_REC_INHERITANCE, Getfile(cls), Getline(cls),
"Recursive scope inheritance of '%s'.\n", HashGetAttr(cls,k_name));
continue;
}
Symtab *s = Swig_symbol_current();
Swig_symbol_setscope(st);
Swig_symbol_inherit(Getattr(bclass,"symtab"));
Swig_symbol_inherit(bst);
Swig_symbol_setscope(s);
/* Recursively hit base classes */