summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2019-04-22 08:31:22 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2019-05-17 21:48:36 +0200
commit9baf218f724afde6f6ec76b2968b171ef73b9dd6 (patch)
tree40ebf7a19dd24ebeb885063d74f3f39143b7e8aa
parent5305c2d9f94124c8d4928fab44c53e6ccec5a2e9 (diff)
Assert that currently no object is being built when calling allocate_ast_zero().
-rw-r--r--src/ast/ast_t.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ast/ast_t.h b/src/ast/ast_t.h
index ce4201a..86f41c1 100644
--- a/src/ast/ast_t.h
+++ b/src/ast/ast_t.h
@@ -634,6 +634,7 @@ struct translation_unit_t {
*/
static inline void *allocate_ast_zero(size_t size)
{
+ assert(obstack_object_size(&ast_obstack) == 0);
return memset(obstack_alloc(&ast_obstack, size), 0, size);
}