Commit 8f4fcc62 by Derek Mauro Committed by Copybara-Service

InlinedVector: Disable CFI checking during the reinterpret_cast on the

heap allocation path. The cast occurs before the memory is initialized.

See also:
https://clang.llvm.org/docs/ControlFlowIntegrity.html#bad-cast-checking.

PiperOrigin-RevId: 551542366
Change-Id: Id5834892c36a5cb8ec095bcfee3e9e31f20c48ae
parent 4ff6968d
......@@ -1632,6 +1632,13 @@ TEST(DynamicVec, EmplaceBack) {
EXPECT_EQ(v.size(), 1u);
}
TEST(DynamicVec, EmplaceBackAfterHeapAllocation) {
DynamicVec v;
v.reserve(10);
v.emplace_back(Dynamic{});
EXPECT_EQ(v.size(), 1u);
}
TEST(AllocatorSupportTest, Constructors) {
using MyAlloc = CountingAllocator<int>;
using AllocVec = absl::InlinedVector<int, 4, MyAlloc>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment