Fixed infinite loop on enum.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@859 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3ad0a40afb
commit
c5bc01c898
2 changed files with 7 additions and 4 deletions
|
|
@ -987,11 +987,10 @@ statement : INCLUDE STRING LBRACE {
|
|||
init_language();
|
||||
if ($3) {
|
||||
if (temp_type) Delete(temp_type);
|
||||
String *ts = NewStringf("enum %s", $3);
|
||||
temp_type = NewStringf("enum %s", $3);
|
||||
/* String *ts = NewSwigType(T_INT); */
|
||||
SwigType_typedef(temp_type,ts);
|
||||
lang->add_typedef(temp_type,Char(ts));
|
||||
Delete(ts);
|
||||
SwigType_typedef(temp_type,$3);
|
||||
lang->add_typedef(temp_type,$3);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1086,6 +1086,10 @@ static void init_scopes() {
|
|||
int SwigType_typedef(SwigType *type, String_or_char *name) {
|
||||
init_scopes();
|
||||
if (Getattr(scopes[scope_level],name)) return -1;
|
||||
if (Cmp(type,name) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Setattr(scopes[scope_level],name,type);
|
||||
if (default_cache)
|
||||
Delattr(default_cache,type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue