From 378b79b90c64997b6fded3381bc5fc8443115b64 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 5 Mar 2023 18:50:28 +0100 Subject: [PATCH] Ignore -Warray-bounds compiler warning in JIT The out-of-bounds pointer is intentional. --- ext/opcache/jit/dynasm/dasm_x86.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/opcache/jit/dynasm/dasm_x86.h b/ext/opcache/jit/dynasm/dasm_x86.h index 618925c2d25..098b226b06a 100644 --- a/ext/opcache/jit/dynasm/dasm_x86.h +++ b/ext/opcache/jit/dynasm/dasm_x86.h @@ -124,7 +124,14 @@ void dasm_free(Dst_DECL) void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl) { dasm_State *D = Dst_REF; +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif D->globals = gl - 10; /* Negative bias to compensate for locals. */ +#ifdef __GNUC__ +# pragma GCC diagnostic pop +#endif DASM_M_GROW(Dst, int, D->lglabels, D->lgsize, (10+maxgl)*sizeof(int)); }