Summary:
The purpose these serve is unclear to me. From the comment I *think*
they were used to hint to the biabduction backend that smart pointers
are just pointers. That said, The tests still mostly pass even without
that (just a few `weak_ptr` tests changed from `NULL_DEREFERENCE` to
`Bad_footprint`).
Moreover, this extra dereference was added unreliably. For instance,
this piece of code:
```
auto x = std::make_unique<X>(some_X);
```
would either get the extra dereference or not depending on which headers
were picked for the C++ stdlib.
The extra dereference was tripping up the liveness checker (see later in
the stack), and probably most checkers too.
Reviewed By: mbouaziz
Differential Revision: D13991130
fbshipit-source-id: 462923595
master
Jules Villard6 years agocommitted byFacebook Github Bot
codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_copy_null_deref, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure unique_ptr::unique_ptr_copy_null_deref()]
codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_copy_null_deref, 3, NULL_DEREFERENCE, B1, ERROR, [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, B1, ERROR, [start of procedure unique_ptr::unique_ptr_move_null_deref()]
codetoanalyze/cpp/errors/smart_ptr/unique_ptr_deref.cpp, unique_ptr::unique_ptr_move_null_deref, 3, NULL_DEREFERENCE, B1, ERROR, [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, CPP, ERROR, [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, MEMORY_LEAK, CPP, ERROR, [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, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromSharedBaseAssign_bad(),start of procedure weak_ptr_constructors::fromSharedBaseAssign(),return from a call to weak_ptr_constructors::fromSharedBaseAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::FN_safeGetFromSharedBaseAssign_bad, 4, Bad_footprint, no_bucket, ERROR, [start of procedure weak_ptr_derefs::FN_safeGetFromSharedBaseAssign_bad(),start of procedure weak_ptr_constructors::fromSharedBaseAssign(),return from a call to weak_ptr_constructors::fromSharedBaseAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,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, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromSharedBaseConstr_bad(),start of procedure weak_ptr_constructors::fromSharedBaseConstr(),return from a call to weak_ptr_constructors::fromSharedBaseConstr,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::FN_safeGetFromSharedBaseConstr_bad, 4, Bad_footprint, no_bucket, ERROR, [start of procedure weak_ptr_derefs::FN_safeGetFromSharedBaseConstr_bad(),start of procedure weak_ptr_constructors::fromSharedBaseConstr(),return from a call to weak_ptr_constructors::fromSharedBaseConstr,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,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, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromSharedDerivedAssign_bad(),start of procedure weak_ptr_constructors::fromSharedDerivedAssign(),return from a call to weak_ptr_constructors::fromSharedDerivedAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::FN_safeGetFromSharedDerivedAssign_bad, 4, Bad_footprint, no_bucket, ERROR, [start of procedure weak_ptr_derefs::FN_safeGetFromSharedDerivedAssign_bad(),start of procedure weak_ptr_constructors::fromSharedDerivedAssign(),return from a call to weak_ptr_constructors::fromSharedDerivedAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromSharedDerivedConstr2_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromSharedDerivedConstr2_bad(),start of procedure weak_ptr_constructors::fromSharedDerivedConstr2(),return from a call to weak_ptr_constructors::fromSharedDerivedConstr2,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::FN_safeGetFromSharedDerivedConstr2_bad, 4, Bad_footprint, no_bucket, ERROR, [start of procedure weak_ptr_derefs::FN_safeGetFromSharedDerivedConstr2_bad(),start of procedure weak_ptr_constructors::fromSharedDerivedConstr2(),return from a call to weak_ptr_constructors::fromSharedDerivedConstr2,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromSharedDerivedConstr_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromSharedDerivedConstr_bad(),start of procedure weak_ptr_constructors::fromSharedDerivedConstr(),return from a call to weak_ptr_constructors::fromSharedDerivedConstr,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::FN_safeGetFromSharedDerivedConstr_bad, 4, Bad_footprint, no_bucket, ERROR, [start of procedure weak_ptr_derefs::FN_safeGetFromSharedDerivedConstr_bad(),start of procedure weak_ptr_constructors::fromSharedDerivedConstr(),return from a call to weak_ptr_constructors::fromSharedDerivedConstr,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromWeakBaseAssign_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromWeakBaseAssign_bad(),start of procedure weak_ptr_constructors::fromWeakBaseAssign(),return from a call to weak_ptr_constructors::fromWeakBaseAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromWeakBaseAssign_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromWeakBaseAssign_bad(),start of procedure weak_ptr_constructors::fromWeakBaseAssign(),return from a call to weak_ptr_constructors::fromWeakBaseAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromWeakBaseConstr_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromWeakBaseConstr_bad(),start of procedure weak_ptr_constructors::fromWeakBaseConstr(),return from a call to weak_ptr_constructors::fromWeakBaseConstr,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromWeakBaseConstr_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromWeakBaseConstr_bad(),start of procedure weak_ptr_constructors::fromWeakBaseConstr(),return from a call to weak_ptr_constructors::fromWeakBaseConstr,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromWeakDerivedAssign_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromWeakDerivedAssign_bad(),start of procedure weak_ptr_constructors::fromWeakDerivedAssign(),return from a call to weak_ptr_constructors::fromWeakDerivedAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]
codetoanalyze/cpp/errors/smart_ptr/weak_ptr.cpp, weak_ptr_derefs::safeGetFromWeakDerivedAssign_bad, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure weak_ptr_derefs::safeGetFromWeakDerivedAssign_bad(),start of procedure weak_ptr_constructors::fromWeakDerivedAssign(),return from a call to weak_ptr_constructors::fromWeakDerivedAssign,start of procedure weak_ptr_derefs::safeGet(),Loop condition is false. Leaving loop,return from a call to weak_ptr_derefs::safeGet]