This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix small nits
[perl5.git] / cc_runtime.h
CommitLineData
66918de8 1#define DOOP(ppname) PUTBACK; PL_op = ppname(aTHX); SPAGAIN
a8a597b2
MB
2
3#define PP_LIST(g) do { \
4 dMARK; \
5 if (g != G_ARRAY) { \
6 if (++MARK <= SP) \
7 *MARK = *SP; \
8 else \
6b88bc9c 9 *MARK = &PL_sv_undef; \
a8a597b2
MB
10 SP = MARK; \
11 } \
12 } while (0)
13
14#define MAYBE_TAINT_SASSIGN_SRC(sv) \
6b88bc9c 15 if (PL_tainting && PL_tainted && (!SvGMAGICAL(left) || !SvSMAGICAL(left) || \
a8a597b2
MB
16 !((mg=mg_find(left, 't')) && mg->mg_len & 1)))\
17 TAINT_NOT
18
19#define PP_PREINC(sv) do { \
20 if (SvIOK(sv)) { \
21 ++SvIVX(sv); \
22 SvFLAGS(sv) &= ~(SVf_NOK|SVf_POK|SVp_NOK|SVp_POK); \
23 } \
24 else \
25 sv_inc(sv); \
26 SvSETMAGIC(sv); \
27 } while (0)
28
29#define PP_UNSTACK do { \
30 TAINT_NOT; \
6b88bc9c 31 PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; \
a8a597b2 32 FREETMPS; \
6b88bc9c 33 oldsave = PL_scopestack[PL_scopestack_ix - 1]; \
a8a597b2
MB
34 LEAVE_SCOPE(oldsave); \
35 SPAGAIN; \
36 } while(0)
37
38/* Anyone using eval "" deserves this mess */
39#define PP_EVAL(ppaddr, nxt) do { \
40 dJMPENV; \
6224f72b 41 int ret; \
a8a597b2 42 PUTBACK; \
6224f72b
GS
43 JMPENV_PUSH(ret); \
44 switch (ret) { \
45 case 0: \
66918de8 46 PL_op = ppaddr(aTHX); \
6b88bc9c 47 PL_retstack[PL_retstack_ix - 1] = Nullop; \
8af582d5 48 if (PL_op != nxt) CALLRUNOPS(); \
a8a597b2
MB
49 JMPENV_POP; \
50 break; \
6224f72b
GS
51 case 1: JMPENV_POP; JMPENV_JUMP(1); \
52 case 2: JMPENV_POP; JMPENV_JUMP(2); \
53 case 3: \
a8a597b2 54 JMPENV_POP; \
6b88bc9c 55 if (PL_restartop != nxt) \
6224f72b 56 JMPENV_JUMP(3); \
a8a597b2 57 } \
6b88bc9c 58 PL_op = nxt; \
a8a597b2
MB
59 SPAGAIN; \
60 } while (0)
61
a6f4eb0a 62
1d651c14
VB
63#define PP_ENTERTRY(jmpbuf,label) \
64 STMT_START { \
65 int ret; \
66 JMPENV_PUSH_ENV(jmpbuf,ret); \
67 switch (ret) { \
68 case 1: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(1);\
69 case 2: JMPENV_POP_ENV(jmpbuf); JMPENV_JUMP(2);\
70 case 3: JMPENV_POP_ENV(jmpbuf); SPAGAIN; goto label;\
71 } \
72 } STMT_END
73#define PP_LEAVETRY \
74 STMT_START{ PL_top_env=PL_top_env->je_prev; }STMT_END