diff --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/openmp/libomptarget/DeviceRTL/src/State.cpp --- a/openmp/libomptarget/DeviceRTL/src/State.cpp +++ b/openmp/libomptarget/DeviceRTL/src/State.cpp @@ -162,7 +162,9 @@ } void *memory::allocGlobal(uint64_t Bytes, const char *Reason) { - return malloc(Bytes); + void *Ptr = malloc(Bytes); + ASSERT(Ptr != nullptr && "Nullptr returned by malloc!"); + return Ptr; } void memory::freeGlobal(void *Ptr, const char *Reason) { free(Ptr); }