diff options
-rw-r--r-- | gcc/objc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/objc/objc-act.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/obj-c++.dg/bad-receiver-type.mm | 15 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/bad-receiver-type.m | 15 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/objc-nofilename-1.m | 21 |
6 files changed, 69 insertions, 3 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 321fe2e..67ccd3b 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2006-03-02 Fariborz Jahanian <fjahanian@apple.com> + + * objc-act.c (init_module_descriptor): Remove file name from + module descriptor. + (gen_type_name_0): Fix ICE when issuing warning. + 2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com> * Make-lang.in (OBJC): Remove (OBJECTIVE-C): Remove diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 463ceed..a90c061 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -2254,9 +2254,10 @@ init_module_descriptor (tree type) size_in_bytes (objc_module_template)); initlist = tree_cons (NULL_TREE, expr, initlist); - /* name = { ..., "foo.m", ... } */ + /* Don't provide any file name for security reasons. */ + /* name = { ..., "", ... } */ - expr = add_objc_string (get_identifier (input_filename), class_names); + expr = add_objc_string (get_identifier (""), class_names); initlist = tree_cons (NULL_TREE, expr, initlist); /* symtab = { ..., _OBJC_SYMBOLS, ... } */ @@ -8883,7 +8884,9 @@ gen_type_name_0 (tree type) if (TREE_CODE (type) == TYPE_DECL && DECL_NAME (type)) type = DECL_NAME (type); - strcat (errbuf, IDENTIFIER_POINTER (type)); + strcat (errbuf, TREE_CODE (type) == IDENTIFIER_NODE + ? IDENTIFIER_POINTER (type) + : ""); /* For 'id' and 'Class', adopted protocols are stored in the pointee. */ if (objc_is_id (orig)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f53333b..e94df36 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-03-02 Fariborz Jahanian <fjahanian@apple.com> + + * objc.dg/objc-nofilename-1.m: New test. + * objc.dg/bad-receiver-type.m: New test. + * obj-c++.dg/bad-receiver-type.mm: New test. + 2006-03-02 Eric Botcazou <ebotcazou@libertysurf.fr> * gcc.dg/single-precision-constant.c: Tweak for non-C99 runtimes. diff --git a/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm b/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm new file mode 100644 index 0000000..1d6699f --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm @@ -0,0 +1,15 @@ +// { dg-do compile } +// { dg-options "" } + +@interface A + +- (void)test; + +@end + +extern int foo(); + +void baz() +{ + [foo test]; /* { dg-warning "invalid receiver type" } */ +} diff --git a/gcc/testsuite/objc.dg/bad-receiver-type.m b/gcc/testsuite/objc.dg/bad-receiver-type.m new file mode 100644 index 0000000..58a5bb8 --- /dev/null +++ b/gcc/testsuite/objc.dg/bad-receiver-type.m @@ -0,0 +1,15 @@ +/* { dg-do compile } */ + +@interface A + +- (void)test; + +@end + +extern int foo(); + +void baz() +{ + [foo test]; /* { dg-warning "invalid receiver type" } */ + /* { dg-warning "cannot convert to a pointer type" "" { target *-*-* } 13} */ +} diff --git a/gcc/testsuite/objc.dg/objc-nofilename-1.m b/gcc/testsuite/objc.dg/objc-nofilename-1.m new file mode 100644 index 0000000..0bd49ff --- /dev/null +++ b/gcc/testsuite/objc.dg/objc-nofilename-1.m @@ -0,0 +1,21 @@ +/* Test to make sure that file name does not appear in the binary. */ +/* { dg-do compile } */ +#include <objc/objc.h> + +@interface Foo { Class isa; } @end +@implementation Foo @end + +@interface Bar : Foo { Class Barisa; } @end + +@implementation Bar : Foo @end; + +@interface FINAL : Bar { Class FINALisa; } @end + +@implementation FINAL : Bar @end; + +int main(int argc, char **argv) +{ + return 0; +} + +/* { dg-final { scan-assembler-not "objc-nofilename-1.m" } } */ |