View Issue Details

IDProjectCategoryView StatusLast Update
0038766FPCCompilerpublic2021-04-19 23:37
ReporterChris Rorden Assigned ToJonas Maebe  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMacBook Air Late 2020, M1OSDarwin 
Fixed in Version3.2.2 
Summary0038766: Inline corrupts code an aach64 [[Example in SynEdit caret]]
DescriptionThis issue is described here:
  https://forum.lazarus.freepascal.org/index.php/topic,54155.0.html
Seems specific to Darwin/Cocoa as I do not see this on Linux. Pressing the Tab key at any location in Source Code causes the cursor move to the first line of the file. I think this issue has been present for a while (since at least last December). I have not recompiled Lazarus since than as I was waiting for updates to FPC to fix bugs.
TagsNo tags attached.
Fixed in Revision49236 - 49237
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Trevor Roydhouse

2021-04-18 04:10

reporter   ~0130437

The issue only occurs on my 2020 M1 (ARM64) Mac mini.
- Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 11.2.3 aarch64 Xcode 12.4

It does not occur on my 2018 Intel Mac mini.
- Lazarus 2.1 r65019 FPC 3.3.1 r49223 macOS 10.14.6 Xcode 11.3.1

Dmitry Boyarintsev

2021-04-19 07:29

developer   ~0130446

apparently some problem with inlining in aach64
The patch is attached.

I was unable to replicate the problem on a standalone project. Didn't dig deeper.

Also, I'm using FPC 3.3.1 (non latest trunk). So the issue might be FPC version specific and NOT exist in the official release.
syneditaarch64.diff (604 bytes)   
Index: syneditpointclasses.pas
===================================================================
--- syneditpointclasses.pas	(revision 65023)
+++ syneditpointclasses.pas	(working copy)
@@ -1145,7 +1145,7 @@
 procedure TSynEditCaret.DoLinesEdited(Sender: TSynEditStrings; aLinePos,
   aBytePos, aCount, aLineBrkCnt: Integer; aText: String);
   // Todo: refactor / this is a copy from selection
-  function AdjustPoint(aPoint: Tpoint): TPoint; inline;
+  function AdjustPoint(aPoint: Tpoint): TPoint; {$ifndef cpuaarch64}inline;{$endif}
   begin
     Result := aPoint;
     if aLineBrkCnt < 0 then begin
syneditaarch64.diff (604 bytes)   

Dmitry Boyarintsev

2021-04-19 07:30

developer   ~0130447

With the inline enabled, the "y" field of the Result is set to 0, by the end of the function

Chris Rorden

2021-04-19 23:37

reporter   ~0130459

Thanks! Checked and problem is resolved.

Issue History

Date Modified Username Field Change
2021-04-16 16:45 Chris Rorden New Issue
2021-04-18 04:10 Trevor Roydhouse Note Added: 0130437
2021-04-19 07:29 Dmitry Boyarintsev Note Added: 0130446
2021-04-19 07:29 Dmitry Boyarintsev File Added: syneditaarch64.diff
2021-04-19 07:30 Dmitry Boyarintsev Note Added: 0130447
2021-04-19 17:36 Dmitry Boyarintsev Assigned To => Martin Friebe
2021-04-19 17:36 Dmitry Boyarintsev Status new => assigned
2021-04-19 20:00 Martin Friebe Assigned To Martin Friebe =>
2021-04-19 20:00 Martin Friebe Status assigned => new
2021-04-19 20:00 Martin Friebe Category LCL =>
2021-04-19 20:00 Martin Friebe Build 64999 =>
2021-04-19 20:00 Martin Friebe Summary Tab Press in Source Editor changes selection to top of file => Inline corrupts code an aach64 [[Example in SynEdit caret]]
2021-04-19 20:00 Martin Friebe LazTarget => -
2021-04-19 20:00 Martin Friebe Widgetset Cocoa =>
2021-04-19 20:00 Martin Friebe Project Lazarus => FPC
2021-04-19 20:08 Martin Friebe Category => Compiler
2021-04-19 20:08 Martin Friebe Product Version 2.0.13 (SVN) =>
2021-04-19 20:08 Martin Friebe FPCTarget => -
2021-04-19 22:53 Jonas Maebe Assigned To => Jonas Maebe
2021-04-19 22:53 Jonas Maebe Status new => resolved
2021-04-19 22:53 Jonas Maebe Resolution open => fixed
2021-04-19 22:53 Jonas Maebe Fixed in Version => 3.3.1
2021-04-19 22:53 Jonas Maebe Fixed in Revision => 49236
2021-04-19 22:53 Jonas Maebe FPCTarget - => 3.2.2
2021-04-19 22:53 Jonas Maebe Fixed in Version 3.3.1 => 3.2.2
2021-04-19 22:53 Jonas Maebe Fixed in Revision 49236 => 49236 - 49237
2021-04-19 23:37 Chris Rorden Status resolved => closed
2021-04-19 23:37 Chris Rorden Note Added: 0130459