From: Richard Biener Date: Fri, 5 Apr 2024 09:02:46 +0000 (+0200) Subject: Add default bitmap obstack allocation check X-Git-Tag: basepoints/gcc-16~9423 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2e9032deaf9dbcff329d650f61e36c6a5aa1fc4;p=thirdparty%2Fgcc.git Add default bitmap obstack allocation check The following adds a check that the global bitmap obstack is initialized when allocating a bitmap from it. * bitmap.cc (bitmap_alloc): When using the global bitmap obstack assert that is initialized. --- diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc index 459e32c1ad1..0905cde696f 100644 --- a/gcc/bitmap.cc +++ b/gcc/bitmap.cc @@ -781,7 +781,10 @@ bitmap_alloc (bitmap_obstack *bit_obstack MEM_STAT_DECL) bitmap map; if (!bit_obstack) - bit_obstack = &bitmap_default_obstack; + { + gcc_assert (bitmap_default_obstack_depth > 0); + bit_obstack = &bitmap_default_obstack; + } map = bit_obstack->heads; if (map) bit_obstack->heads = (class bitmap_head *) map->first;