perl plugin: Do not pass NULL to newRV().
authorSebastian Harl <sh@tokkee.org>
Mon, 16 Feb 2009 12:39:54 +0000 (13:39 +0100)
committerSebastian Harl <sh@tokkee.org>
Mon, 16 Feb 2009 14:22:05 +0000 (15:22 +0100)
newRV() does not handle that correctly and causes a segfault instead. Now, we
use PL_sv_undef instead.

src/perl.c

index f9c9938..9f91d01 100644 (file)
@@ -992,14 +992,14 @@ static int pplugin_call_all (pTHX_ int type, ...)
                if (-1 == data_set2av (aTHX_ ds, pds)) {
                        av_clear (pds);
                        av_undef (pds);
-                       pds = Nullav;
+                       pds = (AV *)&PL_sv_undef;
                        ret = -1;
                }
 
                if (-1 == value_list2hv (aTHX_ vl, ds, pvl)) {
                        hv_clear (pvl);
                        hv_undef (pvl);
-                       pvl = Nullhv;
+                       pvl = (HV *)&PL_sv_undef;
                        ret = -1;
                }
 
@@ -1038,7 +1038,7 @@ static int pplugin_call_all (pTHX_ int type, ...)
                if (-1 == notification2hv (aTHX_ n, notif)) {
                        hv_clear (notif);
                        hv_undef (notif);
-                       notif = Nullhv;
+                       notif = (HV *)&PL_sv_undef;
                        ret = -1;
                }
 
@@ -2023,7 +2023,7 @@ static int perl_config_plugin (pTHX_ oconfig_item_t *ci)
                hv_undef (config);
 
                log_err ("Unable to convert configuration to a Perl hash value.");
-               config = Nullhv;
+               config = (HV *)&PL_sv_undef;
        }
 
        ENTER;