aboutsummaryrefslogtreecommitdiff
path: root/src/node_process_methods.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-16 13:54:22 +0100
committerAnna Henningsen <anna@addaleax.net>2019-02-20 16:49:02 +0100
commit49a2e406329269af2bf55c0ad51560bdf1f14b7f (patch)
tree23b4e1a6e302140ca1b1bad863f68cadf5c688dd /src/node_process_methods.cc
parentfab06681236994c3ac77a1f259373fb9731ed6f7 (diff)
downloadandroid-node-v8-49a2e406329269af2bf55c0ad51560bdf1f14b7f.tar.gz
android-node-v8-49a2e406329269af2bf55c0ad51560bdf1f14b7f.tar.bz2
android-node-v8-49a2e406329269af2bf55c0ad51560bdf1f14b7f.zip
src: move req_wrap_queue to base class of ReqWrap
Introduce a second base class for `ReqWrap` that does not depend on a template parameter and move the `req_wrap_queue_` field to it. This addresses undefined behaviour that occurs when casting to `ReqWrap<uv_req_t>` in the `ReqWrap` constructor. Refs: https://github.com/nodejs/node/issues/26131 PR-URL: https://github.com/nodejs/node/pull/26148 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_process_methods.cc')
-rw-r--r--src/node_process_methods.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc
index 80027c26eb..ca8a435805 100644
--- a/src/node_process_methods.cc
+++ b/src/node_process_methods.cc
@@ -252,7 +252,8 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
std::vector<Local<Value>> request_v;
- for (auto w : *env->req_wrap_queue()) {
+ for (ReqWrapBase* req_wrap : *env->req_wrap_queue()) {
+ AsyncWrap* w = req_wrap->GetAsyncWrap();
if (w->persistent().IsEmpty())
continue;
request_v.push_back(w->GetOwner());