Allow integer literals as addresses in instrumented builtins.
gcc/ PR sanitizer/59029 * gcc/asan.c (get_mem_refs_of_builtin_call): Allow integer literals as addresses in instrumented builtins. gcc-testsuite/ PR sanitizer/59029 * c-c++-common/asan/pr59029.c: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r204508
This commit is contained in:
parent
acf67b8e7c
commit
77e83307fe
@ -1,3 +1,10 @@
|
||||
2013-11-07 Yury Gribov <y.gribov@samsung.com>
|
||||
Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR sanitizer/59029
|
||||
* gcc/asan.c (get_mem_refs_of_builtin_call): Allow
|
||||
integer literals as addresses in instrumented builtins.
|
||||
|
||||
2013-11-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
* config/aarch64/aarch64.c (aarch64_legitimize_reload_address):
|
||||
|
@ -715,7 +715,7 @@ get_mem_refs_of_builtin_call (const gimple call,
|
||||
instrument_derefs. */
|
||||
if (TREE_CODE (dest) == ADDR_EXPR)
|
||||
dest = TREE_OPERAND (dest, 0);
|
||||
else if (TREE_CODE (dest) == SSA_NAME)
|
||||
else if (TREE_CODE (dest) == SSA_NAME || TREE_CODE (dest) == INTEGER_CST)
|
||||
dest = build2 (MEM_REF, TREE_TYPE (TREE_TYPE (dest)),
|
||||
dest, build_int_cst (TREE_TYPE (dest), 0));
|
||||
else
|
||||
|
@ -1,3 +1,9 @@
|
||||
2013-11-07 Yury Gribov <y.gribov@samsung.com>
|
||||
Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR sanitizer/59029
|
||||
* c-c++-common/asan/pr59029.c: New test.
|
||||
|
||||
2013-11-07 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR target/59034
|
||||
|
7
gcc/testsuite/c-c++-common/asan/pr59029.c
Normal file
7
gcc/testsuite/c-c++-common/asan/pr59029.c
Normal file
@ -0,0 +1,7 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
int
|
||||
foo ()
|
||||
{
|
||||
return __sync_fetch_and_add ((int *) 0, 1);
|
||||
}
|
Loading…
Reference in New Issue
Block a user