}
}
if (!intro)
- cv_ckproto(cv, (GV*)dstr,
- SvPOK(sref) ? SvPVX_const(sref) : NULL);
+ cv_ckproto_len(cv, (GV*)dstr,
+ SvPOK(sref) ? SvPVX_const(sref) : NULL,
+ SvPOK(sref) ? SvCUR(sref) : 0);
}
GvCVGEN(dstr) = 0; /* Switch off cacheness. */
GvASSUMECV_on(dstr);
If C<flags> & SV_SMAGIC is true, will call SvSETMAGIC. If C<flags> &
SV_HAS_TRAILING_NUL is true, then C<ptr[len]> must be NUL, and the realloc
-I<may> be skipped. (i.e. the buffer is actually at least 1 byte longer than
+will be skipped. (i.e. the buffer is actually at least 1 byte longer than
C<len>, and already meets the requirements for storing in C<SvPVX>)
=cut
assert(ptr[len] == '\0');
allocate = (flags & SV_HAS_TRAILING_NUL)
- ? len : PERL_STRLEN_ROUNDUP(len + 1);
+ ? len + 1: PERL_STRLEN_ROUNDUP(len + 1);
+ if (flags & SV_HAS_TRAILING_NUL) {
+ /* It's long enough - do nothing.
+ Specfically Perl_newCONSTSUB is relying on this. */
+ } else {
#ifdef DEBUGGING
- {
/* Force a move to shake out bugs in callers. */
char *new_ptr = safemalloc(allocate);
Copy(ptr, new_ptr, len, char);
PoisonFree(ptr,len,char);
Safefree(ptr);
ptr = new_ptr;
- }
#else
- if (!(flags & SV_HAS_TRAILING_NUL)) {
ptr = saferealloc (ptr, allocate);
- }
#endif
+ }
SvPV_set(sv, ptr);
SvCUR_set(sv, len);
SvLEN_set(sv, allocate);
* or are optimized away, then it's unambiguous */
o2 = NULL;
for (kid=o; kid; kid = kid->op_sibling) {
- SV *sv;
if (kid &&
- ( (kid->op_type == OP_CONST && (sv = cSVOPx_sv(kid))
- && SvOK(sv))
+ ( (kid->op_type == OP_CONST && SvOK(cSVOPx_sv(kid)))
|| (kid->op_type == OP_NULL && ! (kid->op_flags & OPf_KIDS))
|| (kid->op_type == OP_PUSHMARK)
)