Skip to content

Fix missing implicitTrap for ArrayRMW and ArrayCmpxchg#8328

Open
sumleo wants to merge 1 commit intoWebAssembly:mainfrom
sumleo:fix-array-atomic-implicit-trap
Open

Fix missing implicitTrap for ArrayRMW and ArrayCmpxchg#8328
sumleo wants to merge 1 commit intoWebAssembly:mainfrom
sumleo:fix-array-atomic-implicit-trap

Conversation

@sumleo
Copy link
Contributor

@sumleo sumleo commented Feb 16, 2026

Summary

  • visitArrayRMW and visitArrayCmpxchg in EffectAnalyzer only set implicitTrap when the array reference is nullable, missing the out-of-bounds index case.
  • All other indexed array operations (ArrayGet, ArraySet, ArrayCopy, ArrayFill, ArrayInitData, ArrayInitElem) correctly set implicitTrap unconditionally.
  • Changed both to set implicitTrap = true unconditionally, matching the pattern of other array operations.

Test plan

  • All existing unit tests pass (309/309).
  • The fix is a minimal change aligning ArrayRMW/ArrayCmpxchg with the existing pattern used by all other array operations.

ArrayRMW and ArrayCmpxchg only set implicitTrap when the array reference
is nullable, but they should set it unconditionally because an out-of-bounds
index also traps. All other indexed array operations (ArrayGet, ArraySet,
ArrayCopy, ArrayFill, ArrayInitData, ArrayInitElem) correctly set
implicitTrap unconditionally for OOB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant