diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-31 15:58:50 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-05-31 16:04:16 +0900 |
commit | b1aecef87364631b0001dd2aafc432931e19a98f (patch) | |
tree | 7132db2022addc42126a1992c312eb7566dd2df6 /compile.c | |
parent | ea42423908ed055f9039b1dce6e9a232a3b2dd90 (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 'compile.c')
-rw-r--r-- | compile.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1263,7 +1263,8 @@ update_catch_except_flags(struct rb_iseq_constant_body *body) return; for (i = 0; i < ct->size; i++) { - const struct iseq_catch_table_entry *entry = &ct->entries[i]; + const struct iseq_catch_table_entry *entry = + UNALIGNED_MEMBER_PTR(ct, entries[i]); if (entry->type != CATCH_TYPE_BREAK && entry->type != CATCH_TYPE_NEXT && entry->type != CATCH_TYPE_REDO) { @@ -2322,7 +2323,7 @@ iseq_set_exception_table(rb_iseq_t *iseq) for (i = 0; i < table->size; i++) { ptr = RARRAY_CONST_PTR_TRANSIENT(tptr[i]); - entry = &table->entries[i]; + entry = UNALIGNED_MEMBER_PTR(table, entries[i]); entry->type = (enum catch_type)(ptr[0] & 0xffff); entry->start = label_get_position((LABEL *)(ptr[1] & ~1)); entry->end = label_get_position((LABEL *)(ptr[2] & ~1)); |