From 338ec3570a685a25bf1a93c3373723af439a2217 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Mon, 12 Oct 2026 15:17:37 +0100 Subject: [PATCH] A message about no place in a file is said without one Compiling a module in a directory that holds another Rt.raz, such as a copy of lib/, crashed: CheckOneModule rightly found Rt twice, but Rt is imported before any file is read, so the message's place named no file and Show read past the files. Show now says such a message as raz: and its kind. Found while listing lib/Str.raz from a copy of lib/. --- diff --git a/src/diag.pas b/src/diag.pas index 92b5706..9480509 100644 --- a/src/diag.pas +++ b/src/diag.pas @@ -175,6 +175,12 @@ procedure Show(const p: TPos; const kind, kindColour, msg: shortstring); var line, start, stop, lo, hi, i, n: longint; buf: PChar; num, gutter: shortstring; begin + if p.f >= numFiles then begin + { about no place in a file, as for Rt, which the compiler imports + before it reads one } + writeln(StdErr, Paint(Bold, 'raz:'), ' ', Paint(kindColour, kind + ':'), ' ', Paint(Bold, msg)); + exit; + end; Locate(p, line, start); buf := files[p.f].buf; writeln(StdErr, Paint(Bold, files[p.f].path + ':' + IntStr(line) + ':'