On Sat Jun 14 20:37:53 2008, coke wrote:
> On Sat Apr 14 15:46:56 2007, allison wrote:
> > What I get is:
> >
> > [oops; continuation 0x188ae28 of type 24 is trying to jump from
> runloop
> > 2 to runloop 1]
> > ok
> > not ok
> >
> > from line 252 of src/pmc/continuation.pmc
> >
> > Looks like this is yet-another-example of the inferior runloops
> problem.
> >
> > Throwing an exception from a called sub works just fine:
> >
> > .sub main :main
> > newclass $P0, "Parent"
> > push_eh handler
> > "foo"()
> > print "not "
> > handler:
> > print "ok\n"
> > end
> > .end
> >
> > .sub foo
> > $P1 = new .Exception
> > $P1["_message"] = "Blah"
> > throw $P1
> > .end
> >
> > Allison
> 
> If I update the syntax here a bit to what I think is the modern-day
> parrot analog, I get:
> 
> $ cat foo.pir
> .sub main :main
>   newclass $P0, "Parent"
>   push_eh handler
>   $P2 = new "Parent"
>   print "not "
> handler:
>   print "ok\n"
> end
> .end
> 
> .namespace ["Parent"]
> .sub __init :method
>   $S0 = typeof self
>   if $S0 != "Parent" goto INIT_OK
>   die "Can not instantiate an interface!"
> INIT_OK:
> .end
> 
> 2;0 [EMAIL PROTECTED]:~/sandbox/parrot$ ./parrot foo.pir
> [oops; continuation 0x82232f0 of type 21 is trying to jump from
> runloop 2 to runloop 1]
> ok
> not ok
> 
> ... Which is what allison was saying she got on the older version.
> 
>  If nothing else, the inferior runloop diagnostic here shouldn't be
> occuring.  Let's see how
> this fares when we re-merge the pdd25 work back into trunk.
> 

Post pdd25cx mergeback, updating the syntax yet again, and simplifying it 
slightly, we have 
the attached file, which generates:

ok #test exception from init vtable
not ok #test exception from init vtable

Even better, remove the 'end' opcode (which shouldn't be needed), and you get a 
segmentation fault. (see attached for backtrace)




-- 
Will "Coke" Coleda
#0  0xb7de8715 in Parrot_ParrotIO_nci_say (interp=0x804f040, pmc=0x81d4e40)
    at 
/home/coke/sandbox/parrot/tools/build/../../lib/Parrot/Pmc2c/PCCMETHOD.pm:451
#1  0xb7e0338e in Parrot_NCI_invoke (interp=0x804f040, pmc=0x81d4e40,
    next=0x8230d30) at ./src/pmc/nci.pmc:203
#2  0xb7c2d6d0 in Parrot_callmethodcc_p_sc (cur_opcode=0x8230d24,
    interp=0x804f040) at src/ops/object.ops:78
#3  0xb7cbc8c4 in runops_slow_core (interp=0x804f040, pc=0x8230d24)
    at src/runops_cores.c:221
#4  0xb7c8f946 in runops_int (interp=0x804f040, offset=0)
    at src/interpreter.c:929
#5  0xb7c90223 in runops (interp=0x804f040, offs=0) at src/inter_run.c:101
#6  0xb7c904c0 in runops_args (interp=0x804f040, sub=0x8214d90,
    obj=0x809ded0, meth_unused=0x0, sig=0xb7ef11b3 "vP",
    ap=0xbf99b10c "\004M!\bH±\231¿P,[EMAIL PROTECTED]") at src/inter_run.c:223
#7  0xb7c905fc in Parrot_runops_fromc_args (interp=0x804f040, sub=0x8214d90,
    sig=0xb7ef11b3 "vP") at src/inter_run.c:295
#8  0xb7c79697 in Parrot_runcode (interp=0x804f040, argc=1, argv=0xbf99b278)
    at src/embed.c:951
#9  0xb7eccdb2 in imcc_run_pbc (interp=0x804f040, obj_file=0,
    output_file=0x0, argc=1, argv=0xbf99b278) at compilers/imcc/main.c:783
#10 0xb7ecd7a2 in imcc_run (interp=0x804f040,
    sourcefile=0xbf99b9f7 "foo.pir", argc=1, argv=0xbf99b278)
    at compilers/imcc/main.c:1071
#11 0x08048978 in main (argc=1, argv=0xbf99b278) at src/main.c:61

.sub main :main
  .local pmc type
  newclass type, 'Parent'

  .local pmc obj
  push_eh handler
    obj = new 'Parent'
    print 'not '
  handler:
  .local pmc exception
  .local string message
  .get_results(exception,message)

  print "ok #"
  say message
  end
.end

.namespace ['Parent']

.sub 'init' :vtable
  die 'test exception from init vtable'
.end

Reply via email to