cvsuser     03/11/02 23:02:08

  Modified:    src      objects.c
  Log:
  Oops, handle with PMCNULL correctly.
  
  Revision  Changes    Path
  1.15      +7 -4      parrot/src/objects.c
  
  Index: objects.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/objects.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -w -r1.14 -r1.15
  --- objects.c 3 Nov 2003 06:52:59 -0000       1.14
  +++ objects.c 3 Nov 2003 07:02:08 -0000       1.15
  @@ -1,7 +1,7 @@
   /* objects.c
    *  Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
    *  CVS Info
  - *     $Id: objects.c,v 1.14 2003/11/03 06:52:59 mrjoltcola Exp $
  + *     $Id: objects.c,v 1.15 2003/11/03 07:02:08 mrjoltcola Exp $
    *  Overview:
    *     Handles class and object manipulation
    *  Data Structure and Algorithms:
  @@ -121,7 +121,7 @@
     VTABLE_set_pmc_keyed_int(interpreter, new_class_array, 1, classname_pmc);
   
     /* Add ourselves to the interpreter's class hash */
  -  if(Parrot_class_lookup(interpreter, class_name)) {
  +  if(Parrot_class_lookup(interpreter, class_name) != PMCNULL) {
        internal_exception(1, "Class %s already registered!\n",
                           string_to_cstring(interpreter, class_name));
     }
  @@ -135,8 +135,11 @@
   PMC *
   Parrot_class_lookup(Parrot_Interp interpreter, STRING *class_name)
   {
  +  if (VTABLE_exists_keyed(interpreter, interpreter->class_hash,
  +                          key_new_string(interpreter, class_name)))
     return VTABLE_get_pmc_keyed(interpreter, interpreter->class_hash,
                                 key_new_string(interpreter, class_name));
  +  return PMCNULL;
   }
   
   void
  
  
  

Reply via email to