validation: Reject decorations on local variables These are never valid. The WGSL parser cannot produce them, but the SPIR-V reader can since these are not always caught by spirv-val. Fixed: chromium:1239557 Change-Id: Ie19e4534ffb73b61beaa42046b18b2b8a3f7f65b Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62020 Auto-Submit: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com> Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
diff --git a/src/resolver/resolver.cc b/src/resolver/resolver.cc index be8e45a..3eb9629 100644 --- a/src/resolver/resolver.cc +++ b/src/resolver/resolver.cc
@@ -3366,8 +3366,11 @@ } for (auto* deco : var->decorations()) { - // TODO(bclayton): Validate decorations Mark(deco); + if (!deco->Is<ast::InternalDecoration>()) { + AddError("decorations are not valid on local variables", deco->source()); + return false; + } } variable_stack_.set(var->symbol(), info);