assertion left != right failed: AAPCS clobber: ARM instr at wasm line 3 writes
param reg R0 before LocalGet(0) at line 5. Op: Mov { rd: R0, op2: Reg(R8) }.
Sequence:
Push { R4,R5,R6,R7,R8,LR }
I64Const { rdlo: R4, rdhi: R5, value: 0 }
Mov R6, R4
Movw R7, 0
Mov R8, R6
Movw R12, 0
Mov R0, R8 <-- flagged: writes param R0
Movw R1, 0
Pop { R4,R5,R6,R7,R8,PC }
Summary
Separate from #186 (which fixed
encoder_no_panictotality), thei64_lowering_doesnt_clobber_paramsfuzz target reports an AAPCS clobber inselect_with_stacki64 lowering. Pre-existing onmain(the lowering path is untouched by the #180/#184/#186 encoder work).Reproducer
Crash input (Base64):
AAUx1/fX19fX19fX19fX19fX1w==The open question: real clobber or harness false-positive?
The flagged
Mov R0, R8is the return-value placement (R0:R1 = the i64 low:high), at the function epilogue right beforePop. The lowered sequence contains noLocalGet(0)read after it — so the param-0 value, if ever read, is read earlier. The harness (i64_lowering_doesnt_clobber_params.rs:163) flags it because it tracks "first LocalGet(p) at wasm line 5" but the ARM for that LocalGet may be dead/elided (its value dropped), in which case overwriting R0 for the return is legitimate and this is a false-positive in the harness's first-read model.Done when
fuzz/seed_corpus/i64_lowering_doesnt_clobber_params/(the target currently has none, like encoder_no_panic did — see arm encoder: not fuzz-total — arithmetic underflows + empty seed corpus make encoder_no_panic flaky #186).