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 @@ -199,8 +199,12 @@ pub fn insert_workflow() {
199199 & matched_function. symbol ,
200200 function. symbol ( ) . address ( ) ,
201201 ) ) ;
202- if let Some ( func_ty) = & matched_function. ty {
203- function. set_auto_type ( & to_bn_type ( & function. arch ( ) , func_ty) ) ;
202+ // core.function.propagateAnalysis will assign user type info to auto, so we must not apply
203+ // otherwise we will wipe over user type info.
204+ if !function. has_user_type ( ) {
205+ if let Some ( func_ty) = & matched_function. ty {
206+ function. set_auto_type ( & to_bn_type ( & function. arch ( ) , func_ty) ) ;
207+ }
204208 }
205209 // TODO: How to clear the comments? They are just persisted.
206210 // TODO: Also they generate an undo action, i hate implicit undo actions so much.
@@ -220,6 +224,11 @@ pub fn insert_workflow() {
220224 decl_instr. variable_for_stack_location_after ( offset)
221225 }
222226 } ;
227+ if mlil. is_var_user_defined ( & decl_var) {
228+ // Internally, analysis will just assign user vars to auto vars and consult only that.
229+ // So we must skip if there is a user-defined var at the decl.
230+ continue ;
231+ }
223232 let decl_ty = match variable. ty {
224233 Some ( decl_ty) => to_bn_type ( & function. arch ( ) , & decl_ty) ,
225234 None => {
You can’t perform that action at this time.
0 commit comments