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

Is this unsound? #72

Open
nico-abram opened this issue Sep 27, 2019 · 2 comments
Open

Is this unsound? #72

nico-abram opened this issue Sep 27, 2019 · 2 comments
Labels

Comments

@nico-abram
Copy link

These no-bounds-checking indexing operations on Storage: https://github.com/kvark/froggy/blob/master/src/lib.rs#L252-L269

I get that they're only so on release, but I'd expect the bounds checking to also happen on release by default (As is common in rust). Maybe a flag to disable it would make more sense

@MaulingMonkey
Copy link

Sure looks unsound to me. I think this was your example from Discord:

let mut storage = froggy::Storage::new();
let ptr1 = storage.create(1i32);
storage[&ptr1] = 2i32;
let mut storage2 = froggy::Storage::new();
storage2[&ptr1] = 2i32;

@kvark
Copy link
Owner

kvark commented Sep 27, 2019

Yes, you are correct. We should keep the checks.

@kvark kvark added the bug label Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants