diff options
author | David Neto <dneto@google.com> | 2021-10-28 15:57:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 15:57:36 -0400 |
commit | 2feb7074d412c0679dc73403f93a9778838200da (patch) | |
tree | 55df9c88e048562ecee295dec703cf475fe30b5a /source/val/validate_cfg.cpp | |
parent | 7c5b17d379f2b2eb218c80df8aa8881b468ba802 (diff) | |
download | SPIRV-Tools-2feb7074d412c0679dc73403f93a9778838200da.tar.gz |
Avoid confusing short-circuiting (#3404)
When checking the OpBranchConditional for selection headers,
we intend to register both the true and false targets.
Short circuiting was getting in the way.
Co-authored-by: Steven Perron <stevenperron@google.com>
Diffstat (limited to 'source/val/validate_cfg.cpp')
-rw-r--r-- | source/val/validate_cfg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/val/validate_cfg.cpp b/source/val/validate_cfg.cpp index f08ab19f..c8e26fc1 100644 --- a/source/val/validate_cfg.cpp +++ b/source/val/validate_cfg.cpp @@ -660,7 +660,7 @@ spv_result_t ValidateStructuredSelections( // was missing a merge instruction and both labels hadn't been seen // previously. const bool both_unseen = - seen.insert(true_label).second && seen.insert(false_label).second; + seen.insert(true_label).second & seen.insert(false_label).second; if (!merge && both_unseen) { return _.diag(SPV_ERROR_INVALID_CFG, terminator) << "Selection must be structured"; |