Skip to content

AE APIs

Jiawei Wang edited this page Jul 18, 2024 · 41 revisions

Essential API Documentation for Labs and Assignments

Lab-Exercise-3

API Introduction
getNodeID("variable") Retrieves the node ID of the specified variable.
IntervalValue(lower, upper) Creates an interval value.
AEState::getInterval() Retrieves the interval value of the abstract state.
AbstractValue::join_with(value) Merges the current value with another value.
svf_assert(condition) Performs an assertion check and throws an exception if the condition is not met.
getMemObjAddress("variable") Retrieves the memory object address of the specified variable.
AEState::getAddrs() Retrieves the set of addresses in the abstract state.
AddressValue(getMemObjAddress("variable")) Creates an address value initialized to the memory object address of the specified variable.
AEState::widening(state) Performs widening on the given state.
AEState::narrowing(state) Performs narrowing on the given state.
AEState::joinWith(state) Merges the current state with another state.
IntervalValue::plus_infinity() Retrieves an interval value representing positive infinity.
IntervalValue::minus_infinity() Retrieves an interval value representing negative infinity.
AbstractValue::meet_with(value) Performs an intersection operation between the current value and another value.
getGepObjAddress("variable", offset) Retrieves the GEP (GetElementPtr) object address of the specified variable with the given offset.
AEState::loadValue(varId) Loads the abstract value from the variable ID's address.
AEState::storeValue(varId, val) Stores the abstract value at the variable ID's address.
AEState::printAbstractTrace() Prints the abstract trace for debugging purposes.

Assignment-3

API Introduction
SVFUtil::isa<CallICFGNode>(stmt) Checks if the given statement is a call ICFG node.
SVFUtil::dyn_cast<GepStmt>(stmt) Dynamically casts the given statement to a GepStmt type.
AbstractExecution::getAbsState(node) Retrieves the abstract state of the given ICFG node.
GepStmt::getLHSVarID() Retrieves the left-hand side variable ID of the GepStmt.
GepStmt::getRHSVarID() Retrieves the right-hand side variable ID of the GepStmt.
AEState::getAddrs() Retrieves the address values in the abstract state.
AEState::getInternalID(addr) Retrieves the internal ID of the given address.
SVFUtil::cast<GepObjVar>(node) Statically casts the given node to a GepObjVar type.
_svfir->getGNode(id) Retrieves the SVFVar with the given ID.
_bufOverflowHelper.addToGepObjOffsetFromBase(objVar, offset) Adds the offset to the GEP object from the base.
_bufOverflowHelper.hasGepObjOffsetFromBase(objVar) Checks if the GEP object has an offset from the base.
_bufOverflowHelper.getGepObjOffsetFromBase(objVar) Retrieves the offset of the GEP object from the base.
_svfir->getBaseObj(id)->getByteSizeOfObj() Retrieves the byte size of the base object.
_bufOverflowHelper.addBugToReporter(bug, node) Adds the detected bug to the reporter.
Options::WidenDelay() Retrieves the value of the widen delay option.
AEState::widening(state) Performs widening on the given state.
AEState::narrowing(state) Performs narrowing on the given state.
handleSingletonWTO(wto) Handles a singleton WTO (Weak Topological Order) which includes an ICFGNode.
handleWTOComponents(components) Handles WTO components (a series of singleton WTO nodes or cycles)
mergeStatesFromPredecessors(node, state) Merges states from predecessor ICFGNodes.
CopyStmt::getLHSVarID() Retrieves the left-hand side variable ID of the copy statement.
CopyStmt::getRHSVarID() Retrieves the right-hand side variable ID of the copy statement.
BinaryOPStmt::getOpVarID(index) Retrieves the operand variable ID of the binary operation statement.
BinaryOPStmt::getResID() Retrieves the result variable ID of the binary operation statement.
BinaryOPStmt::getOpcode() Retrieves the opcode of the binary operation statement.
AEState::loadValue(varId) Loads the abstract value of the given variable ID.
AEState::storeValue(varId, val) Stores the abstract value at the given variable ID.
LoadStmt::getRHSVarID() Retrieves the right-hand side variable ID of the load statement.
LoadStmt::getLHSVarID() Retrieves the left-hand side variable ID of the load statement.
IntervalValue::getIntNumeral() Retrieves the integer representation of the interval value.
AEState::getByteOffset(gep) Retrieves the byte offset of the GEP statement.
AEState::getElementIndex(gep) Retrieves the element index of the GEP statement.
AEState::getGepObjAddrs(varID, offset) Retrieves the address of the GEP object.
AEState::printAbstractTrace() Prints the abstract trace for debugging purposes.
AbstractExecution::runOnModule(icfg) Runs the abstract execution on the given ICFG module.
AbstractExecution::handleSingletonWTO(node) Handles a singleton WTO node in the control flow graph.
AbstractExecution::handleCycleWTO(cycle) Handles a WTO cycle in the control flow graph.
AbstractExecution::handleGlobalNode() Handles global variables and initializations.
AbstractExecution::analyse() The driver function to conduct the overall analysis of the program.
AbstractExecution::updateAbsState(stmt) Updates the abstract state for each type of SVF statement.
AbstractExecution::reportBufOverflow(node) Reports a buffer overflow for a given ICFG node.
AbstractExecution::handleStubFunctions(call) Handles stub functions for verifying abstract interpretation results.
AbstractExecution::handleCallSite(callnode) Handles a call site in the control flow graph.
AbstractExecution::updateGepObjOffsetFromBase(gepAddrs, objAddrs, offset) Updates the GEP object offset from the base.
AbstractExecution::getAccessOffset(objId, gep) Returns the accessing offset of an object at a GepStmt.
AbstractExecution::ensureAllAssertsValidated() Ensures all assertions are validated.
AbstractExecution::initWTO() Marks recursive functions in the call graph.
AbstractExecutionHelper::addBugToReporter(e, node) Adds a detected bug to the bug reporter and prints the report.
AbstractExecutionHelper::printReport() Prints the buffer overflow report.
AbstractExecutionHelper::addToGepObjOffsetFromBase(obj, offset) Adds the offset to the GEP object from the base.
AbstractExecutionHelper::hasGepObjOffsetFromBase(obj) Checks if the GEP object has an offset from the base.
AbstractExecutionHelper::getGepObjOffsetFromBase(obj) Retrieves the offset of the GEP object from the base.

Clone this wiki locally