Correctly expand literal buffer for surrogate pairs.
authoryangguo@chromium.org <yangguo@chromium.org>
Tue, 14 Oct 2014 13:25:19 +0000 (13:25 +0000)
committeryangguo@chromium.org <yangguo@chromium.org>
Tue, 14 Oct 2014 13:25:19 +0000 (13:25 +0000)
R=jkummerow@chromium.org
BUG=chromium:423212
LOG=Y

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24603 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/scanner.h

index d40c626..7f35e71 100644 (file)
@@ -219,6 +219,7 @@ class LiteralBuffer {
       *reinterpret_cast<uint16_t*>(&backing_store_[position_]) =
           unibrow::Utf16::LeadSurrogate(code_unit);
       position_ += kUC16Size;
+      if (position_ >= backing_store_.length()) ExpandBuffer();
       *reinterpret_cast<uint16_t*>(&backing_store_[position_]) =
           unibrow::Utf16::TrailSurrogate(code_unit);
       position_ += kUC16Size;