@@ -3,7 +3,7 @@ use crate::cache::{
33 cached_function_guid, insert_cached_function_match, try_cached_function_guid,
44 try_cached_function_match,
55} ;
6- use crate :: convert:: { platform_to_target, to_bn_type} ;
6+ use crate :: convert:: { platform_to_target, to_bn_symbol_at_address , to_bn_type} ;
77use crate :: matcher:: { Matcher , MatcherSettings } ;
88use crate :: plugin:: settings:: PluginSettings ;
99use crate :: { get_warp_ignore_tag_type, get_warp_tag_type, relocatable_regions, IGNORE_TAG_NAME } ;
@@ -260,6 +260,13 @@ pub fn insert_workflow() -> Result<(), ()> {
260260 if !function. has_user_type ( ) {
261261 if let Some ( func_ty) = & matched_function. ty {
262262 function. set_auto_type ( & to_bn_type ( Some ( function. arch ( ) ) , func_ty) ) ;
263+ } else if !function. has_explicitly_defined_type ( ) {
264+ // Attempt to retrieve the type information from the named platform functions.
265+ // NOTE: We check `has_explicitly_defined_type` because after applying imported type
266+ // information, that flag will be set, allowing us to avoid applying it again.
267+ let bn_symbol =
268+ to_bn_symbol_at_address ( & view, & matched_function. symbol , function. start ( ) ) ;
269+ function. apply_imported_types ( & bn_symbol, None ) ;
263270 }
264271 }
265272 if let Some ( mlil) = ctx. mlil_function ( ) {
0 commit comments