diff options
author | Richard Frith-Macdonald <rfm@gnu.org> | 2011-02-28 13:08:37 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2011-02-28 13:08:37 +0000 |
commit | 55b21c7a644d052ae243adef866d1394fc85a9f1 (patch) | |
tree | 9b5dfa811dd66d83194bea91dd5b2d2150826f29 /libobjc/gc.c | |
parent | 544a301ed4033323b9512fb71ed8c83506c1f0af (diff) | |
download | gcc-55b21c7a644d052ae243adef866d1394fc85a9f1.zip gcc-55b21c7a644d052ae243adef866d1394fc85a9f1.tar.gz gcc-55b21c7a644d052ae243adef866d1394fc85a9f1.tar.bz2 |
Fixed critical typo in Objective-C runtime garbage collection code
From-SVN: r170561
Diffstat (limited to 'libobjc/gc.c')
-rw-r--r-- | libobjc/gc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libobjc/gc.c b/libobjc/gc.c index d36a9cc..5ea4f8a 100644 --- a/libobjc/gc.c +++ b/libobjc/gc.c @@ -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; } |