Parents: #483, #484, #485 Related: #626, #493
Problem
Current Zig dev.1818 allows the Linux x86-64 executable-memory fixture to reach generated-code execution, where it deterministically segfaults. The byte sequence documented as mov eax, 42; ret contains an extra zero byte between the 32-bit immediate and ret: b8 2a 00 00 00 00 c3. x86 decodes the trailing 00 c3 as another instruction rather than ret, so execution falls beyond the emitted body. CI run 32338430544 reproduces the crash at address 0x2a.
Scope
- Encode the exact six-byte
mov eax, imm32; retsequence. - Preserve the RW -> RX publication boundary and immutable-after-publication contract.
- Validate the fixture on x86_64 Linux under the current Zig toolchain and retain the AArch64 control.
No-workaround rules
- No skipping Linux/x86-64, disabling executable-memory tests, catching the signal, padding into a coincidental return, or weakening W^X.
Acceptance
- The exact dev.1818 x86_64 Linux fixture returns 42 without a signal.
- Executable-memory/W^X focused tests and full units pass.
- CI advances beyond the generated-code fixture; no Test262 behavior change is claimed.
Security boundary
Generated bytes are an executable control-flow boundary. Instruction encodings and used lengths must be exact; falling through into padding or adjacent memory is never acceptable.