⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245844 in webkit


Ignore:
Timestamp:
May 28, 2019, 9:13:53 PM (7 years ago)
Author:
sbarati@apple.com
Message:

[WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type
https://bugs.webkit.org/show_bug.cgi?id=198321

Reviewed by Myles C. Maxfield.

Source/WebCore:

Consider this program:
`
thread int* x;
*x = 42
`

In the Checker, we were saying the type of "*x" was "int*" instead of "int".

Test: webgpu/whlsl-dereference-pointer-should-type-check.html

  • Modules/webgpu/WHLSL/WHLSLChecker.cpp:

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

LayoutTests:

  • webgpu/whlsl-dereference-pointer-should-type-check-expected.html: Added.
  • webgpu/whlsl-dereference-pointer-should-type-check.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245838 r245844  
     12019-05-28  Saam Barati  <sbarati@apple.com>
     2
     3        [WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type
     4        https://bugs.webkit.org/show_bug.cgi?id=198321
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        * webgpu/whlsl-dereference-pointer-should-type-check-expected.html: Added.
     9        * webgpu/whlsl-dereference-pointer-should-type-check.html: Added.
     10
    1112019-05-28  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r245839 r245844  
     12019-05-28  Saam Barati  <sbarati@apple.com>
     2
     3        [WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type
     4        https://bugs.webkit.org/show_bug.cgi?id=198321
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        Consider this program:
     9        ```
     10        thread int* x;
     11        *x = 42
     12        ```
     13       
     14        In the Checker, we were saying the type of "*x" was "int*" instead of "int".
     15
     16        Test: webgpu/whlsl-dereference-pointer-should-type-check.html
     17
     18        * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
     19        (WebCore::WHLSL::Checker::visit):
     20
    1212019-05-28  Wenson Hsieh  <wenson_hsieh@apple.com>
    222
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp

    r245745 r245844  
    898898    }
    899899
    900     assignType(dereferenceExpression, pointerType->clone(), AST::LeftValue { pointerType->addressSpace() });
     900    assignType(dereferenceExpression, pointerType->elementType().clone(), AST::LeftValue { pointerType->addressSpace() });
    901901}
    902902
Note: See TracChangeset for help on using the changeset viewer.