|
From: <sv...@va...> - 2014-10-11 15:01:28
|
Author: florian
Date: Sat Oct 11 16:01:21 2014
New Revision: 14619
Log:
Change eq_Invar to handle all kinds of InVars.
Move an assert to a better spot.
Modified:
trunk/exp-sgcheck/sg_main.c
Modified: trunk/exp-sgcheck/sg_main.c
==============================================================================
--- trunk/exp-sgcheck/sg_main.c (original)
+++ trunk/exp-sgcheck/sg_main.c Sat Oct 11 16:01:21 2014
@@ -868,11 +868,11 @@
/* Compare two Invars for equality. */
static Bool eq_Invar ( Invar* i1, Invar* i2 )
{
- tl_assert(i1->tag != Inv_Unset);
- tl_assert(i2->tag != Inv_Unset);
if (i1->tag != i2->tag)
return False;
switch (i1->tag) {
+ case Inv_Unset:
+ return True;
case Inv_Unknown:
return True;
case Inv_Stack0:
@@ -1264,6 +1264,8 @@
case Inv_StackN:
case Inv_Unknown:
break;
+ case Inv_Unset: /* this should never happen */
+ /* fallthrough */
default:
tl_assert(0);
}
@@ -1809,11 +1811,11 @@
/* Did we see something different from before? If no, then there's
no error. */
+ tl_assert(inv->tag != Inv_Unset);
+
if (LIKELY(eq_Invar(&new_inv, inv)))
return;
- tl_assert(inv->tag != Inv_Unset);
-
VG_(memset)(bufE, 0, sizeof(bufE));
show_Invar( bufE, sizeof(bufE)-1, inv, frame->depth );
|