Bug 1921 – struct literal segfaults for structs with nested union/struct
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-03-13T13:10:00Z
Last change time
2015-06-09T05:15:06Z
Keywords
ice-on-valid-code
Assigned to
ibuclaw
Creator
witold.baryluk+d
Comments
Comment #0 by witold.baryluk+d — 2008-03-13T13:10:25Z
module vec1;
struct vec1 {
union {
struct {
float x;
}
float cell;
}
vec1 opMul(float c) {
return vec1(c*x); // line 12
}
}
$ gdc -c vec1.d
vec1.d: In member function ‘opMul’:
vec1.d:12: internal compiler error: Naruszenie ochrony pamięci (Segmentation fault)
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment #1 by witold.baryluk+d — 2008-03-13T13:14:55Z
*** Bug 1922 has been marked as a duplicate of this bug. ***
Comment #2 by tomeksowi — 2009-12-16T14:09:17Z
Not sure if related but I also got stung by nested structs in bug 3622.
Comment #3 by witold.baryluk+d — 2009-12-16T16:39:05Z
(In reply to comment #2)
> Not sure if related but I also got stung by nested structs in bug 3622.
I don't think so. This bug is filled for GDC, D compiler using GCC backend. And in my situation it is the compiler crash, so i don't have even compiled program.
In your case it is DMD and runtime crash.
My codes (from bug opening, and many more complicated) are working without problem in DMD).
Comment #4 by ibuclaw — 2010-08-05T15:01:47Z
I cannot reproduce this using gdc 0.25 with gcc-4.1.2 and gcc-4.3.5.
Comment #5 by witold.baryluk+d — 2010-08-08T09:24:28Z
(In reply to comment #4)
> I cannot reproduce this using gdc 0.25 with gcc-4.1.2 and gcc-4.3.5.
You are right. Works with gcc version 4.3.5 (Debian 1:1.046-4.3.5-2)
Thanks, for update.