]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fixed critical typo in Objective-C runtime garbage collection code
authorRichard Frith-Macdonald <rfm@gnu.org>
Mon, 28 Feb 2011 13:08:37 +0000 (13:08 +0000)
committerNicola Pero <nicola@gcc.gnu.org>
Mon, 28 Feb 2011 13:08:37 +0000 (13:08 +0000)
From-SVN: r170561

libobjc/ChangeLog
libobjc/gc.c

index 3d85c98204161bd6f25bf17c4d9432fd97513bf9..a9399e6bea982eb931f995005ca7e4770f632940 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-28  Richard Frith-Macdonald <rfm@gnu.org>
+
+       PR libobjc/47922
+       * gc.c (class_ivar_set_gcinvisible): Use _C_GCINVISIBLE instead of
+       a hardcoded "!".
+
 2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * configure: Regenerate.
index d36a9cc77de99edec6e856c7a8ff5e0c5e424652..5ea4f8a09158c4a38bf1c5a7ef363774b8c62327 100644 (file)
@@ -422,11 +422,15 @@ class_ivar_set_gcinvisible (Class class, const char *ivarname,
 
          /* The variable is gc visible so we make it gc_invisible.  */
          new_type = objc_malloc (strlen(ivar->ivar_type) + 2);
+
+         /* Copy the variable name.  */
          len = (type - ivar->ivar_type);
          memcpy (new_type, ivar->ivar_type, len);
-         new_type[len] = 0;
-         strcat (new_type, "!");
-         strcat (new_type, type);
+         /* Add '!'.  */
+         new_type[len++] = _C_GCINVISIBLE;
+         /* Copy the original types.  */
+         strcpy (new_type + len, type);
+
          ivar->ivar_type = new_type;
        }