… | |
… | |
546 | * emulate part of the perl startup here. |
546 | * emulate part of the perl startup here. |
547 | */ |
547 | */ |
548 | |
548 | |
549 | coro_init_stacks (); |
549 | coro_init_stacks (); |
550 | |
550 | |
|
|
551 | PL_curcop = 0; |
|
|
552 | PL_in_eval = 0; |
|
|
553 | PL_curpm = 0; |
|
|
554 | |
551 | { |
555 | { |
552 | dSP; |
556 | dSP; |
553 | LOGOP myop; |
557 | LOGOP myop; |
554 | |
558 | |
555 | /*PL_curcop = 0;*/ |
559 | /* I have no idea why this is needed, but it is */ |
556 | PL_in_eval = 0; |
560 | PUSHMARK (SP); |
|
|
561 | |
557 | SvREFCNT_dec (GvAV (PL_defgv)); |
562 | SvREFCNT_dec (GvAV (PL_defgv)); |
558 | GvAV (PL_defgv) = coro->args; coro->args = 0; |
563 | GvAV (PL_defgv) = coro->args; coro->args = 0; |
559 | |
|
|
560 | SPAGAIN; |
|
|
561 | |
564 | |
562 | Zero (&myop, 1, LOGOP); |
565 | Zero (&myop, 1, LOGOP); |
563 | myop.op_next = Nullop; |
566 | myop.op_next = Nullop; |
564 | myop.op_flags = OPf_WANT_VOID; |
567 | myop.op_flags = OPf_WANT_VOID; |
565 | |
568 | |
566 | PL_op = (OP *)&myop; |
569 | PL_op = (OP *)&myop; |
567 | |
570 | |
568 | PUSHMARK (SP); |
|
|
569 | PUSHMARK (SP); |
571 | PUSHMARK (SP); |
570 | XPUSHs ((SV *)get_cv ("Coro::State::coro_init", FALSE)); |
572 | XPUSHs ((SV *)get_cv ("Coro::State::coro_init", FALSE)); |
571 | PUTBACK; |
573 | PUTBACK; |
572 | PL_op = PL_ppaddr[OP_ENTERSUB](aTHX); |
574 | PL_op = PL_ppaddr[OP_ENTERSUB](aTHX); |
573 | SPAGAIN; |
575 | SPAGAIN; |