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

Unified Diff: src/factory.cc

Issue 2660823002: ThinStrings: fix Factory::NewProperSubString (Closed)
Patch Set: Created 3 years, 11 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-crbug-685504.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 92d287b88b4e420ca3b0035290275ebddf261aec..d892d5b994ae2fb469b48f6aad9e0359d6ba3d0f 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -795,6 +795,10 @@ Handle<String> Factory::NewProperSubString(Handle<String> str,
str = Handle<String>(slice->parent(), isolate());
offset += slice->offset();
}
+ if (str->IsThinString()) {
+ Handle<ThinString> thin = Handle<ThinString>::cast(str);
+ str = handle(thin->actual(), isolate());
+ }
DCHECK(str->IsSeqString() || str->IsExternalString());
Handle<Map> map = str->IsOneByteRepresentation()
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-685504.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698