File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ class MemoryAllocator {
217
217
#define ET_TRY_ALLOCATE_OR (memory_allocator__, nbytes__, ...) \
218
218
({ \
219
219
void * et_try_allocate_result = memory_allocator__->allocate (nbytes__); \
220
- if (et_try_allocate_result == nullptr ) { \
220
+ if (et_try_allocate_result == nullptr && nbytes__ > 0 ) { \
221
221
__VA_ARGS__ \
222
222
/* The args must return. */ \
223
223
__ET_UNREACHABLE (); \
@@ -272,7 +272,7 @@ class MemoryAllocator {
272
272
({ \
273
273
type__* et_try_allocate_result = \
274
274
memory_allocator__->allocateList <type__>(nelem__); \
275
- if (et_try_allocate_result == nullptr ) { \
275
+ if (et_try_allocate_result == nullptr && nelem__ > 0 ) { \
276
276
__VA_ARGS__ \
277
277
/* The args must return. */ \
278
278
__ET_UNREACHABLE (); \
You can’t perform that action at this time.
0 commit comments