Fixed a couple of objctective-c bugs.

Oked by Mike Stump.

From-SVN: r111642
This commit is contained in:
Fariborz Jahanian 2006-03-02 17:45:30 +00:00 committed by Fariborz Jahanian
parent 21a8ffa158
commit d349339d33
6 changed files with 69 additions and 3 deletions

View File

@ -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

View File

@ -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))

View File

@ -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.

View File

@ -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" } */
}

View File

@ -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} */
}

View File

@ -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" } } */