Prefer pre-inc/dec unless post-inc/dec are necessary

This commit is contained in:
Rangi42
2025-07-19 15:04:08 -04:00
parent bf69043a1d
commit 14f5e16ae8
19 changed files with 111 additions and 118 deletions

View File

@@ -545,7 +545,7 @@ Symbol *sym_AddAnonLabel() {
}
std::string anon = sym_MakeAnonLabelName(0, true); // The direction is important!
anonLabelID++;
++anonLabelID;
return addLabel(anon);
}
@@ -565,8 +565,8 @@ std::string sym_MakeAnonLabelName(uint32_t ofs, bool neg) {
id = anonLabelID - ofs;
}
} else {
ofs--; // We're referencing symbols that haven't been created yet...
if (ofs > UINT32_MAX - anonLabelID) {
// We're referencing symbols that haven't been created yet...
if (--ofs > UINT32_MAX - anonLabelID) {
// LCOV_EXCL_START
error(
"Reference to anonymous label %" PRIu32 " after, when only %" PRIu32