Skip to content

Commit d0021b2

Browse files
committed
ParseXS: refactor: fix for 5.8.9 builds
The work in this branch broke the parser under 5.8.9. Fix it, by not trying to autovivify an undef object pointer (which under 5.8.9 is a pseudo-hash thingy and generally behaves weirdly). The attempt to autovivify an undef $xsub was always wrong, but harmless: the value wasn't needed and was soon discarded. But under 5.8.9, it became a runtime error.
1 parent e7db425 commit d0021b2

File tree

1 file changed

+6
-3
lines changed
  • dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS

1 file changed

+6
-3
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS/Node.pm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3513,9 +3513,12 @@ sub parse {
35133513

35143514
$self->SUPER::parse($pxs); # set file/line_no, self->{enable}
35153515

3516-
$pxs->blurt("Error: only one SCOPE declaration allowed per XSUB")
3517-
if $xsub->{seen_SCOPE};
3518-
$xsub->{seen_SCOPE} = 1;
3516+
# $xsub not defined for file-scoped SCOPE
3517+
if ($xsub) {
3518+
$pxs->blurt("Error: only one SCOPE declaration allowed per XSUB")
3519+
if $xsub->{seen_SCOPE};
3520+
$xsub->{seen_SCOPE} = 1;
3521+
}
35193522

35203523
# Note that currently this parse method can be called either while
35213524
# parsing an XSUB, or while processing file-scoped keywords

0 commit comments

Comments
 (0)