summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 15:58:50 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 16:04:16 +0900
commitb1aecef87364631b0001dd2aafc432931e19a98f (patch)
tree7132db2022addc42126a1992c312eb7566dd2df6 /vm_insnhelper.c
parentea42423908ed055f9039b1dce6e9a232a3b2dd90 (diff)
Use UNALIGNED_MEMBER_PTR
* internal.h (UNALIGNED_MEMBER_ACCESS, UNALIGNED_MEMBER_PTR): moved from eval_intern.h. * compile.c iseq.c, vm.c: use UNALIGNED_MEMBER_PTR for `entries` in `struct iseq_catch_table`. * vm_eval.c, vm_insnhelper.c: use UNALIGNED_MEMBER_PTR for `body` in `rb_method_definition_t`.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b69eaf168b..7946f9aa4f 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1201,7 +1201,8 @@ vm_throw_start(const rb_execution_context_t *ec, rb_control_frame_t *const reg_c
if (!ct) break;
for (i=0; i < ct->size; i++) {
- const struct iseq_catch_table_entry * const entry = &ct->entries[i];
+ const struct iseq_catch_table_entry *const entry =
+ UNALIGNED_MEMBER_PTR(ct, entries[i]);
if (entry->type == CATCH_TYPE_BREAK &&
entry->iseq == base_iseq &&
@@ -2183,7 +2184,7 @@ vm_method_cfunc_entry(const rb_callable_method_entry_t *me)
rb_bug("wrong method type: %d", me->def->type);
}
#endif
- return &me->def->body.cfunc;
+ return UNALIGNED_MEMBER_PTR(me->def, body.cfunc);
}
static VALUE