Comment 2 for bug 1190418

Revision history for this message
Luís Oliveira (luismbo) wrote : Re: [Bug 1190418] Re: Not enough type checking on API boundaries

On Thu, Jun 13, 2013 at 2:06 AM, james anderson <email address hidden> wrote:
> given that the reported type of the variable was in all cases a
> pointer, one would expect all references to succeed.

with-foreign-object will always give you a pointer to what has just
been allocated. In some cases your test code is allocating enough
memory to hold a pointer, other times it's allocating enough memory to
hold a struct, but you always get a pointer to that allocated memory.

And since CFFI pointers are untyped, the type you specify when
dereferencing them is crucial.