tint/msl: Avoid cloning a built-in struct

This prevents us from crashing when a module-scope private variable
has an inferred type that is a built-in struct. We instead fail to
resolve the generated code.

Bug: chromium:1430309
Change-Id: I71c6eacf28096380227ed1043821ecc3d33ffb40
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/129140
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price 2023-04-25 18:15:40 +00:00 committed by Dawn LUCI CQ
parent 99a0ded622
commit a41693babb
1 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,11 @@ struct ModuleScopeVarToEntryPointParam::State {
return;
}
if (!str->Declaration()) {
// The struct is a built-in structure that we do not need to declare.
return;
}
// Recurse into members.
for (auto* member : str->Members()) {
CloneStructTypes(member->Type());