Commit 3563b709 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix a potential overflow in SortedListBSearch

R=yangguo@chromium.org

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

Patch from Jianghua Yang <jianghua.jhy@alibaba-inc.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21960 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 58bf19e9
......@@ -219,7 +219,7 @@ int SortedListBSearch(const List<T>& list, P cmp) {
int low = 0;
int high = list.length() - 1;
while (low <= high) {
int mid = (low + high) / 2;
int mid = low + (high - low) / 2;
T mid_elem = list[mid];
if (cmp(&mid_elem) > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment