Check for builtin symbols directly, and document why

This commit is contained in:
ISSOtm authored and Eldred Habert committed 2026-10-11 03:44:39 +02:00
1 parent bf894bce6f
commit 82ee97b088
1 file changed
+4 -2
+4 -2
View File
@@ -131,8 +131,10 @@ static void writeSymbol(Symbol const &sym, FILE *file) {
}
void out_RegisterSymbol(Symbol &sym) {
// Check for `sym.src`, to skip any built-in symbol from rgbasm
if (sym.src && !sym.isReferenced() && !sym_IsPC(&sym)) {
// Do not re-register already-referenced symbols, since their ID should not change.
// Do not register builtins, since they are designed to be specific to be per-invocation,
// and they should not be accessible to other assembled objects.
if (!sym.isReferenced() && !sym.isBuiltin) {
sym.ID = objectSymbols.size(); // Set the symbol's ID within the object file
objectSymbols.push_back(&sym);
out_RegisterNode(sym.src);