Skip to content

Make undef warnings thrown from inside xsubs more useful  #18501

@leonerd

Description

@leonerd

Calling e.g SvIV(sv) on an undefined sv will cause perl to print "Use of unininitialized value in ..." the most recent PL_op. If that's anywhere inside an XSUB (which it likely is), the most recent PL_op is the OP_ENTERSUB which brought us here, so it prints "in subroutine entry...". Not very helpful.

I would find this about a billion times more useful if it printed the CvNAME of the XSUB instead; so the output was something like

Use of uninitialized value in XSModule::xfunc() called at Some/Perl/File.pm line 1234.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions