From 82ee97b088695bdc662b3e67dc0ea8b19263128d Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sun, 11 Oct 2026 01:12:15 +0200 Subject: [PATCH] Check for builtin symbols directly, and document why --- src/asm/output.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/asm/output.cpp b/src/asm/output.cpp index 2af5651f..7ed6e6c2 100644 --- a/src/asm/output.cpp +++ b/src/asm/output.cpp @@ -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);