pub fn analysis(&mut self, rfn_addr: &u64) {
        radeco_trace!("CallFixer|Analyze {:#}", rfn_addr);

        if self.rmod.functions.get_mut(rfn_addr).is_none() {
            radeco_err!("RadecoFunction Not Found!");
            return;
        }
        // Sort operands for commutative opcode first.
        {
            let rfn = self.rmod.functions.get_mut(rfn_addr).unwrap();
            radeco_trace!("CallFixer|RadecoFunction: {:?}", rfn.name);
            let ssa = rfn.ssa_mut();
            let mut sorter = Sorter::new(ssa);
            sorter.run();
        }

        // At the first time for analysis, we only assume that SP will balance
        // at entry_point and exit_point. So we only analyze entry block and
        // exit block separately.
        let (entry_store, exit_load) = {
            let rfn = self.rmod.functions.get(rfn_addr).unwrap();
            let ssa = rfn.ssa();

            // analysis entry block
            let entry_store = {
                let sp_name = self.sp_name.clone().unwrap_or(String::new());
                let bp_name = self.bp_name.clone().unwrap_or(String::new());
                let entry_offset = digstack::frontward_analysis(&ssa, sp_name, bp_name);
                self.analysis_entry_store(ssa, entry_offset)
            };

            // analysis exit blocks
            let exit_load = {
                let sp_name = self.sp_name.clone().unwrap_or(String::new());
                let exit_offset = digstack::backward_analysis(&ssa, sp_name);
                self.analysis_exit_load(ssa, exit_offset)
            };
            (entry_store, exit_load)
        };

        let sp_offset = self.mark_preserved(rfn_addr, entry_store, exit_load);
        self.sp_offsets.insert(*rfn_addr, sp_offset);
    }
// First analysis, only based on the assumption the SP is balanced.
// After this, we could at least make sure whether BP is balanced,
// and then we could spread all the stack offset in the whole funciton.
First analysis, only based on the assumption the SP is balanced.
After this, we could at least make sure whether BP is balanced,
and then we could spread all the stack offset in the whole funciton.
First analysis only based on the assumption the SP is balanced . After this we could at least make sure whether BP is balanced and then we could spread all the stack offset in the whole funciton .
pub fn analysis(&mut self, rfn_addr: &u64) {
        radeco_trace!("CallFixer|Analyze {:#}", rfn_addr);
        if self.rmod.functions.get_mut(rfn_addr).is_none() {
            radeco_err!("RadecoFunction Not Found!");
            return;
        }
        // Sort operands for commutative opcode first.
        {
            let rfn = self.rmod.functions.get_mut(rfn_addr).unwrap();
            radeco_trace!("CallFixer|RadecoFunction: {:?}", rfn.name);
            let ssa = rfn.ssa_mut();
            let mut sorter = Sorter::new(ssa);
            sorter.run();
        }
        // At the first time for analysis, we only assume that SP will balance
        // at entry_point and exit_point. So we only analyze entry block and
        // exit block separately.
        let (entry_store, exit_load) = {
            let rfn = self.rmod.functions.get(rfn_addr).unwrap();
            let ssa = rfn.ssa();
            // analysis entry block
            let entry_store = {
                let sp_name = self.sp_name.clone().unwrap_or(String::new());
                let bp_name = self.bp_name.clone().unwrap_or(String::new());
                let entry_offset = digstack::frontward_analysis(&ssa, sp_name, bp_name);
                self.analysis_entry_store(ssa, entry_offset)
            };
            // analysis exit blocks
            let exit_load = {
                let sp_name = self.sp_name.clone().unwrap_or(String::new());
                let exit_offset = digstack::backward_analysis(&ssa, sp_name);
                self.analysis_exit_load(ssa, exit_offset)
            };
            (entry_store, exit_load)
        };
        let sp_offset = self.mark_preserved(rfn_addr, entry_store, exit_load);
        self.sp_offsets.insert(*rfn_addr, sp_offset);
    }
pub fn analysis ( & mut self , rfn_addr : & u64 ) { radeco_trace ! ( " " rfn_addr ) ; if self . rmod . functions . get_mut ( rfn_addr ) . is_none ( ) { radeco_err ! ( " " ) ; return ; } // Sort operands for commutative opcode first. { let rfn = self . rmod . functions . get_mut ( rfn_addr ) . unwrap ( ) ; radeco_trace ! ( " " rfn name ) ; let ssa = rfn . ssa_mut ( ) ; let mut sorter = Sorter :: new ( ssa ) ; sorter . run ( ) ; } // At the first time for analysis, we only assume that SP will balance // at entry_point and exit_point. So we only analyze entry block and // exit block separately. let ( entry_store , exit_load ) = { let rfn = self . rmod . functions . get ( rfn_addr ) . unwrap ( ) ; let ssa = rfn . ssa ( ) ; // analysis entry block let entry_store = { let sp_name = self . sp_name . clone ( ) . unwrap_or ( String :: new ( ) ) ; let bp_name = self . bp_name . clone ( ) . unwrap_or ( String :: new ( ) ) ; let entry_offset = digstack :: frontward_analysis ( & ssa , sp_name , bp_name ) ; self . analysis_entry_store ( ssa , entry_offset ) } ; // analysis exit blocks let exit_load = { let sp_name = self . sp_name . clone ( ) . unwrap_or ( String :: new ( ) ) ; let exit_offset = digstack :: backward_analysis ( & ssa , sp_name ) ; self . analysis_exit_load ( ssa , exit_offset ) } ; ( entry_store , exit_load ) } ; let sp_offset = self . mark_preserved ( rfn_addr , entry_store , exit_load ) ; self . sp_offsets . insert ( * rfn_addr , sp_offset ) ; }
First analysis, only based on the assumption the SP is balanced.
First analysis only based on the assumption the SP is balanced .
&mut self
rfn_addr
&u64
&mut self
rfn_addr
&u64