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

Unified Diff: src/scanner-base.h

Issue 6044009: Fix bug that happens when the first non-ASCII character of a literal is at a power-of-two position. (Closed)
Patch Set: Created 9 years, 12 months 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 | test/mjsunit/regress/regress-1017.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-base.h
diff --git a/src/scanner-base.h b/src/scanner-base.h
index e773586d044ef047e5a0a88dba2f0754e3a6a412..b668df5046dae63903c4a2fd6445336235a24024 100644
--- a/src/scanner-base.h
+++ b/src/scanner-base.h
@@ -214,7 +214,9 @@ class LiteralBuffer {
ASSERT(is_ascii_);
Vector<byte> new_store;
int new_content_size = position_ * kUC16Size;
- if (new_content_size > backing_store_.length()) {
+ if (new_content_size >= backing_store_.length()) {
+ // Ensure room for all currently read characters as UC16 as well
+ // as the character about to be stored.
new_store = Vector<byte>::New(NewCapacity(new_content_size));
} else {
new_store = backing_store_;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1017.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698