11#![ no_main]
22use ckb_vm:: cost_model:: constant_cycles;
3- use ckb_vm:: machine:: VERSION2 ;
3+ use ckb_vm:: machine:: VERSION3 ;
44use ckb_vm:: machine:: asm:: { AsmCoreMachine , AsmDefaultMachineBuilder , AsmMachine } ;
55use ckb_vm:: snapshot;
6- use ckb_vm:: { Bytes , DefaultMachineRunner , Error , ISA_A , ISA_B , ISA_IMC , ISA_MOP , SupportMachine } ;
6+ use ckb_vm:: {
7+ Bytes , DefaultMachineRunner , Error , ISA_A , ISA_B , ISA_CFI , ISA_IMC , ISA_MOP , SupportMachine ,
8+ } ;
79use libfuzzer_sys:: fuzz_target;
810
911fuzz_target ! ( |data: & [ u8 ] | {
1012 let mut machine1 = {
11- let asm_core = AsmCoreMachine :: new( ISA_IMC | ISA_A | ISA_B | ISA_MOP , VERSION2 , 200_000 ) ;
13+ let asm_core = AsmCoreMachine :: new(
14+ ISA_IMC | ISA_A | ISA_B | ISA_MOP | ISA_CFI ,
15+ VERSION3 ,
16+ 200_000 ,
17+ ) ;
1218 let machine = AsmDefaultMachineBuilder :: new( asm_core)
1319 . instruction_cycle_func( Box :: new( constant_cycles) )
1420 . build( ) ;
@@ -25,8 +31,11 @@ fuzz_target!(|data: &[u8]| {
2531
2632 let half_cycles = machine1. machine. cycles( ) / 2 ;
2733 let mut machine2 = {
28- let asm_core =
29- AsmCoreMachine :: new( ISA_IMC | ISA_A | ISA_B | ISA_MOP , VERSION2 , half_cycles) ;
34+ let asm_core = AsmCoreMachine :: new(
35+ ISA_IMC | ISA_A | ISA_B | ISA_MOP | ISA_CFI ,
36+ VERSION3 ,
37+ half_cycles,
38+ ) ;
3039 let machine = AsmDefaultMachineBuilder :: new( asm_core)
3140 . instruction_cycle_func( Box :: new( constant_cycles) )
3241 . build( ) ;
@@ -38,8 +47,11 @@ fuzz_target!(|data: &[u8]| {
3847 let snap = snapshot:: make_snapshot( & mut machine2. machine) . unwrap( ) ;
3948
4049 let mut machine3 = {
41- let asm_core =
42- AsmCoreMachine :: new( ISA_IMC | ISA_A | ISA_B | ISA_MOP , VERSION2 , half_cycles) ;
50+ let asm_core = AsmCoreMachine :: new(
51+ ISA_IMC | ISA_A | ISA_B | ISA_MOP | ISA_CFI ,
52+ VERSION3 ,
53+ half_cycles,
54+ ) ;
4355 let machine = AsmDefaultMachineBuilder :: new( asm_core)
4456 . instruction_cycle_func( Box :: new( constant_cycles) )
4557 . build( ) ;
0 commit comments