diff options
Diffstat (limited to 'chromium/v8/src/unicode-decoder.h')
-rw-r--r-- | chromium/v8/src/unicode-decoder.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/chromium/v8/src/unicode-decoder.h b/chromium/v8/src/unicode-decoder.h index bfb14a38555..c0308411660 100644 --- a/chromium/v8/src/unicode-decoder.h +++ b/chromium/v8/src/unicode-decoder.h @@ -23,9 +23,10 @@ class Utf8DecoderBase { // The first buffer_length utf16 chars are cached in the buffer. void Reset(uint16_t* buffer, size_t buffer_length, const uint8_t* stream, size_t stream_length); - static void WriteUtf16Slow(const uint8_t* stream, uint16_t* data, - size_t length); + static void WriteUtf16Slow(const uint8_t* stream, size_t stream_length, + uint16_t* data, size_t length); const uint8_t* unbuffered_start_; + size_t unbuffered_length_; size_t utf16_length_; bool last_byte_of_buffer_unused_; @@ -48,6 +49,7 @@ class Utf8Decoder : public Utf8DecoderBase { Utf8DecoderBase::Utf8DecoderBase() : unbuffered_start_(NULL), + unbuffered_length_(0), utf16_length_(0), last_byte_of_buffer_unused_(false) {} @@ -84,7 +86,7 @@ size_t Utf8Decoder<kBufferSize>::WriteUtf16(uint16_t* data, if (length <= buffer_length) return length; DCHECK(unbuffered_start_ != NULL); // Copy the rest the slow way. - WriteUtf16Slow(unbuffered_start_, data + buffer_length, + WriteUtf16Slow(unbuffered_start_, unbuffered_length_, data + buffer_length, length - buffer_length); return length; } |