Title: [248746] trunk
Revision
248746
Author
rmoris...@apple.com
Date
2019-08-15 14:18:11 -0700 (Thu, 15 Aug 2019)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (248745 => 248746)


--- trunk/LayoutTests/ChangeLog	2019-08-15 20:50:02 UTC (rev 248745)
+++ trunk/LayoutTests/ChangeLog	2019-08-15 21:18:11 UTC (rev 248746)
@@ -1,3 +1,12 @@
+2019-08-15  Robin Morisset  <rmoris...@apple.com>
+
+        [WHLSL] Don't accept operator&& or operator|| in the Lexer
+        https://bugs.webkit.org/show_bug.cgi?id=200785
+
+        Reviewed by Saam Barati.
+
+        * webgpu/whlsl/lexing.html:
+
 2019-08-15  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: support `console.screenshot` with detached <canvas>

Modified: trunk/LayoutTests/webgpu/whlsl/lexing.html (248745 => 248746)


--- trunk/LayoutTests/webgpu/whlsl/lexing.html	2019-08-15 20:50:02 UTC (rev 248745)
+++ trunk/LayoutTests/webgpu/whlsl/lexing.html	2019-08-15 21:18:11 UTC (rev 248746)
@@ -155,6 +155,18 @@
             return 42;
         }
     `);
+
+    await checkFail(`
+        int operator&&(int x, int y) {
+            return 42;
+        }
+    `);
+
+    await checkFail(`
+        bool operator||(int x, int y) {
+            return 42;
+        }
+    `);
 };
 
 runTests(whlslTests);

Modified: trunk/Source/WebCore/ChangeLog (248745 => 248746)


--- trunk/Source/WebCore/ChangeLog	2019-08-15 20:50:02 UTC (rev 248745)
+++ trunk/Source/WebCore/ChangeLog	2019-08-15 21:18:11 UTC (rev 248746)
@@ -1,3 +1,17 @@
+2019-08-15  Robin Morisset  <rmoris...@apple.com>
+
+        [WHLSL] Don't accept operator&& or operator|| in the Lexer
+        https://bugs.webkit.org/show_bug.cgi?id=200785
+
+        Reviewed by Saam Barati.
+
+        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):
+
 2019-08-15  Saam Barati  <sbar...@apple.com>
 
         Unreviewed. Debug build fix after r248730.

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLLexer.cpp (248745 => 248746)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLLexer.cpp	2019-08-15 20:50:02 UTC (rev 248745)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLLexer.cpp	2019-08-15 21:18:11 UTC (rev 248746)
@@ -868,9 +868,6 @@
                 if (consume(']'))
                     return token(Token::Type::OperatorName);
                 return token(Token::Type::Invalid);
-            case '&':
-                shift();
-                return token(Token::Type::OperatorName);
             case '.':
                 shift();
                 if (!isValidIdentifierStart(peek()))
@@ -918,7 +915,6 @@
 
         case '|':
             shift();
-            consume('|');
             return token(Token::Type::OperatorName);
 
         case '=':
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to