From: Florian Krohm Date: Thu, 20 Aug 2015 22:45:41 +0000 (+0000) Subject: When scanning the statement list for bogus literals we X-Git-Tag: svn/VALGRIND_3_11_0~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd8165387ce60546f450e735acb1efccb21a149f;p=thirdparty%2Fvalgrind.git When scanning the statement list for bogus literals we can stop once the first such literal was found. No need to scan further. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15574 --- diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 02da797fa7..6963078610 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -6252,7 +6252,6 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure, IRType gWordTy, IRType hWordTy ) { Bool verboze = 0||False; - Bool bogus; Int i, j, first_stmt; IRStmt* st; MCEnv mce; @@ -6319,11 +6318,9 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure, extra-detailed (hence extra-expensive) instrumentation in places. Scan the whole bb even if dodgyness is found earlier, so that the flatness assertion is applied to all stmts. */ - - bogus = False; + Bool bogus = False; for (i = 0; i < sb_in->stmts_used; i++) { - st = sb_in->stmts[i]; tl_assert(st); tl_assert(isFlatIRStmt(st)); @@ -6335,10 +6332,9 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure, ppIRStmt(st); VG_(printf)("\n"); } + if (bogus) break; } - } - mce.bogusLiterals = bogus; /* Copy verbatim any IR preamble preceding the first IMark */