diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Node.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Node.pm index 7286f8ae0c7a..120ee11f2179 100644 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Node.pm +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Node.pm @@ -586,7 +586,7 @@ sub as_output_code { # original arg (via an entry in OUTPUT) and once to push the param's # value (via OUTLIST). When doing the latter, any override code on an # OUTPUT line should not be used. - undef $output_code if $out_num; + undef $output_code if defined $out_num; # ------------------------------------------------------------------ diff --git a/dist/ExtUtils-ParseXS/t/001-basic.t b/dist/ExtUtils-ParseXS/t/001-basic.t index 2087c6409c48..1054443c132f 100644 --- a/dist/ExtUtils-ParseXS/t/001-basic.t +++ b/dist/ExtUtils-ParseXS/t/001-basic.t @@ -1623,6 +1623,19 @@ EOF [ 0, 0, qr/\b\QST(1) = RETVALSV;\E\s+\}\s+\Q++SP;/, "store RETVALSV"], [ 0, 0, qr/\b\QXSRETURN(2);/, "XSRETURN(2)" ], ], + [ + "OUTLIST with OUTPUT override", + [ Q(<<'EOF') ], + |void + |foo(IN_OUTLIST int A) + | OUTPUT: + | A setA(ST[99], A); +EOF + [ 0, 1, qr/\bEXTEND\b/, "NO extend" ], + [ 0, 0, qr/\b\QsetA(ST[99], A);/, "set ST[99]" ], + [ 0, 0, qr/\b\QTARGi((IV)A, 1);/, "set ST[0]" ], + [ 0, 0, qr/\b\QXSRETURN(1);/, "XSRETURN(1)" ], + ], ); test_many($preamble, 'XS_Foo_', \@test_fns);