diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-06-12 17:06:49 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-06-12 17:06:49 -0400 |
commit | c555750da410272cc454cd5e61403c495231a64c (patch) | |
tree | 5a01ef40b93e6737ac206904d2fb80308520bc3d | |
parent | 1194d23d65d424e760fa972aa2decc1650497a1b (diff) |
block mismatch message
-rw-r--r-- | types.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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; |