Bug 943723: Fix binary search in TypeRepresentationSetBuilder::insert (r=pnkfelix).
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Wed, 04 Dec 2013 13:37:38 +0100
changeset 174454 94759f93f65e9980931d8c8c25a2a9bbf0b2a3fa
parent 174453 a5f547833e7d288ad18cd494fbcec6ac9c4ea417
child 174455 ea8351e6c6b619f3d452c938aa6891ed7e2cfeae
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspnkfelix
bugs943723
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 943723: Fix binary search in TypeRepresentationSetBuilder::insert (r=pnkfelix).
js/src/jit/TypeRepresentationSet.cpp
--- a/js/src/jit/TypeRepresentationSet.cpp
+++ b/js/src/jit/TypeRepresentationSet.cpp
@@ -77,17 +77,17 @@ TypeRepresentationSetBuilder::insert(Typ
         size_t i = min + ((max - min) >> 1); // average w/o fear of overflow
 
         uintptr_t entryiaddr = (uintptr_t) entries_[i];
         if (entryiaddr == typeReprAddr)
             return true; // typeRepr already present in the set
 
         if (entryiaddr < typeReprAddr) {
             // typeRepr lies to the right of entry i
-            min = i;
+            min = i + 1;
         } else {
             // typeRepr lies to the left of entry i
             max = i;
         }
     }
 
     // As a sanity check, give up if the TypeRepresentationSet grows too large.
     if (entries_.length() >= 512) {