|
From: <sv...@va...> - 2014-09-03 21:50:11
|
Author: florian
Date: Wed Sep 3 21:50:04 2014
New Revision: 14446
Log:
Allocate SectKind.objname dynamically.
Modified:
branches/BUF_REMOVAL/coregrind/m_addrinfo.c
branches/BUF_REMOVAL/include/pub_tool_addrinfo.h
Modified: branches/BUF_REMOVAL/coregrind/m_addrinfo.c
==============================================================================
--- branches/BUF_REMOVAL/coregrind/m_addrinfo.c (original)
+++ branches/BUF_REMOVAL/coregrind/m_addrinfo.c Wed Sep 3 21:50:04 2014
@@ -158,20 +158,12 @@
}
/* -- last ditch attempt at classification -- */
- vg_assert( sizeof(ai->Addr.SectKind.objname) > 4 );
- VG_(memset)( &ai->Addr.SectKind.objname,
- 0, sizeof(ai->Addr.SectKind.objname));
- VG_(strcpy)( ai->Addr.SectKind.objname, "???" );
- HChar *temp_name;
- sect = VG_(DebugInfo_sect_kind)( &temp_name, a);
- VG_(strncpy)(ai->Addr.SectKind.objname, temp_name,
- sizeof(ai->Addr.SectKind.objname)-1);
+ sect = VG_(DebugInfo_sect_kind)( &name, a);
+ ai->Addr.SectKind.objname = VG_(strdup)("mc.da.dsname", name);
if (sect != Vg_SectUnknown) {
ai->tag = Addr_SectKind;
ai->Addr.SectKind.kind = sect;
- vg_assert( ai->Addr.SectKind.objname
- [ sizeof(ai->Addr.SectKind.objname)-1 ] == 0);
return;
}
/* -- Clueless ... -- */
@@ -213,6 +205,7 @@
break;
case Addr_SectKind:
+ VG_(free)(ai->Addr.SectKind.objname);
break;
default:
Modified: branches/BUF_REMOVAL/include/pub_tool_addrinfo.h
==============================================================================
--- branches/BUF_REMOVAL/include/pub_tool_addrinfo.h (original)
+++ branches/BUF_REMOVAL/include/pub_tool_addrinfo.h Wed Sep 3 21:50:04 2014
@@ -153,7 +153,7 @@
// Could only narrow it down to be the PLT/GOT/etc of a given
// object. Better than nothing, perhaps.
struct {
- HChar objname[128];
+ HChar *objname;
VgSectKind kind;
} SectKind;
|