1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Narrowed down unaligned member access region in RB_OBJ_WRITE

Since UNALIGNED_MEMBER_ACCESS assigns to an intermediate variable,
it can cause unused-value warnings.
This commit is contained in:
Nobuyoshi Nakada 2020-12-13 11:34:57 +09:00
parent 88f3ce12d3
commit 97e6c28db4
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -58,8 +58,8 @@ struct rb_objspace; /* in vm_core.h */
#define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
#define RB_OBJ_WRITE(a, slot, b) \
UNALIGNED_MEMBER_ACCESS(\
rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
rb_obj_write((VALUE)(a), UNALIGNED_MEMBER_ACCESS((VALUE *)(slot)), \
(VALUE)(b), __FILE__, __LINE__)
/* gc.c */
extern VALUE *ruby_initial_gc_stress_ptr;