Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: src/futex-emulation.cc

Issue 2659083004: [SAB] Fix crash in Atomics.wake w/ infinite count. (Closed)
Patch Set: fix Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/futex-emulation.h ('k') | src/js/harmony-atomics.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/futex-emulation.cc
diff --git a/src/futex-emulation.cc b/src/futex-emulation.cc
index 9374986cde79fae65be4f6cae423d349353d8dd1..63ad213f8d047d7d1bb6597116efc164ee1d55f5 100644
--- a/src/futex-emulation.cc
+++ b/src/futex-emulation.cc
@@ -188,10 +188,9 @@ Object* FutexEmulation::Wait(Isolate* isolate,
return result;
}
-
Object* FutexEmulation::Wake(Isolate* isolate,
Handle<JSArrayBuffer> array_buffer, size_t addr,
- int num_waiters_to_wake) {
+ uint32_t num_waiters_to_wake) {
DCHECK(addr < NumberToSize(array_buffer->byte_length()));
int waiters_woken = 0;
@@ -203,7 +202,9 @@ Object* FutexEmulation::Wake(Isolate* isolate,
if (backing_store == node->backing_store_ && addr == node->wait_addr_) {
node->waiting_ = false;
node->cond_.NotifyOne();
- --num_waiters_to_wake;
+ if (num_waiters_to_wake != kWakeAll) {
+ --num_waiters_to_wake;
+ }
waiters_woken++;
}
« no previous file with comments | « src/futex-emulation.h ('k') | src/js/harmony-atomics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698