Reviewers: marja,

Message:
PTAL

Description:
Fix fetching tokens in lexer.

BUG=

Please review this at https://chromiumcodereview.appspot.com/26971006/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser

Affected files (+3, -2 lines):
  M src/lexer/lexer.re


Index: src/lexer/lexer.re
diff --git a/src/lexer/lexer.re b/src/lexer/lexer.re
index 0dd6e9efaf1951c1817d73c97dc12f783e3df6a6..b65c2dfec344ba2036a70a0e775ae4c83905d4ff 100644
--- a/src/lexer/lexer.re
+++ b/src/lexer/lexer.re
@@ -343,12 +343,13 @@ void ExperimentalScanner::FillTokens() {
   fetched_ = 0;
   uint8_t chars[BUFFER_SIZE];
   int n = static_cast<int>(fread(&chars, 1, BUFFER_SIZE, file_));
-  scanner_->push(chars, n);
+  for (int i = n; i < BUFFER_SIZE; i++) chars[i] = 0;
+  scanner_->push(chars, BUFFER_SIZE);
 }


 Token::Value ExperimentalScanner::Next(int* beg_pos, int* end_pos) {
-  if (current_ == fetched_) {
+  while (current_ == fetched_) {
     FillTokens();
   }
   *beg_pos = beg_[current_];


--
--
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/groups/opt_out.

Reply via email to