diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-14 06:38:34 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-14 06:38:34 +0000 |
commit | 6e7f39829d6ce1cc80964d4cab85e1d33f1e1595 (patch) | |
tree | d941943476fabdf5f6d5b6433b47bd3130f37481 /ruby.c | |
parent | 8e2c6c1689a8425e36d1f503f651b94afa2a1128 (diff) |
merge revision(s) 66595: [Backport #15471]
fix missed script_compiled events. [Bug #15471]
* ruby.c (process_options): script_compiled events are missed on
command line -e or specified file. this commit fix it.
[Bug #15471]
This patch should be backport to Ruby 2.6 branch.
* vm_core.h (rb_exec_event_hook_script_compiled): introduce utility
function to invoke a script_compiled event.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r-- | ruby.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1863,6 +1863,18 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt) rb_set_safe_level(opt->safe_level); + { + rb_execution_context_t *ec = GET_EC(); + + if (opt->e_script) { + /* -e */ + rb_exec_event_hook_script_compiled(ec, iseq, opt->e_script); + } + else { + /* file */ + rb_exec_event_hook_script_compiled(ec, iseq, Qnil); + } + } return (VALUE)iseq; } |