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.
This commit is contained in:
Takashi Kokubun 2023-12-20 09:17:19 -08:00
parent fac7d2c1ab
commit c28177cd57

View File

@ -67,7 +67,8 @@ module RubyVM::RJIT
compile_block(asm, jit:, pc:) compile_block(asm, jit:, pc:)
iseq.body.jit_entry = @cb.write(asm) iseq.body.jit_entry = @cb.write(asm)
rescue Exception => e rescue Exception => e
$stderr.puts e.full_message $stderr.puts "#{e.class}: #{e.message}"
$stderr.puts e.backtrace
exit 1 exit 1
end end