mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* internal.h (RBASIC_CLEAR_CLASS): Reroute ANSI C's strict
aliasing rule. [ruby-core:74427][Bug #12191][ruby-core:76747][Bug #12657] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c5fb7df2a
commit
869e7809a3
2 changed files with 8 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Aug 8 12:51:12 2016 Zarko Todorovski <zarko@ca.ibm.com>
|
||||
|
||||
* internal.h (RBASIC_CLEAR_CLASS): Reroute ANSI C's strict
|
||||
aliasing rule.
|
||||
[ruby-core:74427][Bug #12191][ruby-core:76747][Bug #12657]
|
||||
|
||||
Sun Aug 7 18:08:27 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* object.c (InitVM_Object): deprecate toplevel constants TRUE,
|
||||
|
|
|
@ -1250,8 +1250,8 @@ struct RBasicRaw {
|
|||
VALUE klass;
|
||||
};
|
||||
|
||||
#define RBASIC_CLEAR_CLASS(obj) (((struct RBasicRaw *)((VALUE)(obj)))->klass = 0)
|
||||
#define RBASIC_SET_CLASS_RAW(obj, cls) (((struct RBasicRaw *)((VALUE)(obj)))->klass = (cls))
|
||||
#define RBASIC_CLEAR_CLASS(obj) memset(&(((struct RBasicRaw *)((VALUE)(obj)))->klass), 0, sizeof(((struct RBasicRaw *)
|
||||
#define RBASIC_SET_CLASS_RAW(obj, cls) memcpy(&((struct RBasicRaw *)((VALUE)(obj)))->klass, &(cls), sizeof(VALUE))
|
||||
#define RBASIC_SET_CLASS(obj, cls) do { \
|
||||
VALUE _obj_ = (obj); \
|
||||
RB_OBJ_WRITE(_obj_, &((struct RBasicRaw *)(_obj_))->klass, cls); \
|
||||
|
|
Loading…
Reference in a new issue