diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-09-04 17:05:39 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-09-04 10:05:39 -0700 |
commit | ca59f04b870c47814d9d81bff458a85579d46d12 (patch) | |
tree | a90979153c5fafc3922a43e525762804418cabb3 /libobjc | |
parent | 1c9ef36d01436421d7f70b19bb1c3724e4226bd7 (diff) | |
download | gcc-ca59f04b870c47814d9d81bff458a85579d46d12.zip gcc-ca59f04b870c47814d9d81bff458a85579d46d12.tar.gz gcc-ca59f04b870c47814d9d81bff458a85579d46d12.tar.bz2 |
re PR libobjc/23108 (alignment bug in libobjc/archive.c)
2005-09-04 Andrew Pinski <pinskia@physics.uc.edu>
Rasmus Hahn <rassahah@neofonie.de>
PR libobjc/23108
* objc.dg/type-stream-1.m: New test.
2005-09-04 Andrew Pinski <pinskia@physics.uc.edu>
Rasmus Hahn <rassahah@neofonie.de>
PR libobjc/23108
* archive.c (objc_write_type): Correct the element offset.
(objc_read_type): Likewise.
Co-Authored-By: Rasmus Hahn <rassahah@neofonie.de>
From-SVN: r103832
Diffstat (limited to 'libobjc')
-rw-r--r-- | libobjc/ChangeLog | 7 | ||||
-rw-r--r-- | libobjc/archive.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog index 0161254..81e11cc 100644 --- a/libobjc/ChangeLog +++ b/libobjc/ChangeLog @@ -1,3 +1,10 @@ +2005-09-04 Andrew Pinski <pinskia@physics.uc.edu> + Rasmus Hahn <rassahah@neofonie.de> + + PR libobjc/23108 + * archive.c (objc_write_type): Correct the element offset. + (objc_read_type): Likewise. + 2005-08-17 Kelley Cook <kcook@gcc.gnu.org> * All files: Update FSF address. diff --git a/libobjc/archive.c b/libobjc/archive.c index eeaf29c..992a696 100644 --- a/libobjc/archive.c +++ b/libobjc/archive.c @@ -1069,7 +1069,7 @@ objc_write_type (TypedStream *stream, const char *type, const void *data) while (*type != _C_STRUCT_E) { align = objc_alignof_type (type); /* padd to alignment */ - acc_size += ROUND (acc_size, align); + acc_size = ROUND (acc_size, align); objc_write_type (stream, type, ((char *) data) + acc_size); acc_size += objc_sizeof_type (type); /* add component size */ type = objc_skip_typespec (type); /* skip component */ @@ -1165,7 +1165,7 @@ objc_read_type(TypedStream *stream, const char *type, void *data) while (*type != _C_STRUCT_E) { align = objc_alignof_type (type); /* padd to alignment */ - acc_size += ROUND (acc_size, align); + acc_size = ROUND (acc_size, align); objc_read_type (stream, type, ((char*)data)+acc_size); acc_size += objc_sizeof_type (type); /* add component size */ type = objc_skip_typespec (type); /* skip component */ |