Add check for option to tint::glsl::writer::ASTFuzzer
Fixes: 343600532
Change-Id: I7a320278bc1c68bb90ef919c62a1af09eff7e0ac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/190722
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
diff --git a/src/tint/lang/glsl/writer/writer_ast_fuzz.cc b/src/tint/lang/glsl/writer/writer_ast_fuzz.cc
index 839e466..e555a75 100644
--- a/src/tint/lang/glsl/writer/writer_ast_fuzz.cc
+++ b/src/tint/lang/glsl/writer/writer_ast_fuzz.cc
@@ -43,7 +43,11 @@
// Excessive values can cause OOM / timeouts in the PadStructs transform.
static constexpr uint32_t kMaxOffset = 0x1000;
- if (options.first_instance_offset > kMaxOffset) {
+ if (options.first_instance_offset && options.first_instance_offset > kMaxOffset) {
+ return false;
+ }
+
+ if (options.first_vertex_offset && options.first_vertex_offset > kMaxOffset) {
return false;
}