@@ -195,23 +195,28 @@ def ast_call_prov(
195195 finfo = xdata .function .finfo
196196 if finfo .has_call_target_info (iaddr ):
197197 ctinfo = finfo .call_target_info (iaddr )
198- fname = ctinfo .target_interface .name
199198 ftype = ctinfo .target_interface .bctype
200199 if ftype is not None :
201200 astfntype = ftype .convert (astree .typconverter )
202- if astree .globalsymboltable .has_symbol (fname ):
203- tgtvinfo = astree .globalsymboltable .get_symbol (fname )
204- hl_tgt = astree .mk_vinfo_lval_expression (tgtvinfo )
201+
202+ if xdata .is_bx_call :
203+ # indirect call
204+ hl_tgt = XU .xxpr_to_ast_def_expr (xprs [- 1 ], xdata , iaddr , astree )
205205 else :
206- gaddr : int = 0
207- if fname .startswith ("sub_" ):
208- gaddr = int ("0x" + fname [4 :], 16 )
206+ fname = ctinfo .target_interface .name
207+ if astree .globalsymboltable .has_symbol (fname ):
208+ tgtvinfo = astree .globalsymboltable .get_symbol (fname )
209+ hl_tgt = astree .mk_vinfo_lval_expression (tgtvinfo )
209210 else :
210- if tgt .is_absolute :
211- tgtaddr = cast (ARMAbsoluteOp , tgt .opkind )
212- gaddr = int (tgtaddr .address .get_hex (), 16 )
213- hl_tgt = astree .mk_global_variable_expr (
214- fname , globaladdress = gaddr , vtype = astfntype )
211+ gaddr : int = 0
212+ if fname .startswith ("sub_" ):
213+ gaddr = int ("0x" + fname [4 :], 16 )
214+ else :
215+ if tgt .is_absolute :
216+ tgtaddr = cast (ARMAbsoluteOp , tgt .opkind )
217+ gaddr = int (tgtaddr .address .get_hex (), 16 )
218+ hl_tgt = astree .mk_global_variable_expr (
219+ fname , globaladdress = gaddr , vtype = astfntype )
215220
216221 if ftype is not None and ftype .is_function :
217222 ftype = cast ("BCTypFun" , ftype )
0 commit comments