summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerard Goossen <gerard@tty.nl>2009-10-29 12:27:49 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-11-06 14:16:27 +0100
commitbb4c52e023e0fcade469e46e9a1d5245ff44f3f2 (patch)
tree70d31b8d5045c7af391d3b1a8a98054d96902263
parent45a2d9782bd1c90e53c52dacd30d9b185db62239 (diff)
downloadperl-bb4c52e023e0fcade469e46e9a1d5245ff44f3f2.tar.gz
move JMPENV_JUMP to die_where and mark it as "noreturn"
-rw-r--r--embed.fnc2
-rw-r--r--mathoms.c2
-rw-r--r--pp.c1
-rw-r--r--pp.h2
-rw-r--r--pp_ctl.c7
-rw-r--r--pp_sys.c1
-rw-r--r--proto.h4
-rw-r--r--util.c18
8 files changed, 16 insertions, 21 deletions
diff --git a/embed.fnc b/embed.fnc
index 204389e5e8..493f9c9403 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -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
diff --git a/mathoms.c b/mathoms.c
index 108b762cf1..626bbb36bc 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -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. */
diff --git a/pp.c b/pp.c
index f58c0c5ace..bb0e57de7e 100644
--- a/pp.c
+++ b/pp.c
@@ -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)
diff --git a/pp.h b/pp.h
index f3da1a7f80..9d078af5e5 100644
--- a/pp.h
+++ b/pp.h
@@ -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
diff --git a/pp_ctl.c b/pp_ctl.c
index ce60ea0375..06a0f7389a 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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)
diff --git a/pp_sys.c b/pp_sys.c
index 015fcdf4a6..8a82573520 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -497,6 +497,7 @@ PP(pp_die)
tmpsv = newSVpvs_flags("Died", SVs_TEMP);
DIE(aTHX_ "%"SVf, SVfARG(tmpsv));
+ RETURN;
}
/* I/O. */
diff --git a/proto.h b/proto.h
index 92737e0e5a..353f9c3d71 100644
--- a/proto.h
+++ b/proto.h
@@ -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)
diff --git a/util.c b/util.c
index f2702129f7..5e5758dadd 100644
--- a/util.c
+++ b/util.c
@@ -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);