@@ -6,8 +6,10 @@ use jingle::analysis::direct_valuation::{
66} ;
77use jingle:: analysis:: pcode_store:: PcodeStore ;
88use jingle:: analysis:: { Analysis , RunnableAnalysis } ;
9+ use jingle:: modeling:: machine:: cpu:: concrete:: ConcretePcodeAddress ;
910use jingle_sleigh:: VarNode ;
1011use jingle_sleigh:: context:: image:: gimli:: load_with_gimli;
12+ use std:: collections:: HashMap ;
1113use std:: env;
1214
1315const FUNC_LINE : u64 = 0x100000460 ;
@@ -56,35 +58,27 @@ fn main() {
5658
5759 // Run the compound analysis - construct the compound initial state explicitly
5860 // (new Analysis API requires passing a value convertible into the CPA `State`)
59- let initial_compound_state = jingle:: analysis:: compound:: CompoundState :: new (
60- // construct left (location) initial state using the DirectLocationAnalysis inherent helper
61- compound_analysis. 0 . make_initial_state ( FUNC_NESTED . into ( ) ) ,
62- // construct right (valuation) initial state directly
63- jingle:: analysis:: direct_valuation:: DirectValuationState :: new ( loaded. arch_info ( ) . clone ( ) ) ,
64- ) ;
65- let compound_states = compound_analysis. run ( & loaded, initial_compound_state) ;
61+
62+ let compound_states = compound_analysis. run ( & loaded, ConcretePcodeAddress :: from ( FUNC_NESTED ) ) ;
6663
6764 tracing:: info!( "Analysis completed with {} states" , compound_states. len( ) ) ;
6865
6966 // Extract the CFG from the DirectLocationAnalysis (left side of compound)
7067 let cfg = compound_analysis. 0 . take_cfg ( ) ;
7168
7269 // Extract valuation information from the compound states
73- use jingle:: analysis:: compound:: CompoundState ;
74- use std:: collections:: HashMap ;
7570 let mut stack_offsets = HashMap :: new ( ) ;
7671 let mut direct_valuations = HashMap :: new ( ) ;
7772
7873 for state in & compound_states {
7974 // Extract location from the outermost left (PcodeAddressLattice)
80- if let jingle:: analysis:: cpa:: lattice:: flat:: FlatLattice :: Value ( addr) = & state. left . inner ( )
81- {
75+ if let jingle:: analysis:: cpa:: lattice:: flat:: FlatLattice :: Value ( addr) = & state. 0 . inner ( ) {
8276 // state.right is DirectValuationState
8377 // Extract stack pointer offset if available
84- if let Some ( sp_value) = state. right . get_value ( & stack_pointer) {
78+ if let Some ( sp_value) = state. 1 . get_value ( & stack_pointer) {
8579 stack_offsets. insert ( * addr, sp_value. clone ( ) ) ;
8680 }
87- direct_valuations. insert ( * addr, state. right . clone ( ) ) ;
81+ direct_valuations. insert ( * addr, state. 1 . clone ( ) ) ;
8882 }
8983 }
9084
0 commit comments