[前][次][番号順一覧][スレッド一覧]

ruby-changes:55344

From: k0kubun <ko1@a...>
Date: Sun, 14 Apr 2019 21:49:25 +0900 (JST)
Subject: [ruby-changes:55344] k0kubun:r67552 (trunk): Avoid crash on logging GC-ed ISeq

k0kubun	2019-04-14 21:49:20 +0900 (Sun, 14 Apr 2019)

  New Revision: 67552

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67552

  Log:
    Avoid crash on logging GC-ed ISeq

  Modified files:
    trunk/mjit_worker.c
Index: mjit_worker.c
===================================================================
--- mjit_worker.c	(revision 67551)
+++ mjit_worker.c	(revision 67552)
@@ -946,9 +946,14 @@ load_func_from_so(const char *so_file, c https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L946
 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__

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]