summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-06-12 17:06:49 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-06-12 17:06:49 -0400
commitc555750da410272cc454cd5e61403c495231a64c (patch)
tree5a01ef40b93e6737ac206904d2fb80308520bc3d
parent1194d23d65d424e760fa972aa2decc1650497a1b (diff)
block mismatch message
-rw-r--r--types.c15
1 files changed, 14 insertions, 1 deletions
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;