summaryrefslogtreecommitdiff
path: root/fakesdio.h
diff options
context:
space:
mode:
authorJim Cromie <jim.cromie@gmail.com>2014-11-02 14:00:47 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-11-02 17:15:04 -0800
commit21b66d1ce5e03b3996596fe9b97b8ce0ce854a95 (patch)
treecded1e37cc3cf99e2cd392a3b078692240b23a9d /fakesdio.h
parent10884df96723d4c5a0a8a5da8e25401124174ed9 (diff)
downloadperl-21b66d1ce5e03b3996596fe9b97b8ce0ce854a95.tar.gz
end the pp_mapstart trickery
Current codebase wires Perl_pp_mapstart to Perl_unimplemented_op (by regen/opcode.pl) [1], but then avoids runtime panics by Perl_ck_grep changing all OP_MAPSTART nodes to use PL_ppaddr[OP_GREPSTART] [2]. This is all too clever by half, so this patch undoes the trickery, and treats these 2 OPS like 93bad3fd5548 did for OP_AELEMFAST and \1_LEX. I cant glean a reason for this historical arrangement: Looking at regen/opcode.pl blamelog.. 65bca31a68 added Perl_unimplemented_op() used by 3 'unreachable' ops, and replaced a 'panic: mapstart' diag with a common one, so the trick goes further back. c78ff9799bf moved a minimal/DIEing pp_mapstart implementation to mathoms.c from pp_ctl.c. Perl_ck_grep also did the GREPSTART patching back then. f54cb97a39f did minor tweaks to a full pp_mapstart implementation. I couldnt find the commit between it and c78ff that changed pp_mapstart to a DIEing one, or I fat-fingered it, or I got distracted. looking at ck-grep(), the code doing [2] is from 22c35a8c23 in 1998. So anyway, I tried the following, it worked, it seems the historical reason is no longer relevant. [1] change regen/opcode.pl generated mapping -#define Perl_pp_mapstart Perl_unimplemented_op +#define Perl_pp_mapstart Perl_pp_grepstart this sets PL_ppaddr[OP_MAPSTART] = PL_ppaddr[OP_GREPSTART] during init, which makes the optype trickery in ck_grep[2] unneeded. [2] Drop re-type-ing of MAPSTARTs as GREPSTARTs by Perl_ck_grep(OP* o) Given 1, mapstart & grepstart share code, so just leave optype alone.
Diffstat (limited to 'fakesdio.h')
0 files changed, 0 insertions, 0 deletions