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

Marshall Clow mclow.lists at gmail.com
Tue May 6 14:05:03 PDT 2014


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.

— Marshall



-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector_asan1.patch
Type: application/octet-stream
Size: 85642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140506/8f9c5794/attachment.obj>


More information about the cfe-commits mailing list