From 58b97722c6a7978e16230e31250a7d9cde254534 Mon Sep 17 00:00:00 2001 From: bjjwwang Date: Mon, 29 Jul 2024 16:26:28 +1000 Subject: [PATCH] add main fun arg init values --- Assignment-3/Assignment-3.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assignment-3/Assignment-3.cpp b/Assignment-3/Assignment-3.cpp index 9aa1bf3..a0b4c54 100644 --- a/Assignment-3/Assignment-3.cpp +++ b/Assignment-3/Assignment-3.cpp @@ -299,6 +299,12 @@ void AbstractExecution::analyse() { // Process the main function if it exists if (const SVFFunction* fun = svfir->getModule()->getSVFFunction("main")) { + // get args of main, and set top + for (u32_t i = 0; i < fun->arg_size(); ++i) { + AEState& as = getAbsStateFromTrace(icfg->getGlobalICFGNode()); + as[svfir->getValueNode(fun->getArg(i))] = IntervalValue::top(); + } + ICFGWTO* wto = funcToWTO[fun]; handleWTOComponents(wto->getWTOComponents()); }