Bug 176262

Summary: WSL should check unreachable code and no returns
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: WebGPUAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: keith_miller, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 176199    
Attachments:
Description Flags
the patch mmaxfield: review+

Filip Pizlo
Reported 2017-09-01 18:19:12 PDT
Patch forthcoming.
Attachments
the patch (12.18 KB, patch)
2017-09-01 18:23 PDT, Filip Pizlo
mmaxfield: review+
Filip Pizlo
Comment 1 2017-09-01 18:23:43 PDT
Created attachment 319684 [details] the patch
Myles C. Maxfield
Comment 2 2017-09-01 19:18:17 PDT
Comment on attachment 319684 [details] the patch I'd like to add control flow statements soon. Hopefully I'm up to the task!
Filip Pizlo
Comment 3 2017-09-01 19:33:02 PDT
(In reply to Myles C. Maxfield from comment #2) > Comment on attachment 319684 [details] > the patch > > I'd like to add control flow statements soon. Hopefully I'm up to the task! The nice thing about those is that the type system basically doesn't have to know about them, so you can probably just let the Checker's and NameResolver's default Visitor methods take care of those control flow nodes. The one exception is ternaries. But that's easy - just verify that the two cases return the same type, and then return that type. I guess to do control flow, we'll either need a bool type, or we'll need a story for which types can be used as bools. How should that work? I guess bool could be a native type. Then you'd need to add a BoolLiteral class. Shouldn't be that hard. Do you want to do that, too?
Filip Pizlo
Comment 4 2017-09-01 19:34:27 PDT
Myles C. Maxfield
Comment 5 2017-09-02 10:54:38 PDT
(In reply to Filip Pizlo from comment #3) > (In reply to Myles C. Maxfield from comment #2) > > Comment on attachment 319684 [details] > > the patch > > > > I'd like to add control flow statements soon. Hopefully I'm up to the task! > > The nice thing about those is that the type system basically doesn't have to > know about them, so you can probably just let the Checker's and > NameResolver's default Visitor methods take care of those control flow nodes. > > The one exception is ternaries. But that's easy - just verify that the two > cases return the same type, and then return that type. > > I guess to do control flow, we'll either need a bool type, or we'll need a > story for which types can be used as bools. How should that work? > > I guess bool could be a native type. Then you'd need to add a BoolLiteral > class. Shouldn't be that hard. Do you want to do that, too? HLSL, GLSL, Metal, and OpenCL all have a native bool type. I see no reason to be different here.
Radar WebKit Bug Importer
Comment 6 2017-09-27 12:54:00 PDT
Myles C. Maxfield
Comment 7 2018-10-13 17:09:51 PDT
Note You need to log in before you can comment on or make changes to this bug.