Bug 158699 - DFG Validation fails when performing a concatenation with only a single entry
Summary: DFG Validation fails when performing a concatenation with only a single entry
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-13 11:27 PDT by Oliver Hunt
Modified: 2016-06-13 16:15 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.39 KB, patch)
2016-06-13 15:35 PDT, Oliver Hunt
saam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2016-06-13 11:27:04 PDT
Fairly simple failure:

function f() {
    for (;;)`${1}`
}
f();

The issue is that we appear to be issuing a str_concat with a single child, which the DFG thinks is invalid. The obvious solutions are to either:
* don't emit str_concat from a single child template literal
* Have the DFG acknowledge this can happen

I think the former is the better option.
Comment 1 Radar WebKit Bug Importer 2016-06-13 14:26:18 PDT
<rdar://problem/26775638>
Comment 2 Oliver Hunt 2016-06-13 15:35:57 PDT
Created attachment 281211 [details]
Patch
Comment 3 Saam Barati 2016-06-13 15:38:39 PDT
Comment on attachment 281211 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=281211&action=review

r=me

> Source/JavaScriptCore/tests/stress/template-literal.js:209
> +function testSingleNode() {

Can you also add other tests for valueOf, etc
Comment 4 Oliver Hunt 2016-06-13 15:51:22 PDT
Comment on attachment 281211 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=281211&action=review

>> Source/JavaScriptCore/tests/stress/template-literal.js:209
>> +function testSingleNode() {
> 
> Can you also add other tests for valueOf, etc

Unrealted to this bug you mean? This bug is specifically because template literals would alway plant a strcat, even if there was only a single node.
Comment 5 Oliver Hunt 2016-06-13 16:15:41 PDT
Committed r202015: <http://trac.webkit.org/changeset/202015>