|
From: <sv...@va...> - 2014-09-19 18:58:28
|
Author: philippe
Date: Fri Sep 19 18:58:18 2014
New Revision: 14558
Log:
Handle explicitely all enum values in 'switch' on AddrInfo tag
(reported by Florian)
Note that Addr_Undescribed will cause an assert if such
an undescribed addrinfo is pretty printed, as normally
such addrinfo should always be described before being pretty printed.
Modified:
trunk/coregrind/m_addrinfo.c
trunk/include/pub_tool_addrinfo.h
Modified: trunk/coregrind/m_addrinfo.c
==============================================================================
--- trunk/coregrind/m_addrinfo.c (original)
+++ trunk/coregrind/m_addrinfo.c Fri Sep 19 18:58:18 2014
@@ -280,11 +280,14 @@
void VG_(clear_addrinfo) ( AddrInfo* ai)
{
switch (ai->tag) {
+ case Addr_Undescribed:
+ break;
+
case Addr_Unknown:
- break;
+ break;
case Addr_Stack:
- break;
+ break;
case Addr_Block:
break;
@@ -354,6 +357,9 @@
vg_assert (!maybe_gcc || mc); // maybe_gcc can only be given in mc mode.
switch (ai->tag) {
+ case Addr_Undescribed:
+ VG_(core_panic)("mc_pp_AddrInfo Addr_Undescribed");
+
case Addr_Unknown:
if (maybe_gcc) {
VG_(emit)( "%sAddress 0x%llx is just below the stack ptr. "
Modified: trunk/include/pub_tool_addrinfo.h
==============================================================================
--- trunk/include/pub_tool_addrinfo.h (original)
+++ trunk/include/pub_tool_addrinfo.h Fri Sep 19 18:58:18 2014
@@ -188,7 +188,8 @@
extern void VG_(clear_addrinfo) ( AddrInfo* ai);
-/* Prints the AddrInfo ai describing a. */
+/* Prints the AddrInfo ai describing a.
+ Note that an ai with tag Addr_Undescribed will cause an assert.*/
extern void VG_(pp_addrinfo) ( Addr a, AddrInfo* ai );
/* Same as VG_(pp_addrinfo) but provides some memcheck specific behaviour:
|