aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-26 06:30:59 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-26 06:30:59 +0000
commitb3076dbba15094c3e1ac6ddb203569d8508abfdc (patch)
tree5d8f54be79c0b8911eeb99cc35e7035080f16dac /gc.c
parentf41854e354462130998287f3a83d2bd86e41661f (diff)
downloadruby-b3076dbba15094c3e1ac6ddb203569d8508abfdc.tar.gz
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 5812a8789e..fd69acf771 100644
--- a/gc.c
+++ b/gc.c
@@ -1819,7 +1819,10 @@ rb_objspace_set_event_hook(const rb_event_flag_t event)
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)