Commit a4771dbd by Derek Mauro Committed by Copybara-Service

InlinedVector: Disable CFI checking on the const GetInlinedData() path

as well. Some empty cases can trigger this.

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

PiperOrigin-RevId: 552846765
Change-Id: I6adb3c0c73efec841ffe8fdac4342f641c68ddbe
parent 22091f4c
......@@ -1639,6 +1639,12 @@ TEST(DynamicVec, EmplaceBackAfterHeapAllocation) {
EXPECT_EQ(v.size(), 1u);
}
TEST(DynamicVec, EmptyIteratorComparison) {
DynamicVec v;
EXPECT_EQ(v.begin(), v.end());
EXPECT_EQ(v.cbegin(), v.cend());
}
TEST(AllocatorSupportTest, Constructors) {
using MyAlloc = CountingAllocator<int>;
using AllocVec = absl::InlinedVector<int, 4, MyAlloc>;
......
......@@ -400,7 +400,7 @@ class Storage {
return reinterpret_cast<Pointer<A>>(data_.inlined.inlined_data);
}
ConstPointer<A> GetInlinedData() const {
ABSL_ATTRIBUTE_NO_SANITIZE_CFI ConstPointer<A> GetInlinedData() const {
return reinterpret_cast<ConstPointer<A>>(data_.inlined.inlined_data);
}
......
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