This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ExtUtils::ParseXS: Accept overridden input typemaps
authorSteffen Mueller <smueller@cpan.org>
Thu, 25 Aug 2011 06:19:40 +0000 (08:19 +0200)
committerSteffen Mueller <smueller@cpan.org>
Thu, 25 Aug 2011 07:27:01 +0000 (09:27 +0200)
commitdcd8b78a7db42cd98ee5f1e4d4a9dea223e29989
treecf07ed52b859ffd5132214dcbce5130ac33bdca9
parent71a65ad3b4b0678fcf5bd6ac3b7ad394accc8079
ExtUtils::ParseXS: Accept overridden input typemaps

This restores the ability to have code like this:

ret_type*
foo(bar, baz)
    int bar
    ThereIsNoTypemapForThisType* baz = somefunc($arg);
  CODE:
  ...

Looks strange and indeed, it is. But it's documented in perlxs
to work, so we can't get away with breaking it. The heuristics
for determining whether to allow this use case is checking for
ST\( or \$arg being found in the initialization. That should take
care of all valid use of this feature and still die horribly in
cases where this is used by mistake (instead of a PREINIT block, etc).
dist/ExtUtils-ParseXS/Changes
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Constants.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/CountLines.pm
dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Utilities.pm