This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document and ensure that sv_catpvf() does no argument ordering
authorAaron Crane <arc@cpan.org>
Tue, 7 Jul 2015 17:16:36 +0000 (18:16 +0100)
committerAaron Crane <arc@cpan.org>
Wed, 15 Jul 2015 13:26:06 +0000 (14:26 +0100)
commit46e58bd2391172ab5e4a73c29fb3313bebcf00bc
tree73a9c44d058a2d156c312fd951cfaf5b10569e27
parent638ca15aeec3bf86124489c8c913c5b42d4fee16
Document and ensure that sv_catpvf() does no argument ordering

sv_catpvf() and friends ultimately end up calling sv_vcatpvfn_flags() with a
C-style va_list argument (rather than with an array of SV pointers). When
the sprintf implementation in sv_vcatpvfn_flags() is called with a va_list
it always ignores any attempt by the format string to reorder the arguments.
This reasonable limitation is now documented, and the implementation throws
an exception when it encounters this situation.

Minimal tests for these exceptions have been added to XS::APItest.
MANIFEST
ext/XS-APItest/APItest.pm
ext/XS-APItest/APItest.xs
ext/XS-APItest/t/svcatpvf.t [new file with mode: 0644]
pod/perldiag.pod
sv.c