Fix -Wunreachable-code-loop-increment warning (#5373)

This commit is contained in:
Ryan Harrison 2023-08-10 15:41:20 -04:00 committed by GitHub
parent 8714d7fad2
commit d6300ee92b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,9 +98,9 @@ spv_result_t spvOperandTableValueLookup(spv_target_env,
// Assumes the underlying table is already sorted ascendingly according to
// opcode value.
for (auto it = std::lower_bound(beg, end, needle, comp);
it != end && it->value == value; ++it) {
// We consider the current operand as available as long as
auto it = std::lower_bound(beg, end, needle, comp);
if (it != end && it->value == value) {
// The current operand is considered available as long as
// it is in the grammar. It might not be *valid* to use,
// but that should be checked by the validator, not by parsing.
*pEntry = it;