summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cop.h3
-rw-r--r--embed.fnc1
-rw-r--r--embed.h1
-rw-r--r--proto.h3
-rw-r--r--util.c9
5 files changed, 15 insertions, 2 deletions
diff --git a/cop.h b/cop.h
index 0a682f15e2..8acdec87d0 100644
--- a/cop.h
+++ b/cop.h
@@ -1134,8 +1134,7 @@ typedef struct stackinfo PERL_SI;
Perl_deb(aTHX_ "pop STACKINFO %d at %s:%d\n", \
i, __FILE__, __LINE__);}) \
if (!prev) { \
- PerlIO_printf(Perl_error_log, "panic: POPSTACK\n"); \
- my_exit(1); \
+ Perl_croak_popstack(); \
} \
SWITCHSTACK(PL_curstack,prev->si_stack); \
/* don't free prev here, free them all at the END{} */ \
diff --git a/embed.fnc b/embed.fnc
index 61934fb2d7..75688fb7c2 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -262,6 +262,7 @@ Anprd |void |croak_no_modify
Anprd |void |croak_xs_usage |NN const CV *const cv \
|NN const char *const params
npr |void |croak_no_mem
+nprX |void |croak_popstack
#if defined(WIN32)
norx |void |win32_croak_not_implemented|NN const char * fname
#endif
diff --git a/embed.h b/embed.h
index 2aae592bc4..1136f60466 100644
--- a/embed.h
+++ b/embed.h
@@ -1059,6 +1059,7 @@
#define coresub_op(a,b,c) Perl_coresub_op(aTHX_ a,b,c)
#define create_eval_scope(a) Perl_create_eval_scope(aTHX_ a)
#define croak_no_mem Perl_croak_no_mem
+#define croak_popstack Perl_croak_popstack
#define cv_ckproto_len_flags(a,b,c,d,e) Perl_cv_ckproto_len_flags(aTHX_ a,b,c,d,e)
#define cv_clone_into(a,b) Perl_cv_clone_into(aTHX_ a,b)
#define cv_forget_slab(a) Perl_cv_forget_slab(aTHX_ a)
diff --git a/proto.h b/proto.h
index e8af3c8548..ee2b14ef7e 100644
--- a/proto.h
+++ b/proto.h
@@ -676,6 +676,9 @@ PERL_CALLCONV_NO_RET void Perl_croak_no_mem(void)
PERL_CALLCONV_NO_RET void Perl_croak_no_modify(void)
__attribute__noreturn__;
+PERL_CALLCONV_NO_RET void Perl_croak_popstack(void)
+ __attribute__noreturn__;
+
PERL_CALLCONV_NO_RET void Perl_croak_sv(pTHX_ SV *baseex)
__attribute__noreturn__
__attribute__nonnull__(pTHX_1);
diff --git a/util.c b/util.c
index 12a6bf439c..987e41ebab 100644
--- a/util.c
+++ b/util.c
@@ -1634,6 +1634,15 @@ Perl_croak_no_mem()
my_exit(1);
}
+/* does not return, used only in POPSTACK */
+void
+Perl_croak_popstack(void)
+{
+ dTHX;
+ PerlIO_printf(Perl_error_log, "panic: POPSTACK\n");
+ my_exit(1);
+}
+
/*
=for apidoc Am|void|warn_sv|SV *baseex