-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[dylink] Fix addEmJs when parameter is indirect pointer #25740
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
base: main
Are you sure you want to change the base?
Conversation
bf6c07d to
c113518
Compare
kripken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks right.
I believe the test for it is other.test_em_js_side_module, runnable with
./test/runner other.test_em_js_side_module
Please add a ** pointer there, to test this.
| js_side_func(42, "hello"); | ||
| js_side_func2("hello again"); | ||
| js_side_func_void(); | ||
| js_side_func_indirect_ptr(NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pass &"hello" and then print the string js_side_func_indirect_ptr?
otherwise lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code inside EM_JS is JavaScript function so I cannot dereference pointer in the C way. Is there a way to do it with JS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you can use the makeGetValue macro. See the libraries in src/lib for examples
|
Also see the failing test, an expectation needs to be updated. See instructions for that in the CI error. |
I think just rebase should fix that |
I'm in the middle of porting libskk with glib, and encountered a
SyntaxError: Unexpected token '*'.Given the value of
cSig,jsArgandjsArgsin debugger view, it seems straightforward.