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
1 changed files with 2 additions and 1 deletions

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);