Skip to content

[C++] Better support optional start/stop in "utf8_slice_codeunits" kernel #34929

@jorisvandenbossche

Description

@jorisvandenbossche

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

There have been various (slightly different) bugs reported about using "utf8_slice_codeunits" with optional start or stop. The stop argument is already optional and translated into the largest int to indicate to always slice until the end, but that internal "workaround" also produces some bugs in the current implementation due to integer overflows.

Potentially, we could use a different mechanism to signal a default start/stop, such as using std::optional<int64_t> instead of std::numeric_limits<int64_t>::max()

Listing the related issues:

The option class is also used for "binary_slice" kernel.

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions