diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-26 06:30:59 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-26 06:30:59 +0000 |
commit | 6b61e99e0860697d2a2b58881ab3939ee2de2f49 (patch) | |
tree | 5d8f54be79c0b8911eeb99cc35e7035080f16dac /gc.c | |
parent | 3234245ae3240fd2018d8d33de998d0573914111 (diff) |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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) |