google / leveldb

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
BSD 3-Clause "New" or "Revised" License
35.71k stars 7.72k forks source link

UB: reinterpret_cast pointer without using launder #1159

Open wineway opened 7 months ago

wineway commented 7 months ago

refer to std::launder, a reinterpret_cast from src ptr of placement new need a launder fence, otherwise it is an undefined behavior