> Le 24 août 2018 à 19:35, Jiahao Li <[email protected]> a écrit :
> 
> 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.
> 
> This attached patch changes the code to use the `new (...) T ()` form (note 
> the parentheses at the end) instead, so that the memory space will be 
> zero-initialized.

Thanks a lot!  Installed.

Reply via email to