Skip to content

Commit a7f59b2

Browse files
committed
Try to make wasm build work again
1 parent f37fab5 commit a7f59b2

File tree

1 file changed

+33
-30
lines changed

1 file changed

+33
-30
lines changed

objdiff-core/src/arch/ppc/flow_analysis.rs

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,44 @@ use crate::{
33
obj::{FlowAnalysisResult, FlowAnalysisValue, Object, Relocation, Symbol},
44
util::{RawDouble, RawFloat},
55
};
6-
use itertools::Itertools;
7-
use ppc750cl::Simm;
86
use alloc::collections::{BTreeMap, BTreeSet};
7+
use alloc::{boxed::Box, format, string::String, vec::Vec};
98
use core::ffi::CStr;
109
use core::ops::{Index, IndexMut};
10+
use itertools::Itertools;
11+
use ppc750cl::Simm;
1112

1213
fn is_store_instruction(op: ppc750cl::Opcode) -> bool {
1314
use ppc750cl::Opcode;
14-
matches!(op,
15+
matches!(
16+
op,
1517
Opcode::Stbux
16-
| Opcode::Stbx
17-
| Opcode::Stfdux
18-
| Opcode::Stfdx
19-
| Opcode::Stfiwx
20-
| Opcode::Stfsux
21-
| Opcode::Stfsx
22-
| Opcode::Sthbrx
23-
| Opcode::Sthux
24-
| Opcode::Sthx
25-
| Opcode::Stswi
26-
| Opcode::Stswx
27-
| Opcode::Stwbrx
28-
| Opcode::Stwcx_
29-
| Opcode::Stwux
30-
| Opcode::Stwx
31-
| Opcode::Stwu
32-
| Opcode::Stb
33-
| Opcode::Stbu
34-
| Opcode::Sth
35-
| Opcode::Sthu
36-
| Opcode::Stmw
37-
| Opcode::Stfs
38-
| Opcode::Stfsu
39-
| Opcode::Stfd
40-
| Opcode::Stfdu)
18+
| Opcode::Stbx
19+
| Opcode::Stfdux
20+
| Opcode::Stfdx
21+
| Opcode::Stfiwx
22+
| Opcode::Stfsux
23+
| Opcode::Stfsx
24+
| Opcode::Sthbrx
25+
| Opcode::Sthux
26+
| Opcode::Sthx
27+
| Opcode::Stswi
28+
| Opcode::Stswx
29+
| Opcode::Stwbrx
30+
| Opcode::Stwcx_
31+
| Opcode::Stwux
32+
| Opcode::Stwx
33+
| Opcode::Stwu
34+
| Opcode::Stb
35+
| Opcode::Stbu
36+
| Opcode::Sth
37+
| Opcode::Sthu
38+
| Opcode::Stmw
39+
| Opcode::Stfs
40+
| Opcode::Stfsu
41+
| Opcode::Stfd
42+
| Opcode::Stfdu
43+
)
4144
}
4245

4346
pub fn guess_data_type_from_load_store_inst_op(inst_op: ppc750cl::Opcode) -> Option<DataType> {
@@ -379,8 +382,8 @@ pub fn ppc_data_flow_analysis(
379382
code: &[u8],
380383
relocations: &[Relocation],
381384
) -> Box<dyn FlowAnalysisResult> {
382-
use ppc750cl::InsIter;
383385
use alloc::collections::VecDeque;
386+
use ppc750cl::InsIter;
384387
let instructions = InsIter::new(code, func_symbol.address as u32)
385388
.map(|(_addr, ins)| (ins.op, ins.basic().args))
386389
.collect_vec();
@@ -454,7 +457,7 @@ pub fn ppc_data_flow_analysis(
454457
// an infinite loop if we hit some kind of bad behavior.
455458
failsafe_counter += 1;
456459
if failsafe_counter > 256 {
457-
println!("Analysis of {} failed to stabilize", func_symbol.name);
460+
//println!("Analysis of {} failed to stabilize", func_symbol.name);
458461
return Box::new(PPCFlowAnalysisResult::new());
459462
}
460463
}

0 commit comments

Comments
 (0)