[wasm] Pass translation state along for before/after_translate_operator callbacks (#879)

This commit is contained in:
Andy Wortman
2019-07-30 07:32:50 -07:00
committed by Benjamin Bouvier
parent 5ca13a70a5
commit b5cb8556f6
3 changed files with 6 additions and 2 deletions

View File

@@ -207,9 +207,9 @@ fn parse_function_body<FE: FuncEnvironment + ?Sized>(
while !state.control_stack.is_empty() {
builder.set_srcloc(cur_srcloc(&reader));
let op = reader.read_operator()?;
environ.before_translate_operator(&op, builder)?;
environ.before_translate_operator(&op, builder, state)?;
translate_operator(&op, builder, state, environ)?;
environ.after_translate_operator(&op, builder)?;
environ.after_translate_operator(&op, builder, state)?;
}
// The final `End` operator left us in the exit block where we need to manually add a return