mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-03 18:55:39 +00:00
Remove the ICE check for expression behaviors always being either `{Next}` or `{Next, Discard}`. Unreachable code may be result in something else. Add the RemoveUnreachableStatements transform to the SPIR-V writer sanitizer transform list. The writer cannot correctly handle unreachable statements. Bug: tint:1369 Bug: chromium:1285622 Change-Id: I9fa54c6d2096b1ee633dd551b628c7dd3ba64fb5 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/76300 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
23 lines
376 B
HLSL
23 lines
376 B
HLSL
bug/tint/1369.wgsl:3:3 warning: code is unreachable
|
|
return true;
|
|
^^^^^^
|
|
|
|
bug/tint/1369.wgsl:9:9 warning: code is unreachable
|
|
var also_unreachable : bool;
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
bool call_discard() {
|
|
if (true) {
|
|
discard;
|
|
return true;
|
|
}
|
|
bool unused;
|
|
return unused;
|
|
}
|
|
|
|
void f() {
|
|
bool v = call_discard();
|
|
bool also_unreachable = false;
|
|
return;
|
|
}
|