1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Allow an MJIT worker to show a backtrace on SEGV

An MJIT worker thread doesn't have ec, and it's required for SDR() and
rb_backtrace_print_as_bugreport(). Therefore it must be checked.
This commit is contained in:
Takashi Kokubun 2020-12-10 21:56:48 -08:00
parent 4439b78336
commit 885135f84c
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -941,8 +941,9 @@ rb_vm_bugreport(const void *ctx)
enum {other_runtime_info = 0};
#endif
const rb_vm_t *const vm = GET_VM();
const rb_execution_context_t *ec = GET_EC();
if (vm) {
if (vm && ec) {
SDR();
rb_backtrace_print_as_bugreport();
fputs("\n", stderr);