From: Gabriel Corona Date: Thu, 23 Jul 2015 14:20:20 +0000 (+0200) Subject: [mc] Fix out of range error in the binary search implementation X-Git-Tag: v3_12~438^2~11 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b7ba586806d5d92f3f9aaf1f1133ef3a555d6e1d?ds=inline [mc] Fix out of range error in the binary search implementation --- diff --git a/src/mc/mc_object_info.cpp b/src/mc/mc_object_info.cpp index a582e21a1f..46c4630101 100644 --- a/src/mc/mc_object_info.cpp +++ b/src/mc/mc_object_info.cpp @@ -130,7 +130,7 @@ simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const int k = i + ((j - i) / 2); if (ip < base[k].low_pc) j = k - 1; - else if (k <= j && ip >= base[k + 1].low_pc) + else if (k < j && ip >= base[k + 1].low_pc) i = k + 1; else if (ip < base[k].function->high_pc) return base[k].function;