Skip to content

Commit

Permalink
Stop calling Perl_die manually
Browse files Browse the repository at this point in the history
Call die() instead.
  • Loading branch information
Leont committed Feb 20, 2025
1 parent 5b377ad commit 45cce2d
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ XS(XS_builtin_func1_scalar)
break;

default:
Perl_die(aTHX_ "panic: unhandled opcode %" IVdf
die("panic: unhandled opcode %" IVdf
" for xs_builtin_func1_scalar()", (IV) ix);
}

Expand Down Expand Up @@ -376,7 +376,7 @@ XS(XS_builtin_func1_void)
break;

default:
Perl_die(aTHX_ "panic: unhandled opcode %" IVdf
die("panic: unhandled opcode %" IVdf
" for xs_builtin_func1_void()", (IV) ix);
}

Expand Down
10 changes: 5 additions & 5 deletions doio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2632,11 +2632,11 @@ Perl_apply(pTHX_ I32 type, SV **mark, SV **sp)
platforms where kill was not defined. */
#ifndef HAS_KILL
if (type == OP_KILL)
Perl_die(aTHX_ PL_no_func, what);
die(PL_no_func, what);
#endif
#ifndef HAS_CHOWN
if (type == OP_CHOWN)
Perl_die(aTHX_ PL_no_func, what);
die(PL_no_func, what);
#endif


Expand Down Expand Up @@ -2675,7 +2675,7 @@ Perl_apply(pTHX_ I32 type, SV **mark, SV **sp)
} else if (fchmod(fd, val))
tot--;
#else
Perl_die(aTHX_ PL_no_func, "fchmod");
die(PL_no_func, "fchmod");
#endif
}
else {
Expand Down Expand Up @@ -2716,7 +2716,7 @@ Perl_apply(pTHX_ I32 type, SV **mark, SV **sp)
} else if (fchown(fd, val, val2))
tot--;
#else
Perl_die(aTHX_ PL_no_func, "fchown");
die(PL_no_func, "fchown");
#endif
}
else {
Expand Down Expand Up @@ -2908,7 +2908,7 @@ nothing in the core.
} else if (futimes(fd, (struct timeval *) utbufp))
tot--;
#else
Perl_die(aTHX_ PL_no_func, "futimes");
die(PL_no_func, "futimes");
#endif
}
else {
Expand Down
2 changes: 1 addition & 1 deletion gv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,7 @@ Perl_gp_free(pTHX_ GV *gv)
&& !gp->gp_form) break;

if (--attempts == 0) {
Perl_die(aTHX_
die(
"panic: gp_free failed to free glob pointer - "
"something is repeatedly re-creating entries"
);
Expand Down
4 changes: 2 additions & 2 deletions hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3499,7 +3499,7 @@ Perl_hv_placeholders_p(pTHX_ HV *hv)
mg = sv_magicext(MUTABLE_SV(hv), 0, PERL_MAGIC_rhash, 0, 0, 0);

if (!mg) {
Perl_die(aTHX_ "panic: hv_placeholders_p");
die("panic: hv_placeholders_p");
}
}
return &(mg->mg_len);
Expand Down Expand Up @@ -3543,7 +3543,7 @@ Perl_hv_placeholders_set(pTHX_ HV *hv, I32 ph)
mg->mg_len = ph;
} else if (ph) {
if (!sv_magicext(MUTABLE_SV(hv), 0, PERL_MAGIC_rhash, 0, 0, ph))
Perl_die(aTHX_ "panic: hv_placeholders_set");
die("panic: hv_placeholders_set");
}
/* else we don't need to add magic to record 0 placeholders. */
}
Expand Down
4 changes: 2 additions & 2 deletions mg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ Perl_magic_set_all_env(pTHX_ SV *sv, MAGIC *mg)
PERL_ARGS_ASSERT_MAGIC_SET_ALL_ENV;
PERL_UNUSED_ARG(mg);
#if defined(VMS)
Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system");
die("Can't make list assignment to %%ENV on this system");
#else
if (PL_localizing) {
HE* entry;
Expand All @@ -1463,7 +1463,7 @@ Perl_magic_clear_all_env(pTHX_ SV *sv, MAGIC *mg)
PERL_UNUSED_ARG(sv);
PERL_UNUSED_ARG(mg);
#if defined(VMS)
Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system");
die("Can't make list assignment to %%ENV on this system");
#else
my_clearenv();
#endif
Expand Down
12 changes: 6 additions & 6 deletions pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
sv = MUTABLE_SV(gv);
}
else if (!isGV_with_GP(sv)) {
Perl_die(aTHX_ "Not a GLOB reference");
die("Not a GLOB reference");
}
}
else {
Expand Down Expand Up @@ -143,7 +143,7 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
goto wasref;
}
if (PL_op->op_flags & OPf_REF || strict) {
Perl_die(aTHX_ PL_no_usym, "a symbol");
die(PL_no_usym, "a symbol");
}
if (ckWARN(WARN_UNINITIALIZED))
report_uninit(sv);
Expand All @@ -158,7 +158,7 @@ S_rv2gv(pTHX_ SV *sv, const bool vivify_sv, const bool strict,
}
else {
if (strict) {
Perl_die(aTHX_
die(
PL_no_symref_sv,
sv,
(SvPOKp(sv) && SvCUR(sv)>32 ? "..." : ""),
Expand Down Expand Up @@ -223,16 +223,16 @@ Perl_softref2xv(pTHX_ SV *const sv, const char *const what,

if (PL_op->op_private & HINT_STRICT_REFS) {
if (SvOK(sv))
Perl_die(aTHX_ PL_no_symref_sv, sv,
die(PL_no_symref_sv, sv,
(SvPOKp(sv) && SvCUR(sv)>32 ? "..." : ""), what);
else
Perl_die(aTHX_ PL_no_usym, what);
die(PL_no_usym, what);
}
if (!SvOK(sv)) {
if (
PL_op->op_flags & OPf_REF
)
Perl_die(aTHX_ PL_no_usym, what);
die(PL_no_usym, what);
if (ckWARN(WARN_UNINITIALIZED))
report_uninit(sv);
if (type != SVt_PV && GIMME_V == G_LIST) {
Expand Down
2 changes: 1 addition & 1 deletion pp_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6767,7 +6767,7 @@ S_doparseform(pTHX_ SV *sv)
mg->mg_flags |= MGf_REFCOUNTED;

if (unchopnum && repeat)
Perl_die(aTHX_ "Repeated format line will never terminate (~~ and @#)");
die("Repeated format line will never terminate (~~ and @#)");

return mg;
}
Expand Down
10 changes: 5 additions & 5 deletions pp_hot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2749,7 +2749,7 @@ S_aassign_uid(pTHX)
# endif /* HAS_SETEUID */
if (PL_delaymagic & DM_UID) {
if (PL_delaymagic_uid != PL_delaymagic_euid)
Perl_die(aTHX_ "No setreuid available");
die("No setreuid available");
PERL_UNUSED_RESULT(PerlProc_setuid(PL_delaymagic_uid));
}
#endif /* HAS_SETRESUID */
Expand Down Expand Up @@ -2784,7 +2784,7 @@ S_aassign_uid(pTHX)
# endif /* HAS_SETEGID */
if (PL_delaymagic & DM_GID) {
if (PL_delaymagic_gid != PL_delaymagic_egid)
Perl_die(aTHX_ "No setregid available");
die("No setregid available");
PERL_UNUSED_RESULT(PerlProc_setgid(PL_delaymagic_gid));
}
#endif /* HAS_SETRESGID */
Expand Down Expand Up @@ -4431,13 +4431,13 @@ S_softref2xv_lite(pTHX_ SV *const sv, const char *const what,
{
if (PL_op->op_private & HINT_STRICT_REFS) {
if (SvOK(sv))
Perl_die(aTHX_ PL_no_symref_sv, sv,
die(PL_no_symref_sv, sv,
(SvPOKp(sv) && SvCUR(sv)>32 ? "..." : ""), what);
else
Perl_die(aTHX_ PL_no_usym, what);
die(PL_no_usym, what);
}
if (!SvOK(sv))
Perl_die(aTHX_ PL_no_usym, what);
die(PL_no_usym, what);
return gv_fetchsv_nomg(sv, GV_ADD, type);
}

Expand Down
2 changes: 1 addition & 1 deletion sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -13499,7 +13499,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
int i = PERL_INT_MIN;
(void)Perl_frexp((NV)fv, &i);
if (i == PERL_INT_MIN)
Perl_die(aTHX_ "panic: frexp: %" VCATPVFN_FV_GF, fv);
die("panic: frexp: %" VCATPVFN_FV_GF, fv);

if (i > 0) {
digits = BIT_DIGITS(i);
Expand Down
2 changes: 1 addition & 1 deletion toke.c
Original file line number Diff line number Diff line change
Expand Up @@ -4961,7 +4961,7 @@ Perl_filter_del(pTHX_ filter_t funcp)
return;
}
/* we need to search for the correct entry and clear it */
Perl_die(aTHX_ "filter_del can only delete in reverse order (currently)");
die("filter_del can only delete in reverse order (currently)");
}


Expand Down

0 comments on commit 45cce2d

Please sign in to comment.