This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix segfault on overloaded arithmetic assignment
Consider an arithmetic assignment operation of the form
$left += $right
A segfault was occuring in the case where $right is an overloaded object
but $left is not; and where $right does not override "+=" but does
provide a 'nomethod' override. Internally, Perl_amagic_call was
attempting to clone $left as if it were an overloaded object, causing the
segfault. This commit fixes the segfault by only cloning the left
operand when the left operand is the overloaded one.