We've got some code that tries to eliminate unused allocations by inspecting their uses. Unfortunately one of the uses it checks is an icmp, where the code currently assumes that an allocation will never return nullptr. This isn't correct. Most obviously out of memory errors are signalled by nullptr on many systems, but even when the kernel is willing to oversubscribe physical RAM malloc will return nullptr for a large enough single request.
In fact, I believe only certain variants of the C++ operator new never return nullptr (because they throw in error cases). So this patch limits that particular icmp check to the cases where the allocation function is known to be safe.