From e8202669a9b0f7cec6af3bffe89711beae7d729a Mon Sep 17 00:00:00 2001 From: Abit Date: Tue, 6 Feb 2024 18:48:31 +0100 Subject: [PATCH] Revert "Avoid potential corruption during unpack of static_variant" --- include/fc/io/raw.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index 6e385832..4fa6076b 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -889,9 +889,8 @@ namespace fc { --_max_depth; unsigned_int w; fc::raw::unpack( s, w, _max_depth ); - static_variant helper( static_cast::tag_type>(w.value) ); - helper.visit( unpack_static_variant( s, _max_depth ) ); - sv = helper; + sv.set_which(w.value); + sv.visit( unpack_static_variant( s, _max_depth ) ); } } } // namespace fc::raw