Use std::variant and automatic allocation for file stack node data

This commit is contained in:
Rangi42
2024-02-28 13:49:12 -05:00
committed by Sylvie
parent e1ac51d7da
commit 0cc49782ab
4 changed files with 54 additions and 38 deletions

View File

@@ -299,7 +299,7 @@ void sdobj_ReadFile(struct FileStackNode const *where, FILE *file, std::vector<s
strerror(errno));
// If the section is absolute, its name might not be unique; thus, mangle the name
if (curSection->modifier == SECTION_NORMAL) {
curSection->name->append(*where->name);
curSection->name->append(where->name());
curSection->name->append(" ");
}
curSection->name->append(sectionName);
@@ -363,7 +363,7 @@ void sdobj_ReadFile(struct FileStackNode const *where, FILE *file, std::vector<s
struct Symbol &symbol = fileSymbols.emplace_back();
// Init other members
symbol.objFileName = where->name->c_str();
symbol.objFileName = where->name().c_str();
symbol.src = where;
symbol.lineNo = lineNo;