From 88fd023a06ceb563d1bb3724c04d4d5b9a516b4c 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 cc5057612..be563ed6a 100644 --- a/drivers/gles_common/rasterizer_canvas_batcher.h +++ b/drivers/gles_common/rasterizer_canvas_batcher.h @@ -683,7 +683,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) {