aarch64-win64: fix try...finally+exit (Bounty Boss), add CI
aarch64-win64: fix try...finally+exit (Bounty Boss)
Fixes the try...finally+exit behaviour on Windows ARM64 so the finally block runs when leaving via exit (or break/continue). Addresses forum topic 66952 (Reply #67) and GitLab #40203.
Summary
-
Compiler (
compiler/aarch64/cgcpu.pas): For aarch64-win64,g_local_unwindnow emits a call to_FPC_local_unwind(RtlUnwindEx) instead of a plain jump when leaving a try block via exit/break/continue. -
Compiler (
compiler/symtable.pas): Case-insensitive fallback for_fpc_local_unwindinsearch_system_procso user compilations find the RTL procedure. -
Compiler (
compiler/fppu.pas): Addsymconstto uses for symtable dependency. -
RTL (
rtl/win64/system.pp,rtl/win64/seh64.inc): Declare and implement_fpc_local_unwindviaRtlUnwindEx(minimal; no debug code).
Test
Minimal test (Bounty Boss): begin → try → exit → finally → end. Success criterion: output contains finally when run on Windows ARM64.
- Test source: generated in CI (workflow creates arm64trap.pas and compiles it).
- CI:
.github/workflows/win-arm64.ymlcross-builds on Linux and runs the test onwindows-11-arm; the "Run Bounty Boss test" step prints the test code and confirms execution on Windows ARM64. Job passes when output contains "finally". -
CI proof (passing run): Windows arm64 workflow run — cross-build + Bounty Boss test on
windows-11-arm(Success).
Scope
This MR does not include native ppca64 (compiler self-compilation on ARM64) or other phases—only the try...finally+exit fix and the CI that demonstrates it. Change set is minimal: no debug code; test sources generated in workflow.
Forum: https://forum.lazarus.freepascal.org/index.php?topic=66952.0