]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Cachegrind should not assert when it encounters a client request.
authorNicholas Nethercote <njn@valgrind.org>
Fri, 12 Aug 2005 23:47:51 +0000 (23:47 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Fri, 12 Aug 2005 23:47:51 +0000 (23:47 +0000)
BACKPORT TO 3_0_X

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

cachegrind/cg_main.c

index 159c5f8837645a7808ad9034d187f5b0e5ab03d7..9897056278c081122001024df1434adbc22e781b 100644 (file)
@@ -576,12 +576,6 @@ void instrumentInstr(IRBB* bbOut, instr_info* i_node, Bool bbSeenBefore,
    if (storeAddrExpr) 
       tl_assert(wordTy == typeOfIRExpr(bbOut->tyenv, storeAddrExpr));
 
-
-   // Nb: instrLen will be zero if Vex failed to decode it.
-   tl_assert( 0 == instrLen ||
-              (instrLen >= VG_MIN_INSTR_SZB && 
-               instrLen <= VG_MAX_INSTR_SZB) );
-
    // Large (eg. 28B, 108B, 512B on x86) data-sized instructions will be
    // done inaccurately, but they're very rare and this avoids errors from
    // hitting more than two cache lines in the simulation.
@@ -703,6 +697,14 @@ static IRBB* cg_instrument ( IRBB* bbIn, VexGuestLayout* layout,
             tl_assert(!addedInstrumentation);
             addedInstrumentation = True;
             
+            // Nb: instrLen will be zero if Vex failed to decode it.
+            // Also Client requests can appear to be very large (eg. 18
+            // bytes on x86) because they are really multiple instructions.
+            tl_assert( 0 == instrLen ||
+                       bbIn->jumpkind == Ijk_ClientReq ||
+                       (instrLen >= VG_MIN_INSTR_SZB && 
+                        instrLen <= VG_MAX_INSTR_SZB) );
+
             // Add instrumentation before this statement.
             instrumentInstr(bbOut, &bbInfo->instrs[ bbInfo_i ], bbSeenBefore,
                       instrAddr, instrLen, dataSize, loadAddrExpr, storeAddrExpr);