Bug 189029 - [WHLSL] ParseConstexpr is very general
Summary: [WHLSL] ParseConstexpr is very general
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 176199
  Show dependency treegraph
Reported: 2018-08-27 16:24 PDT by Myles C. Maxfield
Modified: 2018-10-13 15:12 PDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2018-08-27 16:24:39 PDT
It's called in a few places:

vector<float, 4> // that "4" is a constexpr
float[10] // that "10" is a constexpr

enum asdf : int {
    XYZ = -3 // that "-3" is a constexpr

switch (foo) {
    case MyEnum.XYZ: // that "MyEnum.XYZ" is a constexpr

Because of all that, parseConstexpr can return something like operator-((x + y).z)

We should do a bunch of filtering to make sure the right kind of constexprs are allowed in the various places where they are allowed.
Comment 1 Myles C. Maxfield 2018-10-13 15:12:26 PDT
Migrated to https://github.com/gpuweb/WHLSL/issues/79