RFR(S): 8215265: C2: range check elimination may allow illegal out of bound access

Roland Westrelin rwestrel at redhat.com
Wed Dec 19 15:35:50 UTC 2018


Hi Vladimir,

Thanks for looking at this.

> pre_limit = (low_limit - offset - (scale_con - 1)) / scale_con

pre_limit = (low_limit - offset + (scale_con - 1)) / scale_con

to round up?

But then there's a risk of overlow of low_limit - offset + (scale_con -
1).

So it would need to be:

l = (low_limit - offset) / scale_con
pre_limit = l + ((low_limit - offset - l * scale_con) != 0 ? 1 : 0)

That's why I went with always +1 if scale > 1.

Roland.


More information about the hotspot-compiler-dev mailing list