Revert "[clang][Interp] Use placement new to construct opcode args into vector"

This reverts commit aaf73ae266.

This breaks sanitized builds because the constructor is called with an
unaligned address.
This commit is contained in:
Timm Bäder 2022-11-30 16:07:52 +01:00
parent ec23e5584d
commit 89b009559c
1 changed files with 2 additions and 4 deletions

View File

@ -163,10 +163,8 @@ static void emit(Program &P, std::vector<char> &Code, const T &Val,
}
if constexpr (!std::is_pointer_v<T>) {
// Construct the value directly into our storage vector.
size_t ValPos = Code.size();
Code.resize(Code.size() + Size);
new (Code.data() + ValPos) T(Val);
const char *Data = reinterpret_cast<const char *>(&Val);
Code.insert(Code.end(), Data, Data + Size);
} else {
uint32_t ID = P.getOrCreateNativePointer(Val);
const char *Data = reinterpret_cast<const char *>(&ID);