diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-08 23:57:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-14 12:54:05 -0700 |
commit | b66130dd0dcaf72b6e443ebde808ff3b8ff9c885 (patch) | |
tree | b63612384ab492310823ce54c709401795d03e07 /op.c | |
parent | be1b855bbb2f62dad5aa5efb8dc5bce980ad4086 (diff) | |
download | perl-b66130dd0dcaf72b6e443ebde808ff3b8ff9c885.tar.gz |
Move pp_-specific code out of core_prototype
Commit b8c38f0a2a65 refactored pp_prototype by moving much of its
code to a new function in op.c, called core_prototype. This served
two purposes: (1) to allow the code to be simplified, which required
the use of static functions in op.c, and (2) to allow the &CORE::subs
feature to share the same code.
But some code was moved to core_prototype which, in hindsight, did not
need to be moved, such as the ‘Can’t find an opnumber’ message.
This commit moves that code back to pp_prototype, resulting in a sim-
pler (and possibly faster, at least for &CORE::subs) core_prototype.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -10343,7 +10343,7 @@ returns NULL if C<croak> is false. SV * Perl_core_prototype(pTHX_ SV *sv, const char *name, const int code, - int * const opnum, const bool croak) + int * const opnum) { int i = 0, n = 0, seen_question = 0, defgv = 0; I32 oa; @@ -10353,15 +10353,7 @@ Perl_core_prototype(pTHX_ SV *sv, const char *name, const int code, PERL_ARGS_ASSERT_CORE_PROTOTYPE; - if (!code || code == -KEY_CORE) { - if (croak) - return (SV *)Perl_die(aTHX_ - "Can't find an opnumber for \"%s\"", name - ); - return NULL; - } - - if (code > 0) return NULL; /* Not overridable */ + assert (code < 0 && code != -KEY_CORE); if (!sv) sv = sv_newmortal(); |