aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-04-05 11:02:46 +0200
committerRichard Biener <rguenther@suse.de>2024-05-03 13:26:27 +0200
commita2e9032deaf9dbcff329d650f61e36c6a5aa1fc4 (patch)
treec924e063d7b45a9ffc0043eb8219ae49070b0855
parentc5245c869f0468ddb67c6d996219bd443610673c (diff)
downloadgcc-a2e9032deaf9dbcff329d650f61e36c6a5aa1fc4.zip
gcc-a2e9032deaf9dbcff329d650f61e36c6a5aa1fc4.tar.gz
gcc-a2e9032deaf9dbcff329d650f61e36c6a5aa1fc4.tar.bz2
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.
-rw-r--r--gcc/bitmap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc
index 459e32c..0905cde 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;