From: Josef Weidendorfer Date: Wed, 7 Jul 2010 18:51:59 +0000 (+0000) Subject: Fix for branch prediction: handle calls via function pointer X-Git-Tag: svn/VALGRIND_3_6_0~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a752ca175451c99e090249cd240669c69535cb0b;p=thirdparty%2Fvalgrind.git Fix for branch prediction: handle calls via function pointer Calls via function pointers are indirect branches, and thus should call into the indirect branch predictor simulation. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11212 --- diff --git a/callgrind/main.c b/callgrind/main.c index e36ba8a187..2dd7e18a99 100644 --- a/callgrind/main.c +++ b/callgrind/main.c @@ -1180,7 +1180,7 @@ IRSB* CLG_(instrument)( VgCallbackClosure* closure, /* Deal with branches to unknown destinations. Except ignore ones which are function returns as we assume the return stack predictor never mispredicts. */ - if (sbIn->jumpkind == Ijk_Boring) { + if ((sbIn->jumpkind == Ijk_Boring) || (sbIn->jumpkind == Ijk_Call)) { if (0) { ppIRExpr( sbIn->next ); VG_(printf)("\n"); } switch (sbIn->next->tag) { case Iex_Const: