Skip to content

Add test to verify that argument size mismatch throws UB #1370

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

Merged
merged 3 commits into from
Apr 27, 2020

Conversation

samrat
Copy link
Contributor

@samrat samrat commented Apr 27, 2020

Also, bump up rust-version

Closes #1355

@samrat samrat changed the title Add test to verify argument size mismatch throws UB Add test to verify that argument size mismatch throws UB Apr 27, 2020
@RalfJung
Copy link
Member

Thanks. :)
@bors r+

@bors
Copy link
Contributor

bors commented Apr 27, 2020

📌 Commit 73f258c has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Apr 27, 2020

⌛ Testing commit 73f258c with merge 4556daa...

@bors
Copy link
Contributor

bors commented Apr 27, 2020

☀️ Test successful - checks-travis, status-appveyor
Approved by: RalfJung
Pushing 4556daa to master...

@bors bors merged commit 4556daa into rust-lang:master Apr 27, 2020
fn malloc(size: u32) -> *mut std::ffi::c_void;

#[cfg(target_pointer_width="32")]
fn malloc(size: u16) -> *mut std::ffi::c_void;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size: u16

How about size: u64? These cases test data_size < target_size, whereas we should test data_size != target_size.

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.

Calling a C function with a wrong type from Miri results in panic
4 participants