From b1aecef87364631b0001dd2aafc432931e19a98f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 31 May 2019 15:58:50 +0900 Subject: 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`. --- eval_intern.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'eval_intern.h') diff --git a/eval_intern.h b/eval_intern.h index ad74408ff7..db28aa1598 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -157,23 +157,6 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *); # define VAR_NOCLOBBERED(var) var #endif -#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \ - (defined(__clang__) || GCC_VERSION_SINCE(9, 0, 0)) -# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \ - COMPILER_WARNING_PUSH; \ - COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \ - typeof(expr) unaligned_member_access_result = (expr); \ - COMPILER_WARNING_POP; \ - unaligned_member_access_result; \ -}) -#else -# define UNALIGNED_MEMBER_ACCESS(expr) expr -#endif -#define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem) - -#undef RB_OBJ_WRITE -#define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)) - /* clear ec->tag->state, and return the value */ static inline int rb_ec_tag_state(const rb_execution_context_t *ec) -- cgit v1.2.3