Open RalfJung opened 2 months ago
Once all of them are converted we should probably add a ./miri tidy
(or make it part of ./miri check
and similar commands) that automatically greps and asserts that there are no new ones introduced
Ah yes that's a good low-tech solution.
can i have a try at this?
Sure. :) I'd suggest to start with just one file and fix the deref_pointer
there, to make sure you get the hang of this.
Unfortunately I won't have the time to provide a lot of mentoring. You can always try Zulip, there are other people there that can help.
Calling
deref_pointer
means we create a place at whatever type that argument was declared at by the user. But we can't trust that type, we should ideally entirely ignore it and usederef_pointer_as
everywhere. Failure to do so can lead to ICEs like https://github.com/rust-lang/miri/issues/3839.To help with this, do the following:
rg -w deref_pointer src/shims
deref_pointer
deref_pointer_as
and the correct typeGetting the correct type will be the hardest part of this, and it depends on what the correct type is. Many basic types are available in
this.machine.layouts
, butstruct
types need to be looked up inlibc
/std
or maybe we even have to construct one ourselves (or entirely change the code). If you are unsure about a concrete case, just ask here. :)