XS::APItest::newCONSTSUB was not handling SV reference counts correctly.
authorNicholas Clark <nick@ccl4.org>
Mon, 13 Aug 2012 13:11:41 +0000 (15:11 +0200)
committerNicholas Clark <nick@ccl4.org>
Tue, 14 Aug 2012 08:12:58 +0000 (10:12 +0200)
commit0fc4714aa17fcb440e297d8a2798e956eed9ca21
tree6fed8a6f697ed9ece5c248217b74c725e860c7f5
parentc0810f8ef849bf940e296c00ef5a0c1bd77f9c62
XS::APItest::newCONSTSUB was not handling SV reference counts correctly.

newCONSTSUB() and newCONSTSUB_flags() take ownership of (one reference to)
the passed-in SV. As the XS wrapper is passing in a SV taken from the stack,
it needs to up the reference count by one in order to avoid later bugs.
ext/XS-APItest/APItest.xs
ext/XS-APItest/t/newCONSTSUB.t