move JMPENV_JUMP to die_where and mark it as "noreturn"

This commit is contained in:
Gerard Goossen 2009-10-29 12:27:49 +01:00 committed by Rafael Garcia-Suarez
parent 45a2d9782b
commit bb4c52e023
8 changed files with 16 additions and 21 deletions

View File

@ -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

View File

@ -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. */

1
pp.c
View File

@ -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)

2
pp.h
View File

@ -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

View File

@ -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)

View File

@ -497,6 +497,7 @@ PP(pp_die)
tmpsv = newSVpvs_flags("Died", SVs_TEMP);
DIE(aTHX_ "%"SVf, SVfARG(tmpsv));
RETURN;
}
/* I/O. */

View File

@ -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)

18
util.c
View File

@ -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);