Skip to content

Conversation

@coolreader18
Copy link
Member

I sorta just rewrote it, but there shouldn't be any UB in this

@coolreader18
Copy link
Member Author

Also, do you want to move this to the RustPython org? Do you have permission to create new repos?

@coolreader18
Copy link
Member Author

Actually, I'm not sure if the approach of storing it in the least-significant bit of the pointer will work, since u8 has an align of one and allocators written in rust (e.g. for wasm) might actually pay attention to the layout requested for allocation. Maybe we could bitshift the length left one, since the max length of a slice is isize::MAX: https://stackoverflow.com/questions/32324794/maximum-size-of-an-array-in-32-bits

@youknowone youknowone merged commit 3aa2ddf into RustPython:master Oct 3, 2020
@coolreader18 coolreader18 deleted the no-ub branch October 3, 2020 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants