]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Ensure VG_(tt_fastN) always stays as an array of NULLs if BB profiling
authorJulian Seward <jseward@acm.org>
Tue, 17 Oct 2006 20:39:11 +0000 (20:39 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 17 Oct 2006 20:39:11 +0000 (20:39 +0000)
isn't in effect.  This should cause the dispatcher to segfault if it
should ever inadvertantly end up running the profiled dispatch loop
when it shouldn't.  [The alternative is to run slowly for no apparent
reason.]

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

coregrind/m_transtab.c

index 8f115a7fa6ce34514ae12cbce8a536fbf5cd223a..551aa2350fd6f281741cb2dba82fb040577482dc 100644 (file)
@@ -613,7 +613,7 @@ static void setFastCacheEntry ( Addr64 key, ULong* tce, UInt* count )
 {
    UInt cno = (UInt)VG_TT_FAST_HASH(key);
    VG_(tt_fast)[cno]  = tce;
-   VG_(tt_fastN)[cno] = count;
+   VG_(tt_fastN)[cno] = VG_(clo_profile_flags) > 0  ? count  : NULL;
    n_fast_updates++;
 }