-
Notifications
You must be signed in to change notification settings - Fork 21
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
Initial implementation of wasmbinary to wat #207
base: stylus
Are you sure you want to change the base?
Conversation
arbitrator/prover/src/print.rs
Outdated
for (i, type_idx) in self.functions.iter().enumerate() { | ||
let i1 = i as u32; | ||
|
||
let export_str = match self.maybe_func_name(i1 + 1) { |
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.
Concerned that incorrect index is being used here
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.
Fixed :)
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.
Made some simplifications & fixes. There's just two things to note
- The reason function names are sometimes wrong is that we're not considering imports. If a WASM has no imports, then the names are correct. However if there's
n
imports, the names will be shiftedn
away. Fixing this requires changingfunc_name
,maybe_func_name
, etc to distinguish imports from local functions. - Some of the changes affect
Module
printing, which may be worth checking again and fixing where visually affected
Initial implementation. The wasm instructions are currently not formatted in wat format, so everything is provided, but result is not valid wat.
Resolves STY-22