On 30 Mar 2009, at 14:55, David Chisnall wrote:
Hi,
I'm looking at lines 1032--1038 of NSInvocation.m:
struct {
char x[size];
} dummy;
dummy = va_arg(ap, typeof(dummy));
memcpy(datum, dummy.x, size);
This will only work in cases where the arguments are all passed on
the stack, so won't work for structures containing floating point,
vector, or integer arguments where there is still space in the
registers, and will cause stack corruption in the case where this is
not what happens. I am trying to work out why this code exists at
all, since ffi and ffcall contain routines for doing this safely.
This appears to be an unused method, and the comments in the header
clearly document it as private, not for external use, so I guess it's
just legacy code from ancient times before ffcall and ffi. I have
therefore removed the whole method.
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev