From 5d52d7dcdf07e5d117e9854af5956b2e93ad3e46 Mon Sep 17 00:00:00 2001 From: Aron Budea Date: Wed, 17 Jan 2024 02:54:34 +1030 Subject: [PATCH] silence use-after-free warning in mdds for gcc12.3 in optimized build Follow-up to e7c4166f1e150b10bc2ac52e93f8ad7503db09dc as GCC 12.3 seems to be affected, too. Change-Id: I8e5ba9be64625ffd21d43e627996a9ea8602ce9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162181 Tested-by: Jenkins Reviewed-by: Aron Budea --- external/mdds/gcc-12-silence-use-after-free.patch.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/mdds/gcc-12-silence-use-after-free.patch.1 b/external/mdds/gcc-12-silence-use-after-free.patch.1 index 3f8dd0afe0f3..94f7ba979e61 100644 --- a/external/mdds/gcc-12-silence-use-after-free.patch.1 +++ b/external/mdds/gcc-12-silence-use-after-free.patch.1 @@ -28,13 +28,13 @@ diff -ur mdds.org/include/mdds/node.hpp mdds/include/mdds/node.hpp { - --p->refcount; - if (!p->refcount) -+#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ < 3 && !defined __clang__ ++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ <= 3 && !defined __clang__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuse-after-free" +#endif + if(--p->refcount == 0) delete p; -+#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ < 3 && !defined __clang__ ++#if defined __GNUC__ && __GNUC__ == 12 && __GNUC_MINOR__ <= 3 && !defined __clang__ +#pragma GCC diagnostic pop +#endif }