Update wasm-tools crates (#5248)

No major updates, just keeping up-to-date.
This commit is contained in:
Alex Crichton
2022-11-10 15:23:20 -06:00
committed by GitHub
parent 7ec626b898
commit 0548952319
7 changed files with 100 additions and 70 deletions

View File

@@ -94,21 +94,21 @@ where
&mut self.regalloc,
);
let mut visitor = ValidateThenVisit(&mut validator, self);
while !body.eof() {
body.visit_operator(&mut visitor)??;
let offset = body.original_position();
body.visit_operator(&mut ValidateThenVisit(validator.visitor(offset), self))??;
}
validator.finish(body.original_position())?;
return Ok(());
struct ValidateThenVisit<'a, T, U>(&'a mut T, &'a mut U);
struct ValidateThenVisit<'a, T, U>(T, &'a mut U);
macro_rules! validate_then_visit {
($( @$proposal:ident $op:ident $({ $($arg:ident: $argty:ty),* })? => $visit:ident)*) => {
$(
fn $visit(&mut self, offset: usize $($(,$arg: $argty)*)?) -> Self::Output {
self.0.$visit(offset, $($($arg.clone()),*)?)?;
Ok(self.1.$visit(offset, $($($arg),*)?))
fn $visit(&mut self $($(,$arg: $argty)*)?) -> Self::Output {
self.0.$visit($($($arg.clone()),*)?)?;
Ok(self.1.$visit($($($arg),*)?))
}
)*
};