Browse Source

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.
lawnjelly 1 year ago
parent
commit
64ab7488db
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/gles_common/rasterizer_canvas_batcher.h

+ 1 - 1
drivers/gles_common/rasterizer_canvas_batcher.h

@@ -682,7 +682,7 @@ public:
 
 
 			// this should always succeed after growing
 			// this should always succeed after growing
 			batch = bdata.batches.request();
 			batch = bdata.batches.request();
-			RAST_DEBUG_ASSERT(batch);
+			CRASH_COND_MSG(!batch, "Out of memory");
 		}
 		}
 
 
 		if (p_blank) {
 		if (p_blank) {