Run middlewares after begin_body.

This commit is contained in:
losfair 2019-06-30 11:50:21 +08:00
parent 80509e3f78
commit 614b3b9918

View File

@ -222,13 +222,6 @@ pub fn read_module<
let fcg = mcg
.next_function(Arc::clone(&info))
.map_err(|x| LoadError::Codegen(format!("{:?}", x)))?;
middlewares
.run(
Some(fcg),
Event::Internal(InternalEvent::FunctionBegin(id as u32)),
&info.read().unwrap(),
)
.map_err(|x| LoadError::Codegen(x))?;
let info_read = info.read().unwrap();
let sig = info_read
@ -270,6 +263,13 @@ pub fn read_module<
body_begun = true;
fcg.begin_body(&info.read().unwrap())
.map_err(|x| LoadError::Codegen(format!("{:?}", x)))?;
middlewares
.run(
Some(fcg),
Event::Internal(InternalEvent::FunctionBegin(id as u32)),
&info.read().unwrap(),
)
.map_err(|x| LoadError::Codegen(x))?;
}
middlewares
.run(Some(fcg), Event::Wasm(op), &info.read().unwrap())