Skip to content

[liballoc] Adds checks for UB during allocation. #22069

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

Closed
wants to merge 4 commits into from

Conversation

cgaebel
Copy link
Contributor

@cgaebel cgaebel commented Feb 7, 2015

They're only enabled in debug builds, but a panic is usually more
welcome than UB in debug builds.

They're only enabled in debug builds, but a panic is usually more
welcome than UB in debug builds.
@rust-highfive
Copy link
Contributor

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@Gankra
Copy link
Contributor

Gankra commented Feb 8, 2015

Should we take this opportunity to do size<=int::MAX as well?

@cgaebel
Copy link
Contributor Author

cgaebel commented Feb 8, 2015

I guess that'd be a pro-social thing to do.

@alexcrichton
Copy link
Member

Due to the way we ship liballoc, will this be beneficial to have? Right now we don't actually compile out debug assertions in our shipped artifacts, so this may just end up slowing code down unexpectedly. If we did ship a version with the debug assertions compiled out, this would only help libstd (during the auto builds), not external users.

@huonw
Copy link
Member

huonw commented Feb 8, 2015

I think this is beneficial, and we will probably want to have some way for external users to opt-in to the debug assertions in the stdlib anyway. It may be better to wait until we default to removing debug assertions, but personally I'm happy adding this now.

@huonw
Copy link
Member

huonw commented Apr 6, 2015

r? @gankro (transferring reviewership, don't have the bandwidth right now.)

@rust-highfive rust-highfive assigned Gankra and unassigned huonw Apr 6, 2015
@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase!

@Gankra
Copy link
Contributor

Gankra commented May 1, 2015

:S whoops, I missed @huonw's last comment there. Didn't realized I was in charge of this.

Sorry @cgaebel! This relates, I think, to what exactly we want debug_asserts to be doing in the std libs.

steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 11, 2015
…Gankro

They're only enabled in debug builds, but a panic is usually more
welcome than UB in debug builds.

Previous review at rust-lang#22069

r? @gankro
cc @huon
steveklabnik added a commit to steveklabnik/rust that referenced this pull request May 12, 2015
…Gankro

They're only enabled in debug builds, but a panic is usually more
welcome than UB in debug builds.

Previous review at rust-lang#22069

r? @gankro
cc @huon
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.

6 participants