WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
176262
WSL should check unreachable code and no returns
https://bugs.webkit.org/show_bug.cgi?id=176262
Summary
WSL should check unreachable code and no returns
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
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
Landed in
https://trac.webkit.org/changeset/221513/webkit
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
<
rdar://problem/34694242
>
Myles C. Maxfield
Comment 7
2018-10-13 17:09:51 PDT
Migrated to
https://github.com/gpuweb/WHLSL/issues/161
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug