Index: src/preparser-api.cc |
diff --git a/src/preparser-api.cc b/src/preparser-api.cc |
index dba30265f6aaef24b19966260c2251b8635e6583..3817935f8f8050f5327ff3a9fa964af1a2cb88cd 100644 |
--- a/src/preparser-api.cc |
+++ b/src/preparser-api.cc |
@@ -69,8 +69,12 @@ class InputStreamUTF16Buffer : public UC16CharacterStream { |
} |
} |
- virtual void PushBack(uc16 ch) { |
+ virtual void PushBack(uc32 ch) { |
ASSERT(pos_ > 0); |
+ if (ch == kEndOfInput) { |
+ pos_--; |
+ return; |
+ } |
if (buffer_cursor_ <= pushback_buffer_) { |
// No more room in the current buffer to do pushbacks. |
if (pushback_buffer_end_cache_ == NULL) { |
@@ -98,7 +102,8 @@ class InputStreamUTF16Buffer : public UC16CharacterStream { |
buffer_end_ = pushback_buffer_backing_ + pushback_buffer_backing_size_; |
} |
} |
- pushback_buffer_[buffer_cursor_ - pushback_buffer_- 1] = ch; |
+ pushback_buffer_[buffer_cursor_ - pushback_buffer_- 1] = |
+ static_cast<uc16>(ch); |
pos_--; |
} |