cvsuser     04/12/30 03:37:31

  Modified:    src      pic.c
               t/pmc    objects.t
  Log:
  fix test and prederef
  * match objects_57 result
  * fix new_p_sc predereferencing
  
  Revision  Changes    Path
  1.2       +14 -2     parrot/src/pic.c
  
  Index: pic.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/pic.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pic.c     17 Dec 2004 12:15:13 -0000      1.1
  +++ pic.c     30 Dec 2004 11:37:30 -0000      1.2
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2004 The Perl Foundation.  All Rights Reserved.
  -$Id: pic.c,v 1.1 2004/12/17 12:15:13 leo Exp $
  +$Id: pic.c,v 1.2 2004/12/30 11:37:30 leo Exp $
   
   =head1 NAME
   
  @@ -38,6 +38,9 @@
   */
   
   
  +#define N_STATIC_TYPES 500
  +static INTVAL pmc_type_numbers[N_STATIC_TYPES];
  +
   void
   parrot_PIC_prederef(Interp *interpreter, opcode_t op, void **pc_pred, int 
core)
   {
  @@ -59,7 +62,16 @@
                   if (type <= 0)
                       real_exception(interpreter, NULL, NO_CLASS,
                               "Class '%Ss' not found", class);
  -                (*(INTVAL *)cur_opcode[2]) = type;
  +                if (type > N_STATIC_TYPES)
  +                    internal_exception(1, "Unimp: too many classes");
  +                /*
  +                 * the prederef bytecode needs the address of
  +                 * an INTVAL holding the type
  +                 *
  +                 * TODO if beyond limit use a malloced array
  +                 */
  +                pmc_type_numbers[type] = type;
  +                pc_pred[2] = pmc_type_numbers + type;
                   op = PARROT_OP_new_p_ic;
               }
               break;
  
  
  
  1.65      +3 -3      parrot/t/pmc/objects.t
  
  Index: objects.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/objects.t,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- objects.t 30 Dec 2004 01:11:33 -0000      1.64
  +++ objects.t 30 Dec 2004 11:37:31 -0000      1.65
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: objects.t,v 1.64 2004/12/30 01:11:33 scog Exp $
  +# $Id: objects.t,v 1.65 2004/12/30 11:37:31 leo Exp $
   
   =head1 NAME
   
  @@ -1871,9 +1871,9 @@
   ok 3
   OUTPUT
   
  -output_is(<<'CODE', <<'OUTPUT', "Wrong way to create new objects");
  +output_like(<<'CODE', <<'OUTPUT', "Wrong way to create new objects");
       new P0, .ParrotObject
       end
   CODE
  -Can't create new ParrotObject; use the registered class instead
  +/Can't create new ParrotObject/
   OUTPUT
  
  
  

Reply via email to