summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-12-31 18:55:36 +0000
committerDavid Mitchell <davem@iabyn.com>2011-01-02 20:00:27 +0000
commitd1bea3d84afd8d32a236c8d800e5dfc0f837570e (patch)
tree7dab3aeb9baab81964b9a5e1de46c462327177e4 /pp_sys.c
parentbd31915d33b7eefea64e1a3f2416f804acf79df2 (diff)
downloadperl-d1bea3d84afd8d32a236c8d800e5dfc0f837570e.tar.gz
call pp_glob() even when its being skipped
Currently when an external Perl glob function is used (which is most of the time), the OP_GLOB op is removed and replaced with the pair: GV("CORE::GLOBAL::glob"), ENTERSUB. This commit re-adds the OP_GLOB to the op tree, but with OPf_SPECIAL set; and pp_glob() is updated to just return if OPf_SPECIAL is set. Thus there's no change in outward functionality with this commit. However, by always calling pp_glob(), it will allow us (in the next commit) to handle iterator overloading consistently, regardless of whether the internal globbing function is used or not.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 332abbbc11..7144bc3725 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -358,6 +358,16 @@ PP(pp_glob)
{
dVAR;
OP *result;
+
+ if (PL_op->op_flags & OPf_SPECIAL) {
+ /* call Perl-level glob function instead. Stack args are:
+ * MARK, wildcard, csh_glob context index
+ * and following OPs should be: gv(CORE::GLOBAL::glob), entersub
+ * */
+ return NORMAL;
+ }
+ /* stack args are: wildcard, gv(_GEN_n) */
+
tryAMAGICunTARGET(iter_amg, -1);
/* Note that we only ever get here if File::Glob fails to load