# New Ticket Created by  Bob Rogers 
# Please include the string:  [perl #59614]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59614 >


   Invoking the attached test case fails in the following way:

        [EMAIL PROTECTED]> ./parrot test-exception-pc.pir 
        too few arguments passed (1) - 2 params expected
        current instr.: 'main' pc 9 (test-exception-pc.pir:3)
        [EMAIL PROTECTED]> 

The problem is that pc 9/line 3 is the location of the invokecc
instruction that calls the erring test sub, not the location of the
get_results instruction where the problem is detected.  I'm not sure how
to fix this, because it messes greatly with the modularity of how return
addresses are tracked.

   But I think it really ought to be fixed before the next release --
that or the arg-checking requirement for exception handlers should be
relaxed, at least temporarily.  I stumbled onto this when Kea-CL fell
afoul of the exception handling arg change introduced in r31294 (about
which I don't recall seeing any mention on the list).  Because of the
misplaced error message, it took me a while to track it down.

                                        -- Bob

.sub main :main
        push_eh handler
        test()
        ## NB:  This makes sure the sub call PC is sufficiently
        ## different from the exception handler PC.
        print "foo\n"
        print "bar\n"
        .return ()
handler:
        .local pmc exception
        .local string message
        .get_results (exception, message)
        print "Error: "
        print message
.end

.sub test
        ## Throw an exception.
        $P0 = new 'Exception'
        $P0 = 'oops'
        throw $P0
.end

Reply via email to