[LLVMbugs] [Bug 113] [llvm-gcc] crash assigning into an array in a struct which contains a bitfield

bugzilla-daemon at zion.cs.uiuc.edu bugzilla-daemon at zion.cs.uiuc.edu
Wed Nov 19 16:35:18 PST 2003


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=113

sabre at nondot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         OS/Version|Linux                       |All
           Platform|PC                          |All
         Resolution|                            |FIXED



------- Additional Comments From sabre at nondot.org  2003-11-19 18:35 -------
Fixed.  This one turned out to be an easy case of bitfields sucking.

Testcase here: test/Regression/CFrontend/2003-11-19-BitFieldArray.c

Patch here:
$ diff -u llvm-expand.c~ llvm-expand.c
--- llvm-expand.c~      2003-11-19 16:02:25.000000000 -0600
+++ llvm-expand.c       2003-11-19 18:25:37.000000000 -0600
@@ -4655,7 +4655,7 @@
       /* If this is accessing a union element, we can go ahead and cast the
        *  pointer to the desired type now.
        */
-      if (ActualOffset == Offset && Offset == 0 && Size > ActualSize) {
+      if (ActualOffset == Offset && Size > ActualSize) {
         assert((ActualSize & 7) == 0 && (Size & 7) == 0 &&
                "Illegal union field reference!");
         Result = cast_if_type_not_equal(Fn, Op0,

-Chris



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the llvm-bugs mailing list