summaryrefslogtreecommitdiff
path: root/vm.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.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.c')
-rw-r--r--vm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm.c b/vm.c
index 9dd97e77c7..3f5a619e3c 100644
--- a/vm.c
+++ b/vm.c
@@ -1956,7 +1956,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state,
else {
ct = cfp->iseq->body->catch_table;
if (ct) for (i = 0; i < ct->size; i++) {
- entry = &ct->entries[i];
+ entry = UNALIGNED_MEMBER_PTR(ct, entries[i]);
if (entry->start < epc && entry->end >= epc) {
if (entry->type == CATCH_TYPE_ENSURE) {
catch_iseq = entry->iseq;
@@ -1992,7 +1992,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state,
if (state == TAG_RAISE) {
ct = cfp->iseq->body->catch_table;
if (ct) for (i = 0; i < ct->size; i++) {
- entry = &ct->entries[i];
+ entry = UNALIGNED_MEMBER_PTR(ct, entries[i]);
if (entry->start < epc && entry->end >= epc) {
if (entry->type == CATCH_TYPE_RESCUE ||
@@ -2008,7 +2008,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state,
else if (state == TAG_RETRY) {
ct = cfp->iseq->body->catch_table;
if (ct) for (i = 0; i < ct->size; i++) {
- entry = &ct->entries[i];
+ entry = UNALIGNED_MEMBER_PTR(ct, entries[i]);
if (entry->start < epc && entry->end >= epc) {
if (entry->type == CATCH_TYPE_ENSURE) {
@@ -2035,7 +2035,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state,
search_restart_point:
ct = cfp->iseq->body->catch_table;
if (ct) for (i = 0; i < ct->size; i++) {
- entry = &ct->entries[i];
+ entry = UNALIGNED_MEMBER_PTR(ct, entries[i]);
if (entry->start < epc && entry->end >= epc) {
if (entry->type == CATCH_TYPE_ENSURE) {
@@ -2073,7 +2073,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state,
else {
ct = cfp->iseq->body->catch_table;
if (ct) for (i = 0; i < ct->size; i++) {
- entry = &ct->entries[i];
+ entry = UNALIGNED_MEMBER_PTR(ct, entries[i]);
if (entry->start < epc && entry->end >= epc) {
if (entry->type == CATCH_TYPE_ENSURE) {