From c6e1f6c0194dd5feb2354822c0e32127863b6b87 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 13 Jun 2022 19:11:03 -0700 Subject: [PATCH] ircd::json: Fix reinterpret cast into ctrl_tab; cond uninit warning. --- ircd/json.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ircd/json.cc b/ircd/json.cc index 6e45e5699..44fd5e3a6 100644 --- a/ircd/json.cc +++ b/ircd/json.cc @@ -3708,8 +3708,17 @@ ircd::json::string_stringify(u8x16 &block, // Control character case if(is_ctrl[0]) { - const u8 idx{block[0]}; - block = *reinterpret_cast(ctrl_tab + idx); + static const auto tab + { + reinterpret_cast(ctrl_tab) + }; + + const u8 idx + { + block[0] + }; + + block = tab[idx]; return u64x2 { u64(ctrl_tab_len[idx]), 1 @@ -4097,7 +4106,7 @@ ircd::json::lookup_ctrl_tab_len(const u8x16 in) { in[k++], in[k++], in[k++], in[k++] }, }; - u8x16 ret; + u8x16 ret{0}; i32x4 res[4]; for(k = 0, i = 0; i < 4; ++i) for(j = 0; j < 4; ++j)