summaryrefslogtreecommitdiff
path: root/src/boot/efi/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/efi/util.h')
-rw-r--r--src/boot/efi/util.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h
index 40ce98c611..3d659f7043 100644
--- a/src/boot/efi/util.h
+++ b/src/boot/efi/util.h
@@ -27,16 +27,15 @@
#define xnew_alloc(type, n, alloc) \
({ \
UINTN _alloc_size; \
- if (__builtin_mul_overflow(sizeof(type), (n), &_alloc_size)) \
- assert_not_reached(); \
+ assert_se(!__builtin_mul_overflow(sizeof(type), (n), &_alloc_size)); \
(type *) alloc(_alloc_size); \
})
-#define xallocate_pool(size) ASSERT_PTR(AllocatePool(size))
-#define xallocate_zero_pool(size) ASSERT_PTR(AllocateZeroPool(size))
-#define xreallocate_pool(p, old_size, new_size) ASSERT_PTR(ReallocatePool((p), (old_size), (new_size)))
-#define xpool_print(fmt, ...) ((CHAR16 *) ASSERT_PTR(PoolPrint((fmt), ##__VA_ARGS__)))
-#define xstrdup(str) ((CHAR16 *) ASSERT_PTR(StrDuplicate(str)))
+#define xallocate_pool(size) ASSERT_SE_PTR(AllocatePool(size))
+#define xallocate_zero_pool(size) ASSERT_SE_PTR(AllocateZeroPool(size))
+#define xreallocate_pool(p, old_size, new_size) ASSERT_SE_PTR(ReallocatePool((p), (old_size), (new_size)))
+#define xpool_print(fmt, ...) ((CHAR16 *) ASSERT_SE_PTR(PoolPrint((fmt), ##__VA_ARGS__)))
+#define xstrdup(str) ((CHAR16 *) ASSERT_SE_PTR(StrDuplicate(str)))
#define xnew(type, n) xnew_alloc(type, (n), xallocate_pool)
#define xnew0(type, n) xnew_alloc(type, (n), xallocate_zero_pool)