You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++] Better support optional start/stop in "utf8_slice_codeunits" kernel #34929
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()
If we were to modify SliceOptions directly then that would also affect the ascii kernel as well. Not opposed to doing that, just wanted to give a heads-up.
In any case, I'll probably try this with a distinct options class first to see how it goes with one of the kernels. Then we can determine if the breaking change is justified.
If we were to modify SliceOptions directly then that would also affect the ascii kernel as well. Not opposed to doing that, just wanted to give a heads-up.
I think it's fine to affect both kernels, and actually it's quite logical as well.
If std::optional had been available to us before, we would probably have used it from the start here.
This issue was labelled as a bug but describes an improvement rather than incorrect behaviour, so it has been relabelled as Type: enhancement. It has had no activity in the past 365 days, so it has also been marked as stale. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.
Activity
pitrou commentedon Jul 11, 2023
cc @benibus . This would slightly break the C++ API so we have to make sure this would make things better.
benibus commentedon Jul 13, 2023
If we were to modify
SliceOptionsdirectly then that would also affect the ascii kernel as well. Not opposed to doing that, just wanted to give a heads-up.In any case, I'll probably try this with a distinct options class first to see how it goes with one of the kernels. Then we can determine if the breaking change is justified.
pitrou commentedon Jul 16, 2023
I think it's fine to affect both kernels, and actually it's quite logical as well.
If
std::optionalhad been available to us before, we would probably have used it from the start here.thisisnic commentedon Sep 26, 2026
This issue was labelled as a bug but describes an improvement rather than incorrect behaviour, so it has been relabelled as
Type: enhancement. It has had no activity in the past 365 days, so it has also been marked as stale. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.