Static Value-Flow Analysis
|
#include <SVFIR2AbsState.h>
Static Public Member Functions | |
static z3::context & | getContext () |
static u32_t | getInternalID (u32_t idx) |
Return the internal index if idx is an address otherwise return the value of idx. More... | |
static u32_t | getVirtualMemAddress (u32_t idx) |
The physical address starts with 0x7f...... + idx. More... | |
static bool | isVirtualMemAddress (u32_t val) |
Check bit value of val start with 0x7F000000, filter by 0xFF000000. More... | |
Static Public Attributes | |
static AbstractValue | globalNulladdrs = AddressValue() |
Private Attributes | |
SVFIR * | _svfir |
RelExeState | _relEs |
Definition at line 42 of file SVFIR2AbsState.h.
|
inline |
Definition at line 47 of file SVFIR2AbsState.h.
void SVF::SVFIR2AbsState::applySummary | ( | AbstractState & | es | ) |
|
inline |
Definition at line 102 of file SVFIR2AbsState.h.
IntervalValue SVFIR2AbsState::getByteOffset | ( | const AbstractState & | as, |
const GepStmt * | gep | ||
) |
Return the byte offset expression of a GepStmt elemBytesize is the element byte size of an static alloc or heap alloc array e.g. GepStmt* gep = [i32*10], x, and x is [0,3] std::pair<s32_t, s32_t> byteOffset = getByteOffset(gep); byteOffset should be [0, 12] since i32 is 4 bytes.
This function, getByteOffset, calculates the byte offset for a given GepStmt.
gep | The GepStmt representing the GetElementPtr instruction. |
It is byte offset rather than flatten index. e.g. var2 = getelementptr inbounds struct.OuterStruct, struct.OuterStruct* var0, i64 0, i32 2, i32 0, i64 var1 struct.OuterStruct = type { i32, i32, struct.InnerStruct } struct.InnerStruct = type { [2 x i32] } there are 4 GepTypePairs (<0, struct.OuterStruct*>, <2, struct.OuterStruct>, <0, struct.InnerStruct>, <var1, [2xi32]>) this function process arr/ptr subtype by calculating elemByteSize * indexOperand and process struct subtype by calculating the byte offset from beginning to the field of struct e.g. for 0th pair <0, struct.OuterStruct*>, it is 0* ptrSize(struct.OuterStruct*) = 0 bytes for 1st pair <2, struct.OuterStruct>, it is 2nd field in struct.OuterStruct = 8 bytes for 2nd pair <0, struct.InnerStruct>, it is 0th field in struct.InnerStruct = 0 bytes
Therefore the final byteoffset is [8+4*var1.lb(), 8+4*var1.ub()]
Definition at line 365 of file SVFIR2AbsState.cpp.
|
inlinestatic |
Definition at line 90 of file SVFIR2AbsState.h.
IntervalValue SVFIR2AbsState::getElementIndex | ( | const AbstractState & | as, |
const GepStmt * | gep | ||
) |
Return the offset expression of a GepStmt.
This function, getElementIndex, calculates the offset range as a pair of APOffset values for a given GepStmt.
gep | The GepStmt representing the GetElementPtr instruction. |
Definition at line 457 of file SVFIR2AbsState.cpp.
IntervalValue SVFIR2AbsState::getFPToSIntValue | ( | const AbstractState & | es, |
const SVFVar * | var | ||
) |
Definition at line 161 of file SVFIR2AbsState.cpp.
IntervalValue SVFIR2AbsState::getFPToUIntValue | ( | const AbstractState & | es, |
const SVFVar * | var | ||
) |
Definition at line 167 of file SVFIR2AbsState.cpp.
IntervalValue SVFIR2AbsState::getFPTruncValue | ( | const AbstractState & | es, |
const SVFVar * | var, | ||
const SVFType * | dstType | ||
) |
Definition at line 236 of file SVFIR2AbsState.cpp.
AddressValue SVFIR2AbsState::getGepObjAddress | ( | AbstractState & | es, |
u32_t | pointer, | ||
APOffset | offset | ||
) |
Return the field address given a pointer points to a struct object and an offset.
Definition at line 328 of file SVFIR2AbsState.cpp.
Return the internal index if idx is an address otherwise return the value of idx.
Definition at line 168 of file SVFIR2AbsState.h.
IntervalValue SVFIR2AbsState::getRangeLimitFromType | ( | const SVFType * | type | ) |
Return the value range of Integer SVF Type, e.g. unsigned i8 Type->[0, 255], signed i8 Type->[-128, 127].
This function, getRangeLimitFromType, calculates the lower and upper bounds of a numeric range for a given SVFType. It is used to determine the possible value range of integer types. If the type is an SVFIntegerType, it calculates the bounds based on the size and signedness of the type. The calculated bounds are returned as an IntervalValue representing the lower (lb) and upper (ub) limits of the range.
type | The SVFType for which to calculate the value range. |
Definition at line 49 of file SVFIR2AbsState.cpp.
|
inline |
Definition at line 55 of file SVFIR2AbsState.h.
IntervalValue SVFIR2AbsState::getSExtValue | ( | const AbstractState & | es, |
const SVFVar * | var | ||
) |
Definition at line 156 of file SVFIR2AbsState.cpp.
IntervalValue SVFIR2AbsState::getSIntToFPValue | ( | const AbstractState & | es, |
const SVFVar * | var | ||
) |
Definition at line 173 of file SVFIR2AbsState.cpp.
IntervalValue SVFIR2AbsState::getTruncValue | ( | const AbstractState & | es, |
const SVFVar * | var, | ||
const SVFType * | dstType | ||
) |
Definition at line 185 of file SVFIR2AbsState.cpp.
IntervalValue SVFIR2AbsState::getUIntToFPValue | ( | const AbstractState & | es, |
const SVFVar * | var | ||
) |
Definition at line 179 of file SVFIR2AbsState.cpp.
The physical address starts with 0x7f...... + idx.
Definition at line 174 of file SVFIR2AbsState.h.
IntervalValue SVFIR2AbsState::getZExtValue | ( | const AbstractState & | es, |
const SVFVar * | var | ||
) |
Definition at line 111 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleAddr | ( | AbstractState & | es, |
const AddrStmt * | addr | ||
) |
Definition at line 563 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleBinary | ( | AbstractState & | es, |
const BinaryOPStmt * | binary | ||
) |
Definition at line 572 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleCall | ( | AbstractState & | es, |
const CallPE * | callPE | ||
) |
Definition at line 945 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleCmp | ( | AbstractState & | es, |
const CmpStmt * | cmp | ||
) |
Definition at line 629 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleCopy | ( | AbstractState & | es, |
const CopyStmt * | copy | ||
) |
Definition at line 833 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleGep | ( | AbstractState & | es, |
const GepStmt * | gep | ||
) |
Definition at line 900 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleLoad | ( | AbstractState & | es, |
const LoadStmt * | load | ||
) |
Definition at line 810 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handlePhi | ( | AbstractState & | es, |
const PhiStmt * | phi | ||
) |
Definition at line 932 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleRet | ( | AbstractState & | es, |
const RetPE * | retPE | ||
) |
Definition at line 952 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleSelect | ( | AbstractState & | es, |
const SelectStmt * | select | ||
) |
Definition at line 915 of file SVFIR2AbsState.cpp.
void SVFIR2AbsState::handleStore | ( | AbstractState & | es, |
const StoreStmt * | store | ||
) |
Definition at line 822 of file SVFIR2AbsState.cpp.
|
inline |
Definition at line 115 of file SVFIR2AbsState.h.
void SVFIR2AbsState::initObjVar | ( | AbstractState & | as, |
const ObjVar * | var | ||
) |
Init ObjVar.
constant data
Definition at line 527 of file SVFIR2AbsState.cpp.
|
inline |
whether the memory address stores memory addresses
Definition at line 140 of file SVFIR2AbsState.h.
|
inline |
whether the memory address stores a interval value
Definition at line 134 of file SVFIR2AbsState.h.
|
inline |
Definition at line 110 of file SVFIR2AbsState.h.
|
inline |
whether the variable is in varToAddrs table
Definition at line 127 of file SVFIR2AbsState.h.
|
inline |
whether the variable is in varToVal table
Definition at line 121 of file SVFIR2AbsState.h.
|
inlinestatic |
Check bit value of val start with 0x7F000000, filter by 0xFF000000.
Definition at line 180 of file SVFIR2AbsState.h.
void SVFIR2AbsState::narrowAddrs | ( | AbstractState & | es, |
AbstractState & | lhs, | ||
const AbstractState & | rhs | ||
) |
Definition at line 288 of file SVFIR2AbsState.cpp.
|
inline |
Definition at line 50 of file SVFIR2AbsState.h.
void SVFIR2AbsState::widenAddrs | ( | AbstractState & | es, |
AbstractState & | lhs, | ||
const AbstractState & | rhs | ||
) |
Definition at line 242 of file SVFIR2AbsState.cpp.
|
private |
Definition at line 187 of file SVFIR2AbsState.h.
|
private |
Definition at line 186 of file SVFIR2AbsState.h.
|
static |
Definition at line 45 of file SVFIR2AbsState.h.