RFR: 8346931: Replace divisions by zero in sharedRuntimeTrans.cpp [v5]
Martin Doerr
mdoerr at openjdk.org
Wed Mar 26 10:16:25 UTC 2025
On Tue, 25 Mar 2025 08:32:03 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> There are a few divisions by zero in sharedRuntimeTrans.cpp, used to "construct" NaN and -infinity. This should probably be replaced by using functionality from std::numeric_limits .
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>
> adjust check
LGTM.
src/hotspot/share/runtime/sharedRuntimeTrans.cpp line 129:
> 127: if (((hx&0x7fffffff)|lx)==0)
> 128: return -std::numeric_limits<double>::infinity(); /* log(+-0)=-inf */
> 129: if (hx<0) return std::numeric_limits<double>::quiet_NaN(); /* log(-#) = NaN */
Maybe improve the indentation of the comments?
src/hotspot/share/runtime/sharedRuntimeTrans.cpp line 225:
> 223: if (((hx&0x7fffffff)|lx)==0)
> 224: return -std::numeric_limits<double>::infinity(); /* log(+-0)=-inf */
> 225: if (hx<0) return std::numeric_limits<double>::quiet_NaN(); /* log(-#) = NaN */
Same here.
-------------
Marked as reviewed by mdoerr (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24136#pullrequestreview-2716583280
PR Review Comment: https://git.openjdk.org/jdk/pull/24136#discussion_r2013803844
PR Review Comment: https://git.openjdk.org/jdk/pull/24136#discussion_r2013804225
More information about the hotspot-dev
mailing list