Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Unified Diff: src/lexer/experimental-scanner.cc

Issue 64023004: Experimental lexer generator: Misc fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/lexer/lexer_py.re » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/experimental-scanner.cc
diff --git a/src/lexer/experimental-scanner.cc b/src/lexer/experimental-scanner.cc
index 312bb7b3839fe37aa215d72975a3b4eb6ac3985a..0e797b2a11c30f2fcc492a78879d7fc95b5f30fb 100644
--- a/src/lexer/experimental-scanner.cc
+++ b/src/lexer/experimental-scanner.cc
@@ -51,7 +51,7 @@ const byte* ReadFile(const char* name, Isolate* isolate,
*size = file_size * repeat;
- byte* chars = new byte[*size + 1];
+ byte* chars = new byte[*size];
for (int i = 0; i < file_size;) {
int read = static_cast<int>(fread(&chars[i], 1, file_size - i, file));
i += read;
@@ -61,7 +61,6 @@ const byte* ReadFile(const char* name, Isolate* isolate,
for (int i = file_size; i < *size; i++) {
chars[i] = chars[i - file_size];
}
- chars[*size] = 0;
return chars;
}
« no previous file with comments | « no previous file | src/lexer/lexer_py.re » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698