Skip to content

[C++] utf8_slice_codeunits crashes with max start and negative step #34928

@jorisvandenbossche

Description

@jorisvandenbossche

Describe the bug, including details regarding any error messages, version, and platform.

Reproducer in Python:

In [2]: import sys

In [3]: pa.compute.utf8_slice_codeunits("test", start=sys.maxsize, stop=0, step=-1)
/home/joris/scipy/repos/arrow/cpp/src/arrow/compute/kernels/scalar_string_internal.h:109:  Check failed: (output_ncodeunits) <= (max_output_ncodeunits) 

The idea is that this would slice from the end (the max int value is always beyond the end of a single string) to the beginning of the string with a certain step.

Component(s)

C++

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions