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

Emanuel Peter epeter at openjdk.org
Fri Nov 14 15:45:12 UTC 2025


On Fri, 14 Nov 2025 13:24:14 GMT, Vishal Chand <duke at openjdk.org> wrote:

> 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

@vish-chan @shipilev thanks for working on this!

Looks reasonable to me :)

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

PR Review: https://git.openjdk.org/jdk/pull/28323#pullrequestreview-3465517156


More information about the hotspot-compiler-dev mailing list