tromey / emacs-ffi

FFI for Emacs
99 stars 17 forks source link

added a (crashing) test that calls an ffi-function from a callback #18

Open little-big-h opened 6 years ago

little-big-h commented 6 years ago

I've run into this problem (when building a libclang-based emacs plugin): when calling a function from a callback, the (global) environment pointer is nulled out after the function call (but before finishing the callback). This causes an assertion to fail and crashes emacs.

I see that this is tricky to handle due to the poorly designed emacs runtime (see https://github.com/aaptel/emacs-dynamic-module/issues/41). I have some ideas how to fix/hack it (e.g., a map of function calls to environment objects) and would be willing to help. I felt that this starts with contributing a test case :-).