mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
Currently, in bison's C++ parser template (`lalr.cc`), the `variant<>` struct's `build()` method uses placement-new in the form `new (...) T` to initialize a variant type. However, for POD variant types, this will leave the memory space uninitialized. If we subsequently tries to `::move` into a variant object in such state, the call can trigger clang's undefined behavior sanitizer due to accessing the uninitialized memory. https://lists.gnu.org/archive/html/bison-patches/2018-08/msg00098.html * data/variant.hh (build): Always initialize the stored value. Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
9.8 KiB
9.8 KiB