Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Unified Diff: src/list-inl.h

Issue 422853005: Revert "Fix a potential overflow in SortedListBSearch". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/list-inl.h
diff --git a/src/list-inl.h b/src/list-inl.h
index ee68b36a59cfee633cd58fffa816f21fdf90c15e..1b687b6a960e1b3f499d85dcede3c0e43c82545c 100644
--- a/src/list-inl.h
+++ b/src/list-inl.h
@@ -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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698