From 5f437e09a017372824a35e8d18c1cb72498edcf1 Mon Sep 17 00:00:00 2001 From: Willis Blackburn Date: Thu, 12 Feb 2026 17:54:58 -0500 Subject: [PATCH] Move AssignIds to before we print the info line in order to ensure that we write the correct file count. --- src/ld65/dbgfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ld65/dbgfile.c b/src/ld65/dbgfile.c index 386706f66..0b6a4d515 100644 --- a/src/ld65/dbgfile.c +++ b/src/ld65/dbgfile.c @@ -113,6 +113,9 @@ void CreateDbgFile (void) /* Output version information */ fprintf (F, "version\tmajor=2,minor=0\n"); + /* Assign the ids to the items: this must occur before info, as it removes unused items */ + AssignIds (); + /* Output a line with the item numbers so the debug info module is able ** to preallocate the required memory. */ @@ -131,9 +134,6 @@ void CreateDbgFile (void) TypeCount () ); - /* Assign the ids to the items */ - AssignIds (); - /* Output high level language symbols */ PrintHLLDbgSyms (F);