[PATCH] D12970: SmallVector fix for use-after-dtor bug.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 15:13:20 PDT 2015


eugenis added a comment.

The problem is this:
SmallVectorTemplateCommon only has space for the first element of the vector; the rest of the space is provided by SmallVector and used by effectively overflowing the field SmallVectorTemplateCommon. Sanitizers are OK with it because the memory is, in fact, allocated.

Use-after-destroy detector complains about ~SmallVectorTemplateCommon accessing memory that belongs to SmallVector (the destructor for that has already ran at the point) when calling destructors for individual vector elements in destroy_range.


http://reviews.llvm.org/D12970





More information about the llvm-commits mailing list