From 9db4cf23799b4e528d4333db9d7f509d977a0bc4 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Thu, 16 Mar 2023 09:38:50 +0700 Subject: [PATCH] fix(developer): lm compiler handle missing line no in errors Fixes #8443. Will cherry-pick to stable-16.0. The regex for matching error messages has an optional section for the file/line detail (line 54): ```regex ^(?:(.+) \((\d+)\): )? ``` The code that parses the results did not account for this being optional, which would cause a crash if the error message did not include this information. --- .../Keyman.Developer.System.LexicalModelCompile.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas b/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas index c99d7f84c2..a3e07f03b2 100644 --- a/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas +++ b/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas @@ -61,7 +61,7 @@ begin if m.Success then begin msgFilename := m.Groups[1].Value; - msgLine := StrToInt(m.Groups[2].Value); + msgLine := StrToIntDef(m.Groups[2].Value, 0); msgType := m.Groups[3].Value; msgCode := StrToInt('$'+m.Groups[4].Value); msgText := m.Groups[5].Value;