Perl_ckwarn(pTHX_ U32 w)
{
/* If lexical warnings have not been set, use $^W. */
- if (isLEXWARN_off)
- return PL_dowarn & G_WARN_ON;
+ if (isLEXWARN_off) {
+ /* TODO: Hardcoding this here sucks, see the commit that added this */
+ if (w == WARN_VOID_UNUSUAL)
+ return FALSE;
+ else
+ return PL_dowarn & G_WARN_ON;
+ }
return ckwarn_common(w);
}
Perl_ckwarn_d(pTHX_ U32 w)
{
/* If lexical warnings have not been set then default classes warn. */
- if (isLEXWARN_off)
- return TRUE;
+ if (isLEXWARN_off) {
+ /* TODO: Hardcoding this here sucks, see the commit that added this */
+ if (w == WARN_VOID_UNUSUAL)
+ return FALSE;
+ else
+ return TRUE;
+ }
return ckwarn_common(w);
}
static bool
S_ckwarn_common(pTHX_ U32 w)
{
- if (PL_curcop->cop_warnings == pWARN_ALL)
- return TRUE;
+ if (PL_curcop->cop_warnings == pWARN_ALL) {
+ /* TODO: Hardcoding this here sucks, see the commit that added this */
+ if (w == WARN_VOID_UNUSUAL)
+ return FALSE;
+ else
+ return TRUE;
+ }
if (PL_curcop->cop_warnings == pWARN_NONE)
return FALSE;
/* BFD open and scan only if the filename changed. */
if (ctx->fname_prev == NULL ||
strNE(dl_info->dli_fname, ctx->fname_prev)) {
+ if (ctx->abfd) {
+ bfd_close(ctx->abfd);
+ }
ctx->abfd = bfd_openr(dl_info->dli_fname, 0);
if (ctx->abfd) {
if (bfd_check_format(ctx->abfd, bfd_object)) {
}
#ifdef USE_BFD
Safefree(symbol_names);
+ if (bfd_ctx.abfd) {
+ bfd_close(bfd_ctx.abfd);
+ }
#endif
Safefree(source_lines);
Safefree(source_name_sizes);