Skip to content

Commit 8773c10

Browse files
bnoordhuisaddaleax
authored andcommitted
src: fix abort when taking a heap snapshot
Remove an erroneous CHECK that asserted the persistent object's internal field pointer still pointed to a valid object. If ClearWrap() has been called, the field pointer equals nullptr and that is expected behavior. PR-URL: nodejs#18898 Fixes: nodejs#18256 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matheus Marchini <matheus@sthima.com>
1 parent f6e2ba4 commit 8773c10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/async_wrap.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local<Value> wrapper) {
128128
CHECK_GT(object->InternalFieldCount(), 0);
129129

130130
AsyncWrap* wrap = Unwrap<AsyncWrap>(object);
131-
CHECK_NE(nullptr, wrap);
131+
if (wrap == nullptr) return nullptr; // ClearWrap() already called.
132132

133133
return new RetainedAsyncInfo(class_id, wrap);
134134
}

0 commit comments

Comments
 (0)