Commit 9dd66e3992 for perl
commit 9dd66e3992be759558dcb510fa4aa7d82ec05d97
Author: Tony Cook <tony@develop-help.com>
Date: Mon Sep 21 14:47:46 2026 +1000
Devel::PPPort: add sv_set_undef()
diff --git a/dist/Devel-PPPort/Changes b/dist/Devel-PPPort/Changes
index 703bffb1c0..941a7bf4f0 100644
--- a/dist/Devel-PPPort/Changes
+++ b/dist/Devel-PPPort/Changes
@@ -1,5 +1,9 @@
Revision history for Devel-PPPort
+3.75
+
+ * add sv_set_undef
+
3.74
* add SSize_t_MAX, Size_t_MAX, STRLEN_MAX
diff --git a/dist/Devel-PPPort/PPPort_pm.PL b/dist/Devel-PPPort/PPPort_pm.PL
index 18fab3ca31..f8af61cd76 100644
--- a/dist/Devel-PPPort/PPPort_pm.PL
+++ b/dist/Devel-PPPort/PPPort_pm.PL
@@ -756,7 +756,7 @@ package Devel::PPPort;
use strict;
use vars qw($VERSION $data);
-$VERSION = '3.74';
+$VERSION = '3.75';
sub _init_data
{
diff --git a/dist/Devel-PPPort/parts/inc/Sv_set b/dist/Devel-PPPort/parts/inc/Sv_set
index cb5cd77e36..59615bcdd2 100644
--- a/dist/Devel-PPPort/parts/inc/Sv_set
+++ b/dist/Devel-PPPort/parts/inc/Sv_set
@@ -173,6 +173,8 @@ __UNDEFINED__ SvUV_set(sv, val) \
#endif
+__UNDEFINED__ sv_set_undef(sv) sv_setpv(sv, NULL)
+
=xsubs
IV
@@ -238,7 +240,10 @@ sv_setsv_compile_test(sv)
sv_setsv_flags(sv, NULL, 0);
sv_setsv_flags(sv, NULL, SV_NOSTEAL);
-=tests plan => 15
+void
+sv_set_undef(SV *sv)
+
+=tests plan => 18
my $foo = 5;
is(&Devel::PPPort::TestSvUV_set($foo, 12345), 42);
@@ -276,6 +281,17 @@ is($bar->x(), 'hacker');
is tied($scalar)->{store}, 0;
is $copy2, 'string';
+my $quux_destroyed;
+{
+ my $x = 1;
+ Devel::PPPort::sv_set_undef($x);
+ ok !defined $x, '$x no longer defined';
+ $x = bless {}, "quux";
+ Devel::PPPort::sv_set_undef($x);
+ ok !defined $x, '$x no longer quux-like';
+ is $quux_destroyed, 1, "quux destroyed";
+}
+
package TieScalarCounter;
sub TIESCALAR {
@@ -302,3 +318,9 @@ sub x { 'foobar' }
package bar;
sub x { 'hacker' }
+
+package quux;
+
+sub DESTROY {
+ ++$quux_destroyed;
+}
\ No newline at end of file