New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passing a callable to a foreign function #128
Comments
Passing a callable to a foreign function is done via an internal Jx9 API hence |
I'm not sure I understand the security reasons, could you give me an example of a situation where such a functionality would be unsafe? |
Well, Jx9 was designed to run on restricted embedded devices such as your home router or set top box where memory and stack is limited. Suppose if a broken callable enter in an endless recursive calls/loop on your router... |
How would that be different from executing the same callable from the jx9 script itself? |
Jx9 internal callable are certified not to broke such as calling a recursive function or entering an infinite loop unlike passing a user defined callable to the VM which cannot be controlled. Nevertheless, making callable public shoud be straightforward by simply writing a wrapper around |
I could not find any documentation on this: how can I pass a callable from jx9 to a foreign function written in C, and call this callable on some data?
I tried looking at how
db_fetch_all
is implemented, but it seems to be using a function that is not in the API (here).The text was updated successfully, but these errors were encountered: