From 0f194c83b0f19f7917e6f8b1218d49858220cda6 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Fri, 17 May 2019 13:01:35 +0100 Subject: [PATCH] make S_gen_constant_list() void return Its gen_constant_list(o) returns an OP*, but the thing it returns is currently always o. So just assume it returns it arg. This will shortly make making Perl_list() non-recursive easier. --- embed.fnc | 2 +- op.c | 12 +++++++----- proto.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/embed.fnc b/embed.fnc index b8d429a..0cd0917 100644 --- a/embed.fnc +++ b/embed.fnc @@ -636,7 +636,7 @@ Afpd |char* |form |NN const char* pat|... Ap |char* |vform |NN const char* pat|NULLOK va_list* args Ap |void |free_tmps #if defined(PERL_IN_OP_C) -S |OP* |gen_constant_list|NULLOK OP* o +S |void |gen_constant_list|NULLOK OP* o #endif #if !defined(HAS_GETENV_LEN) : Used in hv.c diff --git a/op.c b/op.c index d781de7..b5da98d 100644 --- a/op.c +++ b/op.c @@ -2356,7 +2356,8 @@ Perl_list(pTHX_ OP *o) /* possibly flatten 1..10 into a constant array */ if (!o->op_next && cUNOPo->op_first->op_type == OP_FLOP) { list(cBINOPo->op_first); - return gen_constant_list(o); + gen_constant_list(o); + return o; } listkids(o); break; @@ -5755,7 +5756,7 @@ S_fold_constants(pTHX_ OP *const o) * the constant value being an AV holding the flattened range. */ -static OP * +static void S_gen_constant_list(pTHX_ OP *o) { dVAR; @@ -5774,7 +5775,7 @@ S_gen_constant_list(pTHX_ OP *o) list(o); if (PL_parser && PL_parser->error_count) - return o; /* Don't attempt to run with errors */ + return; /* Don't attempt to run with errors */ curop = LINKLIST(o); old_next = o->op_next; @@ -5841,7 +5842,7 @@ S_gen_constant_list(pTHX_ OP *o) delete_eval_scope(); } if (ret) - return o; + return; OpTYPE_set(o, OP_RV2AV); o->op_flags &= ~OPf_REF; /* treat \(1..2) like an ordinary list */ @@ -5861,7 +5862,8 @@ S_gen_constant_list(pTHX_ OP *o) SvREADONLY_on(*svp); } LINKLIST(o); - return list(o); + list(o); + return; } /* diff --git a/proto.h b/proto.h index 0fc2adc..9359016 100644 --- a/proto.h +++ b/proto.h @@ -5050,7 +5050,7 @@ STATIC OP* S_force_list(pTHX_ OP* arg, bool nullit); STATIC void S_forget_pmop(pTHX_ PMOP *const o); #define PERL_ARGS_ASSERT_FORGET_PMOP \ assert(o) -STATIC OP* S_gen_constant_list(pTHX_ OP* o); +STATIC void S_gen_constant_list(pTHX_ OP* o); STATIC void S_inplace_aassign(pTHX_ OP* o); #define PERL_ARGS_ASSERT_INPLACE_AASSIGN \ assert(o) -- 1.8.3.1