From 3e522af26e545cc244b6ff9e5f32611eec0b6b71 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Mon, 16 Mar 2020 06:22:27 -0400 Subject: [PATCH 1/2] src: replace handle dereference with ContainerOf this was influenced by https://github.com/nodejs/node/pull/32269 --- src/process_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 1e7de56c6d1581..e7bd21fbad6398 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -292,7 +292,7 @@ class ProcessWrap : public HandleWrap { static void OnExit(uv_process_t* handle, int64_t exit_status, int term_signal) { - ProcessWrap* wrap = static_cast(handle->data); + ProcessWrap* wrap = ContainerOf(&ProcessWrap::process_, handle); CHECK_NOT_NULL(wrap); CHECK_EQ(&wrap->process_, handle); From c8dbd57b5038dbdfa0b5643c863d190142b53b6f Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Mon, 16 Mar 2020 07:15:42 -0400 Subject: [PATCH 2/2] fixup: address review comment --- src/process_wrap.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/process_wrap.cc b/src/process_wrap.cc index e7bd21fbad6398..3d1065c9922183 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -293,7 +293,6 @@ class ProcessWrap : public HandleWrap { int64_t exit_status, int term_signal) { ProcessWrap* wrap = ContainerOf(&ProcessWrap::process_, handle); - CHECK_NOT_NULL(wrap); CHECK_EQ(&wrap->process_, handle); Environment* env = wrap->env();