From 55c585e1e05c6ff25e771575d9113c4253737797 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Tue, 24 Oct 2017 13:54:23 -0700 Subject: [PATCH] [infer][biabduction] remove the bi-abduction based check for uninitialized values Summary: This check is deprecated and will be replaced by a dedicated checker to detect unitialized values. Reviewed By: mbouaziz Differential Revision: D6133108 fbshipit-source-id: 1c0e9ac --- infer/src/IR/Exceptions.ml | 10 ------ infer/src/IR/Exceptions.mli | 2 -- infer/src/backend/symExec.ml | 31 ------------------- infer/src/base/IssueType.ml | 2 +- infer/tests/codetoanalyze/c/errors/issues.exp | 3 -- .../tests/codetoanalyze/cpp/errors/issues.exp | 19 ------------ .../tests/codetoanalyze/java/infer/issues.exp | 17 ---------- .../codetoanalyze/java/tracing/issues.exp | 2 -- .../codetoanalyze/objc/errors/issues.exp | 8 ----- 9 files changed, 1 insertion(+), 93 deletions(-) diff --git a/infer/src/IR/Exceptions.ml b/infer/src/IR/Exceptions.ml index 6ff9d6cd9..b78e8aa71 100644 --- a/infer/src/IR/Exceptions.ml +++ b/infer/src/IR/Exceptions.ml @@ -137,8 +137,6 @@ exception Symexec_memory_error of L.ml_loc exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * L.ml_loc -exception Uninitialized_value of Localise.error_desc * L.ml_loc - exception Unknown_proc exception Unreachable_code_after of Localise.error_desc * L.ml_loc @@ -587,14 +585,6 @@ let recognize_exception exn = ; severity= Low ; kind= None ; category= Nocat } - | Uninitialized_value (desc, ml_loc) -> - { name= IssueType.uninitialized_value - ; description= desc - ; ml_loc= Some ml_loc - ; visibility= Exn_user - ; severity= Medium - ; kind= None - ; category= Nocat } | Unary_minus_applied_to_unsigned_expression (desc, ml_loc) -> { name= IssueType.unary_minus_applied_to_unsigned_expression ; description= desc diff --git a/infer/src/IR/Exceptions.mli b/infer/src/IR/Exceptions.mli index 0f37b70e3..c71409f26 100644 --- a/infer/src/IR/Exceptions.mli +++ b/infer/src/IR/Exceptions.mli @@ -135,8 +135,6 @@ exception Symexec_memory_error of Logging.ml_loc exception Unary_minus_applied_to_unsigned_expression of Localise.error_desc * Logging.ml_loc -exception Uninitialized_value of Localise.error_desc * Logging.ml_loc - exception Unknown_proc exception Unreachable_code_after of Localise.error_desc * Logging.ml_loc diff --git a/infer/src/backend/symExec.ml b/infer/src/backend/symExec.ml index 27c360da4..dc96f5b62 100644 --- a/infer/src/backend/symExec.ml +++ b/infer/src/backend/symExec.ml @@ -94,7 +94,6 @@ let check_block_retain_cycle tenv caller_pname prop block_nullified = false cases for field and array accesses. *) let rec apply_offlist pdesc tenv p fp_root nullify_struct (root_lexp, strexp, typ) offlist (f: Exp.t option -> Exp.t) inst lookup_inst = - let pname = Procdesc.get_proc_name pdesc in let pp_error () = L.d_strln ".... Invalid Field ...." ; L.d_str "strexp : " ; @@ -113,38 +112,8 @@ let rec apply_offlist pdesc tenv p fp_root nullify_struct (root_lexp, strexp, ty in match (offlist, strexp, typ.Typ.desc) with | [], Sil.Eexp (e, inst_curr), _ -> - let inst_is_uninitialized = function - | Sil.Ialloc -> - (* java allocation initializes with default values *) - !Config.curr_language <> Config.Java - | Sil.Iinitial -> - true - | _ -> - false - in - let is_hidden_field () = - match State.get_instr () with - | Some Sil.Load (_, Exp.Lfield (_, fieldname, _), _, _) -> - Typ.Fieldname.is_hidden fieldname - | _ -> - false - in let inst_new = match inst with - | Sil.Ilookup when inst_is_uninitialized inst_curr && not (is_hidden_field ()) -> - (* we are in a lookup of an uninitialized value *) - lookup_inst := Some inst_curr ; - let alloc_attribute_opt = - if Sil.equal_inst inst_curr Sil.Iinitial then None - else Attribute.get_undef tenv p root_lexp - in - let deref_str = Localise.deref_str_uninitialized alloc_attribute_opt in - let err_desc = - Errdesc.explain_memory_access pname tenv deref_str p (State.get_loc ()) - in - let exn = Exceptions.Uninitialized_value (err_desc, __POS__) in - Reporting.log_warning_deprecated pname exn ; - Sil.update_inst inst_curr inst | Sil.Ilookup -> (* a lookup does not change an inst unless it is inst_initial *) lookup_inst := Some inst_curr ; diff --git a/infer/src/base/IssueType.ml b/infer/src/base/IssueType.ml index 51c04abb3..9e816b765 100644 --- a/infer/src/base/IssueType.ml +++ b/infer/src/base/IssueType.ml @@ -293,7 +293,7 @@ let unary_minus_applied_to_unsigned_expression = from_string ~enabled:false "UNARY_MINUS_APPLIED_TO_UNSIGNED_EXPRESSION" -let uninitialized_value = from_string ~enabled:false "UNINITIALIZED_VALUE" +let uninitialized_value = from_string "UNINITIALIZED_VALUE" let unknown_proc = from_string "Unknown_proc" ~hum:"Unknown Procedure" diff --git a/infer/tests/codetoanalyze/c/errors/issues.exp b/infer/tests/codetoanalyze/c/errors/issues.exp index a08ae8caf..966323c51 100644 --- a/infer/tests/codetoanalyze/c/errors/issues.exp +++ b/infer/tests/codetoanalyze/c/errors/issues.exp @@ -1,7 +1,6 @@ codetoanalyze/c/errors/arithmetic/array_out_of_bounds.c, bound_error, 2, ARRAY_OUT_OF_BOUNDS_L1 codetoanalyze/c/errors/arithmetic/array_out_of_bounds.c, bound_error_nested, 2, ARRAY_OUT_OF_BOUNDS_L1 codetoanalyze/c/errors/arithmetic/divide_by_zero.c, arith_divide_by_zero, 3, DIVIDE_BY_ZERO -codetoanalyze/c/errors/arithmetic/test_sizeof.c, my_realloc, 10, UNINITIALIZED_VALUE codetoanalyze/c/errors/arithmetic/unsigned_values.c, signed_array, 3, DIVIDE_BY_ZERO codetoanalyze/c/errors/arithmetic/unsigned_values.c, signed_field, 3, DIVIDE_BY_ZERO codetoanalyze/c/errors/arithmetic/unsigned_values.c, signed_int, 3, DIVIDE_BY_ZERO @@ -16,9 +15,7 @@ codetoanalyze/c/errors/attributes/sentinel.c, truncated_call, 5, PREMATURE_NIL_T codetoanalyze/c/errors/custom_error/custom.c, paf, 3, UNEXPECTED_NEGATIVE_EXPONENT codetoanalyze/c/errors/custom_error/custom.c, pouf, 3, UNEXPECTED_NEGATIVE_EXPONENT codetoanalyze/c/errors/dangling_deref/dpd.c, dpd, 3, DANGLING_POINTER_DEREFERENCE -codetoanalyze/c/errors/dangling_deref/dpd.c, dpd, 3, UNINITIALIZED_VALUE codetoanalyze/c/errors/dangling_deref/dpd.c, intraprocdpd, 3, DANGLING_POINTER_DEREFERENCE -codetoanalyze/c/errors/dangling_deref/dpd.c, intraprocdpd, 3, UNINITIALIZED_VALUE codetoanalyze/c/errors/dangling_deref/dpd.c, nodpd1, 3, NULL_DEREFERENCE codetoanalyze/c/errors/initialization/compound_literal.c, divide_by_zero, 0, DIVIDE_BY_ZERO codetoanalyze/c/errors/initialization/initlistexpr.c, init_divide_by_zero, 2, Assert_failure diff --git a/infer/tests/codetoanalyze/cpp/errors/issues.exp b/infer/tests/codetoanalyze/cpp/errors/issues.exp index 21d58287a..9f1a3dd53 100644 --- a/infer/tests/codetoanalyze/cpp/errors/issues.exp +++ b/infer/tests/codetoanalyze/cpp/errors/issues.exp @@ -56,9 +56,7 @@ codetoanalyze/cpp/errors/mutex/timed_mutex.cpp, try_lock_bad, 2, DOUBLE_LOCK, [s codetoanalyze/cpp/errors/npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_null_field_deref, 2, NULL_DEREFERENCE, [start of procedure boxed_ptr::smart_ptr_null_field_deref(),start of procedure SmartPtr,return from a call to boxed_ptr::SmartPtr_SmartPtr,start of procedure get,return from a call to boxed_ptr::SmartPtr_get] codetoanalyze/cpp/errors/npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_null_method_deref, 2, NULL_DEREFERENCE, [start of procedure boxed_ptr::smart_ptr_null_method_deref(),start of procedure SmartPtr,return from a call to boxed_ptr::SmartPtr_SmartPtr,start of procedure get,return from a call to boxed_ptr::SmartPtr_get] codetoanalyze/cpp/errors/npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_null_method_deref2, 2, NULL_DEREFERENCE, [start of procedure boxed_ptr::smart_ptr_null_method_deref2(),start of procedure SmartPtr,return from a call to boxed_ptr::SmartPtr_SmartPtr,start of procedure get,return from a call to boxed_ptr::SmartPtr_get] -codetoanalyze/cpp/errors/npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_ok_field_deref, 4, UNINITIALIZED_VALUE, [start of procedure boxed_ptr::smart_ptr_ok_field_deref(),start of procedure SmartPtr,return from a call to boxed_ptr::SmartPtr_SmartPtr,start of procedure X,return from a call to boxed_ptr::X_X,start of procedure get,return from a call to boxed_ptr::SmartPtr_get] codetoanalyze/cpp/errors/npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_result_method_null_deref, 4, NULL_DEREFERENCE, [start of procedure boxed_ptr::smart_ptr_result_method_null_deref(),start of procedure SmartPtr,return from a call to boxed_ptr::SmartPtr_SmartPtr,start of procedure X,return from a call to boxed_ptr::X_X,start of procedure get,return from a call to boxed_ptr::SmartPtr_get,start of procedure getNull,return from a call to boxed_ptr::X_getNull] -codetoanalyze/cpp/errors/npe/boxed_ptr.cpp, boxed_ptr::smart_ptr_result_method_ok_deref, 4, UNINITIALIZED_VALUE, [start of procedure boxed_ptr::smart_ptr_result_method_ok_deref(),start of procedure SmartPtr,return from a call to boxed_ptr::SmartPtr_SmartPtr,start of procedure X,return from a call to boxed_ptr::X_X,start of procedure get,return from a call to boxed_ptr::SmartPtr_get,start of procedure getPtr,return from a call to boxed_ptr::X_getPtr] codetoanalyze/cpp/errors/npe/cancellation.cpp, cancellation_test::size_nonzero_deref2_bad, 4, NULL_DEREFERENCE, [start of procedure cancellation_test::size_nonzero_deref2_bad(),start of procedure cancellation_test::is_size_zero(),start of procedure begin,return from a call to cancellation_test::Test_begin,start of procedure end,return from a call to cancellation_test::Test_end,Condition is false,return from a call to cancellation_test::is_size_zero,Condition is true] codetoanalyze/cpp/errors/npe/cancellation.cpp, cancellation_test::size_nonzero_deref_bad, 4, NULL_DEREFERENCE, [start of procedure cancellation_test::size_nonzero_deref_bad(),start of procedure cancellation_test::is_size_zero(),start of procedure begin,return from a call to cancellation_test::Test_begin,start of procedure end,return from a call to cancellation_test::Test_end,Condition is false,return from a call to cancellation_test::is_size_zero,Condition is true] codetoanalyze/cpp/errors/npe/cancellation.cpp, cancellation_test::size_nonzero_deref_iter2_bad, 4, NULL_DEREFERENCE, [start of procedure cancellation_test::size_nonzero_deref_iter2_bad(),start of procedure cancellation_test::is_size_zero_iter(),start of procedure begin_iter,start of procedure TestIter,return from a call to cancellation_test::TestIter_TestIter,start of procedure TestIter,return from a call to cancellation_test::TestIter_TestIter,return from a call to cancellation_test::Test_begin_iter,start of procedure end_iter,start of procedure TestIter,return from a call to cancellation_test::TestIter_TestIter,start of procedure TestIter,return from a call to cancellation_test::TestIter_TestIter,return from a call to cancellation_test::Test_end_iter,start of procedure cancellation_test::operator==(),Condition is false,return from a call to cancellation_test::operator==,return from a call to cancellation_test::is_size_zero_iter,Condition is true] @@ -83,10 +81,8 @@ codetoanalyze/cpp/errors/overwrite_attribute/main.cpp, testSetIntValue, 3, DIVID codetoanalyze/cpp/errors/pointers/unintialized.cpp, initialized_no_dangling_ok, 1, MEMORY_LEAK, [start of procedure initialized_no_dangling_ok()] codetoanalyze/cpp/errors/pointers/unintialized.cpp, initialized_no_dangling_ok, 2, DANGLING_POINTER_DEREFERENCE, [start of procedure initialized_no_dangling_ok()] codetoanalyze/cpp/errors/pointers/unintialized.cpp, known_ctor_dangling_bad, 1, MEMORY_LEAK, [start of procedure known_ctor_dangling_bad(),start of procedure TestDangling,return from a call to TestDangling_TestDangling,start of procedure TestDangling,return from a call to TestDangling_TestDangling] -codetoanalyze/cpp/errors/pointers/unintialized.cpp, known_ctor_dangling_bad, 1, UNINITIALIZED_VALUE, [start of procedure known_ctor_dangling_bad(),start of procedure TestDangling,return from a call to TestDangling_TestDangling] codetoanalyze/cpp/errors/pointers/unintialized.cpp, known_ctor_dangling_bad, 2, DANGLING_POINTER_DEREFERENCE, [start of procedure known_ctor_dangling_bad(),start of procedure TestDangling,return from a call to TestDangling_TestDangling,start of procedure TestDangling,return from a call to TestDangling_TestDangling] codetoanalyze/cpp/errors/pointers/unintialized.cpp, uninitialized_dangling_bad, 2, DANGLING_POINTER_DEREFERENCE, [start of procedure uninitialized_dangling_bad()] -codetoanalyze/cpp/errors/pointers/unintialized.cpp, uninitialized_dangling_bad, 2, UNINITIALIZED_VALUE, [start of procedure uninitialized_dangling_bad()] codetoanalyze/cpp/errors/pointers/unintialized.cpp, unknown_ctor_assume_no_dangling_ok, 1, MEMORY_LEAK, [start of procedure unknown_ctor_assume_no_dangling_ok(),Skipping TestDangling: function or method not found] codetoanalyze/cpp/errors/resource_leaks/raii.cpp, resource_leak, 7, RESOURCE_LEAK, [start of procedure resource_leak(),Condition is false] codetoanalyze/cpp/errors/smart_ptr/const_volatile_type.cpp, test_const1, 3, NULL_DEREFERENCE, [start of procedure test_const1()] @@ -121,16 +117,12 @@ codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_n codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref2, 3, MEMORY_LEAK, [start of procedure shared_ptr::reset_ptr_null_deref2()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_null_deref2, 4, NULL_DEREFERENCE, [start of procedure shared_ptr::reset_ptr_null_deref2()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_ok_deref, 3, MEMORY_LEAK, [start of procedure shared_ptr::reset_ptr_ok_deref()] -codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_ok_deref, 3, UNINITIALIZED_VALUE, [start of procedure shared_ptr::reset_ptr_ok_deref()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_ok_deref2, 4, MEMORY_LEAK, [start of procedure shared_ptr::reset_ptr_ok_deref2()] -codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::reset_ptr_ok_deref2, 4, UNINITIALIZED_VALUE, [start of procedure shared_ptr::reset_ptr_ok_deref2()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_null_deref, 3, MEMORY_LEAK, [start of procedure shared_ptr::shared_ptr_assign_null_deref()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_null_deref, 4, NULL_DEREFERENCE, [start of procedure shared_ptr::shared_ptr_assign_null_deref()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_ok_deref, 5, MEMORY_LEAK, [start of procedure shared_ptr::shared_ptr_assign_ok_deref()] -codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_assign_ok_deref, 5, UNINITIALIZED_VALUE, [start of procedure shared_ptr::shared_ptr_assign_ok_deref()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_copy_null_deref, 3, NULL_DEREFERENCE, [start of procedure shared_ptr::shared_ptr_copy_null_deref()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_copy_ok_deref, 3, MEMORY_LEAK, [start of procedure shared_ptr::shared_ptr_copy_ok_deref()] -codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_copy_ok_deref, 3, UNINITIALIZED_VALUE, [start of procedure shared_ptr::shared_ptr_copy_ok_deref()] codetoanalyze/cpp/errors/smart_ptr/shared_ptr_deref.cpp, shared_ptr::shared_ptr_move_null_deref, 3, NULL_DEREFERENCE, [start of procedure shared_ptr::shared_ptr_move_null_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_array_ptr_deref, 2, NULL_DEREFERENCE, [start of procedure unique_ptr::empty_array_ptr_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::empty_ptr_deref, 2, NULL_DEREFERENCE, [start of procedure unique_ptr::empty_ptr_deref()] @@ -145,17 +137,13 @@ codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_n codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref2, 3, MEMORY_LEAK, [start of procedure unique_ptr::reset_ptr_null_deref2()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_null_deref2, 4, NULL_DEREFERENCE, [start of procedure unique_ptr::reset_ptr_null_deref2()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_ok_deref, 3, MEMORY_LEAK, [start of procedure unique_ptr::reset_ptr_ok_deref()] -codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_ok_deref, 3, UNINITIALIZED_VALUE, [start of procedure unique_ptr::reset_ptr_ok_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_ok_deref2, 4, MEMORY_LEAK, [start of procedure unique_ptr::reset_ptr_ok_deref2()] -codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::reset_ptr_ok_deref2, 4, UNINITIALIZED_VALUE, [start of procedure unique_ptr::reset_ptr_ok_deref2()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_null_deref, 3, MEMORY_LEAK, [start of procedure unique_ptr::unique_ptr_assign_null_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_null_deref, 4, NULL_DEREFERENCE, [start of procedure unique_ptr::unique_ptr_assign_null_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_ok_deref, 5, MEMORY_LEAK, [start of procedure unique_ptr::unique_ptr_assign_ok_deref()] -codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_assign_ok_deref, 5, UNINITIALIZED_VALUE, [start of procedure unique_ptr::unique_ptr_assign_ok_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_copy_null_deref, 3, NULL_DEREFERENCE, [start of procedure unique_ptr::unique_ptr_copy_null_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_move_null_deref, 3, NULL_DEREFERENCE, [start of procedure unique_ptr::unique_ptr_move_null_deref()] codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_move_ok_deref, 3, MEMORY_LEAK, [start of procedure unique_ptr::unique_ptr_move_ok_deref()] -codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_move_ok_deref, 3, UNINITIALIZED_VALUE, [start of procedure unique_ptr::unique_ptr_move_ok_deref()] codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromSharedBaseAssign_bad, 4, NULL_DEREFERENCE, [start of procedure weak_ptr_derefs::safeGetFromSharedBaseAssign_bad(),Skipping std::make_shared(): function or method not found,start of procedure weak_ptr_constructors::fromSharedBaseAssign(),return from a call to weak_ptr_constructors::fromSharedBaseAssign,start of procedure weak_ptr_derefs::safeGet(),Condition is false,return from a call to weak_ptr_derefs::safeGet] codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromSharedBaseConstr_bad, 4, NULL_DEREFERENCE, [start of procedure weak_ptr_derefs::safeGetFromSharedBaseConstr_bad(),Skipping std::make_shared(): function or method not found,start of procedure weak_ptr_constructors::fromSharedBaseConstr(),return from a call to weak_ptr_constructors::fromSharedBaseConstr,start of procedure weak_ptr_derefs::safeGet(),Condition is false,return from a call to weak_ptr_derefs::safeGet] codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromSharedDerivedAssign_bad, 4, NULL_DEREFERENCE, [start of procedure weak_ptr_derefs::safeGetFromSharedDerivedAssign_bad(),Skipping std::make_shared(): function or method not found,start of procedure weak_ptr_constructors::fromSharedDerivedAssign(),return from a call to weak_ptr_constructors::fromSharedDerivedAssign,start of procedure weak_ptr_derefs::safeGet(),Condition is false,return from a call to weak_ptr_derefs::safeGet] @@ -183,19 +171,14 @@ codetoanalyze/cpp/errors/static_local/nonstatic_local_bad.cpp, nonstatic_local_b codetoanalyze/cpp/errors/static_local/nonstatic_local_bad.cpp, nonstatic_local_caller, 2, DANGLING_POINTER_DEREFERENCE, [start of procedure nonstatic_local_caller(),start of procedure nonstatic_local_bad(),return from a call to nonstatic_local_bad] codetoanalyze/cpp/errors/subtyping/cast_with_enforce.cpp, cast_with_enforce::cast_with_npe, 3, NULL_DEREFERENCE, [start of procedure cast_with_enforce::cast_with_npe(),start of procedure Base,return from a call to cast_with_enforce::Base_Base] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::rightPointerCast, 1, MEMORY_LEAK, [start of procedure dynamic__cast::rightPointerCast(),start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived,start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived] -codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::rightPointerCast, 1, UNINITIALIZED_VALUE, [start of procedure dynamic__cast::rightPointerCast(),start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::rightPointerCast, 4, DIVIDE_BY_ZERO, [start of procedure dynamic__cast::rightPointerCast(),start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived,start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived,Condition is true] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::rightReferenceCast, 1, MEMORY_LEAK, [start of procedure dynamic__cast::rightReferenceCast(),start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived,start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived] -codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::rightReferenceCast, 1, UNINITIALIZED_VALUE, [start of procedure dynamic__cast::rightReferenceCast(),start of procedure Derived,start of procedure Base,return from a call to dynamic__cast::Base_Base,return from a call to dynamic__cast::Derived_Derived] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongCastOfArgumentPointer, 2, DIVIDE_BY_ZERO, [start of procedure dynamic__cast::wrongCastOfArgumentPointer(),start of procedure Base,return from a call to dynamic__cast::Base_Base,start of procedure dynamic__cast::castOfArgumentPointer(),Condition is false,return from a call to dynamic__cast::castOfArgumentPointer] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongCastOfArgumentReference, 2, CLASS_CAST_EXCEPTION, [start of procedure dynamic__cast::wrongCastOfArgumentReference(),start of procedure Base,return from a call to dynamic__cast::Base_Base] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongPointerCast, 1, MEMORY_LEAK, [start of procedure dynamic__cast::wrongPointerCast(),start of procedure Base,return from a call to dynamic__cast::Base_Base,start of procedure Base,return from a call to dynamic__cast::Base_Base] -codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongPointerCast, 1, UNINITIALIZED_VALUE, [start of procedure dynamic__cast::wrongPointerCast(),start of procedure Base,return from a call to dynamic__cast::Base_Base] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongPointerCast, 6, DIVIDE_BY_ZERO, [start of procedure dynamic__cast::wrongPointerCast(),start of procedure Base,return from a call to dynamic__cast::Base_Base,start of procedure Base,return from a call to dynamic__cast::Base_Base,Condition is false] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongReferenceCast, 1, MEMORY_LEAK, [start of procedure dynamic__cast::wrongReferenceCast(),start of procedure Base,return from a call to dynamic__cast::Base_Base,start of procedure Base,return from a call to dynamic__cast::Base_Base] -codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongReferenceCast, 1, UNINITIALIZED_VALUE, [start of procedure dynamic__cast::wrongReferenceCast(),start of procedure Base,return from a call to dynamic__cast::Base_Base] codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongReferenceCastNotAssigned, 1, MEMORY_LEAK, [start of procedure dynamic__cast::wrongReferenceCastNotAssigned(),start of procedure Base,return from a call to dynamic__cast::Base_Base,start of procedure Base,return from a call to dynamic__cast::Base_Base] -codetoanalyze/cpp/errors/subtyping/dynamic_cast.cpp, dynamic__cast::wrongReferenceCastNotAssigned, 1, UNINITIALIZED_VALUE, [start of procedure dynamic__cast::wrongReferenceCastNotAssigned(),start of procedure Base,return from a call to dynamic__cast::Base_Base] codetoanalyze/cpp/errors/subtyping/implicit_cast_with_const.cpp, implicit_cast_with_const::BaseDerefNPE, 2, NULL_DEREFERENCE, [start of procedure implicit_cast_with_const::BaseDerefNPE(),start of procedure Base,return from a call to implicit_cast_with_const::Base_Base,start of procedure implicit_cast_with_const::deref()] codetoanalyze/cpp/errors/subtyping/implicit_cast_with_const.cpp, implicit_cast_with_const::DerivedDerefNPE, 2, NULL_DEREFERENCE, [start of procedure implicit_cast_with_const::DerivedDerefNPE(),start of procedure Derived,start of procedure Base,return from a call to implicit_cast_with_const::Base_Base,return from a call to implicit_cast_with_const::Derived_Derived,start of procedure implicit_cast_with_const::deref()] codetoanalyze/cpp/errors/subtyping/subtyping_check.cpp, B_setFG, 4, DIVIDE_BY_ZERO, [start of procedure setFG,start of procedure setF,return from a call to A_setF,Condition is true] @@ -248,7 +231,6 @@ codetoanalyze/cpp/shared/attributes/annotate.cpp, getRef_null_deref1, 3, NULL_DE codetoanalyze/cpp/shared/attributes/annotate.cpp, getRef_null_deref2, 3, NULL_DEREFERENCE, [start of procedure getRef_null_deref2(),start of procedure TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr,return from a call to TranslateAsPtr_TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr] codetoanalyze/cpp/shared/attributes/annotate.cpp, operator_star_null_deref1, 3, NULL_DEREFERENCE, [start of procedure operator_star_null_deref1(),start of procedure TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr,return from a call to TranslateAsPtr_TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr] codetoanalyze/cpp/shared/attributes/annotate.cpp, operator_star_null_deref2, 3, NULL_DEREFERENCE, [start of procedure operator_star_null_deref2(),start of procedure TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr,return from a call to TranslateAsPtr_TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr] -codetoanalyze/cpp/shared/attributes/annotate.cpp, operator_star_ok_deref, 4, UNINITIALIZED_VALUE, [start of procedure operator_star_ok_deref(),start of procedure TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr,return from a call to TranslateAsPtr_TranslateAsPtr,start of procedure setPtr,return from a call to TranslateAsPtr_setPtr] codetoanalyze/cpp/shared/conditional/lvalue_conditional.cpp, div0_assign_conditional, 0, DIVIDE_BY_ZERO, [start of procedure div0_assign_conditional(),start of procedure assign_conditional(),Condition is false,return from a call to assign_conditional] codetoanalyze/cpp/shared/conditional/lvalue_conditional.cpp, div0_choose_lvalue, 0, DIVIDE_BY_ZERO, [start of procedure div0_choose_lvalue(),start of procedure choose_lvalue(),Condition is true,return from a call to choose_lvalue] codetoanalyze/cpp/shared/conditional/lvalue_conditional.cpp, div0_choose_rvalue, 0, DIVIDE_BY_ZERO, [start of procedure div0_choose_rvalue(),start of procedure choose_rvalue(),Condition is true,return from a call to choose_rvalue] @@ -300,7 +282,6 @@ codetoanalyze/cpp/shared/methods/conversion_operator.cpp, conversion_operator::y codetoanalyze/cpp/shared/methods/static.cpp, div0_class, 0, DIVIDE_BY_ZERO, [start of procedure div0_class(),start of procedure fun] codetoanalyze/cpp/shared/methods/static.cpp, div0_instance, 2, DIVIDE_BY_ZERO, [start of procedure div0_instance(),start of procedure fun] codetoanalyze/cpp/shared/methods/virtual_methods.cpp, call_virtual_destructor, 1, MEMORY_LEAK, [start of procedure call_virtual_destructor(),start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle,start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle] -codetoanalyze/cpp/shared/methods/virtual_methods.cpp, call_virtual_destructor, 1, UNINITIALIZED_VALUE, [start of procedure call_virtual_destructor(),start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle] codetoanalyze/cpp/shared/methods/virtual_methods.cpp, call_virtual_destructor, 2, DANGLING_POINTER_DEREFERENCE, [start of procedure call_virtual_destructor(),start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle,start of procedure Triangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Triangle_Triangle] codetoanalyze/cpp/shared/methods/virtual_methods.cpp, poly_area, 3, DIVIDE_BY_ZERO, [start of procedure poly_area(),start of procedure Polygon,return from a call to Polygon_Polygon,start of procedure area,return from a call to Polygon_area] codetoanalyze/cpp/shared/methods/virtual_methods.cpp, rect_area, 4, DIVIDE_BY_ZERO, [start of procedure rect_area(),start of procedure Rectangle,start of procedure Polygon,return from a call to Polygon_Polygon,return from a call to Rectangle_Rectangle,start of procedure set_values,return from a call to Polygon_set_values,start of procedure area,return from a call to Rectangle_area] diff --git a/infer/tests/codetoanalyze/java/infer/issues.exp b/infer/tests/codetoanalyze/java/infer/issues.exp index 90e9658d5..fce43d4b2 100644 --- a/infer/tests/codetoanalyze/java/infer/issues.exp +++ b/infer/tests/codetoanalyze/java/infer/issues.exp @@ -155,27 +155,18 @@ codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions. codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.bufferedReaderNotClosedAfterRead(), 6, RESOURCE_LEAK, [start of procedure bufferedReaderNotClosedAfterRead(),exception java.io.IOException] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.fileReaderNotClosedAfterRead(), 6, RESOURCE_LEAK, [start of procedure fileReaderNotClosedAfterRead(),Skipping FileReader(...): unknown method,exception java.io.IOException] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.inputStreamReaderNotClosedAfterRead(), 6, RESOURCE_LEAK, [start of procedure inputStreamReaderNotClosedAfterRead(),Skipping InputStreamReader(...): unknown method,exception java.io.IOException] -codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.noNeedToCloseBufferReaderWrapperOk(File), 4, UNINITIALIZED_VALUE, [start of procedure noNeedToCloseBufferReaderWrapperOk(...),exception java.io.IOException,Switch condition is true. Entering switch case,exception java.io.IOException] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.pipedReaderFalsePositive(), 5, RESOURCE_LEAK, [start of procedure pipedReaderFalsePositive()] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.pipedReaderNotClosedAfterConnect(PipedWriter), 7, RESOURCE_LEAK, [start of procedure pipedReaderNotClosedAfterConnect(...),exception java.io.IOException] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.pipedReaderNotClosedAfterConstructedWithWriter(), 8, RESOURCE_LEAK, [start of procedure pipedReaderNotClosedAfterConstructedWithWriter(),exception java.io.IOException] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.pushbackReaderNotClosedAfterRead(), 6, RESOURCE_LEAK, [start of procedure pushbackReaderNotClosedAfterRead(),Skipping PushbackReader(...): unknown method,exception java.io.IOException] codetoanalyze/java/infer/ReaderLeaks.java, void ReaderLeaks.readerNotClosedAfterRead(), 6, RESOURCE_LEAK, [start of procedure readerNotClosedAfterRead(),Skipping FileReader(...): unknown method,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, String ResourceLeaks.readInstallationFileBad(File), 6, RESOURCE_LEAK, [start of procedure readInstallationFileBad(...),exception java.io.IOException] -codetoanalyze/java/infer/ResourceLeaks.java, String ResourceLeaks.readInstallationFileGood(File), 8, UNINITIALIZED_VALUE, [start of procedure readInstallationFileGood(...),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, boolean ResourceLeaks.jarFileNotClosed(), 3, RESOURCE_LEAK, [start of procedure jarFileNotClosed()] codetoanalyze/java/infer/ResourceLeaks.java, int ResourceLeaks.fileOutputStreamTwoLeaks1(boolean), 3, RESOURCE_LEAK, [start of procedure fileOutputStreamTwoLeaks1(...),Taking true branch] codetoanalyze/java/infer/ResourceLeaks.java, int ResourceLeaks.fileOutputStreamTwoLeaks1(boolean), 6, RESOURCE_LEAK, [start of procedure fileOutputStreamTwoLeaks1(...),Taking false branch] -codetoanalyze/java/infer/ResourceLeaks.java, int ResourceLeaks.readConfigCloseStream(String), 8, UNINITIALIZED_VALUE, [start of procedure readConfigCloseStream(...),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, int ResourceLeaks.readConfigNotCloseStream(String), 5, RESOURCE_LEAK, [start of procedure readConfigNotCloseStream(...)] -codetoanalyze/java/infer/ResourceLeaks.java, int ResourceLeaks.tryWithResource(), 3, UNINITIALIZED_VALUE, [start of procedure tryWithResource(),exception java.io.IOException,Switch condition is true. Entering switch case,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.NoResourceLeakWarningAfterCheckState(File,int), 2, PRECONDITION_NOT_MET, [start of procedure NoResourceLeakWarningAfterCheckState(...),Taking false branch] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.activityObtainTypedArrayAndLeak(Activity), 2, RESOURCE_LEAK, [start of procedure activityObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(TypedArray)] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closeNullQuietlyWithCloseables(), 5, UNINITIALIZED_VALUE, [start of procedure closeNullQuietlyWithCloseables(),exception java.io.FileNotFoundException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closeNullWithCloseables(), 5, UNINITIALIZED_VALUE, [start of procedure closeNullWithCloseables(),exception java.io.FileNotFoundException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closeWithCloseablesNestedAlloc(), 5, UNINITIALIZED_VALUE, [start of procedure closeWithCloseablesNestedAlloc(),exception java.io.FileNotFoundException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closedQuietlyWithCloseables(), 5, UNINITIALIZED_VALUE, [start of procedure closedQuietlyWithCloseables(),exception java.io.IOException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.closedWithCloseables(), 5, UNINITIALIZED_VALUE, [start of procedure closedWithCloseables(),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.contextObtainTypedArrayAndLeak(Context), 2, RESOURCE_LEAK, [start of procedure contextObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(TypedArray)] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.copyFileLeak(File,File), 11, RESOURCE_LEAK, [start of procedure copyFileLeak(...),Skipping transferTo(...): unknown method,Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.copyFileLeak(File,File), 11, RESOURCE_LEAK, [start of procedure copyFileLeak(...),exception java.io.FileNotFoundException] @@ -199,7 +190,6 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.objectInputStrea codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.objectOutputStreamClosedNestedBad(), 3, RESOURCE_LEAK, [start of procedure objectOutputStreamClosedNestedBad()] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.objectOutputStreamNotClosedAfterWrite(), 4, RESOURCE_LEAK, [start of procedure objectOutputStreamNotClosedAfterWrite()] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.objectOutputStreamNotClosedAfterWrite(), 7, RESOURCE_LEAK, [start of procedure objectOutputStreamNotClosedAfterWrite(),exception java.io.IOException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpURLConnectionDisconnected(), 12, UNINITIALIZED_VALUE, [start of procedure openHttpURLConnectionDisconnected(),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpURLConnectionNotDisconnected(), 7, RESOURCE_LEAK, [start of procedure openHttpURLConnectionNotDisconnected()] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.openHttpsURLConnectionNotDisconnected(), 3, RESOURCE_LEAK, [start of procedure openHttpsURLConnectionNotDisconnected()] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.parseFromInputStreamAndLeak(JsonFactory), 5, RESOURCE_LEAK, [start of procedure parseFromInputStreamAndLeak(...)] @@ -208,18 +198,11 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedInputStream codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.pipedOutputStreamNotClosedAfterWrite(), 7, RESOURCE_LEAK, [start of procedure pipedOutputStreamNotClosedAfterWrite(),exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.scannerNotClosed(), 1, RESOURCE_LEAK, [start of procedure scannerNotClosed()] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.serverSocketNotClosed(), 12, RESOURCE_LEAK, [start of procedure serverSocketNotClosed(),Skipping ServerSocket(...): unknown method,exception java.io.IOException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.serverSocketWithSocketClosed(), 14, UNINITIALIZED_VALUE, [start of procedure serverSocketWithSocketClosed(),Skipping ServerSocket(...): unknown method,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.socketNotClosed(), 1, RESOURCE_LEAK, [start of procedure socketNotClosed()] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(TypedArray)] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 8, UNINITIALIZED_VALUE, [start of procedure twoResources(),exception java.io.FileNotFoundException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesCommonFix(), 8, UNINITIALIZED_VALUE, [start of procedure twoResourcesCommonFix(),exception java.io.FileNotFoundException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesHeliosFix(), 9, UNINITIALIZED_VALUE, [start of procedure twoResourcesHeliosFix(),exception java.io.FileNotFoundException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesHeliosFix(), 12, UNINITIALIZED_VALUE, [start of procedure twoResourcesHeliosFix(),exception java.io.FileNotFoundException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 8, UNINITIALIZED_VALUE, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case,exception java.io.FileNotFoundException] -codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileNoLeak(), 5, UNINITIALIZED_VALUE, [start of procedure zipFileNoLeak(),exception java.io.IOException] codetoanalyze/java/infer/SuppressLintExample.java, void SuppressAllWarnigsInTheClass.shouldNotReportNPE(), 2, NULL_DEREFERENCE, [start of procedure shouldNotReportNPE()] codetoanalyze/java/infer/SuppressLintExample.java, void SuppressAllWarnigsInTheClass.shouldNotReportResourceLeak(), 2, RESOURCE_LEAK, [start of procedure shouldNotReportResourceLeak()] codetoanalyze/java/infer/SuppressLintExample.java, void SuppressLintExample.shouldReportNPE(), 2, NULL_DEREFERENCE, [start of procedure shouldReportNPE()] diff --git a/infer/tests/codetoanalyze/java/tracing/issues.exp b/infer/tests/codetoanalyze/java/tracing/issues.exp index 68c89dea7..d8131a889 100644 --- a/infer/tests/codetoanalyze/java/tracing/issues.exp +++ b/infer/tests/codetoanalyze/java/tracing/issues.exp @@ -28,9 +28,7 @@ codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions. codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionArrayLength(), 3, java.lang.NullPointerException, [start of procedure nullPointerExceptionArrayLength(),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionArrayLength()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod(), 3, java.lang.NullPointerException, [start of procedure nullPointerExceptionCallArrayReadMethod(),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod(), 3, java.lang.NullPointerException, [start of procedure nullPointerExceptionCallArrayReadMethod(),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionCallArrayReadMethod()] -codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFailingFileOutputStreamConstructor(), 7, UNINITIALIZED_VALUE, [start of procedure nullPointerExceptionFromFailingFileOutputStreamConstructor(),exception java.io.FileNotFoundException,Switch condition is false. Skipping switch case] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFailingFileOutputStreamConstructor(), 9, java.lang.NullPointerException, [start of procedure nullPointerExceptionFromFailingFileOutputStreamConstructor(),Taking true branch,return from a call to void NullPointerExceptions.nullPointerExceptionFromFailingFileOutputStreamConstructor()] -codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFaillingResourceConstructor(), 6, UNINITIALIZED_VALUE, [start of procedure nullPointerExceptionFromFaillingResourceConstructor(),exception java.io.FileNotFoundException,Switch condition is false. Skipping switch case] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionFromFaillingResourceConstructor(), 8, java.lang.NullPointerException, [start of procedure nullPointerExceptionFromFaillingResourceConstructor(),Taking true branch,return from a call to void NullPointerExceptions.nullPointerExceptionFromFaillingResourceConstructor()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionUnlessFrameFails(), 6, java.lang.NullPointerException, [start of procedure nullPointerExceptionUnlessFrameFails(),start of procedure NullPointerExceptions$A(...),return from a call to NullPointerExceptions$A.(NullPointerExceptions),start of procedure frame(...),start of procedure id_generics(...),Taking true branch,return from a call to Object NullPointerExceptions.id_generics(NullPointerExceptions$A),Taking true branch,return from a call to NullPointerExceptions$A NullPointerExceptions.frame(NullPointerExceptions$A),Taking true branch,exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionUnlessFrameFails()] codetoanalyze/java/infer/NullPointerExceptions.java, void NullPointerExceptions.nullPointerExceptionWithNullArrayParameter(), 2, java.lang.NullPointerException, [start of procedure nullPointerExceptionWithNullArrayParameter(),start of procedure expectNotNullArrayParameter(...),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.expectNotNullArrayParameter(codetoanalyze.java.infer.NullPointerExceptions$A[]),exception java.lang.NullPointerException,return from a call to void NullPointerExceptions.nullPointerExceptionWithNullArrayParameter()] diff --git a/infer/tests/codetoanalyze/objc/errors/issues.exp b/infer/tests/codetoanalyze/objc/errors/issues.exp index 56ce8d198..7fe2cb7ea 100644 --- a/infer/tests/codetoanalyze/objc/errors/issues.exp +++ b/infer/tests/codetoanalyze/objc/errors/issues.exp @@ -59,7 +59,6 @@ codetoanalyze/objc/errors/npe/nil_in_array_literal.m, Arr_nilInArrayLiteral1, 4, codetoanalyze/objc/errors/npe/nil_in_array_literal.m, Arr_nilInArrayLiteral2, 4, NULL_DEREFERENCE, [start of procedure nilInArrayLiteral2] codetoanalyze/objc/errors/npe/nil_in_array_literal.m, Arr_nilInArrayLiteral3, 4, NULL_DEREFERENCE, [start of procedure nilInArrayLiteral3] codetoanalyze/objc/errors/npe/nil_in_array_literal.m, Arr_nilInArrayWithObject, 4, NULL_DEREFERENCE, [start of procedure nilInArrayWithObject] -codetoanalyze/objc/errors/npe/nil_in_array_literal.m, Arr_noProblem, 3, UNINITIALIZED_VALUE, [start of procedure noProblem] codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionaryLiteralKey0, 4, NULL_DEREFERENCE, [start of procedure nilInDictionaryLiteralKey0] codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionaryLiteralKey1, 4, NULL_DEREFERENCE, [start of procedure nilInDictionaryLiteralKey1] codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionaryLiteralKey2, 4, NULL_DEREFERENCE, [start of procedure nilInDictionaryLiteralKey2] @@ -68,7 +67,6 @@ codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionary codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionaryLiteralValue1, 4, NULL_DEREFERENCE, [start of procedure nilInDictionaryLiteralValue1] codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionaryLiteralValue2, 4, NULL_DEREFERENCE, [start of procedure nilInDictionaryLiteralValue2] codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_nilInDictionaryLiteralValue3, 4, NULL_DEREFERENCE, [start of procedure nilInDictionaryLiteralValue3] -codetoanalyze/objc/errors/npe/nil_in_dictionary_literal.m, ADict_noProblem, 3, UNINITIALIZED_VALUE, [start of procedure noProblem] codetoanalyze/objc/errors/npe/npe_conditional.m, conditionalNPE, 3, NULL_DEREFERENCE, [start of procedure conditionalNPE(),start of procedure name,return from a call to ConditionalA_name,Condition is true] codetoanalyze/objc/errors/npe/npe_self.m, CSelf_init, 2, NULL_DEREFERENCE, [start of procedure init] codetoanalyze/objc/errors/npe/npe_self.m, CSelf_test, 3, NULL_DEREFERENCE, [start of procedure test,Condition is false] @@ -83,16 +81,13 @@ codetoanalyze/objc/errors/subtyping/KindOfClassExample.m, shouldThrowDivideByZer codetoanalyze/objc/errors/variadic_methods/premature_nil_termination.m, PrematureNilTermA_nilInArrayWithObjects, 5, PREMATURE_NIL_TERMINATION_ARGUMENT, [start of procedure nilInArrayWithObjects] codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m, TollBridgeExample_brideRetained, 2, MEMORY_LEAK, [start of procedure brideRetained] codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m, TollBridgeExample_bridge, 2, MEMORY_LEAK, [start of procedure bridge] -codetoanalyze/objc/shared/memory_leaks_benchmark/TollBridgeExample.m, bridgeDictionaryNoLeak, 1, UNINITIALIZED_VALUE, [start of procedure bridgeDictionaryNoLeak()] codetoanalyze/objc/errors/memory_leaks_benchmark/NSData_models_tests.m, NSData_models_tests_macForIV:, 2, MEMORY_LEAK, [start of procedure macForIV:] -codetoanalyze/objc/errors/memory_leaks_benchmark/NSString_models_tests.m, createURLQueryStringBodyEscaping, 11, UNINITIALIZED_VALUE, [start of procedure createURLQueryStringBodyEscaping(),Condition is false] codetoanalyze/objc/errors/npe/Fraction.m, test_virtual_call, 7, NULL_DEREFERENCE, [start of procedure test_virtual_call(),start of procedure setNumerator:,return from a call to Fraction_setNumerator:,start of procedure getNumerator,return from a call to Fraction_getNumerator,Condition is true] codetoanalyze/objc/errors/npe/NPD_core_foundation.m, NullDeref_createCloseCrossGlyphNoLeak:, 5, Assert_failure, [start of procedure createCloseCrossGlyphNoLeak:,Skipping CGRectGetHeight(): function or method not found] codetoanalyze/objc/errors/npe/NPD_core_foundation.m, NullDeref_layoutSubviews, 4, Assert_failure, [start of procedure layoutSubviews] codetoanalyze/objc/errors/npe/NPD_core_foundation.m, NullDeref_measureFrameSizeForTextNoLeak, 4, Assert_failure, [start of procedure measureFrameSizeForTextNoLeak,Condition is true] codetoanalyze/objc/errors/npe/NPD_core_foundation.m, NullDeref_test2, 2, Assert_failure, [start of procedure test2] codetoanalyze/objc/errors/npe/Npe_with_equal_names.m, EqualNamesTest, 3, NULL_DEREFERENCE, [start of procedure EqualNamesTest(),start of procedure meth,return from a call to EqualNamesA_meth] -codetoanalyze/objc/errors/npe/Npe_with_equal_names.m, EqualNamesTest2, 2, UNINITIALIZED_VALUE, [start of procedure EqualNamesTest2(),start of procedure meth,return from a call to EqualNamesA_meth] codetoanalyze/objc/errors/npe/block.m, BlockA_doSomethingThenCallback:, 2, PARAMETER_NOT_NULL_CHECKED, [start of procedure doSomethingThenCallback:] codetoanalyze/objc/errors/npe/block.m, BlockA_foo, 5, NULL_DEREFERENCE, [start of procedure foo] codetoanalyze/objc/errors/npe/block.m, BlockA_foo3:, 3, NULL_DEREFERENCE, [start of procedure foo3:] @@ -108,8 +103,6 @@ codetoanalyze/objc/shared/annotations/nonnull_annotations.m, A_test3:, 1, PARAME codetoanalyze/objc/shared/annotations/nullable_annotations.m, User_otherUserName, 2, NULL_DEREFERENCE, [start of procedure otherUserName,Skipping otherUser: function or method not found] codetoanalyze/objc/shared/annotations/nullable_annotations.m, npe_property_nullable, 3, NULL_DEREFERENCE, [start of procedure npe_property_nullable(),Skipping child: function or method not found] codetoanalyze/objc/shared/annotations/nullable_annotations_fields.m, A_nullable_field, 3, NULL_DEREFERENCE, [start of procedure nullable_field,Skipping getA(): function or method not found] -codetoanalyze/objc/shared/block/block-it.m, objc_blockMyBlock_array_1, 5, UNINITIALIZED_VALUE, [start of procedure block,Condition is false] -codetoanalyze/objc/shared/block/block-it.m, objc_blockMyBlock_array_trans_2, 4, UNINITIALIZED_VALUE, [start of procedure block,Condition is false] codetoanalyze/objc/shared/block/dispatch.m, DispatchA_dispatch_a_block_variable_from_macro_delivers_initialised_object, 3, DIVIDE_BY_ZERO, [start of procedure dispatch_a_block_variable_from_macro_delivers_initialised_object,start of procedure dispatch_a_block_variable_from_macro,start of procedure block,start of procedure init,return from a call to DispatchA_init,return from a call to objc_blockDispatchA_dispatch_a_block_variable_from_macro_4,return from a call to DispatchA_dispatch_a_block_variable_from_macro] codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_blockCapturedVarLeak, 3, MEMORY_LEAK, [start of procedure blockCapturedVarLeak] codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_blockFreeNoLeakTODO, 3, MEMORY_LEAK, [start of procedure blockFreeNoLeakTODO] @@ -124,4 +117,3 @@ codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeak codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_test2:, 1, MEMORY_LEAK, [start of procedure test2:] codetoanalyze/objc/shared/memory_leaks_benchmark/MemoryLeakExample.m, MemoryLeakExample_test2NoLeak, 2, Assert_failure, [start of procedure test2NoLeak] codetoanalyze/objc/shared/npe/Available_expr.m, Available_expr_test_no_bug, 3, NULL_DEREFERENCE, [start of procedure test_no_bug,Condition is true] -codetoanalyze/objc/shared/npe/Nonnull_attribute_example.m, NonnullC_initWithCoder:and:, 2, UNINITIALIZED_VALUE, [start of procedure initWithCoder:and:,start of procedure getA,return from a call to NonnullA_getA]