Revision: 11105
Author:   [email protected]
Date:     Wed Mar 21 07:04:24 2012
Log:      Unbork Windows 64 bit build and guard against overlong UTF-8
serializations.
Review URL: https://chromiumcodereview.appspot.com/9817005
http://code.google.com/p/v8/source/detail?r=11105

Modified:
 /branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Wed Mar 21 06:48:29 2012
+++ /branches/bleeding_edge/src/api.cc  Wed Mar 21 07:04:24 2012
@@ -3721,7 +3721,7 @@
           previous_character = character;
         }
         *last_character = previous_character;
-        return utf8_bytes + current - buffer;
+        return static_cast<int>(utf8_bytes + current - buffer);
       }
       case i::kSeqStringTag: {
         const uint16_t* data =
@@ -3734,7 +3734,7 @@
           previous_character = character;
         }
         *last_character = previous_character;
-        return utf8_bytes + current - buffer;
+        return static_cast<int>(utf8_bytes + current - buffer);
       }
       case i::kSlicedStringTag: {
         i::SlicedString* slice = i::SlicedString::cast(string);
@@ -3818,7 +3818,7 @@
     return len;
   }

-  if (capacity == -1 || capacity >= string_length * 3) {
+  if (capacity == -1 || capacity / 3 >= string_length) {
     int32_t previous = unibrow::Utf16::kNoPreviousCharacter;
     const int kMaxRecursion = 100;
     int utf8_bytes =

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to