Skip to content

Commit 1e88885

Browse files
committed
small update
1 parent bc56e8b commit 1e88885

2 files changed

Lines changed: 45 additions & 43 deletions

File tree

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

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -748,29 +748,6 @@ class IDEInstInteractionAnalysisT
748748
// Overrides at store instructions
749749
if (const auto *Store = llvm::dyn_cast<llvm::StoreInst>(Curr)) {
750750
if (SyntacticAnalysisOnly) {
751-
//
752-
// x --> y
753-
//
754-
// Edge function:
755-
//
756-
// x
757-
// \
758-
// store x y \ \x.{ commit of('store x y') }
759-
// v
760-
// y
761-
//
762-
if (CurrNode == Store->getValueOperand() &&
763-
SuccNode == Store->getPointerOperand()) {
764-
LOG_IF_ENABLE([&]() {
765-
BOOST_LOG_SEV(lg::get(), DFADEBUG) << "Var-Override: ";
766-
for (const auto &EF : EdgeFacts) {
767-
BOOST_LOG_SEV(lg::get(), DFADEBUG) << EF << ", ";
768-
}
769-
BOOST_LOG_SEV(lg::get(), DFADEBUG)
770-
<< "at '" << llvmIRToString(Curr) << "'\n";
771-
}());
772-
return IIAAAddLabelsEF::createEdgeFunction(UserEdgeFacts);
773-
}
774751
// Kill all labels that are propagated along the edge of the value that
775752
// is overridden.
776753
//
@@ -814,6 +791,29 @@ class IDEInstInteractionAnalysisT
814791
}
815792
return IIAAKillOrReplaceEF::createEdgeFunction(UserEdgeFacts);
816793
}
794+
//
795+
// x --> y
796+
//
797+
// Edge function:
798+
//
799+
// x
800+
// \
801+
// store x y \ \x.{ commit of('store x y') }
802+
// v
803+
// y
804+
//
805+
if (CurrNode == Store->getValueOperand() &&
806+
SuccNode == Store->getPointerOperand()) {
807+
LOG_IF_ENABLE([&]() {
808+
BOOST_LOG_SEV(lg::get(), DFADEBUG) << "Var-Override: ";
809+
for (const auto &EF : EdgeFacts) {
810+
BOOST_LOG_SEV(lg::get(), DFADEBUG) << EF << ", ";
811+
}
812+
BOOST_LOG_SEV(lg::get(), DFADEBUG)
813+
<< "at '" << llvmIRToString(Curr) << "'\n";
814+
}());
815+
return IIAAAddLabelsEF::createEdgeFunction(UserEdgeFacts);
816+
}
817817
} else {
818818
// Use points-to information to find all possible overriding edges.
819819

@@ -840,6 +840,24 @@ class IDEInstInteractionAnalysisT
840840
Store->getPointerOperand() == CurrNode)) {
841841
return IIAAKillOrReplaceEF::createEdgeFunction(UserEdgeFacts);
842842
}
843+
// Kill all labels that are propagated along the edge of the
844+
// value/values that is/are overridden.
845+
//
846+
// y --> y
847+
//
848+
// Edge function:
849+
//
850+
// y
851+
// |
852+
// store x y | \x.{}
853+
// v
854+
// y
855+
//
856+
if (CurrNode == SuccNode && this->PT->isInReachableAllocationSites(
857+
Store->getPointerOperand(), CurrNode,
858+
OnlyConsiderLocalAliases)) {
859+
return IIAAKillOrReplaceEF::createEdgeFunction(BitVectorSet<e_t>());
860+
}
843861
// Overriding edge: obtain labels from value to be stored (and may add
844862
// UserEdgeFacts, if any).
845863
//
@@ -865,24 +883,6 @@ class IDEInstInteractionAnalysisT
865883
OnlyConsiderLocalAliases)) {
866884
return IIAAAddLabelsEF::createEdgeFunction(UserEdgeFacts);
867885
}
868-
// Kill all labels that are propagated along the edge of the
869-
// value/values that is/are overridden.
870-
//
871-
// y --> y
872-
//
873-
// Edge function:
874-
//
875-
// y
876-
// |
877-
// store x y | \x.{}
878-
// v
879-
// y
880-
//
881-
if (CurrNode == SuccNode && this->PT->isInReachableAllocationSites(
882-
Store->getPointerOperand(), CurrNode,
883-
OnlyConsiderLocalAliases)) {
884-
return IIAAKillOrReplaceEF::createEdgeFunction(BitVectorSet<e_t>());
885-
}
886886
}
887887
}
888888
// Handle edge functions for general instructions.

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;

0 commit comments

Comments
 (0)