From c555750da410272cc454cd5e61403c495231a64c Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 12 Jun 2020 17:06:49 -0400 Subject: block mismatch message --- types.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/types.c b/types.c index 17ed62c..e850554 100644 --- a/types.c +++ b/types.c @@ -2963,7 +2963,20 @@ static Status types_block(Typer *tr, Block *b) { continue; } } - assert(tr->block == b); +#ifdef TOC_DEBUG + if (tr->block != b) { + printf(TEXT_ERR_START "Block mismatch." TEXT_ERR_END " After typing block:\n"); + print_location(b->where); + printf("tr->block is:"); + if (tr->block) { + printf(" (null)\n"); + } else { + printf("\n"); + print_location(tr->block->where); + } + assert(0); + } +#endif typer_block_exit(tr); b->flags |= BLOCK_FOUND_TYPES; b->flags &= (BlockFlags)~(BlockFlags)BLOCK_FINDING_TYPES; -- cgit v1.2.3