diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-16 15:54:22 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-20 18:49:02 +0300 |
commit | 49a2e406329269af2bf55c0ad51560bdf1f14b7f (patch) | |
tree | 23b4e1a6e302140ca1b1bad863f68cadf5c688dd /src/node_postmortem_metadata.cc | |
parent | fab06681236994c3ac77a1f259373fb9731ed6f7 (diff) |
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_postmortem_metadata.cc')
-rw-r--r-- | src/node_postmortem_metadata.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/node_postmortem_metadata.cc b/src/node_postmortem_metadata.cc index 527bfb623e6..05800f79b09 100644 --- a/src/node_postmortem_metadata.cc +++ b/src/node_postmortem_metadata.cc @@ -28,15 +28,14 @@ V(Environment_HandleWrapQueue, head_, ListNode_HandleWrap, \ Environment::HandleWrapQueue::head_) \ V(ListNode_HandleWrap, next_, uintptr_t, ListNode<HandleWrap>::next_) \ - V(ReqWrap, req_wrap_queue_, ListNode_ReqWrapQueue, \ - ReqWrap<uv_req_t>::req_wrap_queue_) \ V(Environment_ReqWrapQueue, head_, ListNode_ReqWrapQueue, \ Environment::ReqWrapQueue::head_) \ - V(ListNode_ReqWrap, next_, uintptr_t, ListNode<ReqWrap<uv_req_t>>::next_) + V(ListNode_ReqWrap, next_, uintptr_t, ListNode<ReqWrapBase>::next_) extern "C" { int nodedbg_const_ContextEmbedderIndex__kEnvironment__int; uintptr_t nodedbg_offset_ExternalString__data__uintptr_t; +uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue; #define V(Class, Member, Type, Accessor) \ NODE_EXTERN uintptr_t NODEDBG_OFFSET(Class, Member, Type); @@ -51,6 +50,9 @@ int GenDebugSymbols() { ContextEmbedderIndex::kEnvironment; nodedbg_offset_ExternalString__data__uintptr_t = NODE_OFF_EXTSTR_DATA; + nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue = + OffsetOf<ListNode<ReqWrapBase>, ReqWrap<uv_req_t>>( + &ReqWrap<uv_req_t>::req_wrap_queue_); #define V(Class, Member, Type, Accessor) \ NODEDBG_OFFSET(Class, Member, Type) = OffsetOf(&Accessor); |