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:
Ben Noordhuis 2018-02-21 15:49:47 +01:00 committed by Ruben Bridgewater
parent 070a82e82c
commit ffab6cd505
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -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);
}