OSDN Git Service

2004-03-05 Ziemowit Laski <zlaski@apple.com>
[pf3gnuchains/gcc-fork.git] / libobjc / Protocol.m
index 3c18a02..06a25ac 100644 (file)
@@ -1,20 +1,20 @@
 /* This file contains the implementation of class Protocol.
    Copyright (C) 1993 Free Software Foundation, Inc.
 
-This file is part of GNU CC. 
+This file is part of GCC. 
 
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
+along with GCC; see the file COPYING.  If not, write to
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
  
@@ -80,11 +80,12 @@ struct objc_method_description_list {
   const char* name = sel_get_name (aSel);
   struct objc_method_description *result;
 
-  for (i = 0; i < instance_methods->count; i++)
-    {
-      if (!strcmp ((char*)instance_methods->list[i].name, name))
-       return &(instance_methods->list[i]);
-    }
+  if (instance_methods)
+    for (i = 0; i < instance_methods->count; i++)
+      {
+       if (!strcmp ((char*)instance_methods->list[i].name, name))
+         return &(instance_methods->list[i]);
+      }
 
   for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
     {
@@ -107,11 +108,12 @@ struct objc_method_description_list {
   const char* name = sel_get_name (aSel);
   struct objc_method_description *result;
 
-  for (i = 0; i < class_methods->count; i++)
-    {
-      if (!strcmp ((char*)class_methods->list[i].name, name))
-       return &(class_methods->list[i]);
-    }
+  if (class_methods)
+    for (i = 0; i < class_methods->count; i++)
+      {
+       if (!strcmp ((char*)class_methods->list[i].name, name))
+         return &(class_methods->list[i]);
+      }
 
   for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
     {