svf-tools 1.0.976 → 1.0.978
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/svf/include/Graphs/ThreadCallGraph.h +0 -6
- package/svf/include/MTA/LockAnalysis.h +41 -31
- package/svf/include/MTA/MHP.h +34 -54
- package/svf/include/MTA/MTAStat.h +1 -2
- package/svf/include/MTA/TCT.h +36 -18
- package/svf/include/Util/CxtStmt.h +13 -12
- package/svf/include/Util/Options.h +1 -20
- package/svf/include/Util/SVFUtil.h +8 -43
- package/svf/include/Util/ThreadAPI.h +42 -85
- package/svf/lib/Graphs/ThreadCallGraph.cpp +1 -73
- package/svf/lib/MTA/LockAnalysis.cpp +83 -75
- package/svf/lib/MTA/MHP.cpp +142 -121
- package/svf/lib/MTA/MTA.cpp +2 -40
- package/svf/lib/MTA/MTAStat.cpp +7 -33
- package/svf/lib/MTA/TCT.cpp +30 -30
- package/svf/lib/Util/CallGraphBuilder.cpp +0 -15
- package/svf/lib/Util/Options.cpp +0 -62
- package/svf/lib/Util/ThreadAPI.cpp +27 -6
- package/svf-llvm/lib/SVFIRExtAPI.cpp +0 -26
- package/svf-llvm/tools/MTA/CMakeLists.txt +1 -1
- package/svf-llvm/tools/MTA/mta.cpp +0 -8
- package/svf/include/MTA/FSMPTA.h +0 -270
- package/svf/include/MTA/MTAResultValidator.h +0 -448
- package/svf/include/MTA/PCG.h +0 -229
- package/svf/lib/MTA/FSMPTA.cpp +0 -792
- package/svf/lib/MTA/PCG.cpp +0 -364
- package/svf-llvm/tools/MTA/LockResultValidator.cpp +0 -251
- package/svf-llvm/tools/MTA/LockResultValidator.h +0 -84
- package/svf-llvm/tools/MTA/MTAAnnotator.cpp +0 -293
- package/svf-llvm/tools/MTA/MTAAnnotator.h +0 -120
- package/svf-llvm/tools/MTA/MTAResultValidator.cpp +0 -716
- package/svf-llvm/tools/MTA/MTAResultValidator.h +0 -337
|
@@ -69,19 +69,21 @@ void LockAnalysis::analyze()
|
|
|
69
69
|
void LockAnalysis::collectLockUnlocksites()
|
|
70
70
|
{
|
|
71
71
|
ThreadCallGraph* tcg=tct->getThreadCallGraph();
|
|
72
|
+
|
|
72
73
|
for (const SVFFunction* F : tct->getSVFModule()->getFunctionSet())
|
|
73
74
|
{
|
|
74
75
|
for (const SVFBasicBlock* bb : F->getBasicBlockList())
|
|
75
76
|
{
|
|
76
77
|
for (const SVFInstruction* inst : bb->getInstructionList())
|
|
77
78
|
{
|
|
78
|
-
|
|
79
|
+
const ICFGNode* icfgNode = tct->getICFGNode(inst);
|
|
80
|
+
if (tcg->getThreadAPI()->isTDRelease(icfgNode))
|
|
79
81
|
{
|
|
80
|
-
unlocksites.insert(
|
|
82
|
+
unlocksites.insert(icfgNode);
|
|
81
83
|
}
|
|
82
|
-
if (tcg->getThreadAPI()->isTDAcquire(
|
|
84
|
+
if (tcg->getThreadAPI()->isTDAcquire(icfgNode))
|
|
83
85
|
{
|
|
84
|
-
locksites.insert(
|
|
86
|
+
locksites.insert(icfgNode);
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
}
|
|
@@ -101,7 +103,7 @@ void LockAnalysis::buildCandidateFuncSetforLock()
|
|
|
101
103
|
|
|
102
104
|
for (InstSet::iterator it = locksites.begin(), eit = locksites.end(); it != eit; ++it)
|
|
103
105
|
{
|
|
104
|
-
const SVFFunction* fun=(*it)->
|
|
106
|
+
const SVFFunction* fun=(*it)->getFun();
|
|
105
107
|
CallGraphNode* cgnode = tcg->getCallGraphNode(fun);
|
|
106
108
|
if (visited.find(cgnode) == visited.end())
|
|
107
109
|
{
|
|
@@ -111,7 +113,7 @@ void LockAnalysis::buildCandidateFuncSetforLock()
|
|
|
111
113
|
}
|
|
112
114
|
for (InstSet::iterator it = unlocksites.begin(), eit = unlocksites.end(); it != eit; ++it)
|
|
113
115
|
{
|
|
114
|
-
const SVFFunction* fun = (*it)->
|
|
116
|
+
const SVFFunction* fun = (*it)->getFun();
|
|
115
117
|
CallGraphNode* cgnode = tcg->getCallGraphNode(fun);
|
|
116
118
|
if (visited.find(cgnode) == visited.end())
|
|
117
119
|
{
|
|
@@ -145,8 +147,8 @@ void LockAnalysis::analyzeIntraProcedualLock()
|
|
|
145
147
|
// Identify the protected Instructions.
|
|
146
148
|
for (InstSet::const_iterator it = locksites.begin(), ie = locksites.end(); it != ie; ++it)
|
|
147
149
|
{
|
|
148
|
-
const
|
|
149
|
-
assert(
|
|
150
|
+
const ICFGNode* lockSite = *it;
|
|
151
|
+
assert(isCallSite(lockSite) && "Lock acquire instruction must be a CallSite");
|
|
150
152
|
|
|
151
153
|
// Perform forward traversal
|
|
152
154
|
InstSet forwardInsts;
|
|
@@ -167,19 +169,19 @@ void LockAnalysis::analyzeIntraProcedualLock()
|
|
|
167
169
|
/*!
|
|
168
170
|
* Intra-procedural forward traversal
|
|
169
171
|
*/
|
|
170
|
-
bool LockAnalysis::intraForwardTraverse(const
|
|
172
|
+
bool LockAnalysis::intraForwardTraverse(const ICFGNode* lockSite, InstSet& unlockSet, InstSet& forwardInsts)
|
|
171
173
|
{
|
|
172
174
|
|
|
173
|
-
const SVFFunction* svfFun = lockSite->
|
|
175
|
+
const SVFFunction* svfFun = lockSite->getFun();
|
|
174
176
|
|
|
175
177
|
InstVec worklist;
|
|
176
178
|
worklist.push_back(lockSite);
|
|
177
179
|
while (!worklist.empty())
|
|
178
180
|
{
|
|
179
|
-
const
|
|
181
|
+
const ICFGNode *I = worklist.back();
|
|
180
182
|
worklist.pop_back();
|
|
181
183
|
const SVFInstruction* exitInst = svfFun->getExitBB()->back();
|
|
182
|
-
if(exitInst == I)
|
|
184
|
+
if(tct->getICFGNode(exitInst) == I)
|
|
183
185
|
return false;
|
|
184
186
|
|
|
185
187
|
// Skip the visited Instructions.
|
|
@@ -195,10 +197,12 @@ bool LockAnalysis::intraForwardTraverse(const SVFInstruction* lockSite, InstSet&
|
|
|
195
197
|
continue;
|
|
196
198
|
}
|
|
197
199
|
|
|
198
|
-
const
|
|
199
|
-
for (InstVec::const_iterator nit = nextInsts.begin(), enit = nextInsts.end(); nit != enit; ++nit)
|
|
200
|
+
for(const ICFGEdge* outEdge : I->getOutEdges())
|
|
200
201
|
{
|
|
201
|
-
|
|
202
|
+
if(outEdge->getDstNode()->getFun() == I->getFun())
|
|
203
|
+
{
|
|
204
|
+
worklist.push_back(outEdge->getDstNode());
|
|
205
|
+
}
|
|
202
206
|
}
|
|
203
207
|
}
|
|
204
208
|
|
|
@@ -215,16 +219,16 @@ bool LockAnalysis::intraBackwardTraverse(const InstSet& unlockSet, InstSet& back
|
|
|
215
219
|
InstVec worklist;
|
|
216
220
|
for(InstSet::const_iterator it = unlockSet.begin(), eit = unlockSet.end(); it!=eit; ++it)
|
|
217
221
|
{
|
|
218
|
-
const
|
|
219
|
-
const SVFInstruction* entryInst = unlockSite->
|
|
222
|
+
const ICFGNode* unlockSite = *it;
|
|
223
|
+
const SVFInstruction* entryInst = unlockSite->getFun()->getEntryBlock()->back();
|
|
220
224
|
worklist.push_back(*it);
|
|
221
225
|
|
|
222
226
|
while (!worklist.empty())
|
|
223
227
|
{
|
|
224
|
-
const
|
|
228
|
+
const ICFGNode *I = worklist.back();
|
|
225
229
|
worklist.pop_back();
|
|
226
230
|
|
|
227
|
-
if(entryInst == I)
|
|
231
|
+
if(tct->getICFGNode(entryInst) == I)
|
|
228
232
|
return false;
|
|
229
233
|
|
|
230
234
|
// Skip the visited Instructions.
|
|
@@ -239,10 +243,12 @@ bool LockAnalysis::intraBackwardTraverse(const InstSet& unlockSet, InstSet& back
|
|
|
239
243
|
continue;
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
const
|
|
243
|
-
for (InstVec::const_iterator nit = nextInsts.begin(), enit = nextInsts.end(); nit != enit; ++nit)
|
|
246
|
+
for(const ICFGEdge* inEdge : I->getInEdges())
|
|
244
247
|
{
|
|
245
|
-
|
|
248
|
+
if(inEdge->getSrcNode()->getFun() == I->getFun())
|
|
249
|
+
{
|
|
250
|
+
worklist.push_back(inEdge->getSrcNode());
|
|
251
|
+
}
|
|
246
252
|
}
|
|
247
253
|
}
|
|
248
254
|
}
|
|
@@ -304,14 +310,14 @@ void LockAnalysis::handleCallRelation(CxtLockProc& clp, const CallGraphEdge* cgE
|
|
|
304
310
|
{
|
|
305
311
|
|
|
306
312
|
CallStrCxt cxt(clp.getContext());
|
|
307
|
-
|
|
308
|
-
if (isTDAcquire(
|
|
313
|
+
const ICFGNode* curNode = tct->getICFGNode(cs.getInstruction());
|
|
314
|
+
if (isTDAcquire(curNode))
|
|
309
315
|
{
|
|
310
|
-
addCxtLock(cxt,
|
|
316
|
+
addCxtLock(cxt,curNode);
|
|
311
317
|
return;
|
|
312
318
|
}
|
|
313
319
|
const SVFFunction* svfcallee = cgEdge->getDstNode()->getFunction();
|
|
314
|
-
pushCxt(cxt,
|
|
320
|
+
pushCxt(cxt, SVFUtil::cast<CallICFGNode>(curNode), svfcallee);
|
|
315
321
|
|
|
316
322
|
CxtLockProc newclp(cxt, svfcallee);
|
|
317
323
|
if (pushToCTPWorkList(newclp))
|
|
@@ -332,7 +338,7 @@ void LockAnalysis::analyzeLockSpanCxtStmt()
|
|
|
332
338
|
continue;
|
|
333
339
|
CallStrCxt cxt;
|
|
334
340
|
const SVFInstruction* frontInst = (*it)->getEntryBlock()->front();
|
|
335
|
-
CxtStmt cxtstmt(cxt, frontInst);
|
|
341
|
+
CxtStmt cxtstmt(cxt, tct->getICFGNode(frontInst));
|
|
336
342
|
pushToCTSWorkList(cxtstmt);
|
|
337
343
|
}
|
|
338
344
|
|
|
@@ -341,7 +347,7 @@ void LockAnalysis::analyzeLockSpanCxtStmt()
|
|
|
341
347
|
CxtStmt cts = popFromCTSWorkList();
|
|
342
348
|
|
|
343
349
|
touchCxtStmt(cts);
|
|
344
|
-
const
|
|
350
|
+
const ICFGNode* curInst = cts.getStmt();
|
|
345
351
|
instToCxtStmtSet[curInst].insert(cts);
|
|
346
352
|
|
|
347
353
|
DBOUT(DMTA, outs() << "\nVisit cxtStmt: ");
|
|
@@ -365,11 +371,11 @@ void LockAnalysis::analyzeLockSpanCxtStmt()
|
|
|
365
371
|
if(removeCxtStmtToSpan(cts,cts))
|
|
366
372
|
handleIntra(cts);
|
|
367
373
|
}
|
|
368
|
-
else if (
|
|
374
|
+
else if (isCallSite(curInst) && !isExtCall(curInst))
|
|
369
375
|
{
|
|
370
376
|
handleCall(cts);
|
|
371
377
|
}
|
|
372
|
-
else if (curInst->isRetInst())
|
|
378
|
+
else if (isa<IntraICFGNode>(curInst) && cast<IntraICFGNode>(curInst)->getInst()->isRetInst())
|
|
373
379
|
{
|
|
374
380
|
handleRet(cts);
|
|
375
381
|
}
|
|
@@ -401,19 +407,18 @@ void LockAnalysis::printLocks(const CxtStmt& cts)
|
|
|
401
407
|
/// Handle fork
|
|
402
408
|
void LockAnalysis::handleFork(const CxtStmt& cts)
|
|
403
409
|
{
|
|
404
|
-
const SVFInstruction* call = cts.getStmt();
|
|
405
410
|
const CallStrCxt& curCxt = cts.getContext();
|
|
406
|
-
CallICFGNode*
|
|
407
|
-
if(getTCG()->hasThreadForkEdge(
|
|
411
|
+
const CallICFGNode* call = SVFUtil::dyn_cast<CallICFGNode>(cts.getStmt());
|
|
412
|
+
if(getTCG()->hasThreadForkEdge(call))
|
|
408
413
|
{
|
|
409
|
-
for (ThreadCallGraph::ForkEdgeSet::const_iterator cgIt = getTCG()->getForkEdgeBegin(
|
|
410
|
-
ecgIt = getTCG()->getForkEdgeEnd(
|
|
414
|
+
for (ThreadCallGraph::ForkEdgeSet::const_iterator cgIt = getTCG()->getForkEdgeBegin(call),
|
|
415
|
+
ecgIt = getTCG()->getForkEdgeEnd(call); cgIt != ecgIt; ++cgIt)
|
|
411
416
|
{
|
|
412
417
|
const SVFFunction* svfcallee = (*cgIt)->getDstNode()->getFunction();
|
|
413
418
|
CallStrCxt newCxt = curCxt;
|
|
414
419
|
pushCxt(newCxt,call,svfcallee);
|
|
415
420
|
const SVFInstruction* svfInst = svfcallee->getEntryBlock()->front();
|
|
416
|
-
CxtStmt newCts(newCxt, svfInst);
|
|
421
|
+
CxtStmt newCts(newCxt, tct->getICFGNode(svfInst));
|
|
417
422
|
markCxtStmtFlag(newCts, cts);
|
|
418
423
|
}
|
|
419
424
|
}
|
|
@@ -424,21 +429,20 @@ void LockAnalysis::handleFork(const CxtStmt& cts)
|
|
|
424
429
|
void LockAnalysis::handleCall(const CxtStmt& cts)
|
|
425
430
|
{
|
|
426
431
|
|
|
427
|
-
const SVFInstruction* call = cts.getStmt();
|
|
428
432
|
const CallStrCxt& curCxt = cts.getContext();
|
|
429
|
-
CallICFGNode*
|
|
430
|
-
if (getTCG()->hasCallGraphEdge(
|
|
433
|
+
const CallICFGNode* call = SVFUtil::dyn_cast<CallICFGNode>(cts.getStmt());
|
|
434
|
+
if (getTCG()->hasCallGraphEdge(call))
|
|
431
435
|
{
|
|
432
|
-
for (CallGraph::CallGraphEdgeSet::const_iterator cgIt = getTCG()->getCallEdgeBegin(
|
|
436
|
+
for (CallGraph::CallGraphEdgeSet::const_iterator cgIt = getTCG()->getCallEdgeBegin(call), ecgIt = getTCG()->getCallEdgeEnd(call);
|
|
433
437
|
cgIt != ecgIt; ++cgIt)
|
|
434
438
|
{
|
|
435
439
|
const SVFFunction* svfcallee = (*cgIt)->getDstNode()->getFunction();
|
|
436
|
-
if (isExtCall(svfcallee))
|
|
440
|
+
if (SVFUtil::isExtCall(svfcallee))
|
|
437
441
|
continue;
|
|
438
442
|
CallStrCxt newCxt = curCxt;
|
|
439
443
|
pushCxt(newCxt, call, svfcallee);
|
|
440
444
|
const SVFInstruction* svfInst = svfcallee->getEntryBlock()->front();
|
|
441
|
-
CxtStmt newCts(newCxt, svfInst);
|
|
445
|
+
CxtStmt newCts(newCxt, tct->getICFGNode(svfInst));
|
|
442
446
|
markCxtStmtFlag(newCts, cts);
|
|
443
447
|
}
|
|
444
448
|
}
|
|
@@ -448,9 +452,9 @@ void LockAnalysis::handleCall(const CxtStmt& cts)
|
|
|
448
452
|
void LockAnalysis::handleRet(const CxtStmt& cts)
|
|
449
453
|
{
|
|
450
454
|
|
|
451
|
-
const
|
|
455
|
+
const ICFGNode* curInst = cts.getStmt();
|
|
452
456
|
const CallStrCxt& curCxt = cts.getContext();
|
|
453
|
-
const SVFFunction* svffun = curInst->
|
|
457
|
+
const SVFFunction* svffun = curInst->getFun();
|
|
454
458
|
CallGraphNode* curFunNode = getTCG()->getCallGraphNode(svffun);
|
|
455
459
|
|
|
456
460
|
for (CallGraphNode::const_iterator it = curFunNode->getInEdges().begin(), eit = curFunNode->getInEdges().end(); it != eit; ++it)
|
|
@@ -462,14 +466,16 @@ void LockAnalysis::handleRet(const CxtStmt& cts)
|
|
|
462
466
|
++cit)
|
|
463
467
|
{
|
|
464
468
|
CallStrCxt newCxt = curCxt;
|
|
465
|
-
const
|
|
466
|
-
if (matchCxt(newCxt, inst, curFunNode->getFunction()))
|
|
469
|
+
const ICFGNode* inst = *cit;
|
|
470
|
+
if (matchCxt(newCxt, SVFUtil::cast<CallICFGNode>(inst), curFunNode->getFunction()))
|
|
467
471
|
{
|
|
468
|
-
const
|
|
469
|
-
for (InstVec::const_iterator nit = nextInsts.begin(), enit = nextInsts.end(); nit != enit; ++nit)
|
|
472
|
+
for(const ICFGEdge* outEdge : curInst->getOutEdges())
|
|
470
473
|
{
|
|
471
|
-
|
|
472
|
-
|
|
474
|
+
if(outEdge->getDstNode()->getFun() == curInst->getFun())
|
|
475
|
+
{
|
|
476
|
+
CxtStmt newCts(newCxt, outEdge->getDstNode());
|
|
477
|
+
markCxtStmtFlag(newCts, cts);
|
|
478
|
+
}
|
|
473
479
|
}
|
|
474
480
|
}
|
|
475
481
|
}
|
|
@@ -477,14 +483,16 @@ void LockAnalysis::handleRet(const CxtStmt& cts)
|
|
|
477
483
|
cit != ecit; ++cit)
|
|
478
484
|
{
|
|
479
485
|
CallStrCxt newCxt = curCxt;
|
|
480
|
-
const
|
|
481
|
-
if (matchCxt(newCxt, inst, curFunNode->getFunction()))
|
|
486
|
+
const ICFGNode* inst = *cit;
|
|
487
|
+
if (matchCxt(newCxt, SVFUtil::cast<CallICFGNode>(inst), curFunNode->getFunction()))
|
|
482
488
|
{
|
|
483
|
-
const
|
|
484
|
-
for (InstVec::const_iterator nit = nextInsts.begin(), enit = nextInsts.end(); nit != enit; ++nit)
|
|
489
|
+
for(const ICFGEdge* outEdge : curInst->getOutEdges())
|
|
485
490
|
{
|
|
486
|
-
|
|
487
|
-
|
|
491
|
+
if(outEdge->getDstNode()->getFun() == curInst->getFun())
|
|
492
|
+
{
|
|
493
|
+
CxtStmt newCts(newCxt, outEdge->getDstNode());
|
|
494
|
+
markCxtStmtFlag(newCts, cts);
|
|
495
|
+
}
|
|
488
496
|
}
|
|
489
497
|
}
|
|
490
498
|
}
|
|
@@ -495,23 +503,24 @@ void LockAnalysis::handleRet(const CxtStmt& cts)
|
|
|
495
503
|
void LockAnalysis::handleIntra(const CxtStmt& cts)
|
|
496
504
|
{
|
|
497
505
|
|
|
498
|
-
const
|
|
506
|
+
const ICFGNode* curInst = cts.getStmt();
|
|
499
507
|
const CallStrCxt& curCxt = cts.getContext();
|
|
500
508
|
|
|
501
|
-
const
|
|
502
|
-
for (InstVec::const_iterator nit = nextInsts.begin(), enit = nextInsts.end(); nit != enit; ++nit)
|
|
509
|
+
for(const ICFGEdge* outEdge : curInst->getOutEdges())
|
|
503
510
|
{
|
|
504
|
-
|
|
505
|
-
|
|
511
|
+
if(outEdge->getDstNode()->getFun() == curInst->getFun())
|
|
512
|
+
{
|
|
513
|
+
CxtStmt newCts(curCxt, outEdge->getDstNode());
|
|
514
|
+
markCxtStmtFlag(newCts, cts);
|
|
515
|
+
}
|
|
506
516
|
}
|
|
507
517
|
}
|
|
508
518
|
|
|
509
519
|
|
|
510
|
-
void LockAnalysis::pushCxt(CallStrCxt& cxt, const
|
|
520
|
+
void LockAnalysis::pushCxt(CallStrCxt& cxt, const CallICFGNode* call, const SVFFunction* callee)
|
|
511
521
|
{
|
|
512
|
-
const SVFFunction* svfcaller = call->
|
|
513
|
-
|
|
514
|
-
CallSiteID csId = getTCG()->getCallSiteID(cbn, callee);
|
|
522
|
+
const SVFFunction* svfcaller = call->getFun();
|
|
523
|
+
CallSiteID csId = getTCG()->getCallSiteID(call, callee);
|
|
515
524
|
|
|
516
525
|
// /// handle calling context for candidate functions only
|
|
517
526
|
// if (isLockCandidateFun(caller) == false)
|
|
@@ -524,11 +533,10 @@ void LockAnalysis::pushCxt(CallStrCxt& cxt, const SVFInstruction* call, const SV
|
|
|
524
533
|
}
|
|
525
534
|
}
|
|
526
535
|
|
|
527
|
-
bool LockAnalysis::matchCxt(CallStrCxt& cxt, const
|
|
536
|
+
bool LockAnalysis::matchCxt(CallStrCxt& cxt, const CallICFGNode* call, const SVFFunction* callee)
|
|
528
537
|
{
|
|
529
|
-
const SVFFunction* svfcaller = call->
|
|
530
|
-
|
|
531
|
-
CallSiteID csId = getTCG()->getCallSiteID(cbn, callee);
|
|
538
|
+
const SVFFunction* svfcaller = call->getFun();
|
|
539
|
+
CallSiteID csId = getTCG()->getCallSiteID(call, callee);
|
|
532
540
|
|
|
533
541
|
// /// handle calling context for candidate functions only
|
|
534
542
|
// if (isLockCandidateFun(caller) == false)
|
|
@@ -553,7 +561,7 @@ bool LockAnalysis::matchCxt(CallStrCxt& cxt, const SVFInstruction* call, const S
|
|
|
553
561
|
/*!
|
|
554
562
|
* Protected by at least one common lock under every context
|
|
555
563
|
*/
|
|
556
|
-
bool LockAnalysis::isProtectedByCommonLock(const
|
|
564
|
+
bool LockAnalysis::isProtectedByCommonLock(const ICFGNode *i1, const ICFGNode *i2)
|
|
557
565
|
{
|
|
558
566
|
numOfTotalQueries++;
|
|
559
567
|
bool commonlock = false;
|
|
@@ -570,7 +578,7 @@ bool LockAnalysis::isProtectedByCommonLock(const SVFInstruction *i1, const SVFIn
|
|
|
570
578
|
/*!
|
|
571
579
|
* Protected by at least one common context-insensitive lock
|
|
572
580
|
*/
|
|
573
|
-
bool LockAnalysis::isProtectedByCommonCILock(const
|
|
581
|
+
bool LockAnalysis::isProtectedByCommonCILock(const ICFGNode *i1, const ICFGNode *i2)
|
|
574
582
|
{
|
|
575
583
|
|
|
576
584
|
if(!isInsideCondIntraLock(i1) && !isInsideCondIntraLock(i2))
|
|
@@ -604,7 +612,7 @@ bool LockAnalysis::isProtectedByCommonCxtLock(const CxtStmt& cxtStmt1, const Cxt
|
|
|
604
612
|
/*!
|
|
605
613
|
* Protected by at least one common context-sensitive lock under each context
|
|
606
614
|
*/
|
|
607
|
-
bool LockAnalysis::isProtectedByCommonCxtLock(const
|
|
615
|
+
bool LockAnalysis::isProtectedByCommonCxtLock(const ICFGNode *i1, const ICFGNode *i2)
|
|
608
616
|
{
|
|
609
617
|
if(!hasCxtStmtfromInst(i1) || !hasCxtStmtfromInst(i2))
|
|
610
618
|
return false;
|
|
@@ -628,7 +636,7 @@ bool LockAnalysis::isProtectedByCommonCxtLock(const SVFInstruction *i1, const SV
|
|
|
628
636
|
/*!
|
|
629
637
|
* Return true if two instructions are inside at least one common lock span
|
|
630
638
|
*/
|
|
631
|
-
bool LockAnalysis::isInSameSpan(const
|
|
639
|
+
bool LockAnalysis::isInSameSpan(const ICFGNode *i1, const ICFGNode *i2)
|
|
632
640
|
{
|
|
633
641
|
DOTIMESTAT(double queryStart = PTAStat::getClk(true));
|
|
634
642
|
|
|
@@ -646,7 +654,7 @@ bool LockAnalysis::isInSameSpan(const SVFInstruction *i1, const SVFInstruction *
|
|
|
646
654
|
/*!
|
|
647
655
|
* Return true if two instructions are inside same context-insensitive lock span
|
|
648
656
|
*/
|
|
649
|
-
bool LockAnalysis::isInSameCISpan(const
|
|
657
|
+
bool LockAnalysis::isInSameCISpan(const ICFGNode *i1, const ICFGNode *i2) const
|
|
650
658
|
{
|
|
651
659
|
if(!isInsideCondIntraLock(i1) && !isInsideCondIntraLock(i2))
|
|
652
660
|
{
|
|
@@ -678,7 +686,7 @@ bool LockAnalysis::isInSameCSSpan(const CxtStmt& cxtStmt1, const CxtStmt& cxtStm
|
|
|
678
686
|
/*!
|
|
679
687
|
* Return true if two instructions are inside at least one common context-sensitive lock span
|
|
680
688
|
*/
|
|
681
|
-
bool LockAnalysis::isInSameCSSpan(const
|
|
689
|
+
bool LockAnalysis::isInSameCSSpan(const ICFGNode *I1, const ICFGNode *I2) const
|
|
682
690
|
{
|
|
683
691
|
if(!hasCxtStmtfromInst(I1) || !hasCxtStmtfromInst(I2))
|
|
684
692
|
return false;
|