From 60a514f73de00c42c6219c7c13add573636a0800 Mon Sep 17 00:00:00 2001 From: Robbin Ehn Date: Fri, 12 Apr 2024 08:44:54 +0200 Subject: [PATCH] Check far call --- src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp index 15fb841f4e5cc..7c59da329458f 100644 --- a/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp +++ b/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp @@ -3195,6 +3195,7 @@ void MacroAssembler::far_call(const Address &entry, Register tmp) { // We can use auipc + jalr here because we know that the total size of // the code cache cannot exceed 2Gb. relocate(entry.rspec(), [&] { + assert(in_range_auipc_12bit(entry.target() - pc()), "Far call using wrong instructions."); call(entry.target(), tmp); }); }