Shims cannot trust user-defined types, need to always use deref_pointer_as
#3841
Labels
A-shims
Area: This affects the external function shims
C-cleanup
Category: cleaning up our code
E-good-first-issue
A good way to start contributing, mentoring is available
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 #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. :)The text was updated successfully, but these errors were encountered: