diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-08-07 17:24:05 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-08-07 21:25:37 +0300 |
commit | 9511261f350bf4791f6edf567a1c68e3ad540722 (patch) | |
tree | 5816c17ef214c43b1b4973f5835cef8bfaa05319 /src/callback_queue-inl.h | |
parent | 014feecc445c7dfc754378f2626cd43ee30a448d (diff) |
src: fix `size` underflow in CallbackQueue
Only decrease the size when actually removing items.
PR-URL: https://github.com/nodejs/node/pull/34662
Fixes: https://github.com/nodejs/node/issues/34657
Refs: https://github.com/nodejs/node/pull/34572
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/callback_queue-inl.h')
-rw-r--r-- | src/callback_queue-inl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/callback_queue-inl.h b/src/callback_queue-inl.h index 13561864027..9e46ae48699 100644 --- a/src/callback_queue-inl.h +++ b/src/callback_queue-inl.h @@ -22,8 +22,8 @@ CallbackQueue<R, Args...>::Shift() { head_ = ret->get_next(); if (!head_) tail_ = nullptr; // The queue is now empty. + size_--; } - size_--; return ret; } |