]> gcc.gnu.org Git - gcc.git/commit
Disable tree to bool conversion in frange::update_nan.
authorAldy Hernandez <aldyh@redhat.com>
Tue, 11 Oct 2022 17:20:47 +0000 (19:20 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Wed, 12 Oct 2022 06:48:59 +0000 (08:48 +0200)
commit6ce0823721d476cabb2007fecc12c07202325e17
tree741adf98138662f0189da74818e4c9c6a0cfaf3a
parenta901343aa314eb08b362fc6878456d12f96e49b7
Disable tree to bool conversion in frange::update_nan.

We have a set_nan(type) method which can be confused with
update_nan(bool) because of the silent conversion of pointers to bool.
Currently, if you call update_nan(tree), you'll set the possibility of
NAN with a sign of true if tree is non-null.  This is prone to error
and this patch disallows this behavior.

gcc/ChangeLog:

* value-range.cc (frange::set_nonnegative): Pass bool to
update_nan.
* value-range.h: Disallow conversion to bool in update_nan().
gcc/value-range.cc
gcc/value-range.h
This page took 0.062312 seconds and 6 git commands to generate.