Static Value-Flow Analysis
Loading...
Searching...
No Matches
ae.cpp File Reference
#include "SVF-LLVM/SVFIRBuilder.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>

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 854 of file ae.cpp.

855{
856 int arg_num = 0;
857 int extraArgc = 3;
858 char **arg_value = new char *[argc + extraArgc];
859 for (; arg_num < argc; ++arg_num)
860 {
861 arg_value[arg_num] = argv[arg_num];
862 }
863 // add extra options
864 arg_value[arg_num++] = (char*) "-model-consts=true";
865 arg_value[arg_num++] = (char*) "-model-arrays=true";
866 arg_value[arg_num++] = (char*) "-pre-field-sensitive=false";
867 assert(arg_num == (argc + extraArgc) && "more extra arguments? Change the value of extraArgc");
868
869 std::vector<std::string> moduleNameVec;
870 moduleNameVec = OptionBase::parseOptions(
871 arg_num, arg_value, "Static Symbolic Execution", "[options] <input-bitcode...>"
872 );
873 delete[] arg_value;
874 if (SYMABS())
875 {
877 saTest.testsValidation();
878 return 0;
879 }
880
881 if (AETEST())
882 {
883 AETest aeTest;
884 aeTest.testBinaryOpStmt();
885 aeTest.testAbsState();
886 return 0;
887 }
888
890 SVFIRBuilder builder;
891 SVFIR* pag = builder.build();
892 // Run Andersen's to resolve indirect calls, then update SVFIR with resolved targets.
893 // The Andersen singleton will be reused inside AbstractInterpretation::runOnModule().
895 builder.updateCallGraph(ander->getCallGraph());
898 ae.addDetector(std::make_unique<BufOverflowDetector>());
900 ae.addDetector(std::make_unique<NullptrDerefDetector>());
901 ae.runOnModule();
902
905
906 return 0;
907}
static Option< bool > SYMABS("symabs", "symbolic abstraction test", false)
static Option< bool > AETEST("aetest", "abstract execution basic function test", false)
Definition ae.cpp:627
void testBinaryOpStmt()
Definition ae.cpp:633
void testAbsState()
Definition ae.cpp:834
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(SVFIR *_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
CallGraph * getCallGraph() const
Return call graph.
void updateCallGraph(CallGraph *callgraph)
connect PAG edges based on callgraph
virtual SVFIR * build()
Start building SVFIR here.
void testsValidation()
Definition ae.cpp:604

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