fixed SkSL parser unary expression recursion depth limit

Bug: 892506
Change-Id: I244532ee80617dd5f0bbdd2184ccec7325a219f2
Reviewed-on: https://skia-review.googlesource.com/c/193584
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
Ethan Nicholas 2019-02-20 15:18:36 -05:00 committed by Skia Commit-Bot
parent 435a95ef55
commit 6dcc325f35

View File

@ -1816,6 +1816,10 @@ std::unique_ptr<ASTExpression> Parser::unaryExpression() {
case Token::BITWISENOT: // fall through
case Token::PLUSPLUS: // fall through
case Token::MINUSMINUS: {
AutoDepth depth(this);
if (!depth.checkValid()) {
return nullptr;
}
Token t = this->nextToken();
std::unique_ptr<ASTExpression> expr = this->unaryExpression();
if (!expr) {