cvsuser     04/11/20 00:49:17

  Modified:    imcc/t/syn bsr.t
               src      inter_run.c
               t/pmc    object-meths.t
  Log:
  fix exceptions thrown from nested run loops
  
  Revision  Changes    Path
  1.22      +3 -1      parrot/imcc/t/syn/bsr.t
  
  Index: bsr.t
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/t/syn/bsr.t,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- bsr.t     19 Nov 2004 16:28:06 -0000      1.21
  +++ bsr.t     20 Nov 2004 08:49:16 -0000      1.22
  @@ -235,10 +235,12 @@
      print $I0
      print "\n"
      end
  +.end
  +
   # the callers args I5, I6 are used to do the calculation and have
   # the same state after, so instead of calling again the sub, just
   # a branch to the entry is done
  -_fact:
  +.sub _fact
      if I6 <= 1 goto fin
      I5 = I5 * I6
      dec I6
  
  
  
  1.19      +16 -9     parrot/src/inter_run.c
  
  Index: inter_run.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/inter_run.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- inter_run.c       5 Nov 2004 11:23:00 -0000       1.18
  +++ inter_run.c       20 Nov 2004 08:49:17 -0000      1.19
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: inter_run.c,v 1.18 2004/11/05 11:23:00 leo Exp $
  +$Id: inter_run.c,v 1.19 2004/11/20 08:49:17 leo Exp $
   
   =head1 NAME
   
  @@ -55,17 +55,24 @@
           if (setjmp(interpreter->exceptions->destination)) {
               /* an exception was thrown */
               offset = handle_exception(interpreter);
  +            /* update profile for exception execution time */
  +            if (interpreter->profile &&
  +                    Interp_flags_TEST(interpreter, PARROT_PROFILE_FLAG)) {
  +                RunProfile *profile = interpreter->profile;
  +                if (profile->cur_op == PARROT_PROF_EXCEPTION) {
  +                    profile->data[PARROT_PROF_EXCEPTION].time +=
  +                        Parrot_floatval_time() - profile->starttime;
  +                }
  +            }
           }
       }
  -    if (interpreter->profile &&
  -            Interp_flags_TEST(interpreter, PARROT_PROFILE_FLAG)) {
  -        RunProfile *profile = interpreter->profile;
  -        if (profile->cur_op == PARROT_PROF_EXCEPTION) {
  -            profile->data[PARROT_PROF_EXCEPTION].time +=
  -                Parrot_floatval_time() - profile->starttime;
  -        }
  +    if (interpreter->exceptions->runloop_level ==
  +            interpreter->ctx.runloop_level) {
  +        /* if we are coming from an exception and it was thrown deeper
  +         * in a nested run loop, we just leave this loop
  +         */
  +        runops_int(interpreter, offset);
       }
  -    runops_int(interpreter, offset);
       /*
        * pop off exception and put it onto the free list
        * s. above
  
  
  
  1.22      +1 -4      parrot/t/pmc/object-meths.t
  
  Index: object-meths.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/object-meths.t,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- object-meths.t    19 Nov 2004 13:45:32 -0000      1.21
  +++ object-meths.t    20 Nov 2004 08:49:17 -0000      1.22
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: object-meths.t,v 1.21 2004/11/19 13:45:32 leo Exp $
  +# $Id: object-meths.t,v 1.22 2004/11/20 08:49:17 leo Exp $
   
   =head1 NAME
   
  @@ -430,8 +430,6 @@
   B::foo
   OUTPUT
   
  -SKIP: {
  -    skip("currently failing - exceptions are being redone", 1);
   output_is(<<'CODE', <<'OUTPUT', "exceptions and different runloops");
   _main:
       newsub P0, .Exception_Handler, eh
  @@ -461,7 +459,6 @@
   in __init
   back in main
   OUTPUT
  -}
   
   output_is(<<'CODE', <<'OUTPUT', "fetchmethod");
       newclass P3, "Foo"
  
  
  

Reply via email to