Open kkysen opened 1 month ago
To summarize discussions on slack: going from a fn ptr struct to void *
is fine, but going the other direction requires the user to verify that the void *
was derived from a fn ptr. In this case the fact that the void *
came from dlsym
complicates things.
ia2-rewriter
doesn't seem to handle the case where a function pointer is cast from avoid*
, such as the one returned bydlsym
:This results in a compiler error, because while there is an implicit
void*
to function pointer cast, there is no implicitvoid*
tostruct
cast.It doesn't seem like there is a dedicated
IA2_*
macro for this already, asIA2_FN
requires an existing static function name to work.We could probably do something like
IA2_FN_FROM_ADDR
:which expands to: