Skip to content

fuzz: i64_lowering_doesnt_clobber_params flags Mov R0,R8 as AAPCS clobber — real clobber or harness false-positive? #188

@avrabe

Description

@avrabe

Summary

Separate from #186 (which fixed encoder_no_panic totality), the i64_lowering_doesnt_clobber_params fuzz target reports an AAPCS clobber in select_with_stack i64 lowering. Pre-existing on main (the lowering path is untouched by the #180/#184/#186 encoder work).

Reproducer

Crash input (Base64): AAUx1/fX19fX19fX19fX19fX1w==

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 }

The open question: real clobber or harness false-positive?

The flagged Mov R0, R8 is the return-value placement (R0:R1 = the i64 low:high), at the function epilogue right before Pop. The lowered sequence contains no LocalGet(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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions