ruby-changes:40920
From: nobu <ko1@a...>
Date: Wed, 9 Dec 2015 17:02:20 +0900 (JST)
Subject: [ruby-changes:40920] nobu:r52999 (trunk): regparse.h: ANSI alias rule fix
nobu 2015-12-09 17:02:06 +0900 (Wed, 09 Dec 2015) New Revision: 52999 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52999 Log: regparse.h: ANSI alias rule fix * regparse.h (SET_NTYPE): get rid of breaking strict aliasing. patch by Zarko Todorovski in [ruby-core:71953]. [Bug #11790] Modified files: trunk/ChangeLog trunk/regparse.h Index: regparse.h =================================================================== --- regparse.h (revision 52998) +++ regparse.h (revision 52999) @@ -67,7 +67,11 @@ RUBY_SYMBOL_EXPORT_BEGIN https://github.com/ruby/ruby/blob/trunk/regparse.h#L67 BIT_NT_CANY | BIT_NT_BREF)) != 0) #define NTYPE(node) ((node)->u.base.type) -#define SET_NTYPE(node, ntype) (node)->u.base.type = (ntype) +#define SET_NTYPE(node, ntype) \ + do { \ + int value = ntype; \ + memcpy(&((node)->u.base.type), &value, sizeof(int)); \ + } while (0) #define NSTR(node) (&((node)->u.str)) #define NCCLASS(node) (&((node)->u.cclass)) Index: ChangeLog =================================================================== --- ChangeLog (revision 52998) +++ ChangeLog (revision 52999) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Dec 9 17:02:03 2015 Nobuyoshi Nakada <nobu@r...> + + * regparse.h (SET_NTYPE): get rid of breaking strict aliasing. + patch by Zarko Todorovski in [ruby-core:71953]. [Bug #11790] + Wed Dec 9 16:10:37 2015 Koichi Sasada <ko1@a...> * vm.c (rb_vm_cref_in_context): Module#define_method in non-class -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/