]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change eq_Invar to handle all kinds of InVars.
authorFlorian Krohm <florian@eich-krohm.de>
Sat, 11 Oct 2014 15:01:21 +0000 (15:01 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sat, 11 Oct 2014 15:01:21 +0000 (15:01 +0000)
Move an assert to a better spot.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14619

exp-sgcheck/sg_main.c

index 30743e6dca9d0dca89c645151d830f56ab628eb1..f4ae81bf726149e69acd0965adcd3626c4b1df59 100644 (file)
@@ -868,11 +868,11 @@ static void pp_Invar ( Invar* i )
 /* 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 @@ static void preen_global_Invar ( Invar* inv, Addr a, SizeT len )
       case Inv_StackN:
       case Inv_Unknown:
          break;
+      case Inv_Unset: /* this should never happen */
+         /* fallthrough */
       default:
          tl_assert(0);
    }
@@ -1809,11 +1811,11 @@ void helperc__mem_access ( /* Known only at run time: */
 
    /* 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 );