From: Joseph Jones Date: 2015-12-17T21:05:40-07:00 Subject: [ruby-core:72238] [Ruby trunk - Bug #11790] [Open] [PATCH] ANSI alias rules fix --56738614_19495cff_16c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Joseph Jones liked your message with Boxer. On December 8, 2015 at 09:32:= 36 MST, zarko=40ca.ibm.com wrote:Issue =2311790 has been reported by Zark= o Todorovski.----------------------------------------Bug =2311790: =5BPAT= CH=5D ANSI alias rules fix https://bugs.ruby-lang.org/issues/11790* Autho= r: Zarko Todorovski* Status: Open* Priority: Normal* Assignee: * ruby -v:= * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN------------------= ----------------------line 70 in file regparse.h:*=23define SET=5FNTYPE(n= ode, ntype) (node)->u.base.type =3D (ntype)*needs to be changed to confor= m with ANSI alias rulesLine 70 as it is can lead to errors in compiling i= n regparse.c*line 1143: node =3D (Node* )=46reeNodeList;**line 1144: =46r= eeNodeList =3D =46reeNodeList->next;**line 1581: (node)->u.base.type =3D = (0);* where during compiling line 1581 can be moved ahead of line 1144 si= nce under ANSI aliasing rules, the compiler determines that the statement= of =22(node)->u.base.type =3D (0);=22 does not affect the value of =46re= eNodeList. Proposed change in patch is in file regparse.sh:from: *=23defi= ne SET=5FNTYPE(node, ntype) (node)->u.base.type =3D (ntype)*to:*=23define= SET=5FNTYPE(node, ntype) =7Bint value =3D ntype; memcpy(&((node)->u.base= .type), &value, sizeof((node)->u.base.type));=7D*---=46iles--------------= ------------------alias=5Fansi=5Frule.patch (717 Bytes)-- https://bugs.ru= by-lang.org/ --56738614_19495cff_16c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Joseph Jones liked your message with Boxer.


= On December 8, 2015 at 09:32:36 MST, zarko=40ca.ibm.com wrote:
Issue =2311790 has been reported= by Zarko Todorovski.

---------------------------------------= -
Bug =2311790: =5BPATCH=5D ANSI alias rules fix
https://bugs.= ruby-lang.org/issues/11790

* Author: Zarko Todorovski
* = Status: Open
* Priority: Normal
* Assignee:
* ruby -v: * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
---------= -------------------------------
line 70 in file regparse.h:
*=23= define SET=5FNTYPE(node, ntype) (node)->u.base.type =3D (ntype)*
<= br />needs to be changed to conform with ANSI alias rules


Line 70 as it is can lead to errors in compiling in regparse.c
*line 1143: node =3D (Node* )=46reeNodeList;*
*line 1144: =46reeN= odeList =3D =46reeNodeList->next;*
*line 1581: (node)->u.base.type =3D= (0);*

where during compiling line 1581 can be moved ahead of= line 1144 since under ANSI aliasing rules, the compiler determines that = the statement of =22(node)->u.base.type =3D (0);=22 does not affect the v= alue of =46reeNodeList.

Proposed change in patch is in file r= egparse.sh:

from:
*=23define SET=5FNTYPE(node, ntype) = (node)->u.base.type =3D (ntype)*
to:
*=23define SET=5FNTYPE(nod= e, ntype) =7Bint value =3D ntype; memcpy(&((node)->u.base.type), &value,= sizeof((node)->u.base.type));=7D*

---=46iles-----------------= ---------------
alias=5Fansi=5Frule.patch (717 Bytes)

--
https://bugs.ruby-lang.org/
--56738614_19495cff_16c--