summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 12:49:20 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 12:49:20 +0000
commit009a0a3870656268d00e98a12311bfcc70f54a18 (patch)
tree9956d96c382af3714205c0075a4e2b9358c85b1c /mjit_worker.c
parente45c9a40a2ee2ca241565f5953af116cd2b5ab29 (diff)
Avoid crash on logging GC-ed ISeq
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index e7f17ac..819a4a0 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -946,9 +946,14 @@ load_func_from_so(const char *so_file, const char *funcname, struct rb_mjit_unit
static void
print_jit_result(const char *result, const struct rb_mjit_unit *unit, const double duration, const char *c_file)
{
- verbose(1, "JIT %s (%.1fms): %s@%s:%d -> %s", result,
- duration, RSTRING_PTR(unit->iseq->body->location.label),
- RSTRING_PTR(rb_iseq_path(unit->iseq)), FIX2INT(unit->iseq->body->location.first_lineno), c_file);
+ if (unit->iseq == NULL) {
+ verbose(1, "JIT %s (%.1fms): (GCed) -> %s", result, duration, c_file);
+ }
+ else {
+ verbose(1, "JIT %s (%.1fms): %s@%s:%d -> %s", result,
+ duration, RSTRING_PTR(unit->iseq->body->location.label),
+ RSTRING_PTR(rb_iseq_path(unit->iseq)), FIX2INT(unit->iseq->body->location.first_lineno), c_file);
+ }
}
#ifndef __clang__