C-Plus-Plus icon indicating copy to clipboard operation
C-Plus-Plus copied to clipboard

[BUG] timsort - std::bad_array_new_length

Open Jxtopher opened this issue 1 year ago • 2 comments

Description

Hello all,

For sorting/tim_sort.cpp An exception is thrown: std::bad_array_new_length, when you run this piece of code:

void test(int size) {
    std::cout<<"Try for "<<size<<std::endl;
    int *arr = new int[size];
    for (uint i = 0 ; i < size ; i++) {
        arr[i] = size - i;
    }

    printArray(arr, size);
    timSort(arr, size);
    printf("======\n");
    printArray(arr, size);
    delete arr;
}

For example with test(65); the exception is thrown.

Jxtopher avatar Apr 05 '24 20:04 Jxtopher

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 06 '24 00:05 github-actions[bot]

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

github-actions[bot] avatar May 13 '24 00:05 github-actions[bot]