From 08a18cdaf95bcf46df851d15d09bfc3737f3fe2b Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 29 Mar 2024 13:12:42 -0700 Subject: Report timeout in interpretation of AtomicWait (#6452) To avoid slow-running fuzz cases, we report a host limit when interpreting atomic.wait with any non-zero timeout. However, in the allowed case where the timeout is zero, we were incorrectly interpreting the wait as returning 0, meaning that it was woken up, instead of 2, meaning that the timeout expired. Fix it to return 2. --- src/wasm-interpreter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 8da80afc9..8db33de74 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -3398,7 +3398,7 @@ public: if (timeout.getSingleValue().getInteger() != 0) { hostLimit("threads support"); } - return Literal(int32_t(0)); // equal + return Literal(int32_t(2)); // Timed out } Flow visitAtomicNotify(AtomicNotify* curr) { NOTE_ENTER("AtomicNotify"); -- cgit v1.2.3