diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-16 13:54:22 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-20 16:49:02 +0100 |
commit | 49a2e406329269af2bf55c0ad51560bdf1f14b7f (patch) | |
tree | 23b4e1a6e302140ca1b1bad863f68cadf5c688dd /src/node_process_methods.cc | |
parent | fab06681236994c3ac77a1f259373fb9731ed6f7 (diff) | |
download | android-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.cc | 3 |
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()); |