RFR: 8371881: C2: Fix potential SEGV in VTransformReductionVectorNode tracing

Vishal Chand duke at openjdk.org
Fri Nov 14 13:48:11 UTC 2025


This PR fixes a potential SEGV and removes dead code:
• **Fix**: Prevent potential SEGV in VTransformReductionVectorNode - [from @shipilev] This fixes a crash in diagnostic code when isa_ReductionVector() unexpectedly returns nullptr. While this indicates the graph is already corrupted, the additional crash in `TRACE_OPTIMIZE` makes debugging harder. The fix adds defensive null checking to prevent the diagnostic crash and improve error handling.

• **Cleanup**: Remove unused first_red variable

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

Commit messages:
 - 8371881: C2: Fix potential SEGV in VTransformReductionVectorNode tracing

Changes: https://git.openjdk.org/jdk/pull/28323/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28323&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371881
  Stats: 6 lines in 1 file changed: 4 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28323.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28323/head:pull/28323

PR: https://git.openjdk.org/jdk/pull/28323


More information about the hotspot-compiler-dev mailing list