Revert "Fix a potential overflow in SortedListBSearch".
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 28 Jul 2014 11:42:52 +0000 (11:42 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 28 Jul 2014 11:42:52 +0000 (11:42 +0000)
This reverts r21960.

R=jochen@chromium.org

Review URL: https://codereview.chromium.org/422853005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/list-inl.h

index ee68b36a59cfee633cd58fffa816f21fdf90c15e..1b687b6a960e1b3f499d85dcede3c0e43c82545c 100644 (file)
@@ -220,7 +220,7 @@ int SortedListBSearch(const List<T>& list, P cmp) {
   int low = 0;
   int high = list.length() - 1;
   while (low <= high) {
-    int mid = low + (high - low) / 2;
+    int mid = (low + high) / 2;
     T mid_elem = list[mid];
 
     if (cmp(&mid_elem) > 0) {