From eca2e83f5935f881877d072b1d86c443907457c7 Mon Sep 17 00:00:00 2001 From: Graham Kelly Date: Sun, 4 Feb 2024 14:40:37 -0500 Subject: [PATCH] debugging 1 --- src/passes/reorder_funs.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/passes/reorder_funs.rs b/src/passes/reorder_funs.rs index 6f41d4b..cc37d8f 100644 --- a/src/passes/reorder_funs.rs +++ b/src/passes/reorder_funs.rs @@ -32,7 +32,11 @@ pub fn reorder_funcs(m: &mut Module, fs: &BTreeMap) { for t in m.tables.values_mut() { if let Some(e) = t.func_elements.as_mut() { for e in e.iter_mut() { - *e = *fs.get(&*e).unwrap(); + let Some(f) = fs.get(&*e) else{ + let f = *e; + panic!("invalid func: {f}; {}",m.funcs[f].name()) + }; + *e = *f; } } }