Skip to content

wasm2c: fix errors in atomic ops implementation - #2784

Merged
shravanrn merged 1 commit into
WebAssembly:mainfrom
UT-Security:atomicops-fixes
Jul 3, 2026
Merged

shravanrn merged 1 commit into
WebAssembly:mainfrom
UT-Security:atomicops-fixes

Conversation

@shravanrn

@shravanrn shravanrn commented Jul 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes two bugs in the wasm2c atomics implementation

  • The Wasm spec requires DEFINE_ATOMIC_RMW to return the value prior to modification.
  • The Wasm spec requires DEFINE_ATOMIC_CMP_XCHG to return the value read if the compare fails.

All spec tests continue to pass after these changes.

@shravanrn
shravanrn requested review from keithw and sbc100 July 3, 2026 02:31
@shravanrn shravanrn changed the title wasm2c: fix minor errors in atomic ops implementation wasm2c: fix errors in atomic ops implementation Jul 3, 2026

@sbc100 sbc100 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is not good test coverage for multi-threading in the spec tests?

@shravanrn

Copy link
Copy Markdown
Collaborator Author

I guess there is not good test coverage for multi-threading in the spec tests?

Yup, looks like it. I just rechecked the latest test suite upstream and they aren't any changes from what we have (modulo features we don't support).

@shravanrn
shravanrn enabled auto-merge (rebase) July 3, 2026 21:05
@shravanrn
shravanrn merged commit 58cf9ff into WebAssembly:main Jul 3, 2026
17 checks passed
@shravanrn
shravanrn deleted the atomicops-fixes branch July 3, 2026 21:52
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.

2 participants