| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index fb31d83e31c602519965877be4b0cdc5c602768a..4ee90a7f953625fc76cfc492f539be6a1783729e 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -2215,8 +2215,12 @@ static bool AnWord(String* str) {
|
|
|
| Handle<String> String::SlowFlatten(Handle<ConsString> cons,
|
| PretenureFlag pretenure) {
|
| - DCHECK(AllowHeapAllocation::IsAllowed());
|
| DCHECK(cons->second()->length() != 0);
|
| +
|
| + // TurboFan can create cons strings with empty first parts.
|
| + if (cons->first()->length() == 0) return handle(cons->second());
|
| +
|
| + DCHECK(AllowHeapAllocation::IsAllowed());
|
| Isolate* isolate = cons->GetIsolate();
|
| int length = cons->length();
|
| PretenureFlag tenure = isolate->heap()->InNewSpace(*cons) ? pretenure
|
|
|