summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-03-29 13:12:42 -0700
committerGitHub <noreply@github.com>2024-03-29 13:12:42 -0700
commit08a18cdaf95bcf46df851d15d09bfc3737f3fe2b (patch)
tree18010dad170d8b3890047292de3e98827a023a1d /src
parentb10d59d1d201506eba1aaba035e699fec849ea60 (diff)
downloadbinaryen-08a18cdaf95bcf46df851d15d09bfc3737f3fe2b.tar.gz
binaryen-08a18cdaf95bcf46df851d15d09bfc3737f3fe2b.tar.bz2
binaryen-08a18cdaf95bcf46df851d15d09bfc3737f3fe2b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/wasm-interpreter.h2
1 files changed, 1 insertions, 1 deletions
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");