Skip to content

Commit

Permalink
[WGSL] Check for recursion depth in lhs expression
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268459
rdar://121520440

Reviewed by Mike Wyrzykowski.

We have recursion depth checks in expressions and statements, but lhs expressions
(e.g. *****x = ...) can recurse without going through either of those.

* Source/WebGPU/WGSL/Parser.cpp:
(WGSL::Parser<Lexer>::parseLHSExpression):

Canonical link: https://commits.webkit.org/273914@main
  • Loading branch information
tadeuzagallo committed Feb 1, 2024
1 parent 24f491a commit 7504fac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/WebGPU/WGSL/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1763,6 +1763,8 @@ Result<AST::Expression::Ref> Parser<Lexer>::parseLHSExpression()
START_PARSE();

if (current().type == TokenType::And || current().type == TokenType::Star) {
CHECK_RECURSION();

auto op = toUnaryOperation(current());
consume();
PARSE(expression, LHSExpression);
Expand Down

0 comments on commit 7504fac

Please sign in to comment.