diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-06-11 03:06:32 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-06-11 03:06:32 +0200 |
commit | cb331e69ae60c61d35dd595c71408bc7fb73cca6 (patch) | |
tree | 44e78232b5eddb7ba915527a781f50e234eedd01 | |
parent | 5c27be976a5d2fafc104060a16b21a80aff642b1 (diff) | |
download | bxgen-cb331e69ae60c61d35dd595c71408bc7fb73cca6.zip |
Add asserts
-rwxr-xr-x | bxgen.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -401,16 +401,17 @@ void proc_node_remove(pool_t *pool, i64 proc, i64 node) { proc_t *p = &pool->entities[proc].proc; node_t *n = &pool->entities[node].node; + // TODO + // Implement large entities. + assert(n->index_in_proc != UNDEFINED); + assert(p->nodes[n->index_in_proc] == node); if (n->op == CTRL_RET) { assert(p->ret_index != UNDEFINED); p->ret_index = UNDEFINED; } - // TODO - // Implement large entities. - p->nodes[n->index_in_proc] = UNDEFINED; n->index_in_proc = UNDEFINED; } @@ -462,11 +463,12 @@ void unit_proc_remove(pool_t *pool, i64 unit, i64 proc) { unit_t *u = &pool->entities[unit].unit; proc_t *p = &pool->entities[proc].proc; - assert(p->index_in_unit != UNDEFINED); - // TODO // Implement large entities. + assert(p->index_in_unit != UNDEFINED); + assert(u->procs[p->index_in_unit] == proc); + u->procs[p->index_in_unit] = UNDEFINED; p->index_in_unit = UNDEFINED; } |