Static Value-Flow Analysis
Loading...
Searching...
No Matches
ae.cpp File Reference
#include "SVF-LLVM/PAGBuilder.h"
#include "WPA/WPAPass.h"
#include "Util/CommandLine.h"
#include "Util/Options.h"
#include "WPA/Andersen.h"
#include "AE/Core/RelExeState.h"
#include "AE/Core/RelationSolver.h"
#include "AE/Svfexe/AbstractInterpretation.h"
#include <chrono>
#include <limits>

Go to the source code of this file.

Classes

class  SymblicAbstractionTest
class  AETest

Functions

int main (int argc, char **argv)

Variables

static Option< bool > SYMABS ("symabs", "symbolic abstraction test", false)
static Option< bool > AETEST ("aetest", "abstract execution basic function test", false)

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 925 of file ae.cpp.

926{
927 int arg_num = 0;
928 int extraArgc = 3;
929 char **arg_value = new char *[argc + extraArgc];
930 for (; arg_num < argc; ++arg_num)
931 {
932 arg_value[arg_num] = argv[arg_num];
933 }
934 // add extra options
935 arg_value[arg_num++] = (char*) "-model-consts=true";
936 arg_value[arg_num++] = (char*) "-model-arrays=true";
937 arg_value[arg_num++] = (char*) "-pre-field-sensitive=false";
938 assert(arg_num == (argc + extraArgc) && "more extra arguments? Change the value of extraArgc");
939
940 std::vector<std::string> moduleNameVec;
941 moduleNameVec = OptionBase::parseOptions(
942 arg_num, arg_value, "Static Symbolic Execution", "[options] <input-bitcode...>"
943 );
944 delete[] arg_value;
945 if (SYMABS())
946 {
948 saTest.testsValidation();
949 return 0;
950 }
951
952 if (AETEST())
953 {
954 AETest aeTest;
957 aeTest.testBinaryOpStmt();
958 aeTest.testAbsState();
959 return 0;
960 }
961
963 PAGBuilder builder;
964 PAG* pag = builder.build();
965 // Run Andersen's to resolve indirect calls, then update PAG with resolved targets.
966 // The Andersen singleton will be reused inside AbstractInterpretation::runOnModule().
968 builder.updateCallGraph(ander->getCallGraph());
971 ae.addDetector(std::make_unique<BufOverflowDetector>());
973 ae.addDetector(std::make_unique<NullptrDerefDetector>());
974 ae.runOnModule();
975
978
979 return 0;
980}
static Option< bool > SYMABS("symabs", "symbolic abstraction test", false)
static Option< bool > AETEST("aetest", "abstract execution basic function test", false)
Definition ae.cpp:628
void testBoundedIntBoundaryArithmetic()
Definition ae.cpp:634
void testIntervalBoundaryArithmetic()
Definition ae.cpp:672
void testBinaryOpStmt()
Definition ae.cpp:704
void testAbsState()
Definition ae.cpp:905
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
Definition CommandLine.h:75
void addDetector(std::unique_ptr< AEDetector > detector)
static AbstractInterpretation & getAEInstance()
static AndersenWaveDiff * createAndersenWaveDiff(PAG *_pag)
Create an singleton instance directly instead of invoking llvm pass manager.
Definition Andersen.h:430
static void releaseAndersenWaveDiff()
Definition Andersen.h:440
static LLVMModuleSet * getLLVMModuleSet()
Definition LLVMModule.h:137
static void releaseLLVMModuleSet()
Definition LLVMModule.h:144
static void buildSVFModule(Module &mod)
static const Option< bool > NullDerefCheck
nullptr dereference checker, Default: false
Definition Options.h:250
static const Option< bool > BufferOverflowCheck
buffer overflow checker, Default: false
Definition Options.h:248
virtual PAG * build()
Start building PAG here.
void updateCallGraph(CallGraph *callgraph)
connect PAG edges based on callgraph
Definition PAG.h:46
CallGraph * getCallGraph() const
Return call graph.
void testsValidation()
Definition ae.cpp:605

Variable Documentation

◆ AETEST

Option< bool > AETEST("aetest", "abstract execution basic function test", false) ( "aetest" ,
"abstract execution basic function test" ,
false  )
static

◆ SYMABS

Option< bool > SYMABS("symabs", "symbolic abstraction test", false) ( "symabs" ,
"symbolic abstraction test" ,
false  )
static