From 2a04243de7170e4ec67077ce895ef11c2d8067a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 25 Jun 2016 11:05:07 +0200 Subject: [PATCH] Add safety assertion --- include/boost/container/string.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index af85853..c25512a 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -234,6 +234,7 @@ class basic_string_base //Access and copy (to avoid UB) the first byte of the union to know if the //active representation is short or long short_header hdr; + BOOST_STATIC_ASSERT((sizeof(short_header) == 1)); *(unsigned char*)&hdr = *(unsigned char*)&this->members_.m_repr; return hdr.is_short != 0; }