RFR: 8323688: C2: Fix UB of jlong overflow in PhaseIdealLoop::is_counted_loop() [v2]

Christian Hagedorn chagedorn at openjdk.org
Tue Sep 3 09:30:32 UTC 2024


On Tue, 3 Sep 2024 08:58:13 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update src/hotspot/share/opto/loopnode.cpp
>>   
>>   Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
>
> src/hotspot/share/opto/loopnode.cpp line 1974:
> 
>> 1972: 
>> 1973:   // Check (vi) and bail out if the stride is too big.
>> 1974:   if (stride_con == min_signed_integer(iv_bt) || ABS(stride_con) > max_signed_integer(iv_bt) / 2) {
> 
> Suggestion:
> 
>   if (stride_con == min_signed_integer(iv_bt) || (ABS(stride_con) > max_signed_integer(iv_bt) / 2)) {

Thanks for the review, good point!

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20828#discussion_r1741735035


More information about the hotspot-compiler-dev mailing list