diff options
author | alan-baker <alanbaker@google.com> | 2020-01-23 18:04:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 18:04:21 -0500 |
commit | 6729c4a7ce98bc5d1b6e1d3a36c6c9ccf87d8966 (patch) | |
tree | bdda53a9ef024fc18f9ca79a66f434b69c201dea /source/val/validate_cfg.cpp | |
parent | bb236c326d8ec3ea5810f54640ed6d512fb72ecc (diff) | |
download | SPIRV-Tools-6729c4a7ce98bc5d1b6e1d3a36c6c9ccf87d8966.tar.gz |
Fix structured exit validation (#3141)
Fixes #3139
* If the header of the construct is also a merge block, jump to the
associated header instead of the immediate dominator
* prevents spurious failures from unrelated constructs
* new tests
Diffstat (limited to 'source/val/validate_cfg.cpp')
-rw-r--r-- | source/val/validate_cfg.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/val/validate_cfg.cpp b/source/val/validate_cfg.cpp index 43a6af7e..f3019d17 100644 --- a/source/val/validate_cfg.cpp +++ b/source/val/validate_cfg.cpp @@ -728,10 +728,10 @@ spv_result_t StructuredControlFlowChecks( } Construct::ConstructBlockSet construct_blocks = construct.blocks(function); + std::string construct_name, header_name, exit_name; + std::tie(construct_name, header_name, exit_name) = + ConstructNames(construct.type()); for (auto block : construct_blocks) { - std::string construct_name, header_name, exit_name; - std::tie(construct_name, header_name, exit_name) = - ConstructNames(construct.type()); // Check that all exits from the construct are via structured exits. for (auto succ : *block->successors()) { if (block->reachable() && !construct_blocks.count(succ) && |