diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-03 15:40:10 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-03 15:40:10 +0000 |
commit | 47a357424198aec757162a1b18233eafa28e4af2 (patch) | |
tree | 038ba7e0f649ee874269ad2a01a7ba6a2868053e /vm_insnhelper.c | |
parent | 9b586688074a127cf51d162c3de6eb262488f132 (diff) |
merge revision(s) 59181: [Backport #13680]
vm_insnhelper.c: break in once
* vm_insnhelper.c (vm_throw_start): size of catch table has been
included in iseq_catch_table struct, which could be NULL, since
2.2. e.g., proc-closure in `once'.
[ruby-core:81775] [Bug #13680]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index b11c5a61e4..4fdeeb2e6e 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1039,13 +1039,13 @@ vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ru while (escape_cfp < eocfp) { if (escape_cfp->ep == ep) { - const VALUE epc = escape_cfp->pc - escape_cfp->iseq->body->iseq_encoded; - const rb_iseq_t * const iseq = escape_cfp->iseq; - const struct iseq_catch_table * const ct = iseq->body->catch_table; - const int ct_size = ct->size; - int i; + const rb_iseq_t *const iseq = escape_cfp->iseq; + const VALUE epc = escape_cfp->pc - iseq->body->iseq_encoded; + const struct iseq_catch_table *const ct = iseq->body->catch_table; + unsigned int i; - for (i=0; i<ct_size; i++) { + if (!ct) break; + for (i=0; i < ct->size; i++) { const struct iseq_catch_table_entry * const entry = &ct->entries[i]; if (entry->type == CATCH_TYPE_BREAK && entry->start < epc && entry->end >= epc) { |