[PATCH] Adding ASAN support for libc++'s vector

Marshall Clow mclow.lists at gmail.com
Tue May 6 14:33:12 PDT 2014


On May 6, 2014, at 2:05 PM, Marshall Clow <mclow.lists at gmail.com> wrote:

> Address sanitizer does not currently check for accesses beyond the end of a vector, but within the memory block managed by the vector.
> 
> For example:
> 	vector<int> v;
>        v.reserve(10); // make space for 10 elements, but vector is still empty
>        cout << v[1]; // access outside the “valid elements” of the vector.
> 
> This patch adds the ability to detect these kinds of errors to libc++ when using Address Sanitizer.
> Thanks to Kostya for most of the code here.

I should mention that this requires a *very recent* ASAN (say, this morning’s).

— Marshall






More information about the cfe-commits mailing list