fix seg fault with simple typedef struct
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7651 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7b0e15eb57
commit
eb4f07711e
3 changed files with 13 additions and 1 deletions
|
|
@ -290,6 +290,7 @@ CPP_TEST_CASES += \
|
|||
typedef_mptr \
|
||||
typedef_reference \
|
||||
typedef_scope \
|
||||
typedef_struct \
|
||||
typemap_namespace \
|
||||
typemap_ns_using \
|
||||
typemap_numinputs \
|
||||
|
|
|
|||
9
SWIG/Examples/test-suite/typedef_struct.i
Normal file
9
SWIG/Examples/test-suite/typedef_struct.i
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
%module typedef_struct
|
||||
|
||||
%inline {
|
||||
typedef struct {
|
||||
int numpoints;
|
||||
} lineObj;
|
||||
|
||||
typedef lineObj multipointObj;
|
||||
}
|
||||
|
|
@ -586,7 +586,9 @@ Swig_symbol_cadd(String_or_char *name, Node *n) {
|
|||
|
||||
*/
|
||||
if (td1 && checkAttribute(td1,k_storage,k_typedef)) {
|
||||
if (Strcmp(Getattr(td1,k_type), Getattr(td,k_name)) == 0) {
|
||||
String *st = Getattr(td1,k_type);
|
||||
String *sn = Getattr(td,k_name);
|
||||
if (st && sn && (Strcmp(st, sn) == 0)) {
|
||||
Symtab *sc = parentNode(current_symtab);
|
||||
if (sc) td1 = Swig_symbol_clookup(type,sc);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue