Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-08-07 17:24:05 +0300
committerJames M Snell <jasnell@gmail.com>2020-08-07 21:25:37 +0300
commit9511261f350bf4791f6edf567a1c68e3ad540722 (patch)
tree5816c17ef214c43b1b4973f5835cef8bfaa05319 /src/callback_queue-inl.h
parent014feecc445c7dfc754378f2626cd43ee30a448d (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.h2
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;
}