File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
crates/wasmi/src/engine/translator/func2 Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
use super :: { Instr , Reset , ReusableAllocations } ;
2
2
use crate :: {
3
3
core:: FuelCostsProvider ,
4
- engine:: translator:: utils:: BumpFuelConsumption as _,
4
+ engine:: translator:: utils:: { BumpFuelConsumption as _, IsInstructionParameter as _ } ,
5
5
ir:: Instruction ,
6
6
Engine ,
7
7
Error ,
@@ -97,6 +97,10 @@ impl InstrEncoder {
97
97
98
98
/// Pushes a non-parameter [`Instruction`] to the [`InstrEncoder`].
99
99
fn push_instr_impl ( & mut self , instruction : Instruction ) -> Result < Instr , Error > {
100
+ debug_assert ! (
101
+ !instruction. is_instruction_parameter( ) ,
102
+ "parameter: {instruction:?}"
103
+ ) ;
100
104
let instr = self . next_instr ( ) ;
101
105
self . instrs . push ( instruction) ;
102
106
self . last_instr = Some ( instr) ;
@@ -107,6 +111,10 @@ impl InstrEncoder {
107
111
///
108
112
/// The parameter is associated to the last pushed [`Instruction`].
109
113
pub fn push_param ( & mut self , instruction : Instruction ) {
114
+ debug_assert ! (
115
+ instruction. is_instruction_parameter( ) ,
116
+ "non-parameter: {instruction:?}"
117
+ ) ;
110
118
self . instrs . push ( instruction) ;
111
119
}
112
120
You can’t perform that action at this time.
0 commit comments