mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-11 17:08:42 +00:00
Wdeprecated: CollectReachableSymbolsCallback are move constructed/returned by value, so make sure they're copy/moveable
(return by value is in ExprEngine::processPointerEscapedOnBind and any other call to the scanReachableSymbols function template used there) Protect the special members in the base class to avoid slicing, and make derived classes final so these special members don't accidentally become public on an intermediate base which would open up the possibility of slicing again. llvm-svn: 244975
This commit is contained in:
parent
01cd46abae
commit
903c29347a
@ -650,6 +650,12 @@ private:
|
||||
};
|
||||
|
||||
class SymbolVisitor {
|
||||
protected:
|
||||
SymbolVisitor() = default;
|
||||
SymbolVisitor(const SymbolVisitor &) = default;
|
||||
SymbolVisitor(SymbolVisitor &&) {}
|
||||
~SymbolVisitor() = default;
|
||||
|
||||
public:
|
||||
/// \brief A visitor method invoked by ProgramStateManager::scanReachableSymbols.
|
||||
///
|
||||
@ -657,7 +663,6 @@ public:
|
||||
/// false otherwise.
|
||||
virtual bool VisitSymbol(SymbolRef sym) = 0;
|
||||
virtual bool VisitMemRegion(const MemRegion *region) { return true; }
|
||||
virtual ~SymbolVisitor();
|
||||
};
|
||||
|
||||
} // end GR namespace
|
||||
|
@ -515,7 +515,7 @@ REGISTER_MAP_WITH_PROGRAMSTATE(ReallocPairs, SymbolRef, ReallocPair)
|
||||
REGISTER_MAP_WITH_PROGRAMSTATE(FreeReturnValue, SymbolRef, SymbolRef)
|
||||
|
||||
namespace {
|
||||
class StopTrackingCallback : public SymbolVisitor {
|
||||
class StopTrackingCallback final : public SymbolVisitor {
|
||||
ProgramStateRef state;
|
||||
public:
|
||||
StopTrackingCallback(ProgramStateRef st) : state(st) {}
|
||||
|
@ -2678,7 +2678,7 @@ public:
|
||||
} // end anonymous namespace
|
||||
|
||||
namespace {
|
||||
class StopTrackingCallback : public SymbolVisitor {
|
||||
class StopTrackingCallback final : public SymbolVisitor {
|
||||
ProgramStateRef state;
|
||||
public:
|
||||
StopTrackingCallback(ProgramStateRef st) : state(st) {}
|
||||
|
@ -92,7 +92,7 @@ public:
|
||||
REGISTER_MAP_WITH_PROGRAMSTATE(StreamMap, SymbolRef, StreamState)
|
||||
|
||||
namespace {
|
||||
class StopTrackingCallback : public SymbolVisitor {
|
||||
class StopTrackingCallback final : public SymbolVisitor {
|
||||
ProgramStateRef state;
|
||||
public:
|
||||
StopTrackingCallback(ProgramStateRef st) : state(st) {}
|
||||
|
@ -120,7 +120,7 @@ Environment EnvironmentManager::bindExpr(Environment Env,
|
||||
}
|
||||
|
||||
namespace {
|
||||
class MarkLiveCallback : public SymbolVisitor {
|
||||
class MarkLiveCallback final : public SymbolVisitor {
|
||||
SymbolReaper &SymReaper;
|
||||
public:
|
||||
MarkLiveCallback(SymbolReaper &symreaper) : SymReaper(symreaper) {}
|
||||
|
@ -2006,7 +2006,7 @@ void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
|
||||
}
|
||||
|
||||
namespace {
|
||||
class CollectReachableSymbolsCallback : public SymbolVisitor {
|
||||
class CollectReachableSymbolsCallback final : public SymbolVisitor {
|
||||
InvalidatedSymbols Symbols;
|
||||
public:
|
||||
CollectReachableSymbolsCallback(ProgramStateRef State) {}
|
||||
|
@ -546,5 +546,3 @@ bool SymbolReaper::isLive(const VarRegion *VR, bool includeStoreBindings) const{
|
||||
|
||||
return VarContext->isParentOf(CurrentContext);
|
||||
}
|
||||
|
||||
SymbolVisitor::~SymbolVisitor() {}
|
||||
|
Loading…
Reference in New Issue
Block a user