Summary:
This is several inter-connected changes together to keep the tests
happy.
The ConditionalOperator `b?t:e` is translated by first creating a
placeholder variable to temporarily store the result of the evaluation
in each branch, then the real thing we want to assign to reads that
variable. But, there are situations where that changes the semantics of
the expression, namely when the value created is a struct on the stack
(eg, a C++ temporary). This is because in SIL we cannot assign the
*address* of a program variable, only its contents, so by the time we're
out of the conditional operator we cannot set the struct value
correctly anymore: we can only set its content, which we did, but that
results in a "shifted" struct value that is one dereference away from
where it should be.
So a batch of changes concern `conditionalOperator_trans`:
- instead of systematically creating a temporary for the conditional,
use the `trans_state.var_exp_typ` provided from above if available
when translating `ConditionalOperator`
- don't even set anything if that variable was already initialized by
merely translating the branch expression, eg when it's a constructor
- fix long-standing TODO to propagate these initialization facts
accurately for ConditionalOperator (used by `init_expr_trans` to also
figure out if it should insert a store to the variable being
initialised or not)
The rest of the changes adapt some relevant other constructs to deal
with conditionalOperator properly now that it can set the current
variable itself, instead of storing stuff inside a temp variable. This
change was a problem because some constructs, eg a variable declaration,
will insert nodes that set up the variable before calling its
initialization, and now the initialization happens *before* that setup,
in the translation of the inner conditional operator, which naturally
creates nodes above the current one.
- add a generic helper to force a sequential order between two
translation results, forcing node creation if necessary
- use that in `init_expr_trans` and `cxxNewExpr_trans`
- adjust many places where `var_exp_typ` was incorrectly not reset when translating sub-expressions
The sequentiality business creates more nodes when used, and the
conditionalOperator business uses fewer temporary variables, so the
frontend results change quite a bit.
Note that biabduction tests were invaluable in debugging this. There
could be other constructs to adjust similarly to cxxNewExpr that were
not covered by the tests though.
Added tests in pulse that exercises the previous bug.
Reviewed By: da319
Differential Revision: D24796282
fbshipit-source-id: 0790c8d17
master
Jules Villard4 years agocommitted byFacebook GitHub Bot
codetoanalyze/cpp/biabduction/npe/npe_added_to_b1.cpp, npe_added_to_b1::causes_npe_person_bad, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure npe_added_to_b1::causes_npe_person_bad(),start of procedure Person,return from a call to npe_added_to_b1::Person::Person,start of procedure npe_added_to_b1::deref_person()]
codetoanalyze/cpp/biabduction/npe/npe_added_to_b1.cpp, npe_added_to_b1::causes_npe_person_bad, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure npe_added_to_b1::causes_npe_person_bad(),start of procedure Person,return from a call to npe_added_to_b1::Person::Person,start of procedure npe_added_to_b1::deref_person()]
codetoanalyze/cpp/biabduction/npe/null_returned_by_method.cpp, testNullDeref, 3, NULL_DEREFERENCE, B2, ERROR, [start of procedure testNullDeref(),Taking true branch,start of procedure getNull,return from a call to XFactory::getNull]
codetoanalyze/cpp/biabduction/npe/null_returned_by_method.cpp, testNullDeref, 3, NULL_DEREFERENCE, B2, ERROR, [start of procedure testNullDeref(),Taking true branch,start of procedure getNull,return from a call to XFactory::getNull]
codetoanalyze/cpp/biabduction/npe/object_deref.cpp, object_deref::derefNullField, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure object_deref::derefNullField(),start of procedure object_deref::getNull(),return from a call to object_deref::getNull]
codetoanalyze/cpp/biabduction/npe/object_deref.cpp, object_deref::derefNullField, 2, NULL_DEREFERENCE, B1, ERROR, [start of procedure object_deref::derefNullField(),start of procedure object_deref::getNull(),return from a call to object_deref::getNull]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_FP_skip_then_split_case_bad, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_FP_skip_then_split_case_bad(),Skipping ~shared_ptr: method has no implementation,Skipping skip_no_const(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_FP_skip_then_split_case_bad, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_FP_skip_then_split_case_bad(),Skipping std::make_shared<lol>(): method has no implementation,Skipping ~shared_ptr: method has no implementation,Skipping skip_no_const(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_const_skip2_then_split_case_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_const_skip2_then_split_case_ok(),Skipping ~shared_ptr: method has no implementation,Skipping skip_const2(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_const_skip2_then_split_case_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_const_skip2_then_split_case_ok(),Skipping std::make_shared<lol>(): method has no implementation,Skipping ~shared_ptr: method has no implementation,Skipping skip_const2(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_const_skip_then_split_case_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_const_skip_then_split_case_ok(),Skipping ~shared_ptr: method has no implementation,Skipping skip_const(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_const_skip_then_split_case_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_const_skip_then_split_case_ok(),Skipping std::make_shared<lol>(): method has no implementation,Skipping ~shared_ptr: method has no implementation,Skipping skip_const(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_typedef_skip_then_split_case_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_typedef_skip_then_split_case_ok(),Skipping ~shared_ptr: method has no implementation,Skipping skip_typedef(): method has no implementation]
codetoanalyze/cpp/biabduction/npe/skip_function_with_const_formals.cpp, ERROR_typedef_skip_then_split_case_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_typedef_skip_then_split_case_ok(),Skipping std::make_shared<lol>(): method has no implementation,Skipping ~shared_ptr: method has no implementation,Skipping skip_typedef(): method has no implementation]
codetoanalyze/cpp/biabduction/numeric/min_max.cpp, max_X_inv_div0, 2, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure max_X_inv_div0(),start of procedure X_inv,return from a call to X_inv::X_inv,start of procedure X_inv,return from a call to X_inv::X_inv]
codetoanalyze/cpp/biabduction/numeric/min_max.cpp, max_X_inv_div0, 2, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure max_X_inv_div0(),start of procedure X_inv,return from a call to X_inv::X_inv,start of procedure X_inv,return from a call to X_inv::X_inv]
codetoanalyze/cpp/biabduction/numeric/min_max.cpp, max_int_div0, 0, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure max_int_div0()]
codetoanalyze/cpp/biabduction/numeric/min_max.cpp, max_int_div0, 0, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure max_int_div0()]
codetoanalyze/cpp/biabduction/numeric/min_max.cpp, min_X_div0, 2, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure min_X_div0(),start of procedure X,return from a call to X::X,start of procedure X,return from a call to X::X]
codetoanalyze/cpp/biabduction/numeric/min_max.cpp, min_X_div0, 2, DIVIDE_BY_ZERO, no_bucket, ERROR, [start of procedure min_X_div0(),start of procedure X,return from a call to X::X,start of procedure X,return from a call to X::X]
codetoanalyze/cpp/biabduction/smart_ptr/deref_after_move_example.cpp, deref_after_mode_example::Person::Person, 3, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure Person,Skipping unique_ptr<true,_void>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/deref_after_move_example.cpp, deref_after_mode_example::Person::Person, 3, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure Person,Skipping unique_ptr<true,_void>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::ERROR_shared_ptr_check_notnull_ok, 2, Cannot_star, no_bucket, ERROR, [start of procedure shared_ptr::ERROR_shared_ptr_check_notnull_ok(),Skipping shared_ptr: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::ERROR_shared_ptr_check_notnull_ok, 2, Cannot_star, no_bucket, ERROR, [start of procedure shared_ptr::ERROR_shared_ptr_check_notnull_ok(),Skipping shared_ptr: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::ERROR_shared_ptr_check_null_ok, 2, Cannot_star, no_bucket, ERROR, [start of procedure shared_ptr::ERROR_shared_ptr_check_null_ok(),Skipping shared_ptr: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::ERROR_shared_ptr_check_null_ok, 2, Cannot_star, no_bucket, ERROR, [start of procedure shared_ptr::ERROR_shared_ptr_check_null_ok(),Skipping shared_ptr: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_reset_ptr_null_deref2_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_reset_ptr_null_deref2_bad(),Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_reset_ptr_null_deref2_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_reset_ptr_null_deref2_bad(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_reset_ptr_null_deref2_bad, 2, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_reset_ptr_null_deref2_bad(),Skipping shared_ptr<int>: method has no implementation,Skipping reset<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_reset_ptr_null_deref2_bad, 2, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_reset_ptr_null_deref2_bad(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation,Skipping reset<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_reset_ptr_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_reset_ptr_null_deref_bad(),Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_reset_ptr_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_reset_ptr_null_deref_bad(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_shared_ptr_assign_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_shared_ptr_assign_null_deref_bad(),Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_shared_ptr_assign_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_shared_ptr_assign_null_deref_bad(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_shared_ptr_move_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_shared_ptr_move_null_deref_bad(),Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FN_shared_ptr_move_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FN_shared_ptr_move_null_deref_bad(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_reset_ptr_deref2_ok, 3, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_reset_ptr_deref2_ok(),Skipping shared_ptr: method has no implementation,Skipping reset: method has no implementation,Skipping reset<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_reset_ptr_deref2_ok, 3, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_reset_ptr_deref2_ok(),Skipping shared_ptr: method has no implementation,Skipping reset: method has no implementation,Skipping reset<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_reset_ptr_deref_ok, 2, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_reset_ptr_deref_ok(),Skipping shared_ptr: method has no implementation,Skipping reset<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_reset_ptr_deref_ok, 2, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_reset_ptr_deref_ok(),Skipping shared_ptr: method has no implementation,Skipping reset<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_shared_ptr_assign_deref_ok, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_shared_ptr_assign_deref_ok(),Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_shared_ptr_assign_deref_ok, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_shared_ptr_assign_deref_ok(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_shared_ptr_copy_deref_ok, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_shared_ptr_copy_deref_ok(),Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/shared_ptr_deref.cpp, shared_ptr::FP_shared_ptr_copy_deref_ok, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure shared_ptr::FP_shared_ptr_copy_deref_ok(),Skipping __nat: method has no implementation,Skipping shared_ptr<int>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/unique_ptr_deref.cpp, unique_ptr::FN_FP_reset_ptr_null_deref2_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure unique_ptr::FN_FP_reset_ptr_null_deref2_bad(),Skipping unique_ptr<true,_void>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/unique_ptr_deref.cpp, unique_ptr::FN_FP_reset_ptr_null_deref2_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure unique_ptr::FN_FP_reset_ptr_null_deref2_bad(),Skipping unique_ptr<true,_void>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/unique_ptr_deref.cpp, unique_ptr::FN_FP_reset_ptr_null_deref2_bad, 2, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure unique_ptr::FN_FP_reset_ptr_null_deref2_bad(),Skipping unique_ptr<true,_void>: method has no implementation,Skipping reset: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/unique_ptr_deref.cpp, unique_ptr::FN_FP_reset_ptr_null_deref2_bad, 2, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure unique_ptr::FN_FP_reset_ptr_null_deref2_bad(),Skipping unique_ptr<true,_void>: method has no implementation,Skipping reset: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/unique_ptr_deref.cpp, unique_ptr::FN_FP_reset_ptr_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure unique_ptr::FN_FP_reset_ptr_null_deref_bad(),Skipping unique_ptr<true,_void>: method has no implementation]
codetoanalyze/cpp/biabduction/smart_ptr/unique_ptr_deref.cpp, unique_ptr::FN_FP_reset_ptr_null_deref_bad, 1, BIABDUCTION_MEMORY_LEAK, CPP, ERROR, [start of procedure unique_ptr::FN_FP_reset_ptr_null_deref_bad(),Skipping unique_ptr<true,_void>: method has no implementation]
codetoanalyze/cpp/biabduction/vector/empty_access.cpp, ERROR_vector_as_param_empty_bad, 2, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_vector_as_param_empty_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/empty_access.cpp, ERROR_vector_as_param_empty_bad, 2, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_vector_as_param_empty_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/empty_access.cpp, ERROR_vector_as_param_nonempty_ok, 2, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_vector_as_param_nonempty_ok(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/empty_access.cpp, ERROR_vector_as_param_nonempty_ok, 2, Cannot_star, no_bucket, ERROR, [start of procedure ERROR_vector_as_param_nonempty_ok(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/empty_access.cpp, FN_vector_as_param_clear_bad, 2, Cannot_star, no_bucket, ERROR, [start of procedure FN_vector_as_param_clear_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/empty_access.cpp, FN_vector_as_param_clear_bad, 2, Cannot_star, no_bucket, ERROR, [start of procedure FN_vector_as_param_clear_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/iterator_access.cpp, iterator_access::possible_npe, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure iterator_access::possible_npe(),Skipping ~__wrap_iter: method has no implementation,Loop condition is true. Entering loop body,Taking true branch,Taking true branch]
codetoanalyze/cpp/biabduction/vector/iterator_access.cpp, iterator_access::possible_npe, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure iterator_access::possible_npe(),Skipping begin: method has no implementation,Skipping ~__wrap_iter: method has no implementation,Skipping end: method has no implementation,Loop condition is true. Entering loop body,Taking true branch,Taking true branch]
codetoanalyze/cpp/biabduction/vector/iterator_cmp.cpp, iterator_compare::ERROR_empty_deref1_bad, 3, Cannot_star, no_bucket, ERROR, [start of procedure iterator_compare::ERROR_empty_deref1_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/iterator_cmp.cpp, iterator_compare::ERROR_empty_deref1_bad, 3, Cannot_star, no_bucket, ERROR, [start of procedure iterator_compare::ERROR_empty_deref1_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/iterator_cmp.cpp, iterator_compare::ERROR_empty_deref2_bad, 3, Cannot_star, no_bucket, ERROR, [start of procedure iterator_compare::ERROR_empty_deref2_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/iterator_cmp.cpp, iterator_compare::ERROR_empty_deref2_bad, 3, Cannot_star, no_bucket, ERROR, [start of procedure iterator_compare::ERROR_empty_deref2_bad(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/iterator_cmp.cpp, iterator_compare::ERROR_empty_no_deref1_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure iterator_compare::ERROR_empty_no_deref1_ok(),Skipping vector: method has no implementation]
codetoanalyze/cpp/biabduction/vector/iterator_cmp.cpp, iterator_compare::ERROR_empty_no_deref1_ok, 3, Cannot_star, no_bucket, ERROR, [start of procedure iterator_compare::ERROR_empty_no_deref1_ok(),Skipping vector: method has no implementation]
codetoanalyze/cpp/pulse/aliasing.cpp, alias_null_deref_latent, 6, NULLPTR_DEREFERENCE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,assigned,invalid access occurs here]
codetoanalyze/cpp/pulse/aliasing.cpp, alias_null_deref_latent, 6, NULLPTR_DEREFERENCE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,assigned,invalid access occurs here]
codetoanalyze/cpp/pulse/aliasing.cpp, call_ifnotthenderef_false_null_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,when calling `ifnotthenderef` here,parameter `x` of ifnotthenderef,invalid access occurs here]
codetoanalyze/cpp/pulse/aliasing.cpp, call_ifnotthenderef_false_null_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,when calling `ifnotthenderef` here,parameter `x` of ifnotthenderef,invalid access occurs here]
codetoanalyze/cpp/pulse/aliasing.cpp, call_ifthenderef_true_null_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,when calling `ifthenderef` here,parameter `x` of ifthenderef,invalid access occurs here]
codetoanalyze/cpp/pulse/aliasing.cpp, call_ifthenderef_true_null_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,when calling `ifthenderef` here,parameter `x` of ifthenderef,invalid access occurs here]
codetoanalyze/cpp/pulse/basic_string.cpp, use_range_of_invalidated_temporary_string_bad, 2, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,when calling `setLanguage` here,variable `C++ temporary` declared here,passed as argument to `Range::Range`,parameter `str` of Range::Range,return from call to `Range::Range`,passed as argument to `std::basic_string::~basic_string()` (modelled),return from call to `std::basic_string::~basic_string()` (modelled),was invalidated by `delete`,use-after-lifetime part of the trace starts here,passed as argument to `setLanguage`,variable `C++ temporary` declared here,passed as argument to `Range::Range`,parameter `str` of Range::Range,passed as argument to `std::basic_string::data()` (modelled),return from call to `std::basic_string::data()` (modelled),assigned,return from call to `Range::Range`,return from call to `setLanguage`,when calling `Range::operator[]` here,parameter `this` of Range::operator[],invalid access occurs here]
codetoanalyze/cpp/pulse/basic_string.cpp, use_range_of_invalidated_temporary_string_bad, 2, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,when calling `setLanguage` here,variable `C++ temporary` accessed here,passed as argument to `Range::Range`,parameter `str` of Range::Range,return from call to `Range::Range`,passed as argument to `std::basic_string::~basic_string()` (modelled),return from call to `std::basic_string::~basic_string()` (modelled),was invalidated by `delete`,use-after-lifetime part of the trace starts here,passed as argument to `setLanguage`,variable `C++ temporary` accessed here,passed as argument to `Range::Range`,parameter `str` of Range::Range,passed as argument to `std::basic_string::data()` (modelled),return from call to `std::basic_string::data()` (modelled),assigned,return from call to `Range::Range`,return from call to `setLanguage`,when calling `Range::operator[]` here,parameter `this` of Range::operator[],invalid access occurs here]
codetoanalyze/cpp/pulse/basics.cpp, multiple_invalidations_branch_latent, 6, USE_AFTER_DELETE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,invalid access occurs here]
codetoanalyze/cpp/pulse/basics.cpp, multiple_invalidations_branch_latent, 6, USE_AFTER_DELETE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,invalid access occurs here]
codetoanalyze/cpp/pulse/basics.cpp, multiple_invalidations_branch_latent, 6, USE_AFTER_DELETE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,invalid access occurs here]
codetoanalyze/cpp/pulse/basics.cpp, multiple_invalidations_branch_latent, 6, USE_AFTER_DELETE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `ptr` of multiple_invalidations_branch_latent,invalid access occurs here]
codetoanalyze/cpp/pulse/basics.cpp, multiple_invalidations_loop_latent, 5, USE_AFTER_DELETE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,parameter `ptr` of multiple_invalidations_loop_latent,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `ptr` of multiple_invalidations_loop_latent,invalid access occurs here]
codetoanalyze/cpp/pulse/basics.cpp, multiple_invalidations_loop_latent, 5, USE_AFTER_DELETE, no_bucket, ERROR, [*** LATENT ***,invalidation part of the trace starts here,parameter `ptr` of multiple_invalidations_loop_latent,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `ptr` of multiple_invalidations_loop_latent,invalid access occurs here]
codetoanalyze/cpp/pulse/deduplication.cpp, deduplication::templated_function_bad<int>, 3, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,passed as argument to `new` (modelled),return from call to `new` (modelled),assigned,when calling `deduplication::templated_delete_function<int>` here,parameter `a` of deduplication::templated_delete_function<int>,was invalidated by `delete`,use-after-lifetime part of the trace starts here,passed as argument to `new` (modelled),return from call to `new` (modelled),assigned,when calling `deduplication::templated_access_function<int>` here,parameter `a` of deduplication::templated_access_function<int>,invalid access occurs here]
codetoanalyze/cpp/pulse/deduplication.cpp, deduplication::templated_function_bad<int>, 3, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,passed as argument to `new` (modelled),return from call to `new` (modelled),assigned,when calling `deduplication::templated_delete_function<int>` here,parameter `a` of deduplication::templated_delete_function<int>,was invalidated by `delete`,use-after-lifetime part of the trace starts here,passed as argument to `new` (modelled),return from call to `new` (modelled),assigned,when calling `deduplication::templated_access_function<int>` here,parameter `a` of deduplication::templated_access_function<int>,invalid access occurs here]
codetoanalyze/cpp/pulse/exit_test.cpp, store_exit_null_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,when calling `store_exit` here,parameter `x` of store_exit,invalid access occurs here]
codetoanalyze/cpp/pulse/exit_test.cpp, store_exit_null_bad, 0, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,when calling `store_exit` here,parameter `x` of store_exit,invalid access occurs here]
codetoanalyze/cpp/pulse/folly_DestructorGuard.cpp, UsingDelayedDestruction::double_delete_bad, 2, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `this` of UsingDelayedDestruction::double_delete_bad,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `this` of UsingDelayedDestruction::double_delete_bad,invalid access occurs here]
codetoanalyze/cpp/pulse/folly_DestructorGuard.cpp, UsingDelayedDestruction::double_delete_bad, 2, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `this` of UsingDelayedDestruction::double_delete_bad,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `this` of UsingDelayedDestruction::double_delete_bad,invalid access occurs here]
codetoanalyze/cpp/pulse/frontend.cpp, deref_null_namespace_alias_ptr_bad, 4, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,when calling `some::thing::bad_ptr` here,passed as argument to `new` (modelled),return from call to `new` (modelled),assigned,was invalidated by `delete`,use-after-lifetime part of the trace starts here,passed as argument to `some::thing::bad_ptr`,return from call to `some::thing::bad_ptr`,assigned,invalid access occurs here]
codetoanalyze/cpp/pulse/frontend.cpp, frontend::conditional_expression_bad, 5, NULLPTR_DEREFERENCE, no_bucket, ERROR, [invalidation part of the trace starts here,assigned,is the null pointer,use-after-lifetime part of the trace starts here,assigned,invalid access occurs here]
codetoanalyze/cpp/pulse/frontend.cpp, frontend::deref_null_namespace_alias_ptr_bad, 4, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,when calling `frontend::some::thing::bad_ptr` here,passed as argument to `new` (modelled),return from call to `new` (modelled),assigned,was invalidated by `delete`,use-after-lifetime part of the trace starts here,passed as argument to `frontend::some::thing::bad_ptr`,return from call to `frontend::some::thing::bad_ptr`,assigned,invalid access occurs here]
codetoanalyze/cpp/pulse/interprocedural.cpp, access_to_invalidated_alias2_bad, 3, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of access_to_invalidated_alias2_bad,assigned,when calling `invalidate_and_set_to_null` here,parameter `x_ptr` of invalidate_and_set_to_null,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `x` of access_to_invalidated_alias2_bad,when calling `wraps_read` here,parameter `x` of wraps_read,when calling `wraps_read_inner` here,parameter `x` of wraps_read_inner,invalid access occurs here]
codetoanalyze/cpp/pulse/interprocedural.cpp, access_to_invalidated_alias2_bad, 3, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of access_to_invalidated_alias2_bad,assigned,when calling `invalidate_and_set_to_null` here,parameter `x_ptr` of invalidate_and_set_to_null,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `x` of access_to_invalidated_alias2_bad,when calling `wraps_read` here,parameter `x` of wraps_read,when calling `wraps_read_inner` here,parameter `x` of wraps_read_inner,invalid access occurs here]
codetoanalyze/cpp/pulse/interprocedural.cpp, access_to_invalidated_alias_bad, 3, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of access_to_invalidated_alias_bad,when calling `invalidate_and_set_to_null` here,parameter `x_ptr` of invalidate_and_set_to_null,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `x` of access_to_invalidated_alias_bad,assigned,when calling `wraps_read` here,parameter `x` of wraps_read,when calling `wraps_read_inner` here,parameter `x` of wraps_read_inner,invalid access occurs here]
codetoanalyze/cpp/pulse/interprocedural.cpp, access_to_invalidated_alias_bad, 3, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of access_to_invalidated_alias_bad,when calling `invalidate_and_set_to_null` here,parameter `x_ptr` of invalidate_and_set_to_null,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `x` of access_to_invalidated_alias_bad,assigned,when calling `wraps_read` here,parameter `x` of wraps_read,when calling `wraps_read_inner` here,parameter `x` of wraps_read_inner,invalid access occurs here]
codetoanalyze/cpp/pulse/interprocedural.cpp, delete_aliased_then_read_bad, 4, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of delete_aliased_then_read_bad,assigned,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `x` of delete_aliased_then_read_bad,assigned,when calling `wraps_read` here,parameter `x` of wraps_read,when calling `wraps_read_inner` here,parameter `x` of wraps_read_inner,invalid access occurs here]
codetoanalyze/cpp/pulse/interprocedural.cpp, delete_aliased_then_read_bad, 4, USE_AFTER_DELETE, no_bucket, ERROR, [invalidation part of the trace starts here,parameter `x` of delete_aliased_then_read_bad,assigned,was invalidated by `delete`,use-after-lifetime part of the trace starts here,parameter `x` of delete_aliased_then_read_bad,assigned,when calling `wraps_read` here,parameter `x` of wraps_read,when calling `wraps_read_inner` here,parameter `x` of wraps_read_inner,invalid access occurs here]