summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-06-27 18:34:36 +0100
committerNicholas Clark <nick@ccl4.org>2010-06-27 18:42:03 +0100
commit9fed9930ce50e45354ea3630282369d9cbf41332 (patch)
treebbff8153b688078490f75948769e9c7d65f92c9c
parenta009834b5bcd633e6446e235821ffdb3091b62b8 (diff)
downloadperl-9fed9930ce50e45354ea3630282369d9cbf41332.tar.gz
Return DIE(...) to *return*ing Perl_die(...).
Much simplification ensues - witness the diffstat. Changes Perl_die_unwind() to use Perl_croak() rather than DIE(). Reverses an unwise part of bb4c52e023e0fcad. Reverts 9e95c6350a60744d and 805bf316c58ab2d7.
-rw-r--r--mathoms.c2
-rw-r--r--pp.c2
-rw-r--r--pp.h2
-rw-r--r--pp_ctl.c4
-rw-r--r--pp_sys.c54
5 files changed, 4 insertions, 60 deletions
diff --git a/mathoms.c b/mathoms.c
index 7154245d70..058d76d568 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -697,13 +697,11 @@ 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 94965f2d8c..ab1c680579 100644
--- a/pp.c
+++ b/pp.c
@@ -3618,7 +3618,6 @@ PP(pp_crypt)
#else
DIE(aTHX_
"The crypt() function is unimplemented due to excessive paranoia.");
- return NORMAL;
#endif
}
@@ -6020,7 +6019,6 @@ 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 8cf208cded..f1db6b78b1 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 Perl_die
+#define DIE return Perl_die
/*
=for apidoc Ams||PUTBACK
diff --git a/pp_ctl.c b/pp_ctl.c
index 7b94587fd2..28fc6ffdb3 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1635,8 +1635,8 @@ Perl_die_unwind(pTHX_ SV *msv)
* supposed to trap errors. So now that we've popped the
* EVAL that pp_require pushed, and processed the error
* message, rethrow the error */
- DIE(aTHX_ "%sCompilation failed in require",
- *msg ? msg : "Unknown error\n");
+ Perl_croak(aTHX_ "%sCompilation failed in require",
+ *msg ? msg : "Unknown error\n");
}
if (in_eval & EVAL_KEEPERR) {
Perl_ck_warner(aTHX_ packWARN(WARN_MISC), "\t(in cleanup) %s",
diff --git a/pp_sys.c b/pp_sys.c
index a6d356e470..1f1f59c06c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -487,8 +487,7 @@ PP(pp_die)
else {
exsv = newSVpvs_flags("Died", SVs_TEMP);
}
- die_sv(exsv);
- RETURN;
+ return die_sv(exsv);
}
/* I/O. */
@@ -677,7 +676,6 @@ badexit:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_func, "pipe");
- return NORMAL;
#endif
}
@@ -1168,7 +1166,6 @@ PP(pp_sselect)
RETURN;
#else
DIE(aTHX_ "select not implemented");
- return NORMAL;
#endif
}
@@ -2378,7 +2375,6 @@ PP(pp_flock)
RETURN;
#else
DIE(aTHX_ PL_no_func, "flock()");
- return NORMAL;
#endif
}
@@ -2431,7 +2427,6 @@ PP(pp_socket)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_sock_func, "socket");
- return NORMAL;
#endif
}
@@ -2493,7 +2488,6 @@ PP(pp_sockpair)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_sock_func, "socketpair");
- return NORMAL;
#endif
}
@@ -2525,7 +2519,6 @@ nuts:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "bind");
- return NORMAL;
#endif
}
@@ -2556,7 +2549,6 @@ nuts:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "connect");
- return NORMAL;
#endif
}
@@ -2583,7 +2575,6 @@ nuts:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "listen");
- return NORMAL;
#endif
}
@@ -2663,7 +2654,6 @@ badexit:
#else
DIE(aTHX_ PL_no_sock_func, "accept");
- return NORMAL;
#endif
}
@@ -2688,7 +2678,6 @@ nuts:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "shutdown");
- return NORMAL;
#endif
}
@@ -2766,7 +2755,6 @@ nuts2:
#else
DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]);
- return NORMAL;
#endif
}
@@ -2831,7 +2819,6 @@ nuts2:
#else
DIE(aTHX_ PL_no_sock_func, PL_op_desc[PL_op->op_type]);
- return NORMAL;
#endif
}
@@ -3633,7 +3620,6 @@ PP(pp_chroot)
RETURN;
#else
DIE(aTHX_ PL_no_func, "chroot");
- return NORMAL;
#endif
}
@@ -3708,7 +3694,6 @@ PP(pp_link)
{
/* Have neither. */
DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]);
- return NORMAL;
}
#endif
@@ -3923,7 +3908,6 @@ nope:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_dir_func, "opendir");
- return NORMAL;
#endif
}
@@ -3931,7 +3915,6 @@ PP(pp_readdir)
{
#if !defined(Direntry_t) || !defined(HAS_READDIR)
DIE(aTHX_ PL_no_dir_func, "readdir");
- return NORMAL;
#else
#if !defined(I_DIRENT) && !defined(VMS)
Direntry_t *readdir (DIR *);
@@ -4010,7 +3993,6 @@ nope:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_dir_func, "telldir");
- return NORMAL;
#endif
}
@@ -4036,7 +4018,6 @@ nope:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_dir_func, "seekdir");
- return NORMAL;
#endif
}
@@ -4060,7 +4041,6 @@ nope:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_dir_func, "rewinddir");
- return NORMAL;
#endif
}
@@ -4093,7 +4073,6 @@ nope:
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_dir_func, "closedir");
- return NORMAL;
#endif
}
@@ -4140,7 +4119,6 @@ PP(pp_fork)
RETURN;
# else
DIE(aTHX_ PL_no_func, "fork");
- return NORMAL;
# endif
#endif
}
@@ -4170,7 +4148,6 @@ PP(pp_wait)
RETURN;
#else
DIE(aTHX_ PL_no_func, "wait");
- return NORMAL;
#endif
}
@@ -4201,7 +4178,6 @@ PP(pp_waitpid)
RETURN;
#else
DIE(aTHX_ PL_no_func, "waitpid");
- return NORMAL;
#endif
}
@@ -4407,7 +4383,6 @@ PP(pp_getppid)
RETURN;
#else
DIE(aTHX_ PL_no_func, "getppid");
- return NORMAL;
#endif
}
@@ -4429,7 +4404,6 @@ PP(pp_getpgrp)
RETURN;
#else
DIE(aTHX_ PL_no_func, "getpgrp()");
- return NORMAL;
#endif
}
@@ -4463,7 +4437,6 @@ PP(pp_setpgrp)
RETURN;
#else
DIE(aTHX_ PL_no_func, "setpgrp()");
- return NORMAL;
#endif
}
@@ -4477,7 +4450,6 @@ PP(pp_getpriority)
RETURN;
#else
DIE(aTHX_ PL_no_func, "getpriority()");
- return NORMAL;
#endif
}
@@ -4493,7 +4465,6 @@ PP(pp_setpriority)
RETURN;
#else
DIE(aTHX_ PL_no_func, "setpriority()");
- return NORMAL;
#endif
}
@@ -4544,7 +4515,6 @@ PP(pp_tms)
RETURN;
# else
DIE(aTHX_ "times not implemented");
- return NORMAL;
# endif
#endif /* HAS_TIMES */
}
@@ -4661,7 +4631,6 @@ PP(pp_alarm)
RETURN;
#else
DIE(aTHX_ PL_no_func, "alarm");
- return NORMAL;
#endif
}
@@ -4731,7 +4700,6 @@ PP(pp_semget)
RETURN;
#else
DIE(aTHX_ "System V IPC is not implemented on this machine");
- return NORMAL;
#endif
}
@@ -4867,7 +4835,6 @@ PP(pp_ghostent)
RETURN;
#else
DIE(aTHX_ PL_no_sock_func, "gethostent");
- return NORMAL;
#endif
}
@@ -4941,7 +4908,6 @@ PP(pp_gnetent)
RETURN;
#else
DIE(aTHX_ PL_no_sock_func, "getnetent");
- return NORMAL;
#endif
}
@@ -5002,7 +4968,6 @@ PP(pp_gprotoent)
RETURN;
#else
DIE(aTHX_ PL_no_sock_func, "getprotoent");
- return NORMAL;
#endif
}
@@ -5078,7 +5043,6 @@ PP(pp_gservent)
RETURN;
#else
DIE(aTHX_ PL_no_sock_func, "getservent");
- return NORMAL;
#endif
}
@@ -5090,7 +5054,6 @@ PP(pp_shostent)
RETSETYES;
#else
DIE(aTHX_ PL_no_sock_func, "sethostent");
- return NORMAL;
#endif
}
@@ -5102,7 +5065,6 @@ PP(pp_snetent)
RETSETYES;
#else
DIE(aTHX_ PL_no_sock_func, "setnetent");
- return NORMAL;
#endif
}
@@ -5114,7 +5076,6 @@ PP(pp_sprotoent)
RETSETYES;
#else
DIE(aTHX_ PL_no_sock_func, "setprotoent");
- return NORMAL;
#endif
}
@@ -5126,7 +5087,6 @@ PP(pp_sservent)
RETSETYES;
#else
DIE(aTHX_ PL_no_sock_func, "setservent");
- return NORMAL;
#endif
}
@@ -5139,7 +5099,6 @@ PP(pp_ehostent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_sock_func, "endhostent");
- return NORMAL;
#endif
}
@@ -5152,7 +5111,6 @@ PP(pp_enetent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_sock_func, "endnetent");
- return NORMAL;
#endif
}
@@ -5165,7 +5123,6 @@ PP(pp_eprotoent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_sock_func, "endprotoent");
- return NORMAL;
#endif
}
@@ -5178,7 +5135,6 @@ PP(pp_eservent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_sock_func, "endservent");
- return NORMAL;
#endif
}
@@ -5412,7 +5368,6 @@ PP(pp_gpwent)
RETURN;
#else
DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]);
- return NORMAL;
#endif
}
@@ -5424,7 +5379,6 @@ PP(pp_spwent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_func, "setpwent");
- return NORMAL;
#endif
}
@@ -5436,7 +5390,6 @@ PP(pp_epwent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_func, "endpwent");
- return NORMAL;
#endif
}
@@ -5511,7 +5464,6 @@ PP(pp_ggrent)
RETURN;
#else
DIE(aTHX_ PL_no_func, PL_op_desc[PL_op->op_type]);
- return NORMAL;
#endif
}
@@ -5523,7 +5475,6 @@ PP(pp_sgrent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_func, "setgrent");
- return NORMAL;
#endif
}
@@ -5535,7 +5486,6 @@ PP(pp_egrent)
RETPUSHYES;
#else
DIE(aTHX_ PL_no_func, "endgrent");
- return NORMAL;
#endif
}
@@ -5551,7 +5501,6 @@ PP(pp_getlogin)
RETURN;
#else
DIE(aTHX_ PL_no_func, "getlogin");
- return NORMAL;
#endif
}
@@ -5650,7 +5599,6 @@ PP(pp_syscall)
RETURN;
#else
DIE(aTHX_ PL_no_func, "syscall");
- return NORMAL;
#endif
}