Adversarial review of A.0 found two silent-wrong defects reachable via the public atomic_load/atomic_store intrinsics (raw LLVM verifier errors, not clean sx diagnostics) + a latent alignment fallback. All fixed: - scalar-kind allowlist (call.zig): the size-only T guard admitted same-sized aggregates ([8]u8, 8-byte structs) -> invalid 'load atomic [8 x i8]'. Now an allowlist switch (integer/float/bool/pointer/enum/vector) rejects loudly. - per-op ordering validity (call.zig): load cannot release/acq_rel, store cannot acquire/acq_rel -> loud diagnostic instead of invalid LLVM. - val_ty align fallback (ops.zig): the 'else .i64' (align 8) default would over-align a sub-8 store -> now bails loudly on a missing val_ty. Locked by examples 1130 (non-scalar) + 1131 (bad ordering). Suite green (713/0).
6 lines
251 B
Plaintext
6 lines
251 B
Plaintext
error: atomic load ordering cannot be .release or .acq_rel (use .relaxed / .acquire / .seq_cst)
|
|
--> examples/1131-diagnostics-atomic-bad-ordering.sx:8:31
|
|
|
|
|
8 | x := atomic_load(i64, @n, .release);
|
|
| ^^^^^^^^
|