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

ruby-changes:49934

From: shyouhei <ko1@a...>
Date: Fri, 26 Jan 2018 15:31:05 +0900 (JST)
Subject: [ruby-changes:49934] shyouhei:r62052 (trunk): treat PC for gc events

shyouhei	2018-01-26 15:30:59 +0900 (Fri, 26 Jan 2018)

  New Revision: 62052

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

  Log:
    treat PC for gc events
    
    ADD_PCs moved. That didn't change vast majority of event hooks
    because vm_traece() has been placed before ADD_PC. However for GC
    events the situation is different. We have to take care.

  Modified files:
    trunk/gc.c
Index: gc.c
===================================================================
--- gc.c	(revision 62051)
+++ gc.c	(revision 62052)
@@ -1819,7 +1819,10 @@ rb_objspace_set_event_hook(const rb_even https://github.com/ruby/ruby/blob/trunk/gc.c#L1819
 static void
 gc_event_hook_body(rb_execution_context_t *ec, rb_objspace_t *objspace, const rb_event_flag_t event, VALUE data)
 {
+    /* increment PC because source line is calculated with PC-1 */
+    ec->cfp->pc++;
     EXEC_EVENT_HOOK(ec, event, ec->cfp->self, 0, 0, 0, data);
+    ec->cfp->pc--;
 }
 
 #define gc_event_hook_available_p(objspace) ((objspace)->flags.has_hook)

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

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