We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since 399fef9, trailing elements in an array that has been unshifted and resized might not be properly Zero() initialized. This is because of faulty arithmetic when calculating to_null, the number of elements to initialize, when the array was only partially shifted.
to_null
This commit corrects the arithmetic, adds comments arount the calculation of to_null, and adds a test based upon the case provided in GH #21235.
The test added segfaults more reliably for me - almost every time - than the originally supplied case. However, since it relies upon uninitialized memory, it's probably still not deterministic and somewhat dependent upon the choice of memory allocator.
Closes #21235
Sorry, something went wrong.
Perl_av_extend_guts: Zero() trailing elements after unshift & resize
b451fd3
Since Perl@399fef9, trailing elements in an array that has been unshifted and resized might not be properly Zero() initialized. This is because of faulty arithmetic when calculating `to_null`, the number of elements to initialize, when the array was only partially shifted. This commit corrects the arithmetic, adds comments arount the calculation of `to_null`, and adds a test based upon the case provided in GH Perl#21235. The test added segfaults more reliably for me - almost every time - than the originally supplied case. However, since it relies upon uninitialized memory, it's probably still not deterministic and somewhat dependent upon the choice of memory allocator. Closes Perl#21235
9e298ab
Zero initialize Perl AV elements after unshift and resize.
748ae95
Perl/perl5#21235 Perl/perl5#21265 Perl/perl5@9e298ab Bug reported by Anton Borowka. Fix from upstream Perl. OK afresh1@
tonycoz tonycoz approved these changes
Successfully merging this pull request may close these issues.