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

Unified Diff: src/objects.cc

Issue 7809: Fix bug 1439135 (slicedstring on constring not flat) (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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/bugs/bug-1439135.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 529)
+++ src/objects.cc (working copy)
@@ -510,6 +510,12 @@
ASSERT(!ss->buffer()->IsSlicedString());
Object* ok = String::cast(ss->buffer())->Flatten();
if (ok->IsFailure()) return ok;
+ // Under certain circumstances (TryFlatten fails in String::Slice)
+ // we can have a cons string under a slice. In this case we need
+ // to get the flat string out of the cons!
+ if (String::cast(ok)->StringIsConsString()) {
+ ss->set_buffer(ConsString::cast(ok)->first());
+ }
return this;
}
case kConsStringTag: {
« no previous file with comments | « no previous file | test/mjsunit/bugs/bug-1439135.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698