File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -197,8 +197,12 @@ pub fn insert_workflow() {
197197 & matched_function. symbol ,
198198 function. symbol ( ) . address ( ) ,
199199 ) ) ;
200- if let Some ( func_ty) = & matched_function. ty {
201- function. set_auto_type ( & to_bn_type ( & function. arch ( ) , func_ty) ) ;
200+ // core.function.propagateAnalysis will assign user type info to auto, so we must not apply
201+ // otherwise we will wipe over user type info.
202+ if !function. has_user_type ( ) {
203+ if let Some ( func_ty) = & matched_function. ty {
204+ function. set_auto_type ( & to_bn_type ( & function. arch ( ) , func_ty) ) ;
205+ }
202206 }
203207 // TODO: How to clear the comments? They are just persisted.
204208 // TODO: Also they generate an undo action, i hate implicit undo actions so much.
@@ -218,6 +222,11 @@ pub fn insert_workflow() {
218222 decl_instr. variable_for_stack_location_after ( offset)
219223 }
220224 } ;
225+ if mlil. is_var_user_defined ( & decl_var) {
226+ // Internally, analysis will just assign user vars to auto vars and consult only that.
227+ // So we must skip if there is a user-defined var at the decl.
228+ continue ;
229+ }
221230 let decl_ty = match variable. ty {
222231 Some ( decl_ty) => to_bn_type ( & function. arch ( ) , & decl_ty) ,
223232 None => {
You can’t perform that action at this time.
0 commit comments