"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "projects/CodeThorn/src/EStateTransferFunctions.h" between
rose-0.11.53.0.tar.gz and rose-0.11.54.0.tar.gz

About: ROSE is a compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C, C++, UPC, Fortran, OpenMP, Java, Python and PHP applications.

EStateTransferFunctions.h  (rose-0.11.53.0):EStateTransferFunctions.h  (rose-0.11.54.0)
skipping to change at line 18 skipping to change at line 18
#include <string> #include <string>
#include <unordered_set> #include <unordered_set>
#include "Labeler.h" #include "Labeler.h"
#include "EState.h" #include "EState.h"
#include "VariableIdMapping.h" #include "VariableIdMapping.h"
#include "AbstractValue.h" #include "AbstractValue.h"
#include "AstTerm.h" #include "AstTerm.h"
#include "ProgramLocationsReport.h" #include "ProgramLocationsReport.h"
#include "TypeSizeMapping.h" #include "TypeSizeMapping.h"
#include "CodeThornOptions.h" #include "CodeThornOptions.h"
#include "ReadWriteListener.h"
#include "MemoryViolationAnalysis.h"
namespace CodeThorn { namespace CodeThorn {
class CTAnalysis; class CTAnalysis;
class SingleBoolEvalResult { class SingleBoolEvalResult {
public: public:
EState estate; EState estate;
CodeThorn::BoolLattice result; CodeThorn::BoolLattice result;
bool isTop() {return result.isTop();} bool isTop() {return result.isTop();}
bool isTrue() {return result.isTrue();} bool isTrue() {return result.isTrue();}
skipping to change at line 49 skipping to change at line 51
bool isTop() {return result.isTop();} bool isTop() {return result.isTop();}
bool isTrue() {return result.isTrue();} bool isTrue() {return result.isTrue();}
bool isFalse() {return result.isFalse();} bool isFalse() {return result.isFalse();}
bool isBot() {return result.isBot();} bool isBot() {return result.isBot();}
}; };
enum InterpreterMode { IM_DISABLED, IM_ENABLED }; enum InterpreterMode { IM_DISABLED, IM_ENABLED };
// ACCESS_ERROR is null pointer dereference is detected. ACCESS_NON_EXISTING i f pointer is lattice bottom element. // ACCESS_ERROR is null pointer dereference is detected. ACCESS_NON_EXISTING i f pointer is lattice bottom element.
enum MemoryAccessBounds {ACCESS_ERROR,ACCESS_DEFINITELY_NP, ACCESS_DEFINITELY_ INSIDE_BOUNDS, ACCESS_POTENTIALLY_OUTSIDE_BOUNDS, ACCESS_DEFINITELY_OUTSIDE_BOUN DS, ACCESS_NON_EXISTING}; enum MemoryAccessBounds {ACCESS_ERROR,ACCESS_DEFINITELY_NP, ACCESS_DEFINITELY_ INSIDE_BOUNDS, ACCESS_POTENTIALLY_OUTSIDE_BOUNDS, ACCESS_DEFINITELY_OUTSIDE_BOUN DS, ACCESS_NON_EXISTING};
class ReadWriteListener {
public:
// result is value after reading from memLoc in pstate at label lab
virtual void readingFromMemoryLocation(Label lab, PStatePtr pstate, Abstract
Value& memLoc, AbstractValue& result) {}
// pstate is state at label lab before writing newValue to
// memLoc. (*pstate).writeToMemoryLocation(memloc,result) gives
// state after write
virtual void writingToMemoryLocation(Label lab, PStatePtr pstate, AbstractVa
lue& memLoc, AbstractValue& newValue) {}
// evalResult.value() holds AbstractValue of boolean value
virtual void trueFalseEdgeEvaluation(Edge edge, SingleEvalResult evalResult
, const EState* estate) {}
virtual void functionCallExternal(Edge edge, const EState* estate) {}
};
class EStateTransferFunctions : public DFTransferFunctions { class EStateTransferFunctions : public DFTransferFunctions {
public: public:
EStateTransferFunctions(); EStateTransferFunctions();
static void initDiagnostics(); static void initDiagnostics();
// must be set // must be set
void setAnalyzer(CodeThorn::CTAnalysis* analyzer); void setAnalyzer(CodeThorn::CTAnalysis* analyzer);
CTAnalysis* getAnalyzer(); CTAnalysis* getAnalyzer();
AbstractValue::Operator sgNodeToAbstractValueOperator(SgNode* node); AbstractValue::Operator sgNodeToAbstractValueOperator(SgNode* node);
skipping to change at line 320 skipping to change at line 309
void writeUndefToMemoryLocation(Label lab, PState* pstate, AbstractValue mem Loc); void writeUndefToMemoryLocation(Label lab, PState* pstate, AbstractValue mem Loc);
void writeUndefToMemoryLocation(PState* pstate, AbstractValue memLoc); void writeUndefToMemoryLocation(PState* pstate, AbstractValue memLoc);
// utilify functions // utilify functions
AbstractValue getMemoryRegionAbstractElementSize(CodeThorn::AbstractValue re gionAddress); AbstractValue getMemoryRegionAbstractElementSize(CodeThorn::AbstractValue re gionAddress);
AbstractValue getMemoryRegionAbstractNumElements(CodeThorn::AbstractValue re gionAddress); AbstractValue getMemoryRegionAbstractNumElements(CodeThorn::AbstractValue re gionAddress);
int getMemoryRegionNumElements(CodeThorn::AbstractValue regionAddress); int getMemoryRegionNumElements(CodeThorn::AbstractValue regionAddress);
int getMemoryRegionElementSize(CodeThorn::AbstractValue regionAddress); int getMemoryRegionElementSize(CodeThorn::AbstractValue regionAddress);
// if set to 0 then no listner active. By default it is 0. // if set to 0 then no listner active. By default it is 0.
void setReadWriteListener(ReadWriteListener* listener); size_t numberOfReadWriteListeners();
ReadWriteListener* getReadWriteListener(); void registerReadWriteListener(ReadWriteListener* listener, std::string name
="");
ReadWriteListener* getReadWriteListener(std::string name);
// initialize command line arguments provided by option "--cl-options" in PS tate // initialize command line arguments provided by option "--cl-options" in PS tate
void initializeCommandLineArgumentsInState(Label lab, PState& initialPState) ; void initializeCommandLineArgumentsInState(Label lab, PState& initialPState) ;
void initializeStringLiteralInState(Label lab, PState& initialPState,SgStrin gVal* stringValNode, VariableId stringVarId); void initializeStringLiteralInState(Label lab, PState& initialPState,SgStrin gVal* stringValNode, VariableId stringVarId);
void initializeStringLiteralsInState(Label lab, PState& initialPState); void initializeStringLiteralsInState(Label lab, PState& initialPState);
protected: protected:
AbstractValue abstractValueFromSgValueExp(SgValueExp* valueExp, EvalMode mod e); AbstractValue abstractValueFromSgValueExp(SgValueExp* valueExp, EvalMode mod e);
ReadWriteListener* _readWriteListener=nullptr; std::map<std::string,ReadWriteListener*> _readWriteListenerMap;
// general evaluation function for abstract value operators // general evaluation function for abstract value operators
SingleEvalResult evalOp(SgNode* node, SingleEvalResult evalOp(SgNode* node,
SingleEvalResult lhsResult, SingleEvalResult lhsResult,
SingleEvalResult rhsResult, SingleEvalResult rhsResult,
EState estate, EvalMode mode); EState estate, EvalMode mode);
// evaluation functions // evaluation functions
SingleEvalResult evalConditionalExpr(SgConditionalExp* node, EState estate, EvalMode mode=MODE_VALUE); SingleEvalResult evalConditionalExpr(SgConditionalExp* node, EState estate, EvalMode mode=MODE_VALUE);
SingleEvalResult evaluateShortCircuitOperators(SgNode* node,EState estate, E valMode mode=MODE_VALUE); SingleEvalResult evaluateShortCircuitOperators(SgNode* node,EState estate, E valMode mode=MODE_VALUE);
 End of changes. 4 change blocks. 
19 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)