Handle more MJIT compilation failures

NotImplementedError is not part StandardError, for example. When that
kind of exception happens, current_cc_unit remains not NULL, and
mjit_finish ends up waiting for 5 seconds, which is inconvenient.
This commit is contained in:
Takashi Kokubun 2022-11-15 00:18:12 -08:00
parent 2652bc3578
commit f500ca9b8a
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -43,9 +43,9 @@ module RubyVM::MJIT
C.fprintf(f, "\n} // end of #{funcname}\n") C.fprintf(f, "\n} // end of #{funcname}\n")
return success return success
rescue => e # Should rb_rescue be called in C? rescue Exception => e # should we use rb_rescue in C instead?
if C.mjit_opts.warnings || C.mjit_opts.verbose > 0 if C.mjit_opts.warnings || C.mjit_opts.verbose > 0
$stderr.puts e.full_message $stderr.puts "MJIT error: #{e.full_message}"
end end
return false return false
end end