SVG path render fails under macOS Darwin M1 aarch64 compiled code with -gh option on. (BGRABitmap v11.6.3)
Analysis:
With "Use Heaptrc unit (-gh)" option on:
In BGRAPath.pas function parseFloat:single (line 2241) returns strange results that doesn't match to the AValue string.
It turned out that val(copy(AValue,numberStart,p-numberStart),result,errPos); doesnt return valid results.
Workaround/Fix:
Disable -gh option.
or/and
Introducing a local string var str:string; in scope of parseFloat that fixes the problem:
str:=copy(AValue,numberStart,p-numberStart);
val(str,result,errPos);
This is likely a FPC issue under Darwin related to the -gh option. Same code compiled for Win64 with -gh on shows no issue. Voting for adding the proposed workaround in code as -gh option is quite common while coding/debugging fpc projects. There might be other similar issues according to this compile scenario. Please review.