From 186ad018e388045e3bed3c52f6b19f771325ec1b Mon Sep 17 00:00:00 2001 From: Paul Driver Date: Tue, 7 Nov 2017 15:48:22 -0800 Subject: [PATCH] guard for non-presence of mug in _ch_trim_node --- noun/hashtable.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/noun/hashtable.c b/noun/hashtable.c index 5367cb47b..4814afad7 100644 --- a/noun/hashtable.c +++ b/noun/hashtable.c @@ -214,8 +214,13 @@ _ch_trim_node(u3h_root* har_u, u3h_slot* sot_w, c3_w lef_w, c3_w rem_w) lef_w -= 5; bit_w = (rem_w >> lef_w); - rem_w = (rem_w & ((1 << lef_w) - 1)); map_w = han_u->map_w; + + if ( 0 == (map_w & (1 << bit_w)) ) { + return c3n; + } + + rem_w = (rem_w & ((1 << lef_w) - 1)); inx_w = _ch_popcount(map_w & ((1 << bit_w) - 1)); tos_w = &(han_u->sot_w[inx_w]);