summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index 8b7c84c7ae..24186e0895 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5095,10 +5095,14 @@ S_compile_runtime_code(pTHX_ RExC_state_t * const pRExC_state,
SPAGAIN;
qr_ref = POPs;
PUTBACK;
- if (SvTRUE(ERRSV))
{
- Safefree(pRExC_state->code_blocks);
- Perl_croak(aTHX_ "%s", SvPVx_nolen_const(ERRSV));
+ SV * const errsv = ERRSV;
+ if (SvTRUE_NN(errsv))
+ {
+ Safefree(pRExC_state->code_blocks);
+ /* use croak_sv ? */
+ Perl_croak_nocontext("%s", SvPV_nolen_const(errsv));
+ }
}
assert(SvROK(qr_ref));
qr = SvRV(qr_ref);