-
Notifications
You must be signed in to change notification settings - Fork 663
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
Clarity-Wasm: Implement "pass_argument_to_wasm" for remaining types #4979
Clarity-Wasm: Implement "pass_argument_to_wasm" for remaining types #4979
Conversation
…on for optional and response
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 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.
This looks great, assuming we add tests in the clarity-wasm repo. I just had one request for an additional check.
@@ -539,21 +539,16 @@ pub fn call_function<'a, 'b, 'c>( | |||
|
|||
// Convert the args into wasmtime values | |||
let mut wasm_args = vec![]; | |||
for arg in args { | |||
for (arg, ty) in args.iter().zip(func_types.get_arg_types()) { |
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 we add a check that args
and func_types
are the same size?
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.
Not sure this is useful there, the typechecker should catch the inequality before that stage.
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.
yeah, but aren't we going with a "don't trust the type checker" policy? Or maybe "trust but verify"?
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.
Right :D
This is the stacks-core part of clarity-wasm's PR 443.
It implements the remaining types and fixes the current implementation that did not respect the ABI.
The tests are not ready yet in the original repo.