Merge branch 'backport-4291-gvariant-analyzer-glib-2-82' into 'glib-2-82'

Backport !4291 “glib/gvariant: Fix check for G_ANALYZER_ANALYZING” to glib-2-82

See merge request GNOME/glib!4306
This commit is contained in:
Michael Catanzaro 2024-09-25 16:08:52 +00:00
commit 41e92f4bdb
2 changed files with 2 additions and 2 deletions

View File

@ -187,7 +187,7 @@ name_unref (Name *name)
* So, until the static analysis improves, or we find some way to restructure
* the code, squash the false positive use-after-free or double-unref warnings
* by making this function a no-op to the static analyser. */
#ifndef G_ANALYZER_ANALYZING
#if !G_ANALYZER_ANALYZING
g_assert (name->refcount > 0);
if (--name->refcount == 0)
{

View File

@ -3504,7 +3504,7 @@ g_variant_builder_init (GVariantBuilder *builder,
g_assert_not_reached ();
}
#ifdef G_ANALYZER_ANALYZING
#if G_ANALYZER_ANALYZING
/* Static analysers cant couple the code in g_variant_builder_init() to the
* code in g_variant_builder_end() by GVariantType, so end up assuming that
* @offset and @children mismatch and that uninitialised memory is accessed