pass by value and also snprintf()
Bruce Korb
bruce.korb@gmail.com
Mon Apr 27 16:59:00 GMT 2015
I read this paragraph and have a question:
avalues is a vector of void * pointers that point to the memory
locations holding the argument values for a call.
If cif declares that the function has no arguments (i.e., nargs was
0), then avalues is ignored. Note that
argument values may be modified by the callee (for instance, structs
passed by value); the burden of
copying pass-by-value arguments is placed on the caller.
If libffi moves the values into places where the callee can find them,
it would be interesting
to know how the callee can modify the original value. That value
cannot be at the place pointed to
by the "avalues" array of pointers.
- - - - -
Anyway, I believe in my last missive, I had all the arguments for
snprintf() set up correctly,
yet snprintf faulted anyway. Since GDB showed everything as I would
expect and since
I cannot make much sense of what the ffi_call_unix64 is doing, I hope
there is an
obvious answer to what I am missing:
https://sourceware.org/ml/libffi-discuss/2015/msg00063.html
Thank you in advance! Regards, Bruce
More information about the Libffi-discuss
mailing list