Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent segfault when qsort etc called with a scalar argument
If a user mistakenly passed a perl scalar argument to qsort and its ilk, the SV would be mistaken for a piddle and passed to the underlying generic_qsort etc routines. Not surprisingly, those routine's array index tricks would cause a segfault. This commit causes qsort, qsorti, qsortvec, and qsortveci to barf if an argument is passed with incorrect dimensions. Some care is taken to allow trivial sorts. 2 tests for each routine have been added, and some existing tests labeled.
- Loading branch information
Showing
2 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters