]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix for branch prediction: handle calls via function pointer
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Wed, 7 Jul 2010 18:51:59 +0000 (18:51 +0000)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Wed, 7 Jul 2010 18:51:59 +0000 (18:51 +0000)
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

callgrind/main.c

index e36ba8a18762b1ace7b75dd7e290ed682c9116c5..2dd7e18a99b85d79405912fc4b4a8eb5a052088b 100644 (file)
@@ -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: