]> git.ipfire.org Git - thirdparty/gcc.git/commit
[asan] Fix for PR asan/56330
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Feb 2013 09:32:56 +0000 (09:32 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Feb 2013 09:32:56 +0000 (09:32 +0000)
commitd9dc05a18a24f4096a08dd3866da04d1abaf7c1a
tree8d20d0d3ec1ed8a33b52873e900b4acbeff14e5c
parent5fcbca6b321a23646e3202399ca2dafa824425db
[asan] Fix for PR asan/56330

gcc/
* asan.c (get_mem_refs_of_builtin_call): White space and style
cleanup.
(instrument_mem_region_access): Do not forget to always put
instrumentation of the of 'base' and 'base + len' in a "if (len !=
0) statement, even for cases where either 'base' or 'base + len'
are not instrumented -- because they have been previously
instrumented.  Simplify the logic by putting all the statements
instrument 'base + len' inside a sequence, and then insert that
sequence right before the current insertion point.  Then, to
instrument 'base + len', just get an iterator on that statement.
And do not forget to update the pointer to iterator the function
received as argument.

gcc/testsuite/

* c-c++-common/asan/no-redundant-instrumentation-4.c: New test file.
* c-c++-common/asan/no-redundant-instrumentation-5.c: Likewise.
* c-c++-common/asan/no-redundant-instrumentation-6.c: Likewise.
* c-c++-common/asan/no-redundant-instrumentation-7.c: Likewise.
* c-c++-common/asan/no-redundant-instrumentation-8.c: Likewise.
* c-c++-common/asan/pr56330.c: Likewise.
* c-c++-common/asan/no-redundant-instrumentation-1.c (test1):
Ensure the size argument of __builtin_memcpy is a constant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196102 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/asan.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-1.c
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-4.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-5.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-6.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-7.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-8.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/asan/pr56330.c [new file with mode: 0644]