From c50461528c857a4ef7d97d852014bd8dc1f3cac4 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 6 Mar 2023 13:50:25 +0100 Subject: [PATCH] fixed UB with begin when using fast iteration --- include/boost/unordered/detail/foa.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 63b43ee4..c4d8b56f 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1457,7 +1457,7 @@ public: iterator begin()noexcept { iterator it{arrays.groups,0,arrays.elements}; - if(!(arrays.groups[0].match_occupied()&0x1))++it; + if(arrays.elements&&!(arrays.groups[0].match_occupied()&0x1))++it; return it; }