From 54d7b85cabfd97409c20c8426edeada999a2511a Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 29 Sep 2020 12:55:06 -0700 Subject: [PATCH] u3: updates u3i_slab implementation to normalize zero-length allocations to 1 --- pkg/urbit/noun/imprison.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/urbit/noun/imprison.c b/pkg/urbit/noun/imprison.c index 0e1dbfd4c..8277d43e2 100644 --- a/pkg/urbit/noun/imprison.c +++ b/pkg/urbit/noun/imprison.c @@ -119,7 +119,7 @@ u3i_slab_bare(u3i_slab* sab_u, c3_g met_g, c3_d len_d) // if we only need one word, use the static storage in [sab_u] // - if ( 1 == wor_w ) { + if ( (0 == wor_w) || (1 == wor_w) ) { sab_u->_._vat_u = 0; sab_u->buf_w = &sab_u->_._sat_w; sab_u->len_w = 1;