re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)
authorMarek Polacek <polacek@redhat.com>
Mon, 10 Apr 2017 17:18:15 +0000 (17:18 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Mon, 10 Apr 2017 17:18:15 +0000 (17:18 +0000)
commit98a7a34e26ec1e809712dbbebb0193f2ac545018
treef72e0e27e76d0c06c364498bb0651309c7d8946a
parent46bf3f84b6a117d94ac7479c9e13e05af82d9931
re PR sanitizer/80348 (UBSAN: compile time crash in ubsan_instrument_division)

PR sanitizer/80348
* typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
ORIG_TYPE earlier and not only when shortening.

* g++.dg/ubsan/div-by-zero-3.C: New test.

From-SVN: r246812
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ubsan/div-by-zero-3.C [new file with mode: 0644]