diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-12-12 23:58:16 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-12-12 15:58:16 -0800 |
commit | 6b990f0dd703328b48acd7321ca19c114fcfef9f (patch) | |
tree | d1eb9cf5a1c5a4511b1235ff768b0e571662c301 /gcc/objc | |
parent | 59ced947910469573d2c66d14cd0d7143c731730 (diff) | |
download | gcc-6b990f0dd703328b48acd7321ca19c114fcfef9f.zip gcc-6b990f0dd703328b48acd7321ca19c114fcfef9f.tar.gz gcc-6b990f0dd703328b48acd7321ca19c114fcfef9f.tar.bz2 |
re PR objc/25348 (ICE encoding zero sized struct array)
2005-12-12 Andrew Pinski <pinskia@physics.uc.edu>
PR objc/25348
* objc-act.c (encode_array): Handle arrays to zero sized types.
2005-12-12 Andrew Pinski <pinskia@physics.uc.edu>
PR objc/25348
* objc.dg/encode-9.m: New test.
From-SVN: r108432
Diffstat (limited to 'gcc/objc')
-rw-r--r-- | gcc/objc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index f2a6fd6..5f7951f 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2005-12-12 Andrew Pinski <pinskia@physics.uc.edu> + + PR objc/25348 + * objc-act.c (encode_array): Handle arrays to zero sized types. + 2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> * Make-lang.in (objc.all.build, objc.install-normal): Remove. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 817553a..201a722 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -7920,9 +7920,12 @@ encode_array (tree type, int curtype, int format) return; } - sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, - (TREE_INT_CST_LOW (an_int_cst) - / TREE_INT_CST_LOW (TYPE_SIZE (array_of)))); + if (TREE_INT_CST_LOW (TYPE_SIZE (array_of)) == 0) + sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0); + else + sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, + TREE_INT_CST_LOW (an_int_cst) + / TREE_INT_CST_LOW (TYPE_SIZE (array_of))); obstack_grow (&util_obstack, buffer, strlen (buffer)); encode_type (array_of, curtype, format); |