Skip to content

Commit

Permalink
croak squash
Browse files Browse the repository at this point in the history
  • Loading branch information
richardleach committed Dec 12, 2024
1 parent ef3e70d commit a867572
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
6 changes: 3 additions & 3 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -5811,6 +5811,9 @@ S |void |assert_uft8_cache_coherent \
|STRLEN from_cache \
|STRLEN real \
|NN SV * const sv
S |void |croak_sv_setsv_flags \
|NN SV * const dsv \
|NN SV * const ssv
S |bool |curse |NN SV * const sv \
|const bool check_refcnt
RS |STRLEN |expect_number |NN const char ** const pattern
Expand Down Expand Up @@ -5870,9 +5873,6 @@ ST |STRLEN |sv_pos_u2b_midway \
|NN const U8 *send \
|STRLEN uoffset \
|const STRLEN uend
S |void |sv_setsv_flags_croak \
|NN SV * const dsv \
|NN SV * const ssv
i |void |sv_unglob |NN SV * const sv \
|U32 flags
RTi |char * |uiv_2buf |NN char * const buf \
Expand Down
2 changes: 1 addition & 1 deletion embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,7 @@
# define F0convert S_F0convert
# define anonymise_cv_maybe(a,b) S_anonymise_cv_maybe(aTHX_ a,b)
# define assert_uft8_cache_coherent(a,b,c,d) S_assert_uft8_cache_coherent(aTHX_ a,b,c,d)
# define croak_sv_setsv_flags(a,b) S_croak_sv_setsv_flags(aTHX_ a,b)
# define curse(a,b) S_curse(aTHX_ a,b)
# define expect_number(a) S_expect_number(aTHX_ a)
# define find_array_subscript(a,b) S_find_array_subscript(aTHX_ a,b)
Expand All @@ -2174,7 +2175,6 @@
# define sv_pos_u2b_cached(a,b,c,d,e,f,g) S_sv_pos_u2b_cached(aTHX_ a,b,c,d,e,f,g)
# define sv_pos_u2b_forwards S_sv_pos_u2b_forwards
# define sv_pos_u2b_midway S_sv_pos_u2b_midway
# define sv_setsv_flags_croak(a,b) S_sv_setsv_flags_croak(aTHX_ a,b)
# define sv_unglob(a,b) S_sv_unglob(aTHX_ a,b)
# define uiv_2buf S_uiv_2buf
# define utf8_mg_len_cache_update(a,b,c) S_utf8_mg_len_cache_update(aTHX_ a,b,c)
Expand Down
10 changes: 5 additions & 5 deletions proto.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4281,7 +4281,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dsv, SV* ssv, const I32 flags)
#endif
*/
if (UNLIKELY(both_type == SVTYPEMASK)) {
sv_setsv_flags_croak(dsv, ssv);
croak_sv_setsv_flags(dsv, ssv);
NOT_REACHED;
}

Expand Down Expand Up @@ -4383,7 +4383,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dsv, SV* ssv, const I32 flags)
invlist_clone(ssv, dsv);
return;
default:
sv_setsv_flags_croak(dsv, ssv);
croak_sv_setsv_flags(dsv, ssv);
NOT_REACHED; /* NOTREACHED */

case SVt_REGEXP:
Expand Down Expand Up @@ -4437,7 +4437,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dsv, SV* ssv, const I32 flags)
else if (UNLIKELY(dtype == SVt_PVAV || dtype == SVt_PVHV
|| dtype == SVt_PVFM))
{
sv_setsv_flags_croak(dsv, ssv);
croak_sv_setsv_flags(dsv, ssv);
NOT_REACHED;
} else if (sflags & SVf_ROK) {
if (isGV_with_GP(dsv)
Expand Down Expand Up @@ -17725,8 +17725,9 @@ Perl_report_uninit(pTHX_ const SV *uninit_sv)
* The main aim is to keep Perl_sv_setsv_flags as slim as possible and this
* includes keeping the call sites for this function small.
*/
void S_sv_setsv_flags_croak(pTHX_ SV * const dsv, SV * const ssv)
void S_croak_sv_setsv_flags(pTHX_ SV * const dsv, SV * const ssv)
{
OP *op = PL_op;
if (SvIS_FREED(dsv)) {
Perl_croak(aTHX_ "panic: attempt to copy value %" SVf
" to a freed scalar %p", SVfARG(ssv), (void *)dsv);
Expand All @@ -17739,17 +17740,17 @@ void S_sv_setsv_flags_croak(pTHX_ SV * const dsv, SV * const ssv)
if (SvTYPE(ssv) > SVt_PVLV)
{
const char * const type = sv_reftype(ssv,0);
if (PL_op)
if (op)
/* diag_listed_as: Bizarre copy of %s */
Perl_croak(aTHX_ "Bizarre copy of %s in %s", type, OP_DESC(PL_op));
Perl_croak(aTHX_ "Bizarre copy of %s in %s", type, OP_DESC(op));
else
Perl_croak(aTHX_ "Bizarre copy of %s", type);
}

const char * const type = sv_reftype(dsv,0);
if (PL_op)
if (op)
/* diag_listed_as: Cannot copy to %s */
Perl_croak(aTHX_ "Cannot copy to %s in %s", type, OP_DESC(PL_op));
Perl_croak(aTHX_ "Cannot copy to %s in %s", type, OP_DESC(op));
else
Perl_croak(aTHX_ "Cannot copy to %s", type);

Expand Down

0 comments on commit a867572

Please sign in to comment.