Fix NSData initWithBytesNoCopy:length:deallocator:

The previous implementation simply swizzled `NSData` into `NSDataWithDeallocatorBlock`, and forgot to actually assign `bytes` and `length`.
This commit is contained in:
Mads Marquart 2021-10-29 09:17:56 +02:00 committed by GitHub
parent 47480d781a
commit d439847ba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3548,6 +3548,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
}
GSClassSwizzle(self, dataBlock);
bytes = buf;
length = len;
ASSIGN(deallocator, (id)deallocBlock);
return self;
}