bevy/crates/bevy_ecs/src
Joseph 58f7dac689
Fix unsoundness in QueryState::is_empty (#9463)
# Objective

`QueryState::is_empty` is unsound, as it does not validate the world. If
a mismatched world is passed in, then the query filter may cast a
component to an incorrect type, causing undefined behavior.

## Solution

Add world validation. To prevent a performance regression in `Query`
(whose world does not need to be validated), the unchecked function
`is_empty_unsafe_world_cell` has been added. This also allows us to
remove one of the last usages of the private function
`UnsafeWorldCell::unsafe_world`, which takes us a step towards being
able to remove that method entirely.
2023-09-02 23:43:22 +00:00
..
entity Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
query Fix unsoundness in QueryState::is_empty (#9463) 2023-09-02 23:43:22 +00:00
reflect Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
schedule Fix anonymous set name stack overflow (#9650) 2023-08-31 22:52:59 +00:00
storage Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
system Fix unsoundness in QueryState::is_empty (#9463) 2023-09-02 23:43:22 +00:00
world Fix some nightly warnings (#9672) 2023-09-02 18:35:06 +00:00
archetype.rs Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
bundle.rs Fix some nightly warnings (#9672) 2023-09-02 18:35:06 +00:00
change_detection.rs Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
component.rs Derive Eq, PartialEq for Tick (#9020) 2023-07-04 19:08:51 +00:00
event.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00
lib.rs Allow disjoint mutable world access via EntityMut (#9419) 2023-08-28 23:30:59 +00:00
removal_detection.rs Refactor EventReader::iter to read (#9631) 2023-08-30 14:20:03 +00:00