Skip to content

Commit

Permalink
RJIT: Prefer STDERR over $stderr
Browse files Browse the repository at this point in the history
When $stderr is redirected, you'll have no way to see why RJIT got
broken. This reference must always be the actual stderr.
  • Loading branch information
k0kubun committed Dec 23, 2023
1 parent c25705c commit ef06510
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ruby_vm/rjit/compiler.rb
Expand Up @@ -67,8 +67,8 @@ def compile(iseq, cfp)
compile_block(asm, jit:, pc:)
iseq.body.jit_entry = @cb.write(asm)
rescue Exception => e
$stderr.puts "#{e.class}: #{e.message}"
$stderr.puts e.backtrace
STDERR.puts "#{e.class}: #{e.message}"
STDERR.puts e.backtrace
exit 1
end

Expand Down Expand Up @@ -110,7 +110,7 @@ def entry_stub_hit(entry_stub, cfp)

return block.start_addr
rescue Exception => e
$stderr.puts e.full_message
STDERR.puts e.full_message
exit 1
end

Expand Down Expand Up @@ -165,7 +165,7 @@ def branch_stub_hit(branch_stub, cfp, target0_p)

return target.address
rescue Exception => e
$stderr.puts e.full_message
STDERR.puts e.full_message
exit 1
end

Expand Down

0 comments on commit ef06510

Please sign in to comment.