Index: src/pmc/continuation.pmc =================================================================== --- src/pmc/continuation.pmc (revision 11359) +++ src/pmc/continuation.pmc (working copy) @@ -150,22 +150,30 @@ =item C -Sets the pointer to the actual subroutine. +Sets the pointer to the return instruction. =cut */ void set_pointer (void* value) { + opcode_t *pos = value; + struct Parrot_cont * cc = PMC_cont(SELF); + PObj_get_FLAGS(SELF) |= PObj_private1_FLAG; - PMC_cont(SELF)->address = value; + cc->address = value; + if (pos && *pos == PARROT_OP_get_results_pc) { + cc->current_results = pos; + } + else + cc->current_results = NULL; } /* =item C -Returns the pointer to the actual subroutine. +Returns the pointer to the return instruction. =cut Index: src/pmc/exception_handler.pmc =================================================================== --- src/pmc/exception_handler.pmc (revision 11359) +++ src/pmc/exception_handler.pmc (working copy) @@ -82,17 +82,6 @@ return result; } - void set_pointer (void* value) { - opcode_t *pos = value; - struct Parrot_cont * cc = PMC_cont(SELF); - if (*pos == PARROT_OP_get_results_pc) { - cc->current_results = pos; - } - else - cc->current_results = NULL; - SUPER(value); - } - void* invoke (void* ex) { struct Parrot_cont * cc = PMC_cont(SELF); PMC *exception = ex; Index: t/op/calling.t =================================================================== --- t/op/calling.t (revision 11359) +++ t/op/calling.t (working copy) @@ -1579,6 +1579,31 @@ ok 2 OUTPUT +pir_output_is(<<'CODE', <<'OUTPUT', "set_args via explicit continuation"); +.sub main :main + .local string result + result = "not ok 2\n" + .local pmc cont + cont = new .Continuation + set_addr cont, cont_dest + bar(cont, "ok 1\n") + print "oops\n" +cont_dest: + .get_results (result) + print result +.end + +.sub bar + .param pmc cc + .param string s + print s + cc("ok 2\n") +.end +CODE +ok 1 +ok 2 +OUTPUT + pir_output_is(<<'CODE', <<'OUTPUT', "call evaled vtable code"); .sub main :main .local string s @@ -2154,5 +2179,5 @@ /duplicate name/ OUTPUT ## remember to change the number of tests :-) -BEGIN { plan tests => 85 } +BEGIN { plan tests => 86 }