Update of /cvsroot/ups/ups/ups
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31953
Modified Files:
ao_dwftype.c
Log Message:
Keep one void type for each symbol table so that it doesn't wind up
being used after the pool it was allocated from has been freed.
Index: ao_dwftype.c
===================================================================
RCS file: /cvsroot/ups/ups/ups/ao_dwftype.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** ao_dwftype.c 14 Feb 2007 14:59:46 -0000 1.14
--- ao_dwftype.c 29 Jul 2008 14:22:47 -0000 1.15
***************
*** 56,60 ****
dwf_type_from_dtype PROTO((dtype_t *dt));
static type_t *
! dwf_get_void_type PROTO((alloc_pool_t *ap));
static type_t *
dwf_try_resolve_base_type PROTO((Dwarf_Debug dbg, Dwarf_Die die,
--- 56,60 ----
dwf_type_from_dtype PROTO((dtype_t *dt));
static type_t *
! dwf_get_void_type PROTO((alloc_pool_t *ap, symtab_t *st));
static type_t *
dwf_try_resolve_base_type PROTO((Dwarf_Debug dbg, Dwarf_Die die,
***************
*** 556,570 ****
* DW_TAG_pointer_type with no base type, implying 'void'
*/
! static type_t *dwf_get_void_type(ap)
alloc_pool_t *ap;
{
! static type_t *void_type = NULL;
!
! if (void_type == NULL) {
! void_type = ci_make_type(ap, TY_VOID);
! void_type->ty_size = 0;
! void_type->ty_name = "void";
}
! return void_type;
}
--- 556,570 ----
* DW_TAG_pointer_type with no base type, implying 'void'
*/
! static type_t *dwf_get_void_type(ap, st)
alloc_pool_t *ap;
+ symtab_t *st;
{
! ao_stdata_t *ast = AO_STDATA(st);
! if (ast->st_dw_void_type == NULL) {
! ast->st_dw_void_type = ci_make_type(ap, TY_VOID);
! ast->st_dw_void_type->ty_size = 0;
! ast->st_dw_void_type->ty_name = "void";
}
! return ast->st_dw_void_type;
}
***************
*** 643,647 ****
* If there is no DW_AT_type attribute this is a "void *" or similar.
*/
! *(dt->dt_p_type) = dwf_get_void_type(ap);
}
return base;
--- 643,647 ----
* If there is no DW_AT_type attribute this is a "void *" or similar.
*/
! *(dt->dt_p_type) = dwf_get_void_type(ap, stf->stf_symtab);
}
return base;
***************
*** 816,820 ****
* A declaration without a type - assume a typedef of 'void'.
*/
! type->ty_base = dwf_get_void_type(ap);
} else {
/*
--- 816,820 ----
* A declaration without a type - assume a typedef of 'void'.
*/
! type->ty_base = dwf_get_void_type(ap, stf->stf_symtab);
} else {
/*
|