mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
JDK-8374852: correct comment and make more concise
This commit is contained in:
parent
6808ebe77c
commit
52a3681555
@ -54,11 +54,11 @@ public class TestRangeCheck {
|
||||
// to the `StringCoding::countPositives0` intrinsic.
|
||||
// `countPositives` validates its input using
|
||||
// `Preconditions::checkFromIndexSize`, which also maps to an
|
||||
// intrinsic. When `checkFromIndexSize` is not inlined, C2 does not
|
||||
// know about the explicit range checks, and does not cut off the
|
||||
// dead code. As a result, an invalid value (e.g., `-1`) can be fed
|
||||
// as input into the `countPositives0` intrinsic, got replaced
|
||||
// by TOP, and cause a failure in the matcher.
|
||||
// intrinsic. If `checkFromIndexSize` is not inlined,
|
||||
// C2 lacks knowledge of the explicit range checks, so an invalid
|
||||
// index (e.g., -1) can reach `countPositives0`. The intrinsic then
|
||||
// replaces the out‑of‑range data input with TOP, preserving the
|
||||
// control flow, which leads to a matcher failure.
|
||||
return JLA.countPositives(bytes, -1, 42);
|
||||
} catch (Exception e) {
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user