Current implementation of calling BUILD from XS discards scalar
by its own POPs. However, it can unexpectedly decrement
PL_stack_sp and lead to stack collapse, especially 'STACK
UNDERFLOW!!!'.
Fix discards on BUILD and also DEMOLISH using G_DISCARD flag
according to the perldoc documentation.
Current implementation of calling BUILD from XS discards scalar by its own POPs. However, it can unexpectedly decrement PL_stack_sp and lead to stack collapse, especially 'STACK UNDERFLOW!!!'. Fix discards on BUILD and also DEMOLISH using G_DISCARD flag according to the perldoc documentation.
Stack Snapshot
-Ds
output of perl-5.24.1t/900_mouse_bugs/020_stack_collapse_on_build.t