about summary refs log tree commit diff
path: root/sysdeps/hppa/fpu/fraiseexcpt.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-11-02 16:19:44 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-12-19 15:12:38 -0300
commitd0829302728954e0abacfc01551c17daf4d61c87 (patch)
tree931ddfa8eee1f5bf55078f807d287773bdb9febe /sysdeps/hppa/fpu/fraiseexcpt.c
parent80a40a9e14d9a01e3f70c5b37ecd1da83033b6de (diff)
downloadglibc-d0829302728954e0abacfc01551c17daf4d61c87.tar.gz
glibc-d0829302728954e0abacfc01551c17daf4d61c87.tar.xz
glibc-d0829302728954e0abacfc01551c17daf4d61c87.zip
hppa: Fix undefined behaviour in feclearexcept (BZ 30983)
The expression

  (excepts & FE_ALL_EXCEPT) << 27

produces a signed integer overflow when 'excepts' is specified as
FE_INVALID (= 0x10), because
  - excepts is of type 'int',
  - FE_ALL_EXCEPT is of type 'int',
  - thus (excepts & FE_ALL_EXCEPT) is (int) 0x10,
  - 'int' is 32 bits wide.

The patched code produces the same instruction sequence as
previosuly.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/hppa/fpu/fraiseexcpt.c')
0 files changed, 0 insertions, 0 deletions