diff --git a/src/ca65/error.c b/src/ca65/error.c index 38195d669..69446b3fc 100644 --- a/src/ca65/error.c +++ b/src/ca65/error.c @@ -144,7 +144,7 @@ static void AddNotifications (const Collection* LineInfos) break; case LI_TYPE_EXT: - Msg = "Assembler code generated from this line"; + Msg = "Assembly code generated from this line"; break; case LI_TYPE_MACRO: diff --git a/src/ca65/lineinfo.c b/src/ca65/lineinfo.c index 92fecec58..e6707dac4 100644 --- a/src/ca65/lineinfo.c +++ b/src/ca65/lineinfo.c @@ -368,6 +368,14 @@ void NewAsmLine (void) /* Start a new line using the current line info */ AsmLineInfo = StartLine (&CurTok.Pos, LI_TYPE_ASM, 0); + + /* If the first LineInfo in the list came from a .dbg line, then we want + ** errors and warnings to show it as an additional note, not as the primary + ** line. Therefore, swap the first two LineInfo items. + */ + if (GetLineInfoType (CollAtUnchecked (&CurLineInfo, 0)) == LI_TYPE_EXT) { + CollMove (&CurLineInfo, 1, 0); + } }