@@ -45,7 +45,7 @@ def get_param_sites(mlil: MediumLevelILFunction) -> Mapping[LowLevelILInstructio
45
45
:param mlil: MLIL function to search
46
46
:return: Map of param sites as described above
47
47
"""
48
- call_sites = {}
48
+ call_sites : dict [ MediumLevelILInstruction , List [ Tuple [ int , LowLevelILInstruction ]]] = {}
49
49
mlil = mlil .ssa_form
50
50
51
51
# As a function to handle call and tailcall identically
@@ -54,7 +54,7 @@ def collect_call_params(call_site, dest, params):
54
54
for i , param in enumerate (params ):
55
55
llil = param .llil
56
56
if llil is not None :
57
- def_sites .append ((param , llil ))
57
+ def_sites .append ((i , llil ))
58
58
continue
59
59
60
60
match param :
@@ -73,10 +73,11 @@ def collect_call_params(call_site, dest, params):
73
73
case MediumLevelILConstBase ():
74
74
# This is wrong, but it works (sometimes)
75
75
# Oh god, have I just quoted php.net
76
- def_site_idx = mlil .llil .get_instruction_start (param .address )
77
- if def_site_idx is not None :
78
- def_sites .append ((i , mlil .llil [def_site_idx ].ssa_form ))
79
- continue
76
+ if mlil .llil is not None :
77
+ def_site_idx = mlil .llil .get_instruction_start (param .address )
78
+ if def_site_idx is not None :
79
+ def_sites .append ((i , mlil .llil [def_site_idx ].ssa_form ))
80
+ continue
80
81
81
82
if len (def_sites ) == 0 :
82
83
log_debug (f"Could not find def site for param { i } in call at { call_site .address :#x} " )
0 commit comments