You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #2058 - RalfJung:variadic, r=RalfJung
For variadic functions, accept arbitrary trailing arguments
However, make sure that if we use argument N we check the size of all arguments before that, because otherwise this might not work properly depending on how varargs are implemented. This caught bugs in our futex tests. ;)
I couldn't find a good way to systematically ensure this, so it is just something we have to be on the look for during review. (This generally applies also for fixed-arg shims: we should check the size of each parameter.)
Also treat prctl like a variadic function, Cc `@saethlin.`
Copy file name to clipboardExpand all lines: tests/compile-fail/fs/unix_open_missing_required_mode.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,5 +12,5 @@ fn main() {
12
12
fntest_file_open_missing_needed_mode(){
13
13
let name = b"missing_arg.txt\0";
14
14
let name_ptr = name.as_ptr().cast::<libc::c_char>();
15
-
let _fd = unsafe{ libc::open(name_ptr, libc::O_CREAT)};//~ ERROR Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected 3
15
+
let _fd = unsafe{ libc::open(name_ptr, libc::O_CREAT)};//~ ERROR Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
0 commit comments