diff --git a/lib/codegen/src/postopt.rs b/lib/codegen/src/postopt.rs index 6de918d08d..50661f4cc1 100644 --- a/lib/codegen/src/postopt.rs +++ b/lib/codegen/src/postopt.rs @@ -169,8 +169,10 @@ fn optimize_cpu_flags( ); } } - pos.func.update_encoding(info.cmp_inst, isa).is_ok(); - pos.func.update_encoding(info.br_inst, isa).is_ok(); + let ok = pos.func.update_encoding(info.cmp_inst, isa).is_ok(); + debug_assert!(ok); + let ok = pos.func.update_encoding(info.br_inst, isa).is_ok(); + debug_assert!(ok); } @@ -320,7 +322,8 @@ fn optimize_complex_addresses(pos: &mut EncCursor, inst: Inst, isa: &TargetIsa) } _ => return, } - pos.func.update_encoding(info.inst, isa).is_ok(); + let ok = pos.func.update_encoding(info.inst, isa).is_ok(); + debug_assert!(ok); }