From c4e3ffb1f916d8501f39d1beb7f65160c939afe5 Mon Sep 17 00:00:00 2001 From: pinskia Date: Mon, 12 Dec 2005 23:58:16 +0000 Subject: 2005-12-12 Andrew Pinski PR objc/25348 * objc-act.c (encode_array): Handle arrays to zero sized types. 2005-12-12 Andrew Pinski PR objc/25348 * objc.dg/encode-9.m: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108432 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/objc/ChangeLog | 5 +++++ gcc/objc/objc-act.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'gcc/objc') diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index f2a6fd692ac..5f7951f82db 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,8 @@ +2005-12-12 Andrew Pinski + + PR objc/25348 + * objc-act.c (encode_array): Handle arrays to zero sized types. + 2005-12-07 Rafael Ávila de Espíndola * 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 817553a1eed..201a722c232 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); -- cgit v1.2.1