This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Have newCONSTSUB pass the length to newXS
[perl5.git] / op.c
diff --git a/op.c b/op.c
index e4a9f13..3071440 100644 (file)
--- a/op.c
+++ b/op.c
@@ -6924,8 +6924,6 @@ Perl_newCONSTSUB_flags(pTHX_ HV *stash, const char *name, STRLEN len,
     const char *const file = temp_sv ? SvPV_nolen_const(temp_sv) : NULL;
 #endif
 
-    PERL_UNUSED_ARG(len);
-
     ENTER;
 
     if (IN_PERL_RUNTIME) {
@@ -6952,7 +6950,7 @@ Perl_newCONSTSUB_flags(pTHX_ HV *stash, const char *name, STRLEN len,
        and so doesn't get free()d.  (It's expected to be from the C pre-
        processor __FILE__ directive). But we need a dynamically allocated one,
        and we need it to get freed.  */
-    cv = newXS_flags(name, const_sv_xsub, file ? file : "", "",
+    cv = newXS_len_flags(name, len, const_sv_xsub, file ? file : "", "",
                     XS_DYNAMIC_FILENAME | flags);
     CvXSUBANY(cv).any_ptr = sv;
     CvCONST_on(cv);