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

Unified Diff: src/objects.cc

Issue 42499: Added a few sanity-assertions about flat strings underlying buffers. (Closed)
Patch Set: Created 11 years, 9 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 | src/regexp-macro-assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 72fc5e5088bc5446b00517181a5cdbe8ddf26142..9f50d62483324d0b76780df0c6d534d279a87d5b 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -618,6 +618,8 @@ Object* String::TryFlatten() {
if (StringShape(String::cast(ok)).IsCons()) {
ss->set_buffer(ConsString::cast(ok)->first());
}
+ ASSERT(StringShape(this).IsAsciiRepresentation() ==
+ StringShape(ss->buffer()).IsAsciiRepresentation());
return this;
}
case kConsStringTag: {
« no previous file with comments | « no previous file | src/regexp-macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698