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

@ -412,6 +412,12 @@ void Swig_symbol_inherit(Symtab *s) {
Setattr(current_symtab,k_inherit, inherit);
Delete(inherit);
}
if (s == current_symtab) {
Swig_warning(WARN_PARSE_REC_INHERITANCE, Getfile(s), Getline(s),
"Recursive scope inheritance of '%s'.\n", HashGetAttr(s,k_name));
return;
}
assert(s != current_symtab);
ilen = Len(inherit);
for (i = 0; i < ilen; i++) {