Open afonso360 opened 1 year ago
Maybe we should restrict the current lowering to only if the aligned flag is present?
I think that's the most reasonable fix, yeah; and correspondingly, add the aligned
flag when generating these instructions from Wasm atomic ops in cranelift-wasm
, as we guarantee that the heap is aligned with the built-in allocators and I believe the Wasm ops require the address to be naturally aligned wrt the heap base. Support for atomic ops in CLIF without aligned
is then machine-dependent: x86 has them, most other architectures probably don't.
👋 Hey,
Fuzzgen found this on AArch64.
.clif
Test CaseSteps to Reproduce
clif-util test ./the-above.clif
This test does not crash in QEMU, only in a real AArch64 machine.
Expected Results
I would expect this to either pass or fail to compile. According to the docs, the instruction should not be allowed to trap, since it does not have the
aligned
flag.Actual Results
Versions and Environment
Cranelift version or commit: main Operating system: Linux Architecture: AArch64
Extra Info
Maybe we should restrict the current lowering to only if the
aligned
flag is present?