From 8777c9be0f45ac3c917698c1afb18e1e8507a188 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 25 Jul 2012 18:00:34 -0700 Subject: [PATCH] Merge ck_trunc and ck_chdir ck_chdir, added in 2006 (d4ac975e) duplicates ck_trunc, added in 1993 (79072805), except for a null op check which is harmless when applied to chdir. --- embed.h | 1 - op.c | 17 ----------------- opcode.h | 2 +- proto.h | 6 ------ regen/opcodes | 2 +- 5 files changed, 2 insertions(+), 26 deletions(-) diff --git a/embed.h b/embed.h index f8be76d..5e9f6eb 100644 --- a/embed.h +++ b/embed.h @@ -1011,7 +1011,6 @@ #define check_utf8_print(a,b) Perl_check_utf8_print(aTHX_ a,b) #define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a) #define ck_bitop(a) Perl_ck_bitop(aTHX_ a) -#define ck_chdir(a) Perl_ck_chdir(aTHX_ a) #define ck_cmp(a) Perl_ck_cmp(aTHX_ a) #define ck_concat(a) Perl_ck_concat(aTHX_ a) #define ck_defined(a) Perl_ck_defined(aTHX_ a) diff --git a/op.c b/op.c index 28fc225..b5ebd79 100644 --- a/op.c +++ b/op.c @@ -10020,23 +10020,6 @@ Perl_ck_svconst(pTHX_ OP *o) } OP * -Perl_ck_chdir(pTHX_ OP *o) -{ - PERL_ARGS_ASSERT_CK_CHDIR; - if (o->op_flags & OPf_KIDS) { - SVOP * const kid = (SVOP*)cUNOPo->op_first; - - if (kid && kid->op_type == OP_CONST && - (kid->op_private & OPpCONST_BARE)) - { - o->op_flags |= OPf_SPECIAL; - kid->op_private &= ~OPpCONST_STRICT; - } - } - return ck_fun(o); -} - -OP * Perl_ck_trunc(pTHX_ OP *o) { PERL_ARGS_ASSERT_CK_TRUNC; diff --git a/opcode.h b/opcode.h index 2c7db83..10dc22a 100644 --- a/opcode.h +++ b/opcode.h @@ -1596,7 +1596,7 @@ EXT Perl_check_t PL_check[] /* or perlvars.h */ Perl_ck_ftst, /* fttty */ Perl_ck_ftst, /* fttext */ Perl_ck_ftst, /* ftbinary */ - Perl_ck_chdir, /* chdir */ + Perl_ck_trunc, /* chdir */ Perl_ck_fun, /* chown */ Perl_ck_fun, /* chroot */ Perl_ck_fun, /* unlink */ diff --git a/proto.h b/proto.h index 2c04468..1930ff3 100644 --- a/proto.h +++ b/proto.h @@ -312,12 +312,6 @@ PERL_CALLCONV OP * Perl_ck_bitop(pTHX_ OP *o) #define PERL_ARGS_ASSERT_CK_BITOP \ assert(o) -PERL_CALLCONV OP * Perl_ck_chdir(pTHX_ OP *o) - __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_CK_CHDIR \ - assert(o) - PERL_CALLCONV OP * Perl_ck_cmp(pTHX_ OP *o) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); diff --git a/regen/opcodes b/regen/opcodes index da2212a..e249407 100644 --- a/regen/opcodes +++ b/regen/opcodes @@ -413,7 +413,7 @@ ftbinary -B ck_ftst isu- F- # File calls. # chdir really behaves as if it had both "S?" and "F?" -chdir chdir ck_chdir isT% S? +chdir chdir ck_trunc isT% S? chown chown ck_fun imsT@ L chroot chroot ck_fun isTu% S? unlink unlink ck_fun imsTu@ L -- 2.7.4