Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct the unsoundness slice range of arr.min/max #15654

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Apr 15, 2024

This fixes #15646.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Apr 15, 2024
@reswqa reswqa changed the title fix: Fix unsound of arr.min/max fix: Correct the unsoundness slice range of arr.min/max Apr 15, 2024
let sliced = unsafe { values.clone().sliced_unchecked(start, start + width) };
// SAFETY: This value array from a FixedSizeListArray,
// we can ensure that `start + width` will not out out range
let sliced = unsafe { values.clone().sliced_unchecked(start, width) };
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sort of scary 😨 We didn't find it until today.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ai.. :/

@reswqa reswqa marked this pull request as ready for review April 15, 2024 09:26
@ritchie46 ritchie46 merged commit d8bae07 into pola-rs:main Apr 15, 2024
25 checks passed
Copy link

codspeed-hq bot commented Apr 15, 2024

CodSpeed Performance Report

Merging #15654 will not alter performance

Comparing reswqa:oor_arr_max_min (5d7de46) with main (99ab9c0)

Summary

✅ 22 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arr.max() paniced in the latest release
2 participants