Support CFRelease() on TFBed objects even without Foundation

See https://github.com/darlinghq/darling-security/pull/3
This commit is contained in:
Sergey Bugaev 2020-04-16 11:02:13 +03:00
parent 4809c095d9
commit 2cbfb0348f

View File

@ -1697,7 +1697,11 @@ static void _CFRelease(CFTypeRef cf) {
}
{
Boolean isValidObjCObject = ((CFRuntimeBase *) cf)->_cfisa != 0;
Boolean isValidObjCObject = false;
if (((CFRuntimeBase *) cf)->_cfisa) {
Class class = object_getClass(cf);
isValidObjCObject = !_class_isFutureClass(class);
}
if (isValidObjCObject) {
if (__CFZombieEnabled) {
[(id)cf dealloc];