Skip to content

Commit 36445a6

Browse files
authored
Merge pull request #488 from secure-software-engineering/f-IIAAnalysisFixes
F iia analysis fixes
2 parents 384f55f + 171f1eb commit 36445a6

8 files changed

Lines changed: 473 additions & 366 deletions

File tree

.clang-tidy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ CheckOptions:
5151
- key: readability-identifier-naming.VariableCase
5252
value: CamelCase
5353
- key: readability-identifier-naming.VariableIgnoredRegexp
54-
value: (c|d|d1|d2|d3|d4|d5|d5_restoredCtx|eP|f|f3|f4|f5|fCalleeSummary|g|n|dPrime|fPrime)
54+
value: (c|d|d1|d2|d3|d4|d5|d5_restoredCtx|eP|f|f3|f4|f5|fCalleeSummary|g|n|nPrime|dPrime|fPrime)
5555
- key: readability-identifier-naming.ParameterIgnoredRegexp
5656
value: (d|d1|d2|d3|d4|d5|eP|f|n)
5757
- key: readability-identifier-naming.FunctionIgnoredRegexp
58-
value: (try_emplace|from_json|to_json)
58+
value: (try_emplace|from_json|to_json|equal_to)
5959
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
6060
value: 1
6161
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEInstInteractionAnalysis.h

Lines changed: 349 additions & 285 deletions
Large diffs are not rendered by default.

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/TypeStateDescriptions/OpenSSLEVPKDFCTXDescription.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ class OpenSSLEVPKDFCTXDescription : public TypeStateDescription {
8080
IDESolver<IDETypeStateAnalysisDomain> &KDFAnalysisResults)
8181
: KDFAnalysisResults(KDFAnalysisResults) {}
8282

83-
[[nodiscard]] bool isFactoryFunction(const std::string &FuncName) const override;
84-
[[nodiscard]] bool isConsumingFunction(const std::string &FuncName) const override;
83+
[[nodiscard]] bool
84+
isFactoryFunction(const std::string &FuncName) const override;
85+
[[nodiscard]] bool
86+
isConsumingFunction(const std::string &FuncName) const override;
8587
[[nodiscard]] bool isAPIFunction(const std::string &FuncName) const override;
8688
[[nodiscard]] TypeStateDescription::State
8789
getNextState(std::string Tok, TypeStateDescription::State S) const override;

include/phasar/PhasarLLVM/DataFlowSolver/IfdsIde/Solver/IDESolver.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -682,30 +682,30 @@ class IDESolver
682682
n_t n = Edge.getTarget();
683683
d_t d2 = Edge.factAtTarget();
684684
EdgeFunctionPtrType f = jumpFunction(Edge);
685-
for (const auto Fn : ICF->getSuccsOf(n)) {
685+
for (const auto nPrime : ICF->getSuccsOf(n)) {
686686
FlowFunctionPtrType FlowFunc =
687-
CachedFlowEdgeFunctions.getNormalFlowFunction(n, Fn);
687+
CachedFlowEdgeFunctions.getNormalFlowFunction(n, nPrime);
688688
INC_COUNTER("FF Queries", 1, PAMM_SEVERITY_LEVEL::Full);
689689
const container_type Res = computeNormalFlowFunction(FlowFunc, d1, d2);
690690
ADD_TO_HISTOGRAM("Data-flow facts", res.size(), 1,
691691
PAMM_SEVERITY_LEVEL::Full);
692-
saveEdges(n, Fn, d2, Res, false);
692+
saveEdges(n, nPrime, d2, Res, false);
693693
for (d_t d3 : Res) {
694694
EdgeFunctionPtrType g =
695-
CachedFlowEdgeFunctions.getNormalEdgeFunction(n, d2, Fn, d3);
695+
CachedFlowEdgeFunctions.getNormalEdgeFunction(n, d2, nPrime, d3);
696696
LOG_IF_ENABLE(BOOST_LOG_SEV(lg::get(), DEBUG)
697697
<< "Queried Normal Edge Function: " << g->str());
698698
EdgeFunctionPtrType fPrime = f->composeWith(g);
699699
if (SolverConfig.emitESG()) {
700-
IntermediateEdgeFunctions[std::make_tuple(n, d2, Fn, d3)].push_back(
701-
g);
700+
IntermediateEdgeFunctions[std::make_tuple(n, d2, nPrime, d3)]
701+
.push_back(g);
702702
}
703703
LOG_IF_ENABLE(BOOST_LOG_SEV(lg::get(), DEBUG)
704704
<< "Compose: " << g->str() << " * " << f->str()
705705
<< " = " << fPrime->str();
706706
BOOST_LOG_SEV(lg::get(), DEBUG) << ' ');
707707
INC_COUNTER("EF Queries", 1, PAMM_SEVERITY_LEVEL::Full);
708-
propagate(d1, Fn, d3, fPrime, nullptr, false);
708+
propagate(d1, nPrime, d3, fPrime, nullptr, false);
709709
}
710710
}
711711
}

test/llvm_test_code/inst_interaction/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ set(Sources
1818
global_01.cpp
1919
global_02.cpp
2020
heap_01.cpp
21-
KillTest.cpp
21+
KillTest_01.cpp
22+
KillTest_02.cpp
2223
return_01.cpp
2324
rvo_01.cpp
2425
struct_01.cpp

test/llvm_test_code/inst_interaction/KillTest.cpp renamed to test/llvm_test_code/inst_interaction/KillTest_01.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ int main() {
44
int k = i;
55
j = 42;
66
return 0;
7-
}
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
int A = 42;
2+
int B;
3+
4+
void initB() { B = 21; }
5+
6+
int main() {
7+
int C = B;
8+
9+
initB();
10+
11+
return A + B + C;
12+
}

0 commit comments

Comments
 (0)