mattgallagher / CwlPreconditionTesting

A Mach exception handler that allows Swift precondition failures to be caught and tested.
ISC License
175 stars 46 forks source link

arm64 support #24

Closed saagarjha closed 2 years ago

saagarjha commented 2 years ago

On arm64, Swift emits brk instructions instead which SIGTRAP rather than SIGILL. So there's a couple of changes for that, as well as various tweaks: some for correctness, and some to simplify the code.

brennanMKE commented 2 years ago

I've confirmed this is working well for me on an M1 Mac.

I am running these custom assertions for various behaviors to cover all the common fatal errors. Each of the tests are passing.

I have run these tests on Intel and M1 Macs with all tests passing.

mattgallagher commented 2 years ago

I have no way of testing the ARM64 stuff myself but it looks sound and the x86_64 paths still work so I've gone ahead and merged.

rogerluan commented 2 years ago

This is amazing, thank you @saagarjha 🌟

@mattgallagher when can we expect a new release with this feature in? 🙇 😁

rogerluan commented 2 years ago

Oooh I just realized this was merged 6 minutes ago 😆 my bad, no hurry @mattgallagher 😂