Allocations can be conditional; if the condition evaluates to false, we end up calling halide_malloc(0). Since it's legal via spec for malloc(0) to return nullptr, we need to be cautious here: if we are compiling with assertions enabled, and have a malloc() (etc) implementation that returns nullptr for alloc(0), we need to skip the assertion check, since we know the result won't be used... but the assertion would fail because the (ignored) result is null.
NOTE: I've only seen this in the C++ backend; so far, I can't replicate it with LLVM backends.