File: docatch.c.inc

package info (click to toggle)
libfuture-asyncawait-perl 0.70-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 528 kB
  • sloc: perl: 2,647; ansic: 118; pascal: 34; makefile: 3
file content (43 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* vi: set ft=c inde=: */

#ifndef docatch

#define docatch(firstpp)  S_docatch(aTHX_ firstpp)

static OP *S_docatch(pTHX_ Perl_ppaddr_t firstpp)
{
    int ret;
    OP * const oldop = PL_op;
    dJMPENV;

    assert(CATCH_GET == TRUE);

    JMPENV_PUSH(ret);
    switch (ret) {
    case 0:
	PL_op = firstpp(aTHX);
 redo_body:
        if(PL_op)
            CALLRUNOPS(aTHX);
	break;
    case 3:
	/* die caught by an inner eval - continue inner loop */
	if (PL_restartop && PL_restartjmpenv == PL_top_env) {
	    PL_restartjmpenv = NULL;
	    PL_op = PL_restartop;
	    PL_restartop = 0;
	    goto redo_body;
	}
	/* FALLTHROUGH */
    default:
	JMPENV_POP;
	PL_op = oldop;
	JMPENV_JUMP(ret);
	NOT_REACHED; /* NOTREACHED */
    }
    JMPENV_POP;
    PL_op = oldop;
    return NULL;
}

#endif