Skip to content

Commit dfcb46a

Browse files
committed
Update syscall FIXME to include note about 'wrong' types.
1 parent dc36988 commit dfcb46a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/shims/posix/linux/foreign_items.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
116116
// FIXME: The libc syscall() function is a variadic function.
117117
// It's valid to call it with more arguments than a syscall
118118
// needs, so none of these syscalls should use check_arg_count.
119-
// However, depending on the calling convention it might depend
120-
// on the type and size of the arguments whether a call with
121-
// the wrong number of arguments (or types) is valid or not.
119+
// It's even valid to call it with the wrong type of arguments,
120+
// as long as they'd end up in the same place with the calling
121+
// convention used. (E.g. using a `usize` instead of a pointer.)
122+
// It's not directly clear which number, size, and type of arguments
123+
// are acceptable in which cases and which aren't. (E.g. some
124+
// types might take up the space of two registers.)
122125
// So this needs to be researched first.
126+
123127
let sys_getrandom = this
124128
.eval_libc("SYS_getrandom")?
125129
.to_machine_usize(this)?;

0 commit comments

Comments
 (0)