tc39 / proposal-atomics-wait-async

"asynchronous atomic wait" for ECMAScript
https://tc39.github.io/proposal-atomics-wait-async/
Other
89 stars 18 forks source link

CancelAlarm may be called with falsy "alarm" value and assert #9

Closed lars-t-hansen closed 5 years ago

lars-t-hansen commented 5 years ago

Context: 1.11. In the case where we wait without a timeout, the alarm variable will be false when we call Suspend(). When we are subsequently woken by a notify, the syncresult will still be "ok". Thus we will call CancelAlarm on the falsy alarm value, and that will assert. I think the call to CancelAlarm needs a guard that alarm is truthy.

syg commented 5 years ago

Good catch, will fix.