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: https://github.com/nodejs/node/pull/18898 Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
parent
070a82e82c
commit
ffab6cd505
@ -124,7 +124,7 @@ RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local<Value> wrapper) {
|
||||
CHECK_GT(object->InternalFieldCount(), 0);
|
||||
|
||||
AsyncWrap* wrap = Unwrap<AsyncWrap>(object);
|
||||
CHECK_NE(nullptr, wrap);
|
||||
if (wrap == nullptr) return nullptr; // ClearWrap() already called.
|
||||
|
||||
return new RetainedAsyncInfo(class_id, wrap);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user