[plt-scheme] (ab)using ffi-call to execute assembly

From: Noel Welsh (noelwelsh at gmail.com)
Date: Mon Jul 13 09:08:23 EDT 2009

Hello,

Let's say I have a byte string containing some assembler. Can I abuse
ffi-call to execute this code? I'm getting segmentation faults at the
moment. Looking at

  http://svn.plt-scheme.org/plt/trunk/src/foreign/foreign.ssc

I see

#define SCHEME_FFIANYPTR_VAL(x) \
  (SCHEME_CPTRP(x) ? SCHEME_CPTR_VAL(x) : \
    (SCHEME_FALSEP(x) ? NULL : \
      (SCHEME_FFIOBJP(x) ? (((ffi_obj_struct*)x)->obj) : \
       (SCHEME_BYTE_STRINGP(x) ? SCHEME_BYTE_STR_VAL(x) : \

so I guess this won't work but perhaps I can use a different type in
place of byte strings?

Ta,
Noel


Posted on the users mailing list.