@@ -4,8 +4,8 @@ use ckb_vm::{
4
4
machine:: VERSION2 ,
5
5
memory:: { round_page_down, round_page_up, FLAG_EXECUTABLE , FLAG_FREEZED } ,
6
6
snapshot2:: { DataSource , Snapshot2Context } ,
7
- Bytes , CoreMachine , DefaultMachine , DefaultMachineBuilder , Error , Memory , DEFAULT_MEMORY_SIZE ,
8
- ISA_A , ISA_B , ISA_IMC , ISA_MOP , RISCV_PAGESIZE ,
7
+ Bytes , CoreMachine , DefaultMachine , DefaultMachineBuilder , Error , Memory , SupportMachine ,
8
+ DEFAULT_MEMORY_SIZE , ISA_A , ISA_B , ISA_IMC , ISA_MOP , RISCV_PAGESIZE ,
9
9
} ;
10
10
use ckb_vm_definitions:: asm:: AsmCoreMachine ;
11
11
use libfuzzer_sys:: fuzz_target;
@@ -183,6 +183,7 @@ fuzz_target!(|data: [u8; 96]| {
183
183
. memory_mut( )
184
184
. load_bytes( ( i * RISCV_PAGESIZE ) as u64 , RISCV_PAGESIZE as u64 )
185
185
. unwrap( ) ;
186
+
186
187
if mem1 != mem2 {
187
188
eprintln!( "mem1[0..32] = {:?}" , & mem1[ 0 ..32 ] ) ;
188
189
eprintln!( "mem2[0..32] = {:?}" , & mem2[ 0 ..32 ] ) ;
@@ -196,5 +197,12 @@ fuzz_target!(|data: [u8; 96]| {
196
197
}
197
198
panic!( "The memory restored by operation resume is not same as snapshot operation at page {}" , i) ;
198
199
}
200
+
201
+ let flag1 = machine1. memory_mut( ) . fetch_flag( i as u64 ) ;
202
+ let flag2 = machine2. memory_mut( ) . fetch_flag( i as u64 ) ;
203
+
204
+ if flag1 != flag2 {
205
+ panic!( "Flag at page {}" , i) ;
206
+ }
199
207
}
200
208
} ) ;
0 commit comments