-
Notifications
You must be signed in to change notification settings - Fork 24
Improve offset_front()
#785
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
Conversation
Could you first take a look at the new offset functions? I'll apply them later. Thanks. |
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.
Looks good, I've simplified a bit.
After this PR is merged, can we merge |
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! I've changed the logic to have the information at the right place (essentially func_body
should be in Expr
).
crates/interpreter/src/exec.rs
Outdated
side_table, | ||
0, | ||
#[cfg(feature = "toctou")] | ||
&[], |
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 is this not parser.save()
?
crates/interpreter/src/valid.rs
Outdated
@@ -221,6 +224,7 @@ struct Context<'m, M: ValidMode> { | |||
globals: Vec<GlobalType>, | |||
elems: Vec<RefType>, | |||
datas: Option<usize>, | |||
func_body: &'m [u8], |
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 do we need this?
crates/interpreter/src/valid.rs
Outdated
// SAFETY: This function is only called after parsing an End instruction. | ||
target.parser = offset_front(target.parser, -1); | ||
// This function is only called after parsing an End instruction. | ||
target.parser = offset_front_check(self.context.func_body, target.parser, -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.
We don't need a check here, since it's not based on user input.
Yes, I'll create a PR from a fork of this branch in my repo to avoid the PR getting double CI (once for push and once for pull_request). |
Do you mind explaining the differences in more detail? You are ahead of me. Thanks! |
#737 is the PR where I merged the
|
#46