diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-06 02:53:13 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-10 16:22:35 -0600 |
commit | 9bdda7728a2aabe294567f816f5bfa0e031c1e90 (patch) | |
tree | 006fe0ff1fdbfde139b22d090496c72d704b0a64 | |
parent | f2c306d42abf44b99101b07989d48d68bdbd142e (diff) |
Add more assert()s
-rw-r--r-- | cmd/sbc_harness/main.c | 1 | ||||
-rw-r--r-- | lib9p/tables.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/cmd/sbc_harness/main.c b/cmd/sbc_harness/main.c index 25b122c..7765ca8 100644 --- a/cmd/sbc_harness/main.c +++ b/cmd/sbc_harness/main.c @@ -234,4 +234,5 @@ int main() { infof("==================================================================="); coroutine_add("init", init_cr, NULL); coroutine_main(); + assert_notreached("all coroutines exited"); } diff --git a/lib9p/tables.c b/lib9p/tables.c index 271b17b..68b960e 100644 --- a/lib9p/tables.c +++ b/lib9p/tables.c @@ -96,6 +96,7 @@ void _lib9p_unmarshal(const struct _lib9p_recv_tentry xxx_table[LIB9P_VER_NUM][0 enum lib9p_msg_type typ = net_bytes[4]; *ret_typ = typ; struct _lib9p_recv_tentry tentry = xxx_table[ctx->version][typ/2]; + assert(tentry.unmarshal); tentry.unmarshal(ctx, net_bytes, ret_body); } @@ -124,8 +125,9 @@ bool _lib9p_marshal(const struct _lib9p_send_tentry xxx_table[LIB9P_VER_NUM][0x8 .net_copied_size = 0, .net_copied = ret_copied, }; - struct _lib9p_send_tentry tentry = xxx_table[ctx->version][typ/2]; + assert(tentry.marshal); + bool ret_erred = tentry.marshal(ctx, body, &ret); if (ret_iov[ret.net_iov_cnt-1].iov_len == 0) ret.net_iov_cnt--; |