resolver: Fix for ICE: node not reached by the resolver
More of a workaround. Will be properly fixed by tint:724 . Fixed: tint:728 Change-Id: If4887a781106010d12209365f36f27b493a9f173 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48422 Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
parent
83116d298c
commit
5b3d88b748
|
@ -207,10 +207,14 @@ bool Resolver::ResolveInternal() {
|
|||
|
||||
for (auto* node : builder_->ASTNodes().Objects()) {
|
||||
if (marked_.count(node) == 0) {
|
||||
if (node->Is<ast::AccessDecoration>()) {
|
||||
// These are generated by the WGSL parser, used to build
|
||||
// sem::AccessControls and then leaked.
|
||||
// Once we introduce AST types, this should be fixed.
|
||||
if (node->IsAnyOf<ast::AccessDecoration, ast::StrideDecoration>()) {
|
||||
// TODO(crbug.com/tint/724) - Remove once tint:724 is complete.
|
||||
// ast::AccessDecorations are generated by the WGSL parser, used to
|
||||
// build sem::AccessControls and then leaked.
|
||||
// ast::StrideDecoration are used to build a sem::ArrayTypes, but
|
||||
// multiple arrays of the same stride, size and element type are
|
||||
// currently de-duplicated by the type manager, and we leak these
|
||||
// decorations.
|
||||
continue;
|
||||
}
|
||||
TINT_ICE(diagnostics_) << "AST node '" << node->TypeInfo().name
|
||||
|
|
|
@ -1626,6 +1626,13 @@ TEST_F(ResolverTest, Function_EntryPoints_LinearTime) {
|
|||
ASSERT_TRUE(r()->Resolve()) << r()->error();
|
||||
}
|
||||
|
||||
// Test for crbug.com/tint/728
|
||||
TEST_F(ResolverTest, ASTNodesAreReached) {
|
||||
Structure("A", {Member("x", ty.array<f32, 4>(4))});
|
||||
Structure("B", {Member("x", ty.array<f32, 4>(4))});
|
||||
ASSERT_TRUE(r()->Resolve()) << r()->error();
|
||||
}
|
||||
|
||||
TEST_F(ResolverTest, ASTNodeNotReached) {
|
||||
EXPECT_FATAL_FAILURE(
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue