Thread overview
[Bug 210] [REG] Comparing identical unions with alignment holes may start failing
Feb 07, 2016
Johannes Pfau
Feb 07, 2016
Iain Buclaw
Feb 07, 2016
Iain Buclaw
February 07, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=210

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johannespfau@gmail.com

--- Comment #1 from Johannes Pfau <johannespfau@gmail.com> ---
> No, comparing Bar b1 == Bar b2 will not succeed in your case. Yes, this is different from dmd. Should it be considered a bug/regression? I don't mind reverting this for unions, but it might not always be correct anyway...

You're right. I didn't realize we can't actually compare unions in any other way. For the record: As we don't know the 'active' union field we can't do field-by-field comparisons of unions. So the only meaningful way to compare unions is by memcmp. And then we'd have to fill the 'holes' in structs again...

I don't know if this corner-case is important enough  to really worry about this.

-- 
You are receiving this mail because:
You are watching all bug changes.

February 07, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=210

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
https://github.com/D-Programming-GDC/GDC/pull/148

Well, I did a quick test and unions aren't returned in registers.  Which makes it safe to issue memset in StructLiteralExp, but only for them.

-- 
You are receiving this mail because:
You are watching all bug changes.

February 07, 2016
http://bugzilla.gdcproject.org/show_bug.cgi?id=210

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
https://github.com/D-Programming-GDC/GDC/commit/b1b1b3e3ee7ab2b5e88c0f0c6bcd6c1160f2228d

-- 
You are receiving this mail because:
You are watching all bug changes.