Skip to content

SVG Path render fails under macOS Darwin M1 aarch64 with "Use Heaptrc unit on (-gh)" - solution provided #261

@accSone

Description

@accSone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions