sema: fix cppcheck unreadVariable in zirCmpEq
The coerce calls create IP side effects; comparison uses captured lhs_lo/rhs_lo values. Use (void)semaCoerce() to make intent explicit. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1326,8 +1326,10 @@ static AirInstRef zirCmpEq(
|
||||
TypeIndex result_ty
|
||||
= (lhs_ty == IP_INDEX_COMPTIME_INT_TYPE) ? rhs_ty : lhs_ty;
|
||||
if (result_ty != IP_INDEX_COMPTIME_INT_TYPE) {
|
||||
lhs = semaCoerce(sema, block, result_ty, lhs);
|
||||
rhs = semaCoerce(sema, block, result_ty, rhs);
|
||||
// Coerce for IP side effects (creates typed int entries);
|
||||
// comparison uses captured lhs_lo/rhs_lo values.
|
||||
(void)semaCoerce(sema, block, result_ty, lhs);
|
||||
(void)semaCoerce(sema, block, result_ty, rhs);
|
||||
}
|
||||
bool eq = (lhs_lo == rhs_lo && lhs_hi == rhs_hi);
|
||||
return AIR_REF_FROM_IP((eq == (air_tag == AIR_INST_CMP_EQ))
|
||||
|
||||
Reference in New Issue
Block a user