@@ -37,6 +43,19 @@ static SVal conjureOffsetSymbolOnLocation(
return Symbol;
}
+// Update the SVal bound to the Cast expression with the SVal
+// bound to the casted expression
+static ProgramStateRef updateStateAfterSimpleCast(StmtNodeBuilder& Bldr,
+
@@ -51,27 +47,29 @@ removeInformationStoredForDeadInstances(const CallEvent
,
}
template
-void handleConstructorAndAssignment(const CallEvent , CheckerContext ,
+bool handleConstructorAndAssignment(const CallEvent , CheckerContext ,
SVal
@@ -602,6 +619,37 @@ void ExprEngine::VisitDeclStmt(const DeclStmt *DS,
ExplodedNode *Pred,
ExplodedNode *UpdatedN = N;
SVal InitVal = state->getSVal(InitEx, LC);
+ // The call expression to which we have bound something is hidden behind
+ // an
@@ -681,6 +681,37 @@ ExprEngine::processRegionChanges(ProgramStateRef state,
LCtx, Call);
}
+ProgramStateRef
+ExprEngine::handleCastingBeforeEvalCall(ExplodedNode *Pred, const Expr *Ex,
+
@@ -355,4 +356,38 @@ void nonInlineFunctionCallPtr() {
char c = std::get (v); // no-warning
(void)a;
(void)c;
-}
\ No newline at end of file
+}
+
+////
+// std::swap for std::variant
@@ -37,6 +43,19 @@ static SVal conjureOffsetSymbolOnLocation(
return Symbol;
}
+// Update the SVal bound to the Cast expression with the SVal
+// bound to the casted expression
+static ProgramStateRef updateStateAfterSimpleCast(StmtNodeBuilder& Bldr,
@@ -206,23 +221,42 @@ class StdVariantChecker : public Checker {
if (!ThisMemRegion)
return;
+// Get the first type alternative of the std::variant instance.
+assert((ThisSVal.getType(C.getASTContext())->isPointerType() ||
+
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/87886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/NagyDonat commented:
Some additional remarks.
https://github.com/llvm/llvm-project/pull/87886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -206,23 +221,42 @@ class StdVariantChecker : public Checker {
if (!ThisMemRegion)
return;
+// Get the first type alternative of the std::variant instance.
+assert((ThisSVal.getType(C.getASTContext())->isPointerType() ||
+
@@ -2261,6 +2261,8 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
Bldr.takeNodes(Pred);
const auto *C = cast(S);
ExplodedNodeSet dstExpr;
+ // Point of interes: maybe my cast somehow will not get visited or will
NagyDonat
@@ -286,6 +332,21 @@ class StdVariantChecker : public Checker {
C.emitReport(std::move(R));
return true;
}
+
+ // TODO Implement modeling of std::variant's emplace method.
+ // Currently when this method call is encountered we just
+ // stop the modeling of that
@@ -206,23 +221,42 @@ class StdVariantChecker : public Checker {
if (!ThisMemRegion)
return;
+// Get the first type alternative of the std::variant instance.
+assert((ThisSVal.getType(C.getASTContext())->isPointerType() ||
+
@@ -231,16 +265,22 @@ class StdVariantChecker : public Checker {
// Get the mem region of the argument std::variant and look up the type
// information that we know about it.
const MemRegion *ArgMemRegion = Call.getArgSVal(0).getAsRegion();
-const QualType
https://github.com/NagyDonat edited
https://github.com/llvm/llvm-project/pull/87886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -51,27 +47,29 @@ removeInformationStoredForDeadInstances(const CallEvent
,
}
template
-void handleConstructorAndAssignment(const CallEvent , CheckerContext ,
+bool handleConstructorAndAssignment(const CallEvent , CheckerContext ,
SVal
@@ -265,16 +305,22 @@ class StdVariantChecker : public Checker {
}
QualType RetrievedCanonicalType = RetrievedType.getCanonicalType();
-QualType StoredCanonicalType = StoredType->getCanonicalType();
-if (RetrievedCanonicalType == StoredCanonicalType)
+
https://github.com/NagyDonat commented:
Thanks for working on this checker and improving its behavior!
I started a review of this commit, but I didn't get too far yet; I'll continue
reviewing on the next days. So far I read the code under `Checkers/`and added
some minor stylistic remarks, but
https://github.com/spaits edited https://github.com/llvm/llvm-project/pull/87886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff b5f2db940643af3837c77adde1dadb7208922211
b250e2db91515b33c427bfa1b9faf6f376010bf0 --
https://github.com/spaits edited https://github.com/llvm/llvm-project/pull/87886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spaits edited https://github.com/llvm/llvm-project/pull/87886
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
22 matches
Mail list logo