From 1913fc9d3b4389dcbffa1aae84a8a35de28aac81 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 7 Apr 2020 12:54:59 +0000 Subject: [PATCH] Handle fallthrough, kill and nop in type determination. These statements have no expressions to determine so they just return true. Bug: tint:5 Change-Id: I639bce9c254c12357ac3a1d2a9cfaaee437716c0 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/18833 Reviewed-by: David Neto --- src/type_determiner.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/type_determiner.cc b/src/type_determiner.cc index 8cc2b8b41d..ae65ea8929 100644 --- a/src/type_determiner.cc +++ b/src/type_determiner.cc @@ -96,6 +96,15 @@ bool TypeDeterminer::DetermineResultType(ast::Statement* stmt) { return DetermineResultType(e->condition()) && DetermineResultType(e->body()); } + if (stmt->IsFallthrough()) { + return true; + } + if (stmt->IsKill()) { + return true; + } + if (stmt->IsNop()) { + return true; + } error_ = "unknown statement type for type determination"; return false;