From 64ab7488dbb58f561d8bf378af5dac32e88aad7f Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 11 Dec 2023 17:45:30 +0000 Subject: [PATCH] Workaround GCC warning in `rasterizer_canvas_batcher` `-Werror=array-bounds` flags when creating a new batch, possibly due to the possibility of the malloc failing (out of memory). This PR adds an explicit `CRASHNOW` in the hope the compiler will recognise this case is not intended to be recoverable. --- drivers/gles_common/rasterizer_canvas_batcher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles_common/rasterizer_canvas_batcher.h b/drivers/gles_common/rasterizer_canvas_batcher.h index d6229286547..4e9f59cba98 100644 --- a/drivers/gles_common/rasterizer_canvas_batcher.h +++ b/drivers/gles_common/rasterizer_canvas_batcher.h @@ -682,7 +682,7 @@ public: // this should always succeed after growing batch = bdata.batches.request(); - RAST_DEBUG_ASSERT(batch); + CRASH_COND_MSG(!batch, "Out of memory"); } if (p_blank) {