-
Notifications
You must be signed in to change notification settings - Fork 44
Updated orca_wasm into wirm latest version #300
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
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.
Thank you for splitting this off! I left a bunch of comments, addressing which I think should make this a very small diff indeed. I might be wrong about some assumptions though, as I didn't attempt any of these changes myself.
let mut table_instr_idx = 0usize; | ||
let mut delta: i32 = 0; | ||
{ | ||
let ops_ro = builder.body.instructions.get_ops(); |
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.
I think you should be able to revert the changes to this loop and instead change instructions.iter_mut()
to instructions.get_ops().iter_mut()
in (the original) line 762.
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.
builder.body.instructions.get_ops()
returns an immutable reference so you can't use iter_mut()
on it
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.
Ah, right. There's a get_ops_mut()
that should hopefully work, though
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.
get_ops_mut panics if there are flags on the Instructions, and there are flags
} | ||
} | ||
builder.inject_at( | ||
// Inject adjustments after the located instruction: add delta and add arg index |
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.
Why doesn't the inject_at
approach work here anymore? Maybe you just couldn't find it anymore because it moved into the InjectAt
trait? If you change the use wirm::opcode::Inject;
statement to use wirm::opcode::{Inject, InjectAt};
I think the original code should work as before.
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 I totally missed the InjectAt
, added it back but the other code is necessary to set the instruction as it can't be done in the loop for the reason in the previous comment
let mut table_instr_idx = 0usize; | ||
let mut delta: i32 = 0; | ||
{ | ||
let ops_ro = builder.body.instructions.get_ops(); |
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.
Ah, right. There's a get_ops_mut()
that should hopefully work, though
Split from #298