Changeset 248706 in webkit


Ignore:
Timestamp:
Aug 14, 2019 8:36:22 PM (5 years ago)
Author:
mmaxfield@apple.com
Message:

[WHLSL] Variables shouldn't be able to have void type
https://bugs.webkit.org/show_bug.cgi?id=200751

Reviewed by Robin Morisset.

Source/WebCore:

Trivial fix. Found by https://github.com/gpuweb/WHLSL/issues/320.

Test: webgpu/whlsl/void-variable-parameter.html

  • Modules/webgpu/WHLSL/WHLSLChecker.cpp:

(WebCore::WHLSL::Checker::visit):

LayoutTests:

  • webgpu/whlsl/void-variable-parameter-expected.txt: Added.
  • webgpu/whlsl/void-variable-parameter.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248695 r248706  
     12019-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [WHLSL] Variables shouldn't be able to have void type
     4        https://bugs.webkit.org/show_bug.cgi?id=200751
     5
     6        Reviewed by Robin Morisset.
     7
     8        * webgpu/whlsl/void-variable-parameter-expected.txt: Added.
     9        * webgpu/whlsl/void-variable-parameter.html: Added.
     10
    1112019-08-14  Zalan Bujtas  <zalan@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r248704 r248706  
     12019-08-14  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [WHLSL] Variables shouldn't be able to have void type
     4        https://bugs.webkit.org/show_bug.cgi?id=200751
     5
     6        Reviewed by Robin Morisset.
     7
     8        Trivial fix. Found by https://github.com/gpuweb/WHLSL/issues/320.
     9
     10        Test: webgpu/whlsl/void-variable-parameter.html
     11
     12        * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
     13        (WebCore::WHLSL::Checker::visit):
     14
    1152019-08-14  Justin Fan  <justin_fan@apple.com>
    216
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp

    r248650 r248706  
    953953    // and that doesn't recurse on the anonymous variables, so we can assume the variable has a type.
    954954    checkErrorAndVisit(*variableDeclaration.type());
     955    if (matches(*variableDeclaration.type(), m_intrinsics.voidType())) {
     956        setError(Error("Variables can't have void type.", variableDeclaration.codeLocation()));
     957        return;
     958    }
    955959    if (variableDeclaration.initializer()) {
    956960        auto& lhsType = *variableDeclaration.type();
Note: See TracChangeset for help on using the changeset viewer.