diff options
author | Gerard Goossen <gerard@tty.nl> | 2009-10-29 12:27:49 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-11-06 14:16:27 +0100 |
commit | bb4c52e023e0fcade469e46e9a1d5245ff44f3f2 (patch) | |
tree | 70d31b8d5045c7af391d3b1a8a98054d96902263 | |
parent | 45a2d9782bd1c90e53c52dacd30d9b185db62239 (diff) | |
download | perl-bb4c52e023e0fcade469e46e9a1d5245ff44f3f2.tar.gz |
move JMPENV_JUMP to die_where and mark it as "noreturn"
-rw-r--r-- | embed.fnc | 2 | ||||
-rw-r--r-- | mathoms.c | 2 | ||||
-rw-r--r-- | pp.c | 1 | ||||
-rw-r--r-- | pp.h | 2 | ||||
-rw-r--r-- | pp_ctl.c | 7 | ||||
-rw-r--r-- | pp_sys.c | 1 | ||||
-rw-r--r-- | proto.h | 4 | ||||
-rw-r--r-- | util.c | 18 |
8 files changed, 16 insertions, 21 deletions
@@ -218,7 +218,7 @@ Afp |OP* |die |NULLOK const char* pat|... s |OP* |vdie |NULLOK const char* pat|NULLOK va_list* args #endif : Used in util.c -p |OP* |die_where |NULLOK SV* msv +pr |void |die_where |NULLOK SV* msv Ap |void |dounwind |I32 cxix : FIXME pmb |bool |do_aexec |NULLOK SV* really|NN SV** mark|NN SV** sp @@ -684,11 +684,13 @@ Perl_init_i18nl14n(pTHX_ int printwarn) PP(pp_padany) { DIE(aTHX_ "NOT IMPL LINE %d",__LINE__); + return NORMAL; } PP(pp_mapstart) { DIE(aTHX_ "panic: mapstart"); /* uses grepstart */ + return NORMAL; } /* These ops all have the same body as pp_null. */ @@ -5333,6 +5333,7 @@ PP(unimplemented_op) dVAR; DIE(aTHX_ "panic: unimplemented op %s (#%d) called", OP_NAME(PL_op), PL_op->op_type); + return NORMAL; } PP(pp_boolkeys) @@ -86,7 +86,7 @@ Refetch the stack pointer. Used after a callback. See L<perlcall>. #define dTARG SV *targ #define NORMAL PL_op->op_next -#define DIE return Perl_die +#define DIE Perl_die /* =for apidoc Ams||PUTBACK @@ -1543,7 +1543,7 @@ Perl_qerror(pTHX_ SV *err) ++PL_parser->error_count; } -OP * +void Perl_die_where(pTHX_ SV *msv) { dVAR; @@ -1632,14 +1632,15 @@ Perl_die_where(pTHX_ SV *msv) *msg ? msg : "Unknown error\n"); } assert(CxTYPE(cx) == CXt_EVAL); - return cx->blk_eval.retop; + PL_restartop = cx->blk_eval.retop; + JMPENV_JUMP(3); + /* NOTREACHED */ } } write_to_stderr( msv ? msv : ERRSV ); my_failure_exit(); /* NOTREACHED */ - return 0; } PP(pp_xor) @@ -497,6 +497,7 @@ PP(pp_die) tmpsv = newSVpvs_flags("Died", SVs_TEMP); DIE(aTHX_ "%"SVf, SVfARG(tmpsv)); + RETURN; } /* I/O. */ @@ -522,7 +522,9 @@ PERL_CALLCONV OP* Perl_die(pTHX_ const char* pat, ...) #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) STATIC OP* S_vdie(pTHX_ const char* pat, va_list* args); #endif -PERL_CALLCONV OP* Perl_die_where(pTHX_ SV* msv); +PERL_CALLCONV void Perl_die_where(pTHX_ SV* msv) + __attribute__noreturn__; + PERL_CALLCONV void Perl_dounwind(pTHX_ I32 cxix); /* PERL_CALLCONV bool Perl_do_aexec(pTHX_ SV* really, SV** mark, SV** sp) __attribute__nonnull__(pTHX_2) @@ -1364,8 +1364,7 @@ S_vdie(pTHX_ const char* pat, va_list *args) message = vdie_croak_common(pat, args); - PL_restartop = die_where(message); - JMPENV_JUMP(3); + die_where(message); /* NOTREACHED */ return NULL; } @@ -1403,13 +1402,7 @@ Perl_vcroak(pTHX_ const char* pat, va_list *args) msv = S_vdie_croak_common(aTHX_ pat, args); - if (PL_in_eval) { - PL_restartop = die_where(msv); - JMPENV_JUMP(3); - } - - write_to_stderr( msv ? msv : ERRSV ); - my_failure_exit(); + die_where(msv); } #if defined(PERL_IMPLICIT_CONTEXT) @@ -1564,12 +1557,7 @@ Perl_vwarner(pTHX_ U32 err, const char* pat, va_list* args) assert(msv); S_vdie_common(aTHX_ msv, FALSE); } - if (PL_in_eval) { - PL_restartop = die_where(msv); - JMPENV_JUMP(3); - } - write_to_stderr(msv); - my_failure_exit(); + die_where(msv); } else { Perl_vwarn(aTHX_ pat, args); |