Subject: | [PATCH] vxs segfaults on Jifty's Makefile.PL |
Date: | Sat, 01 Apr 2006 12:33:01 +0800 |
To: | bug-version [...] rt.cpan.org, jpeacock [...] rowman.com |
From: | Audrey Tang <audreyt [...] audreyt.org> |
Message body not shown because it is not plain text.
This patch fixes a segfault occurred on my freebsd laptop with Jifty's
Makefile.PL that checks for version.pm. I don't really know what's
happening here, but testing for a null pointer before SvOK()'ing it
seems to be an acceptable practice anyway.
Thanks!
Audrey
--- vxs.xs.orig Sat Apr 1 13:28:57 2006
+++ vxs.xs Sat Apr 1 13:29:11 2006
@@ -201,7 +201,7 @@
gvp = pkg ? (GV**)hv_fetch(pkg,"VERSION",7,FALSE) : Null(GV**);
- if (gvp && isGV(gv = *gvp) && SvOK(sv = GvSV(gv))) {
+ if (gvp && isGV(gv = *gvp) && (sv = GvSV(gv)) && SvOK(sv)) {
SV *nsv = sv_newmortal();
sv_setsv(nsv, sv);
sv = nsv;