Skip to content

Commit 06c1b78

Browse files
committed
pp_backtick: remove RC_STACK wrapper and use the new APIs
1 parent 26d7084 commit 06c1b78

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

pp_sys.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ S_emulate_eaccess(pTHX_ const char* path, Mode_t mode)
278278
# define PERL_EFF_ACCESS(p,f) (S_emulate_eaccess(aTHX_ (p), (f)))
279279
#endif
280280

281-
PP_wrapped(pp_backtick, 1, 0)
281+
PP(pp_backtick)
282282
{
283-
dSP; dTARGET;
283+
dTARGET;
284284
PerlIO *fp;
285-
const char * const tmps = POPpconstx;
285+
const char * const tmps = SvPV_nolen(*PL_stack_sp);
286286
const U8 gimme = GIMME_V;
287287
const char *mode = "r";
288288

@@ -292,6 +292,7 @@ PP_wrapped(pp_backtick, 1, 0)
292292
else if (PL_op->op_private & OPpOPEN_IN_CRLF)
293293
mode = "rt";
294294
fp = PerlProc_popen(tmps, mode);
295+
rpp_popfree_1();
295296
if (fp) {
296297
const char * const type = Perl_PerlIO_context_layers(aTHX_ NULL);
297298
if (type && *type)
@@ -310,7 +311,7 @@ PP_wrapped(pp_backtick, 1, 0)
310311
while (sv_gets(TARG, fp, SvCUR(TARG)) != NULL)
311312
NOOP;
312313
LEAVE_with_name("backtick");
313-
XPUSHs(TARG);
314+
rpp_push_1(TARG);
314315
SvTAINTED_on(TARG);
315316
}
316317
else {
@@ -320,7 +321,8 @@ PP_wrapped(pp_backtick, 1, 0)
320321
SvREFCNT_dec(sv);
321322
break;
322323
}
323-
mXPUSHs(sv);
324+
rpp_extend(1);
325+
rpp_push_1_norc(sv);
324326
if (SvLEN(sv) - SvCUR(sv) > 20) {
325327
SvPV_shrink_to_cur(sv);
326328
}
@@ -333,10 +335,10 @@ PP_wrapped(pp_backtick, 1, 0)
333335
else {
334336
STATUS_NATIVE_CHILD_SET(-1);
335337
if (gimme == G_SCALAR)
336-
RETPUSHUNDEF;
338+
rpp_push_1(&PL_sv_undef);
337339
}
338340

339-
RETURN;
341+
return NORMAL;
340342
}
341343

342344

0 commit comments

Comments
 (0)