From c28177cd57c99865bbf18e73008ba6fb11f73a2e Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 20 Dec 2023 09:17:19 -0800 Subject: [PATCH] RJIT: Print an error message first Creating a backtrace can crash if RJIT is triggered by branch_stub_hit. In that case, it's useful to at least print the error message. --- lib/ruby_vm/rjit/compiler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ruby_vm/rjit/compiler.rb b/lib/ruby_vm/rjit/compiler.rb index 2c4e1d67cf0e4c..964814460bf4c3 100644 --- a/lib/ruby_vm/rjit/compiler.rb +++ b/lib/ruby_vm/rjit/compiler.rb @@ -67,7 +67,8 @@ def compile(iseq, cfp) compile_block(asm, jit:, pc:) iseq.body.jit_entry = @cb.write(asm) rescue Exception => e - $stderr.puts e.full_message + $stderr.puts "#{e.class}: #{e.message}" + $stderr.puts e.backtrace exit 1 end