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:
parent
ec23e5584d
commit
89b009559c
|
@ -163,10 +163,8 @@ static void emit(Program &P, std::vector<char> &Code, const T &Val,
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (!std::is_pointer_v<T>) {
|
if constexpr (!std::is_pointer_v<T>) {
|
||||||
// Construct the value directly into our storage vector.
|
const char *Data = reinterpret_cast<const char *>(&Val);
|
||||||
size_t ValPos = Code.size();
|
Code.insert(Code.end(), Data, Data + Size);
|
||||||
Code.resize(Code.size() + Size);
|
|
||||||
new (Code.data() + ValPos) T(Val);
|
|
||||||
} else {
|
} else {
|
||||||
uint32_t ID = P.getOrCreateNativePointer(Val);
|
uint32_t ID = P.getOrCreateNativePointer(Val);
|
||||||
const char *Data = reinterpret_cast<const char *>(&ID);
|
const char *Data = reinterpret_cast<const char *>(&ID);
|
||||||
|
|
Loading…
Reference in New Issue