Revision: 21960
Author:   [email protected]
Date:     Tue Jun 24 09:37:51 2014 UTC
Log:      Fix a potential overflow in SortedListBSearch

[email protected]

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

Patch from Jianghua Yang <[email protected]>.
http://code.google.com/p/v8/source/detail?r=21960

Modified:
 /branches/bleeding_edge/src/list-inl.h

=======================================
--- /branches/bleeding_edge/src/list-inl.h      Tue Jun  3 08:12:43 2014 UTC
+++ /branches/bleeding_edge/src/list-inl.h      Tue Jun 24 09:37:51 2014 UTC
@@ -219,7 +219,7 @@
   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) {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to