This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add VMS symbol shortening to PL_bincompat_options.
[perl5.git] / util.c
diff --git a/util.c b/util.c
index 9375bd2..20429f7 100644 (file)
--- a/util.c
+++ b/util.c
@@ -6519,21 +6519,26 @@ Perl_xs_apiversion_bootcheck(pTHX_ SV *module, const char *api_p,
                             STRLEN api_len)
 {
     SV *xpt = NULL;
-    SV *compver = Perl_newSVpvn(aTHX_ api_p, api_len);
-    SV *runver = new_version(PL_apiversion);
+    SV *compver = Perl_newSVpvn_flags(aTHX_ api_p, api_len, SVs_TEMP);
+    SV *runver;
 
     PERL_ARGS_ASSERT_XS_APIVERSION_BOOTCHECK;
 
+    /* This might croak  */
     compver = upg_version(compver, 0);
+    /* This should never croak */
+    runver = new_version(PL_apiversion);
     if (vcmp(compver, runver)) {
+       SV *compver_string = vstringify(compver);
+       SV *runver_string = vstringify(runver);
        xpt = Perl_newSVpvf(aTHX_ "Perl API version %"SVf
-                            " of %s does not match %"SVf,
-                            SVfARG(Perl_sv_2mortal(aTHX_ vstringify(compver))),
-                            SvPV_nolen_const(module),
-                            SVfARG(Perl_sv_2mortal(aTHX_ vstringify(runver))));
+                           " of %"SVf" does not match %"SVf,
+                           compver_string, module, runver_string);
        Perl_sv_2mortal(aTHX_ xpt);
+
+       SvREFCNT_dec(compver_string);
+       SvREFCNT_dec(runver_string);
     }
-    SvREFCNT_dec(compver);
     SvREFCNT_dec(runver);
     if (xpt)
        Perl_croak_sv(aTHX_ xpt);