Reachability bugfix.

This commit is contained in:
Chris Fallin 2022-11-29 21:39:29 -08:00
parent dcc8148dcb
commit 0966fdf1e8
No known key found for this signature in database
GPG key ID: 31649E4FE65EB465
2 changed files with 1 additions and 2 deletions

View file

@ -1296,7 +1296,7 @@ impl<'a, 'b> FunctionBodyBuilder<'a, 'b> {
out, out,
params, params,
results, results,
merge_reachable, merge_reachable: merge_reachable || self.reachable,
}); });
self.cur_block = el; self.cur_block = el;
self.locals.start_block(el, self.reachable); self.locals.start_block(el, self.reachable);

View file

@ -224,7 +224,6 @@ impl<'a> Module<'a> {
let mut module = frontend::wasm_to_ir(bytes)?; let mut module = frontend::wasm_to_ir(bytes)?;
for func_decl in module.funcs.values_mut() { for func_decl in module.funcs.values_mut() {
if let Some(body) = func_decl.body_mut() { if let Some(body) = func_decl.body_mut() {
crate::passes::rpo::run(body);
let cfg = crate::cfg::CFGInfo::new(body); let cfg = crate::cfg::CFGInfo::new(body);
crate::passes::basic_opt::gvn(body, &cfg); crate::passes::basic_opt::gvn(body, &cfg);
crate::passes::resolve_aliases::run(body); crate::passes::resolve_aliases::run(body);