Fixed DSLParser error uncovered by ossfuzz
Missed one more case of Optional<Wrapper<Expression>>. This should be the last one. Bug: oss-fuzz:38944 Change-Id: Ic7f790cd99e2a3ee1c3874cc767a4702265d1723 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450476 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
parent
3d9c73c100
commit
f62934b85a
@ -108,6 +108,7 @@ sksl_error_tests = [
|
||||
"/sksl/errors/Ossfuzz38140.sksl",
|
||||
"/sksl/errors/Ossfuzz38560.sksl",
|
||||
"/sksl/errors/Ossfuzz38865.sksl",
|
||||
"/sksl/errors/Ossfuzz38944.sksl",
|
||||
"/sksl/errors/OverflowFloatLiteral.sksl",
|
||||
"/sksl/errors/OverflowIntLiteral.sksl",
|
||||
"/sksl/errors/OverflowInt64Literal.sksl",
|
||||
|
1
resources/sksl/errors/Ossfuzz38944.sksl
Normal file
1
resources/sksl/errors/Ossfuzz38944.sksl
Normal file
@ -0,0 +1 @@
|
||||
int a = log(
|
@ -1666,11 +1666,11 @@ DSLExpression DSLParser::suffix(DSLExpression base) {
|
||||
ExpressionArray args;
|
||||
if (this->peek().fKind != Token::Kind::TK_RPAREN) {
|
||||
for (;;) {
|
||||
skstd::optional<DSLWrapper<DSLExpression>> expr = this->assignmentExpression();
|
||||
if (!expr) {
|
||||
DSLExpression expr = this->assignmentExpression();
|
||||
if (!expr.hasValue()) {
|
||||
return {};
|
||||
}
|
||||
args.push_back((**expr).release());
|
||||
args.push_back(expr.release());
|
||||
if (!this->checkNext(Token::Kind::TK_COMMA)) {
|
||||
break;
|
||||
}
|
||||
|
5
tests/sksl/errors/Ossfuzz38944.glsl
Normal file
5
tests/sksl/errors/Ossfuzz38944.glsl
Normal file
@ -0,0 +1,5 @@
|
||||
### Compilation failed:
|
||||
|
||||
error: 1: expected expression, but found ''
|
||||
error: 1: expected ';', but found ''
|
||||
2 errors
|
Loading…
Reference in New Issue
Block a user