diff options
author | Thomas Lively <tlively@google.com> | 2023-02-27 15:40:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-27 13:40:49 -0800 |
commit | edc278476167b50e3f07bf38d0523707fff749f6 (patch) | |
tree | 0b531cf85a22bc6dbae8b20d9b6278dcae623738 /src/wasm2js.h | |
parent | ca24a2e1fe75a4cd6c64f0c79c618b1c5722cacc (diff) | |
download | binaryen-edc278476167b50e3f07bf38d0523707fff749f6.tar.gz binaryen-edc278476167b50e3f07bf38d0523707fff749f6.tar.bz2 binaryen-edc278476167b50e3f07bf38d0523707fff749f6.zip |
[wasm2js] Fix atomic notify to take an unsigned count (#5525)
Without this fix, the common idiom of using `INT_MAX` in C source to mean an
unlimited number of waiters should be woken up actually compiled down to an
argument of -1 in JS, causing zero waiters to be woken.
Diffstat (limited to 'src/wasm2js.h')
-rw-r--r-- | src/wasm2js.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h index 08969b8ba..45721bd75 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -2135,8 +2135,9 @@ Ref Wasm2JSBuilder::processFunctionBody(Module* m, ValueBuilder::appendToCall( call, ValueBuilder::makePtrShift(makePointer(curr->ptr, curr->offset), 2)); - ValueBuilder::appendToCall(call, - visit(curr->notifyCount, EXPRESSION_RESULT)); + ValueBuilder::appendToCall( + call, + makeSigning(visit(curr->notifyCount, EXPRESSION_RESULT), JS_UNSIGNED)); return call; } |