forked from OSchip/llvm-project
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>) {
|
||||
// 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);
|
||||
|
|
Loading…
Reference in New Issue