11use crate :: utils:: trace_log;
22use crate :: { Emitter , Reader , State , Tokenizer } ;
33
4+ #[ cfg( feature = "afl-ijon" ) ]
5+ use afl:: { ijon_hashint, ijon_state} ;
6+
47#[ derive( Debug ) ]
58pub ( crate ) struct MachineState < R : Reader , E : Emitter > {
69 #[ allow( clippy:: type_complexity) ]
@@ -103,8 +106,14 @@ impl<R: Reader, E: Emitter> MachineHelper<R, E> {
103106
104107 pub ( crate ) fn enter_state ( & mut self , state : MachineState < R , E > , is_attribute : bool ) {
105108 debug_assert ! ( self . return_state. is_none( ) ) ;
106- self . return_state = Some ( ( self . state , is_attribute) ) ;
109+ let return_state = ( self . state , is_attribute) ;
110+ self . return_state = Some ( return_state) ;
107111 self . switch_to ( state) ;
112+ #[ cfg( feature = "afl-ijon" ) ]
113+ ijon_state ! ( ijon_hashint(
114+ ijon_hashint( state. function as u32 , return_state. 0 . function as u32 ) ,
115+ is_attribute as u32
116+ ) ) ;
108117 }
109118
110119 pub ( crate ) fn pop_return_state ( & mut self ) -> MachineState < R , E > {
@@ -123,6 +132,8 @@ impl<R: Reader, E: Emitter> MachineHelper<R, E> {
123132 state. debug_name
124133 ) ;
125134 self . state = state;
135+ #[ cfg( feature = "afl-ijon" ) ]
136+ ijon_state ! ( state. function as u32 ) ;
126137 }
127138}
128139
0 commit comments