legion icon indicating copy to clipboard operation
legion copied to clipboard

Unsound fn ComponentStorage::move_entity

Open MaulingMonkey opened this issue 6 years ago • 0 comments

(@mooman219#0454 pointed this out to me on the community rust discord)

In a release build, this will access out-of-bounds - the fn should likely be marked unsafe, or the debug_assert upgraded to a regular assert: https://github.com/TomGillen/legion/blob/98a1cc44bf46a6df55d10b180ccf7ec73233a9ea/src/storage.rs#L924-L930

I'm not sure if there's a way to get your hands on a ComponentStorage using the public/safe interface of legion, although the type is publicly exported as legion::storage::ComponentStorage. Might be worth constraining some of these types to pub(crate) if they're inaccessable from the public API...

MaulingMonkey avatar Sep 19 '19 21:09 MaulingMonkey