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

Changeset 248746 in webkit


Ignore:
Timestamp:
Aug 15, 2019, 2:18:11 PM (7 years ago)
Author:
rmorisset@apple.com
Message:
[WHLSL] Don't accept operator&& or operator
in the Lexer

https://bugs.webkit.org/show_bug.cgi?id=200785

Reviewed by Saam Barati.

Source/WebCore:

Implementing && or
as function calls would lose us short-circuiting.

2 new tests in LayoutTests/webgpu/whlsl/lexing.html

  • Modules/webgpu/WHLSL/WHLSLLexer.cpp:

(WebCore::WHLSL::Lexer::consumeTokenFromStream):

LayoutTests:

  • webgpu/whlsl/lexing.html:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248736 r248746  
     12019-08-15  Robin Morisset  <rmorisset@apple.com>
     2
     3        [WHLSL] Don't accept operator&& or operator|| in the Lexer
     4        https://bugs.webkit.org/show_bug.cgi?id=200785
     5
     6        Reviewed by Saam Barati.
     7
     8        * webgpu/whlsl/lexing.html:
     9
    1102019-08-15  Devin Rousso  <drousso@apple.com>
    211
  • trunk/LayoutTests/webgpu/whlsl/lexing.html

    r248658 r248746  
    156156        }
    157157    `);
     158
     159    await checkFail(`
     160        int operator&&(int x, int y) {
     161            return 42;
     162        }
     163    `);
     164
     165    await checkFail(`
     166        bool operator||(int x, int y) {
     167            return 42;
     168        }
     169    `);
    158170};
    159171
  • trunk/Source/WebCore/ChangeLog

    r248740 r248746  
     12019-08-15  Robin Morisset  <rmorisset@apple.com>
     2
     3        [WHLSL] Don't accept operator&& or operator|| in the Lexer
     4        https://bugs.webkit.org/show_bug.cgi?id=200785
     5
     6        Reviewed by Saam Barati.
     7
     8        Implementing && or || as function calls would lose us short-circuiting.
     9
     10        2 new tests in LayoutTests/webgpu/whlsl/lexing.html
     11
     12        * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
     13        (WebCore::WHLSL::Lexer::consumeTokenFromStream):
     14
    1152019-08-15  Saam Barati  <sbarati@apple.com>
    216
  • trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLLexer.cpp

    r248658 r248746  
    869869                    return token(Token::Type::OperatorName);
    870870                return token(Token::Type::Invalid);
    871             case '&':
    872                 shift();
    873                 return token(Token::Type::OperatorName);
    874871            case '.':
    875872                shift();
     
    919916        case '|':
    920917            shift();
    921             consume('|');
    922918            return token(Token::Type::OperatorName);
    923919
Note: See TracChangeset for help on using the changeset viewer.