From edc278476167b50e3f07bf38d0523707fff749f6 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Mon, 27 Feb 2023 15:40:49 -0600 Subject: [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. --- src/wasm2js.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3