diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-10-31 18:34:59 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-10-31 18:34:59 +0000 |
commit | 65bca31a689e744d19bc76458567e5ae895ca3dd (patch) | |
tree | b5169e63a1f207d980ba8fa5cc0bd20a23f53b56 | |
parent | 836ede62bb86a610a76a79ff480e4916d1c82de1 (diff) | |
download | perl-65bca31a689e744d19bc76458567e5ae895ca3dd.tar.gz |
Replace the 3 currently "unreachable" ops with a single op body
unimplemented_op() that panics descriptively if ever reached.
p4raw-id: //depot/perl@25937
-rw-r--r-- | opcode.h | 8 | ||||
-rwxr-xr-x | opcode.pl | 5 | ||||
-rw-r--r-- | pod/perldiag.pod | 9 | ||||
-rw-r--r-- | pp.c | 7 |
4 files changed, 21 insertions, 8 deletions
@@ -20,6 +20,8 @@ #define Perl_pp_i_postinc Perl_pp_postinc #define Perl_pp_i_postdec Perl_pp_postdec +PERL_PPDEF(Perl_unimplemented_op) + START_EXTERN_C #define OP_NAME(o) ((o)->op_type == OP_CUSTOM ? custom_op_name(o) : \ @@ -776,7 +778,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ MEMBER_TO_FPTR(Perl_pp_padsv), MEMBER_TO_FPTR(Perl_pp_padav), MEMBER_TO_FPTR(Perl_pp_padhv), - MEMBER_TO_FPTR(Perl_pp_padany), + MEMBER_TO_FPTR(Perl_unimplemented_op), /* Perl_pp_padany */ MEMBER_TO_FPTR(Perl_pp_pushre), MEMBER_TO_FPTR(Perl_pp_rv2gv), MEMBER_TO_FPTR(Perl_pp_rv2sv), @@ -918,7 +920,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ MEMBER_TO_FPTR(Perl_pp_reverse), MEMBER_TO_FPTR(Perl_pp_grepstart), MEMBER_TO_FPTR(Perl_pp_grepwhile), - MEMBER_TO_FPTR(Perl_pp_mapstart), + MEMBER_TO_FPTR(Perl_unimplemented_op), /* Perl_pp_mapstart */ MEMBER_TO_FPTR(Perl_pp_mapwhile), MEMBER_TO_FPTR(Perl_pp_range), MEMBER_TO_FPTR(Perl_pp_flip), @@ -1112,7 +1114,7 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */ MEMBER_TO_FPTR(Perl_pp_getlogin), MEMBER_TO_FPTR(Perl_pp_syscall), MEMBER_TO_FPTR(Perl_pp_lock), - MEMBER_TO_FPTR(Perl_pp_threadsv), + MEMBER_TO_FPTR(Perl_unimplemented_op), /* Perl_pp_threadsv */ MEMBER_TO_FPTR(Perl_pp_setstate), MEMBER_TO_FPTR(Perl_pp_method_named), MEMBER_TO_FPTR(Perl_pp_dor), @@ -40,7 +40,8 @@ my %alias; # Format is "this function" => "does these op names" my @raw_alias = ( Perl_do_kv => [qw( keys values )], - ); + Perl_unimplemented_op => [qw(padany threadsv mapstart)], + ); while (my ($func, $names) = splice @raw_alias, 0, 2) { $alias{$_} = $func for @$names; @@ -72,6 +73,8 @@ print <<"END"; #define Perl_pp_i_postinc Perl_pp_postinc #define Perl_pp_i_postdec Perl_pp_postdec +PERL_PPDEF(Perl_unimplemented_op) + END print ON <<"END"; diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 42a1fcbdcd..3c16b0d2b6 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2916,10 +2916,6 @@ references to an object. (P) Something requested a negative number of bytes of malloc. -=item panic: mapstart - -(P) The compiler is screwed up with respect to the map() function. - =item panic: memory wrap (P) Something tried to allocate more memory than possible. @@ -3000,6 +2996,11 @@ was string. (P) The compiler attempted to do a goto, or something weird like that. +=item panic: unimplemented op %s (#%d) called + +(P) The compiler is screwed up and attempted to use an op that isn't permitted +at run time. + =item panic: utf16_to_utf8: odd bytelen (P) Something tried to call utf16_to_utf8 with an odd (as opposed @@ -4785,6 +4785,13 @@ PP(pp_lock) RETURN; } + +PP(unimplemented_op) +{ + DIE(aTHX_ "panic: unimplemented op %s (#%d) called", OP_NAME(PL_op), + PL_op->op_type); +} + /* * Local variables: * c-indentation-style: bsd |