|  |  | @ -1034,28 +1034,6 @@ let check_junk ?original_prop pname tenv prop = | 
			
		
	
		
		
			
				
					
					|  |  |  |       in |  |  |  |       in | 
			
		
	
		
		
			
				
					
					|  |  |  |       List.for_all ~f:predicate entries |  |  |  |       List.for_all ~f:predicate entries | 
			
		
	
		
		
			
				
					
					|  |  |  |     in |  |  |  |     in | 
			
		
	
		
		
			
				
					
					|  |  |  |     let hpred_in_cycle hpred = |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       (* check if the predicate belongs to a cycle in the heap *) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       let id_in_cycle id = |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         let set1 = sigma_reachable (Sil.fav_from_list [id]) sigma in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         let set2 = Ident.IdentSet.remove id set1 in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         let fav2 = Sil.fav_from_list (Ident.IdentSet.elements set2) in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         let set3 = sigma_reachable fav2 sigma in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         Ident.IdentSet.mem id set3 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       let entries = Sil.hpred_entries hpred in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       let predicate = function Exp.Var id -> id_in_cycle id | _ -> false in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       let hpred_is_loop = |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         match hpred with |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         (* true if hpred has a self loop, ie one field points to id *) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         | Sil.Hpointsto (Exp.Var id, se, _) -> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             let fav = Sil.fav_new () in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             Sil.strexp_fav_add fav se ; Sil.fav_mem fav id |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         | _ -> |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             false |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |       hpred_is_loop || List.exists ~f:predicate entries |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     in |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     let rec remove_junk_recursive sigma_done sigma_todo = |  |  |  |     let rec remove_junk_recursive sigma_done sigma_todo = | 
			
		
	
		
		
			
				
					
					|  |  |  |       match sigma_todo with |  |  |  |       match sigma_todo with | 
			
		
	
		
		
			
				
					
					|  |  |  |       | [] -> |  |  |  |       | [] -> | 
			
		
	
	
		
		
			
				
					|  |  | @ -1130,13 +1108,13 @@ let check_junk ?original_prop pname tenv prop = | 
			
		
	
		
		
			
				
					
					|  |  |  |               match (alloc_attribute, resource) with |  |  |  |               match (alloc_attribute, resource) with | 
			
		
	
		
		
			
				
					
					|  |  |  |               | Some PredSymb.Awont_leak, Rmemory _ -> |  |  |  |               | Some PredSymb.Awont_leak, Rmemory _ -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                   (true, exn_leak) |  |  |  |                   (true, exn_leak) | 
			
		
	
		
		
			
				
					
					|  |  |  |               | Some _, Rmemory Mobjc when hpred_in_cycle hpred -> ( |  |  |  |               | Some _, Rmemory Mobjc -> ( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 match RetainCycles.report_cycle tenv hpred original_prop with |  |  |  |                 match RetainCycles.report_cycle tenv hpred original_prop with | 
			
		
	
		
		
			
				
					
					|  |  |  |                 | Some exn -> |  |  |  |                 | Some exn -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                     (false, exn) |  |  |  |                     (false, exn) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 | None -> |  |  |  |                 | None -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                     (true, exn_leak) ) |  |  |  |                     (true, exn_leak) ) | 
			
		
	
		
		
			
				
					
					|  |  |  |               | (Some _, Rmemory Mobjc | Some _, Rmemory Mnew | Some _, Rmemory Mnew_array) |  |  |  |               | (Some _, Rmemory Mnew | Some _, Rmemory Mnew_array) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 when Config.curr_language_is Config.Clang -> |  |  |  |                 when Config.curr_language_is Config.Clang -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                   (is_none ml_bucket_opt, exn_leak) |  |  |  |                   (is_none ml_bucket_opt, exn_leak) | 
			
		
	
		
		
			
				
					
					|  |  |  |               | Some _, Rmemory _ -> |  |  |  |               | Some _, Rmemory _ -> | 
			
		
	
	
		
		
			
				
					|  |  | @ -1149,7 +1127,7 @@ let check_junk ?original_prop pname tenv prop = | 
			
		
	
		
		
			
				
					
					|  |  |  |                   (false, exn_leak) |  |  |  |                   (false, exn_leak) | 
			
		
	
		
		
			
				
					
					|  |  |  |               | Some _, Rlock -> |  |  |  |               | Some _, Rlock -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                   (false, exn_leak) |  |  |  |                   (false, exn_leak) | 
			
		
	
		
		
			
				
					
					|  |  |  |               | _ when hpred_in_cycle hpred && Sil.is_objc_object hpred -> ( |  |  |  |               | _ when Sil.is_objc_object hpred -> ( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 match |  |  |  |                 match | 
			
		
	
		
		
			
				
					
					|  |  |  |                   (* When it's a cycle and it is an Objective-C object then |  |  |  |                   (* When it's a cycle and it is an Objective-C object then | 
			
		
	
		
		
			
				
					
					|  |  |  |                         we have a retain cycle. Objc object may not have the |  |  |  |                         we have a retain cycle. Objc object may not have the | 
			
		
	
	
		
		
			
				
					|  |  | @ -1159,7 +1137,7 @@ let check_junk ?original_prop pname tenv prop = | 
			
		
	
		
		
			
				
					
					|  |  |  |                 | Some exn -> |  |  |  |                 | Some exn -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                     (false, exn) |  |  |  |                     (false, exn) | 
			
		
	
		
		
			
				
					
					|  |  |  |                 | None -> |  |  |  |                 | None -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                     (true, exn_leak) ) |  |  |  |                     (Config.curr_language_is Config.Java, exn_leak) ) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |               | _ -> |  |  |  |               | _ -> | 
			
		
	
		
		
			
				
					
					|  |  |  |                   (Config.curr_language_is Config.Java, exn_leak) |  |  |  |                   (Config.curr_language_is Config.Java, exn_leak) | 
			
		
	
		
		
			
				
					
					|  |  |  |             in |  |  |  |             in | 
			
		
	
	
		
		
			
				
					|  |  | 
 |