From cf2d33ca2ee08c61596ab10b7602500a6931fa31 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 28 Aug 2023 10:14:19 +0000 Subject: [PATCH] 8299658: C1 compilation crashes in LinearScan::resolve_exception_edge Reviewed-by: thartmann, lucy --- src/hotspot/share/c1/c1_LinearScan.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/c1/c1_LinearScan.cpp b/src/hotspot/share/c1/c1_LinearScan.cpp index a2663adacf0..0634d970c26 100644 --- a/src/hotspot/share/c1/c1_LinearScan.cpp +++ b/src/hotspot/share/c1/c1_LinearScan.cpp @@ -1949,6 +1949,14 @@ void LinearScan::resolve_exception_edge(XHandler* handler, int throwing_op_id, i // interval at the throwing instruction must be searched using the operands // of the phi function Value from_value = phi->operand_at(handler->phi_operand()); + if (from_value == nullptr) { + // We have reached here in a kotlin application running with JVMTI + // capability "can_access_local_variables". + // The illegal state is not yet propagated to this phi. Do it here. + phi->make_illegal(); + // We can skip the illegal phi edge. + return; + } // with phi functions it can happen that the same from_value is used in // multiple mappings, so notify move-resolver that this is allowed