Skip to content

Commit

Permalink
Fix atomic fence encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kg committed Sep 6, 2024
1 parent 5a9b7b7 commit 8de6f60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mono/browser/runtime/jiterpreter-trace-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3977,8 +3977,12 @@ function emit_atomics (
builder: WasmBuilder, ip: MintOpcodePtr, opcode: number
) {
if (opcode === MintOpcode.MINT_MONO_MEMORY_BARRIER) {
if (WasmEnableThreads)
if (WasmEnableThreads) {
builder.appendAtomic(WasmAtomicOpcode.atomic_fence);
// The text format and other parts of the spec say atomic.fence has no operands,
// but the binary encoding requires a dummy zero byte for some reason
builder.appendU8(0);
}
return true;
}

Expand Down

0 comments on commit 8de6f60

Please sign in to comment.