Avoid using std::get except in holds_alternative-asserting accessors

This commit is contained in:
Rangi42
2024-03-03 23:33:23 -05:00
parent 13904dc536
commit f2c875e71e
6 changed files with 23 additions and 8 deletions

View File

@@ -340,11 +340,11 @@ static void readSection(FILE *file, Section &section, char const *fileName,
static void linkSymToSect(Symbol &symbol, Section &section)
{
uint32_t a = 0, b = section.symbols.size();
int32_t symbolOffset = std::get<Label>(symbol.data).offset;
int32_t symbolOffset = symbol.label().offset;
while (a != b) {
uint32_t c = (a + b) / 2;
int32_t otherOffset = std::get<Label>(section.symbols[c]->data).offset;
int32_t otherOffset = section.symbols[c]->label().offset;
if (otherOffset > symbolOffset)
b = c;