HvNAME_get() can return NULL, and strNE() wants non-null args.
[
As a side note: on debugging builds this line
if (strNE(HvNAME_get(hv),"main")) {
macro-expands into an 18,000 character line (!) due to the fact that
HvNAME_get() is quite a big expansion under debugging, and strNE expands to
strlen, which under gcc expands to a huge macro (which is mainly lots of
different compile-time alternatives depending on which of its args are
constants), that references its args several times.
]
our($VERSION, @ISA, @EXPORT_OK);
-$VERSION = "1.26";
+$VERSION = "1.27";
use Carp;
use Exporter ();
SV *Package
PPCODE:
HV *hv;
+ char *hvname;
ENTER;
hv = gv_stashsv(Package, GV_ADDWARN); /* should exist already */
- if (strNE(HvNAME_get(hv),"main")) {
+ hvname = HvNAME_get(hv);
+ if (!hvname || strNE(hvname, "main")) {
/* make it think it's in main:: */
hv_name_set(hv, "main", 4, 0);
(void) hv_store(hv,"_",1,(SV *)PL_defgv,0); /* connect _ to global */