From 3f37873a68f953120252d0ab7057b03939b47ade Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 5 Mar 2024 09:34:25 +1100 Subject: [PATCH] WIP --- sv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sv.c b/sv.c index 5ba3b1b62cea..6d8dd2683ae0 100644 --- a/sv.c +++ b/sv.c @@ -4912,10 +4912,11 @@ Perl_sv_setsv_cow(pTHX_ SV **pdsv, SV *ssv) sv_dump(dsv); } #endif - if (!CHECK_COWBUF_THRESHOLD(cur, len) - || ! CHECK_COW_THRESHOLD(cur, len)) { + if (!SvIsCOW(ssv) && + (!CHECK_COWBUF_THRESHOLD(cur, len) + || ! CHECK_COW_THRESHOLD(cur, len))) { DEBUG_C(PerlIO_printf(Perl_debug_log, - "Fast copy on write: Sizes %zu/%zu not appropriate to COW\n", cur, len)); + "Fast copy on write: Sizes %zu/%zu %p/%p not appropriate to COW\n", cur, len, dsv ? (void *)SvPVX(dsv) : (void *)0, (void*)SvPVX(ssv))); return FALSE; } if (dsv) {