Fix UBSan static initializer sanitization 60/94860/2
authorSlava Barinov <v.barinov@samsung.com>
Mon, 24 Oct 2016 15:00:12 +0000 (18:00 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 16 Nov 2016 04:46:15 +0000 (20:46 -0800)
commit156fbb7fedd1ce059862d8c6259b7e6ec118cddc
treeb99e5b06df3edfa9ab61601bc536e1b3d2093dda
parentc154cbb654836f06646db4c36a695059e9821953
Fix UBSan static initializer sanitization

PR sanitizer/66190
* cp-gimplify.c (struct cp_genericize_data): Add no_sanitize_p.
(cp_genericize_r): Don't instrument static initializers.
(cp_genericize_tree): Initialize wtd.no_sanitize_p.

* g++.dg/ubsan/static-init-1.C: New test.
* g++.dg/ubsan/static-init-2.C: New test.
* g++.dg/ubsan/static-init-3.C: New test.

upstream hash: d120fa25444c859c1c1d8104a72820bf6d0851c7
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224096 138bc75d-0d04-0410-961f-82ee72b054a4

Authored-by: mpolacek
Change-Id: I9306d036380140291faa2000fd08d9cf60120ee6
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
gcc/cp/cp-gimplify.c
gcc/testsuite/g++.dg/ubsan/static-init-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/static-init-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ubsan/static-init-3.C [new file with mode: 0644]