svf-tools 1.0.347 → 1.0.348
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/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +2 -1
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +73 -71
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +46 -45
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +275 -224
- package/SVF-doxygen/html/html/functions_func_i.html +13 -10
- package/SVF-doxygen/html/html/functions_i.html +13 -10
- package/SVF-doxygen/html/html/functions_o.html +3 -3
- package/SVF-doxygen/html/html/functions_p.html +9 -9
- package/SVF-doxygen/html/html/functions_r.html +8 -4
- package/SVF-doxygen/html/html/functions_s.html +6 -6
- package/SVF-doxygen/html/html/functions_t.html +3 -1
- package/SVF-doxygen/html/html/functions_v.html +6 -6
- package/SVF-doxygen/html/html/search/all_10.js +7 -7
- package/SVF-doxygen/html/html/search/all_12.js +2 -2
- package/SVF-doxygen/html/html/search/all_13.js +5 -5
- package/SVF-doxygen/html/html/search/all_14.js +4 -4
- package/SVF-doxygen/html/html/search/all_16.js +3 -3
- package/SVF-doxygen/html/html/search/all_9.js +2 -1
- package/SVF-doxygen/html/html/search/all_c.js +1 -1
- package/SVF-doxygen/html/html/search/all_d.js +2 -2
- package/SVF-doxygen/html/html/search/all_e.js +1 -1
- package/SVF-doxygen/html/html/search/all_f.js +1 -1
- package/SVF-doxygen/html/html/search/functions_8.js +1 -0
- package/SVF-doxygen/html/html/search/variables_14.js +2 -2
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/include/SVF-FE/SVFIRBuilder.h +3 -0
- package/lib/SVF-FE/SVFIRBuilder.cpp +66 -30
- package/package.json +1 -1
|
@@ -72,6 +72,7 @@ var searchData=
|
|
|
72
72
|
['inedgeend',['InEdgeEnd',['../classSVF_1_1GenericNode.html#afe6a7b286d9af4992f41b59612fd2900',1,'SVF::GenericNode::InEdgeEnd()'],['../classSVF_1_1GenericNode.html#a0118fbeb2b314dcdcb53c56a2a13ab07',1,'SVF::GenericNode::InEdgeEnd() const']]],
|
|
73
73
|
['inedgekindtosetmap',['InEdgeKindToSetMap',['../classSVF_1_1SVFVar.html#a0d918a6c8dd3b7b395d4c7161bcf9656',1,'SVF::SVFVar']]],
|
|
74
74
|
['inedges',['InEdges',['../classSVF_1_1GenericNode.html#a24971168130222400d9aa5f03610bff5',1,'SVF::GenericNode']]],
|
|
75
|
+
['inferfieldidxfrombyteoffset',['inferFieldIdxFromByteOffset',['../classSVF_1_1SVFIRBuilder.html#a0a45cfcf052feef11a716c4ed3d49406',1,'SVF::SVFIRBuilder']]],
|
|
75
76
|
['inferfromcallgraph',['inferFromCallGraph',['../classSVF_1_1PCG.html#adff1702e1b0a902de7ded742846fe137',1,'SVF::PCG']]],
|
|
76
77
|
['infilter',['inFilter',['../classSVF_1_1LockResultValidator.html#a445dbda778198acac87fbbfa029b0dfb',1,'SVF::LockResultValidator']]],
|
|
77
78
|
['info',['info',['../classSVF_1_1ExtAPI.html#a21b103f723d914a95fd0eef28551a3ca',1,'SVF::ExtAPI']]],
|
|
@@ -107,7 +108,7 @@ var searchData=
|
|
|
107
108
|
['insertphi',['insertPHI',['../classSVF_1_1MemSSA.html#acc6f72d96cf29e36093ba08ea86b8983',1,'SVF::MemSSA']]],
|
|
108
109
|
['insertvalueinst',['InsertValueInst',['../namespaceSVF.html#a485b10fc29e76fdb6f31a56ebbde8f24',1,'SVF']]],
|
|
109
110
|
['inst',['inst',['../classSVF_1_1IntraICFGNode.html#ac160eae9228d5b6627a6ca74da0b03e4',1,'SVF::IntraICFGNode::inst()'],['../classSVF_1_1CallPE.html#a60e8280eb3e77e67e3dfa4dcee943edf',1,'SVF::CallPE::inst()'],['../classSVF_1_1RetPE.html#a028363b55fa19897a93f1c78ec905723',1,'SVF::RetPE::inst()'],['../classSVF_1_1LoadMU.html#a7bbac3ff5455aa1340f348c7cb239c46',1,'SVF::LoadMU::inst()'],['../classSVF_1_1StoreCHI.html#a6e58e7cde1f417ec3feaef98f6f74be2',1,'SVF::StoreCHI::inst()'],['../classSVF_1_1CxtStmt.html#a237b8738885e57d5a9b984221f611567',1,'SVF::CxtStmt::inst()']]],
|
|
110
|
-
['inst2labelmap',['
|
|
111
|
+
['inst2labelmap',['inst2LabelMap',['../classSVF_1_1SVFStmt.html#abb83549118bcd7216a053d82f7180d1c',1,'SVF::SVFStmt::inst2LabelMap()'],['../classSVF_1_1SVFStmt.html#a5a3db6b1335b4adc55b961a6f480f228',1,'SVF::SVFStmt::Inst2LabelMap()']]],
|
|
111
112
|
['inst_5fiterator',['inst_iterator',['../namespaceSVF.html#a255af6ff30782cb9a548feadb0fe7d6b',1,'SVF']]],
|
|
112
113
|
['instance',['INSTANCE',['../classSVF_1_1DCHEdge.html#a9ab4cd83d9ee475d3d8445cd91839726a3e807b4caeb170c5cd1e855ac1a92d77',1,'SVF::DCHEdge']]],
|
|
113
114
|
['instantce',['INSTANTCE',['../classSVF_1_1CHEdge.html#a26280c3b724551036f7e3ba2b5922676a8721eaefd547d6ba5229463d644815f4',1,'SVF::CHEdge']]],
|
|
@@ -85,7 +85,7 @@ var searchData=
|
|
|
85
85
|
['lockset',['LockSet',['../classSVF_1_1LockAnalysis.html#a4bde0f39a6b5cf83e0011d7ef272c685',1,'SVF::LockAnalysis']]],
|
|
86
86
|
['locksites',['locksites',['../classSVF_1_1LockAnalysis.html#a87c412a54f48e5314454cd1d44ef9b0e',1,'SVF::LockAnalysis']]],
|
|
87
87
|
['locksitetolockset',['LockSiteToLockSet',['../classSVF_1_1LockAnalysis.html#a1f9ae41c4ed7450d0d8b29cd20a6ef25',1,'SVF::LockAnalysis']]],
|
|
88
|
-
['lockspan',['
|
|
88
|
+
['lockspan',['LockSpan',['../classSVF_1_1LockAnalysis.html#a07b7d49e1fbe3e5dc694b6aadbee05b8',1,'SVF::LockAnalysis::LockSpan()'],['../classSVF_1_1MHP.html#a08ba219ec02b07b1bbd91a88ebb4acd7',1,'SVF::MHP::LockSpan()'],['../classSVF_1_1SVFGNodeLockSpan.html#a762505799b9257bbcb766fccdce40fd4',1,'SVF::SVFGNodeLockSpan::lockSpan()']]],
|
|
89
89
|
['locktime',['lockTime',['../classSVF_1_1LockAnalysis.html#adadee129c04b82576b4ca3c7594cdcb2',1,'SVF::LockAnalysis']]],
|
|
90
90
|
['lockvalid',['LockValid',['../classSVF_1_1Options.html#a78b3b44f2c0dc94dc1363ca57ee76d66',1,'SVF::Options']]],
|
|
91
91
|
['locmemmodel',['LocMemModel',['../classSVF_1_1Options.html#aba8e13f8bb26cf6a0718282e6f9a1940',1,'SVF::Options']]],
|
|
@@ -36,7 +36,7 @@ var searchData=
|
|
|
36
36
|
['maxcachehard',['maxCacheHard',['../structDdManager.html#a1b53bee9cf86fc1131c420c2aef7e473',1,'DdManager']]],
|
|
37
37
|
['maxcontextlen',['MaxContextLen',['../classSVF_1_1Options.html#a2e53156bd075d7802d390672f129c6a8',1,'SVF::Options']]],
|
|
38
38
|
['maxcxtsize',['MaxCxtSize',['../classSVF_1_1TCT.html#aaae41663b1d1f4d38b047c50c156defb',1,'SVF::TCT']]],
|
|
39
|
-
['maxfieldlimit',['
|
|
39
|
+
['maxfieldlimit',['MaxFieldLimit',['../classSVF_1_1Options.html#adfc1a5c6098d3867e29fc65ca9ffa1cc',1,'SVF::Options::MaxFieldLimit()'],['../classSVF_1_1SymbolTableInfo.html#a9b8b7ecb217c7395025231b04e7b4c26',1,'SVF::SymbolTableInfo::maxFieldLimit()'],['../classSVF_1_1StInfo.html#a4cd926bd095254dd287f1cf26e02483e',1,'SVF::StInfo::maxFieldLimit()']]],
|
|
40
40
|
['maxgen_5fratio',['MAXGEN_RATIO',['../cuddInt_8c.html#ad06617a840460570896838fbc917b0f2',1,'cuddInt.c']]],
|
|
41
41
|
['maxgrowth',['maxGrowth',['../structDdManager.html#a8a6a4238d1bc8a87eabd2c3eabd233d7',1,'DdManager']]],
|
|
42
42
|
['maxgrowthalt',['maxGrowthAlt',['../structDdManager.html#a2926e48e488cec20a61e9b0dc6b91795',1,'DdManager']]],
|
|
@@ -125,7 +125,7 @@ var searchData=
|
|
|
125
125
|
['metasame',['metaSame',['../classSVF_1_1PointsTo.html#aa1e773b7abda97441d6ffe39c668d4ec',1,'SVF::PointsTo']]],
|
|
126
126
|
['metedges',['metEdges',['../classSVF_1_1AndersenLCD.html#a501ff7f8648c735c4a896063128d9ccc',1,'SVF::AndersenLCD']]],
|
|
127
127
|
['mfspta',['mfspta',['../classSVF_1_1FSMPTA.html#af248a80855457ca9e5a7208c114681bb',1,'SVF::FSMPTA']]],
|
|
128
|
-
['mhp',['MHP',['../classSVF_1_1MHP.html',1,'SVF::MHP'],['../
|
|
128
|
+
['mhp',['MHP',['../classSVF_1_1MHP.html',1,'SVF::MHP'],['../classSVF_1_1MTASVFGBuilder.html#a73024bf30aa3ec79e5953a7ea1f8feb7',1,'SVF::MTASVFGBuilder::mhp()'],['../classSVF_1_1FSMPTA.html#aa8dcd130d4b9283fc6b903de8e4ad830',1,'SVF::FSMPTA::mhp()'],['../classSVF_1_1MTAAnnotator.html#a94d7a3fd9166126c052fca28f9a4c825',1,'SVF::MTAAnnotator::mhp()'],['../classSVF_1_1MTAResultValidator.html#a6b3592525d5275d583c0726744d1f857',1,'SVF::MTAResultValidator::mhp()'],['../classSVF_1_1MHPValidator.html#ad6e417ad7f0b1b399822eaa62d83341d',1,'SVF::MHPValidator::mhp()'],['../classSVF_1_1MHP.html#abf1f5a7c365dfb95b42015b7b2ad6fbe',1,'SVF::MHP::MHP()']]],
|
|
129
129
|
['mhp_2ecpp',['MHP.cpp',['../MHP_8cpp.html',1,'']]],
|
|
130
130
|
['mhp_2eh',['MHP.h',['../MHP_8h.html',1,'']]],
|
|
131
131
|
['mhpfuns',['mhpfuns',['../classSVF_1_1PCG.html#a96f91b051a8035b614e015bf4d5081e0',1,'SVF::PCG']]],
|
|
@@ -20,7 +20,7 @@ var searchData=
|
|
|
20
20
|
['nextsetindex',['nextSetIndex',['../classSVF_1_1CoreBitVector.html#a087f69adea5e9e83bd908a1ab0ee1383',1,'SVF::CoreBitVector']]],
|
|
21
21
|
['nil',['NIL',['../util_8h.html#a31bfee01545b78af63301bf9e857218b',1,'util.h']]],
|
|
22
22
|
['no_5fstruct_5falloc',['no_struct_alloc',['../classSVF_1_1ExtAPI.html#a235ef40373e36583004eb6d289ce63f9',1,'SVF::ExtAPI']]],
|
|
23
|
-
['node',['
|
|
23
|
+
['node',['Node',['../classSVF_1_1List.html#a4eba65b40d347ea80e2427320eb9c5a1',1,'SVF::List::Node()'],['../classSVF_1_1SCCDetection.html#a6458c27c625add944fcb8a3ef7b536a6',1,'SVF::SCCDetection::Node()'],['../classSVF_1_1WPASolver.html#a5fd488d74e04aa9e66ca4eb42c6dbbf4',1,'SVF::WPASolver::Node()'],['../structDdGen.html#a7678908601787fa2d5ce4bccdd004ffb',1,'DdGen::node()'],['../classSVF_1_1NullPtrVFGNode.html#adef43dcc86e61145a7fdc6711b28239d',1,'SVF::NullPtrVFGNode::node()']]],
|
|
24
24
|
['node_5findex',['Node_Index',['../classSVF_1_1SCCDetection.html#a5fa111bb849052b8a753194cd0cd5e0c',1,'SVF::SCCDetection::Node_Index()'],['../classSVF_1_1WPASolver.html#a01450e1475679d093413e6496c198fc0',1,'SVF::WPASolver::Node_Index()']]],
|
|
25
25
|
['node_5fiterator',['node_iterator',['../classSVF_1_1CFLSolver.html#a586cfb2dd110d1853e70e534e0f66624',1,'SVF::CFLSolver::node_iterator()'],['../classSVF_1_1SCCDetection.html#abaf75ef45e8f5349b902dab063999ad8',1,'SVF::SCCDetection::node_iterator()']]],
|
|
26
26
|
['nodeallocstrat',['NodeAllocStrat',['../classSVF_1_1Options.html#a2537be131132830c63d408133619a065',1,'SVF::Options']]],
|
|
@@ -47,7 +47,7 @@ var searchData=
|
|
|
47
47
|
['operator_5b_5d',['operator[]',['../classSVF_1_1ContextCond.html#a62cc1c7c01d454e9cbebd3f7f5f3aa1f',1,'SVF::ContextCond']]],
|
|
48
48
|
['operator_7c',['operator|',['../namespaceSVF.html#aa01b96d5bc6c3930b0bfca789acf75c4',1,'SVF']]],
|
|
49
49
|
['operator_7c_3d',['operator|=',['../classSVF_1_1CondStdSet.html#a90e4c4ead1cbdca01c0be801a68b005b',1,'SVF::CondStdSet::operator|=()'],['../classSVF_1_1CondPointsToSet.html#a74c50cfaf788a828a4fc97eba703ec4e',1,'SVF::CondPointsToSet::operator|=()'],['../classSVF_1_1PointsTo.html#aa8644057ec182382e3c34e90d7d61ade',1,'SVF::PointsTo::operator|=(const PointsTo &rhs)'],['../classSVF_1_1PointsTo.html#a687b34cac3c43dd957b86a4833a24871',1,'SVF::PointsTo::operator|=(const NodeBS &rhs)'],['../classSVF_1_1CoreBitVector.html#af8e63360242a49fb63c3ef3d7071503d',1,'SVF::CoreBitVector::operator|=()']]],
|
|
50
|
-
['opincomingbbs',['
|
|
50
|
+
['opincomingbbs',['OPIncomingBBs',['../classSVF_1_1IntraPHIVFGNode.html#a66928f6cc755bd2a048804d00f859a80',1,'SVF::IntraPHIVFGNode::OPIncomingBBs()'],['../classSVF_1_1IntraPHIVFGNode.html#a73f39a488ad82300010abd18afe247a4',1,'SVF::IntraPHIVFGNode::opIncomingBBs()']]],
|
|
51
51
|
['opit',['OpIt',['../classllvm_1_1generic__bridge__gep__type__iterator.html#aa3fd4dca27e09df9ee726879624ae47e',1,'llvm::generic_bridge_gep_type_iterator']]],
|
|
52
52
|
['oppts',['opPts',['../classSVF_1_1PersistentPointsToCache.html#ac7865b3ea1d76d2c522b465cc8e86639',1,'SVF::PersistentPointsToCache']]],
|
|
53
53
|
['options',['Options',['../classSVF_1_1Options.html',1,'SVF::Options'],['../classSVF_1_1Options.html#a08c25694f8f9e31eb8b116ad58c1c078',1,'SVF::Options::Options()']]],
|
|
@@ -29,6 +29,7 @@ var searchData=
|
|
|
29
29
|
['indvfedgestart',['indVFEdgeStart',['../classSVF_1_1SVFGStat.html#adcb30427bb220dc122ad22030e10eb21',1,'SVF::SVFGStat']]],
|
|
30
30
|
['inedgebegin',['InEdgeBegin',['../classSVF_1_1GenericNode.html#ae5b113921530eee6afe58a65d8e5b3a7',1,'SVF::GenericNode::InEdgeBegin()'],['../classSVF_1_1GenericNode.html#a7c0ff80b1c0ae8b76fc620f21495ca39',1,'SVF::GenericNode::InEdgeBegin() const']]],
|
|
31
31
|
['inedgeend',['InEdgeEnd',['../classSVF_1_1GenericNode.html#afe6a7b286d9af4992f41b59612fd2900',1,'SVF::GenericNode::InEdgeEnd()'],['../classSVF_1_1GenericNode.html#a0118fbeb2b314dcdcb53c56a2a13ab07',1,'SVF::GenericNode::InEdgeEnd() const']]],
|
|
32
|
+
['inferfieldidxfrombyteoffset',['inferFieldIdxFromByteOffset',['../classSVF_1_1SVFIRBuilder.html#a0a45cfcf052feef11a716c4ed3d49406',1,'SVF::SVFIRBuilder']]],
|
|
32
33
|
['inferfromcallgraph',['inferFromCallGraph',['../classSVF_1_1PCG.html#adff1702e1b0a902de7ded742846fe137',1,'SVF::PCG']]],
|
|
33
34
|
['infilter',['inFilter',['../classSVF_1_1LockResultValidator.html#a445dbda778198acac87fbbfa029b0dfb',1,'SVF::LockResultValidator']]],
|
|
34
35
|
['inforwardslice',['inForwardSlice',['../classSVF_1_1SVFGStat.html#adc6a5c3e430bdf942f1462e101ac6917',1,'SVF::SVFGStat::inForwardSlice()'],['../classSVF_1_1ProgSlice.html#a5a4b7f34001cc90f9b60222caee1bde6',1,'SVF::ProgSlice::inForwardSlice()']]],
|
|
@@ -25,9 +25,9 @@ var searchData=
|
|
|
25
25
|
['tid',['tid',['../classSVF_1_1CxtThreadStmt.html#ad96bacc3de1ce576ad397d19aa99a269',1,'SVF::CxtThreadStmt::tid()'],['../classSVF_1_1CxtThreadProc.html#a99b24e1be2bfb49569532c2c28c68969',1,'SVF::CxtThreadProc::tid()']]],
|
|
26
26
|
['timelimit',['timeLimit',['../structDdManager.html#a6c14f932c4a66c6234e6b19bd8b6647f',1,'DdManager']]],
|
|
27
27
|
['timeofcollapse',['timeOfCollapse',['../classSVF_1_1AndersenBase.html#ad40b196c2c699bd115529b806d20de25',1,'SVF::AndersenBase']]],
|
|
28
|
-
['timeofcreatemuchi',['
|
|
28
|
+
['timeofcreatemuchi',['TimeOfCreateMUCHI',['../classSVF_1_1MemSSAStat.html#a48c70f0ed1c7d031a3cd528035162e52',1,'SVF::MemSSAStat::TimeOfCreateMUCHI()'],['../classSVF_1_1MemSSA.html#a4d2418b7df74f23d8fd328f66e29f198',1,'SVF::MemSSA::timeOfCreateMUCHI()']]],
|
|
29
29
|
['timeofgeneratingmemregions',['TimeOfGeneratingMemRegions',['../classSVF_1_1MemSSAStat.html#a74c36654b7452aa94aa241881f0a83c5',1,'SVF::MemSSAStat::TimeOfGeneratingMemRegions()'],['../classSVF_1_1MemSSA.html#a37dca8a7d155de4870358146d219b5e5',1,'SVF::MemSSA::timeOfGeneratingMemRegions()']]],
|
|
30
|
-
['timeofinsertingphi',['
|
|
30
|
+
['timeofinsertingphi',['timeOfInsertingPHI',['../classSVF_1_1MemSSA.html#a3c7b5fa73fdc7c805ee3673fbe812b44',1,'SVF::MemSSA::timeOfInsertingPHI()'],['../classSVF_1_1MemSSAStat.html#a0c24822c8549af6a96e82312954fab9b',1,'SVF::MemSSAStat::TimeOfInsertingPHI()']]],
|
|
31
31
|
['timeofprocesscopygep',['timeOfProcessCopyGep',['../classSVF_1_1AndersenBase.html#aae14de6fbca9280d8d0290326aa493f0',1,'SVF::AndersenBase']]],
|
|
32
32
|
['timeofprocessloadstore',['timeOfProcessLoadStore',['../classSVF_1_1AndersenBase.html#a9fe738f1e11c80006d540f246a80bfdf',1,'SVF::AndersenBase']]],
|
|
33
33
|
['timeofsccdetection',['timeOfSCCDetection',['../classSVF_1_1AndersenBase.html#a6b7d0e57f741c446d0bf178939960143',1,'SVF::AndersenBase']]],
|
|
@@ -17,7 +17,7 @@ var searchData=
|
|
|
17
17
|
['maxcachehard',['maxCacheHard',['../structDdManager.html#a1b53bee9cf86fc1131c420c2aef7e473',1,'DdManager']]],
|
|
18
18
|
['maxcontextlen',['MaxContextLen',['../classSVF_1_1Options.html#a2e53156bd075d7802d390672f129c6a8',1,'SVF::Options']]],
|
|
19
19
|
['maxcxtsize',['MaxCxtSize',['../classSVF_1_1TCT.html#aaae41663b1d1f4d38b047c50c156defb',1,'SVF::TCT']]],
|
|
20
|
-
['maxfieldlimit',['
|
|
20
|
+
['maxfieldlimit',['MaxFieldLimit',['../classSVF_1_1Options.html#adfc1a5c6098d3867e29fc65ca9ffa1cc',1,'SVF::Options::MaxFieldLimit()'],['../classSVF_1_1SymbolTableInfo.html#a9b8b7ecb217c7395025231b04e7b4c26',1,'SVF::SymbolTableInfo::maxFieldLimit()'],['../classSVF_1_1StInfo.html#a4cd926bd095254dd287f1cf26e02483e',1,'SVF::StInfo::maxFieldLimit()']]],
|
|
21
21
|
['maxgrowth',['maxGrowth',['../structDdManager.html#a8a6a4238d1bc8a87eabd2c3eabd233d7',1,'DdManager']]],
|
|
22
22
|
['maxgrowthalt',['maxGrowthAlt',['../structDdManager.html#a2926e48e488cec20a61e9b0dc6b91795',1,'DdManager']]],
|
|
23
23
|
['maximumbudget',['maximumBudget',['../classSVF_1_1DPItem.html#a5dbb0e6010b38c5b937ff06cb40cd0ef',1,'SVF::DPItem']]],
|
|
@@ -121,6 +121,9 @@ public:
|
|
|
121
121
|
/// Process constant expression
|
|
122
122
|
void processCE(const Value *val);
|
|
123
123
|
|
|
124
|
+
/// Infer field index from byteoffset.
|
|
125
|
+
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, Size_t idx);
|
|
126
|
+
|
|
124
127
|
/// Compute offset of a gep instruction or gep constant expression
|
|
125
128
|
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
126
129
|
|
|
@@ -209,6 +209,44 @@ void SVFIRBuilder::initialiseNodes()
|
|
|
209
209
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
/*
|
|
213
|
+
Handling single value types, for constant index, including pointer, integer, etc
|
|
214
|
+
e.g. field_idx = getelementptr i8, %i8* %p, i64 -4
|
|
215
|
+
We can obtain the field index by inferring the byteoffset if %p is casted from a pointer to a struct
|
|
216
|
+
*/
|
|
217
|
+
u32_t SVFIRBuilder::inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, Size_t idx){
|
|
218
|
+
auto srcptr = gepOp->getOperand(0);
|
|
219
|
+
llvm::BitCastOperator* castop1 = SVFUtil::dyn_cast<llvm::BitCastOperator>(srcptr);
|
|
220
|
+
Type* sttype = nullptr;
|
|
221
|
+
if(castop1 && castop1->getSrcTy()->isPointerTy() && castop1->getSrcTy()->getPointerElementType()->isStructTy()){
|
|
222
|
+
sttype = castop1->getSrcTy()->getPointerElementType();
|
|
223
|
+
}
|
|
224
|
+
else
|
|
225
|
+
{
|
|
226
|
+
for(auto user : srcptr->users()){
|
|
227
|
+
if(SVFUtil::isa<llvm::BitCastOperator>(user)){
|
|
228
|
+
llvm::BitCastOperator* castop2 = SVFUtil::dyn_cast<llvm::BitCastOperator>(user);
|
|
229
|
+
if(castop2 && castop2->getDestTy()->isPointerTy() && castop2->getDestTy()->getPointerElementType()->isStructTy()){
|
|
230
|
+
sttype = castop2->getDestTy()->getPointerElementType();
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if(sttype){
|
|
237
|
+
// Case 1: Access a field of a struct (which is not ANSI-compliant)
|
|
238
|
+
// Case 2: A pointer-arithematic
|
|
239
|
+
// Since this is a field-index based memory model, for both cases, we set field-index to 0, but we set constant offset to byte offset
|
|
240
|
+
// We conside the whole array of object as one element for field-sensitive analysis, but byteoffset can be used for handling pointer arithematic
|
|
241
|
+
// (This handling is unsound since the program itself is not ANSI-compliant)
|
|
242
|
+
const llvm::StructLayout* stdl = dl->getStructLayout(SVFUtil::dyn_cast<StructType>(sttype));
|
|
243
|
+
return stdl->getElementContainingOffset(idx);
|
|
244
|
+
}else{
|
|
245
|
+
// Case 2: This operation is likely accessing an array through pointer p.
|
|
246
|
+
return 0;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
212
250
|
/*!
|
|
213
251
|
* Return the object node offset according to GEP insn (V).
|
|
214
252
|
* Given a gep edge p = q + i, if "i" is a constant then we return its offset size
|
|
@@ -231,53 +269,51 @@ bool SVFIRBuilder::computeGepOffset(const User *V, LocationSet& ls)
|
|
|
231
269
|
gi != ge; ++gi)
|
|
232
270
|
{
|
|
233
271
|
ls.addOffsetValue(gi.getOperand());
|
|
272
|
+
|
|
234
273
|
// Handling array types, skipe array handling here
|
|
235
|
-
// We treat whole array as one,
|
|
274
|
+
// We treat whole array as one, but we can distinguish different field of an array of struct
|
|
236
275
|
// e.g. s[1].f1 is differet from s[0].f2
|
|
237
276
|
if(SVFUtil::isa<ArrayType>(*gi))
|
|
238
277
|
continue;
|
|
239
278
|
|
|
240
|
-
//The int
|
|
241
|
-
// (may not be constant for arrays).
|
|
279
|
+
//The int value of the current index operand
|
|
242
280
|
ConstantInt *op = SVFUtil::dyn_cast<ConstantInt>(gi.getOperand());
|
|
243
|
-
|
|
244
|
-
/// given a gep edge p = q + i,
|
|
245
|
-
if(!op)
|
|
246
|
-
{
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
//The actual index
|
|
250
|
-
Size_t idx = op->getSExtValue();
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
// Handling pointer types
|
|
254
|
-
// These GEP instructions are simply making address computations from the base pointer address
|
|
255
|
-
// e.g. idx = (char*) &p + 4, at this case gep only one offset index (idx)
|
|
256
|
-
// Case 1: This operation is likely accessing an array through pointer p.
|
|
257
|
-
// Case 2: It may also be used to access a field of a struct (which is not ANSI-compliant)
|
|
258
|
-
// Since this is a field-index based memory model,
|
|
259
|
-
// for case 1: we consider the whole array as one element, This can be improved by LocMemModel as it can distinguish different
|
|
260
|
-
// elements of the same array.
|
|
261
|
-
// for case 2: we treat idx the same as &p by ignoring const 4 (This handling is unsound since the program itself is not ANSI-compliant).
|
|
262
|
-
if (SVFUtil::isa<PointerType>(*gi))
|
|
263
|
-
{
|
|
264
|
-
//off += idx;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
281
|
+
|
|
268
282
|
// Handling struct here
|
|
269
283
|
if (const StructType *ST = SVFUtil::dyn_cast<StructType>(*gi) )
|
|
270
284
|
{
|
|
271
|
-
|
|
285
|
+
// If the first operand is a non-constant, it is likely an array access
|
|
286
|
+
// (e.g., %ptr = getelementptr struct_A, %struct_A* %1, i64 %idx)
|
|
287
|
+
if(!op && op == gepOp->getOperand(1)){
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
assert(op && "non-const index in an operand in GEP");
|
|
291
|
+
//The actual index
|
|
292
|
+
Size_t idx = op->getSExtValue();
|
|
272
293
|
const vector<u32_t> &so = SymbolTableInfo::SymbolInfo()->getFlattenedFieldIdxVec(ST);
|
|
273
294
|
if ((unsigned)idx >= so.size())
|
|
274
295
|
{
|
|
275
296
|
outs() << "!! Struct index out of bounds" << idx << "\n";
|
|
276
297
|
assert(0);
|
|
277
298
|
}
|
|
278
|
-
//add the translated offset
|
|
299
|
+
// add the translated offset
|
|
279
300
|
ls.setFldIdx(ls.accumulateConstantFieldIdx() + so[idx]);
|
|
280
301
|
}
|
|
302
|
+
|
|
303
|
+
if ((*gi)->isSingleValueType())
|
|
304
|
+
{
|
|
305
|
+
if(!op){
|
|
306
|
+
// Handle non-constant index
|
|
307
|
+
// Given a gep edge p = q + idx, where idx is non-constant
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
// The actual index
|
|
311
|
+
Size_t idx = op->getSExtValue();
|
|
312
|
+
|
|
313
|
+
// infer the field offset based on the byte offset
|
|
314
|
+
u32_t fieldOffset = inferFieldIdxFromByteOffset(gepOp, dataLayout, ls, idx);
|
|
315
|
+
ls.setFldIdx(fieldOffset);
|
|
316
|
+
}
|
|
281
317
|
}
|
|
282
318
|
return true;
|
|
283
319
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.348",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|