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
Hi, thanks for your contribution to this great coroutine library.
However, we have found lots of unsound problems in the util crate may_queue.
For example, the set and get set and get the data without boundary checking for performance consideration.
These functions are actually unsafe since they ask the caller to guarantee the index is in-bound and the compiler fails to check this.
It is certainly ok to mark the unsafe functions as safe and use them with care in 'may'.
But considering the crate may_queue is available in crates.io and these functions are public, we think it's still necessary to make these functions more sound.
Suggestions
Here are some action choices we suggested:
Mark these functions as 'unsafe' which would lead to large code changes.
(recommended) Add assert! or at least debug_assert! macros to validate that the index is in-bound.
The text was updated successfully, but these errors were encountered:
Hi, thanks for your contribution to this great coroutine library.
However, we have found lots of unsound problems in the util crate
may_queue
.For example, the
set
andget
set and get the data without boundary checking for performance consideration.These functions are actually unsafe since they ask the caller to guarantee the
index
is in-bound and the compiler fails to check this.It is certainly ok to mark the unsafe functions as safe and use them with care in 'may'.
But considering the crate
may_queue
is available in crates.io and these functions are public, we think it's still necessary to make these functions more sound.Suggestions
Here are some action choices we suggested:
assert!
or at leastdebug_assert!
macros to validate that theindex
is in-bound.The text was updated successfully, but these errors were encountered: