[Bug sanitizer/79572] [6 Regression] reference binding to null pointer not reported with -fsanitize=undefined

2017-05-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79572

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #16 from Jakub Jelinek  ---
Fixed.

[Bug sanitizer/79572] [6 Regression] reference binding to null pointer not reported with -fsanitize=undefined

2017-05-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79572

--- Comment #15 from Jakub Jelinek  ---
Author: jakub
Date: Fri May  5 21:49:20 2017
New Revision: 247694

URL: https://gcc.gnu.org/viewcvs?rev=247694&root=gcc&view=rev
Log:
Backported from mainline
2017-03-31  Jakub Jelinek  

PR c++/79572
* c-ubsan.h (ubsan_maybe_instrument_reference): Change argument to
tree *.
* c-ubsan.c (ubsan_maybe_instrument_reference): Likewise.  Handle
not just NOP_EXPR to REFERENCE_TYPE, but also INTEGER_CST with
REFERENCE_TYPE.

* cp-gimplify.c (cp_genericize_r): Sanitize INTEGER_CSTs with
REFERENCE_TYPE.  Adjust ubsan_maybe_instrument_reference caller
for NOP_EXPR to REFERENCE_TYPE.

* g++.dg/ubsan/null-8.C: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/ubsan/null-8.C
Modified:
branches/gcc-6-branch/gcc/c-family/ChangeLog
branches/gcc-6-branch/gcc/c-family/c-ubsan.c
branches/gcc-6-branch/gcc/c-family/c-ubsan.h
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/cp-gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug sanitizer/79572] [6 Regression] reference binding to null pointer not reported with -fsanitize=undefined

2017-03-31 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79572

Jakub Jelinek  changed:

   What|Removed |Added

   Assignee|mpolacek at gcc dot gnu.org|jakub at gcc dot gnu.org
Summary|[6/7 Regression] reference  |[6 Regression] reference
   |binding to null pointer not |binding to null pointer not
   |reported with   |reported with
   |-fsanitize=undefined|-fsanitize=undefined

--- Comment #14 from Jakub Jelinek  ---
Fixed on the trunk so far.