Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C++: Fix queries after shared guards#958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,7 +51,7 @@ class ExplicitComparison extends EffectivelyComparison, FinalComparisonOperation
override FunctionExpr getFunctionExpr() { result = funcExpr }
}

class ImplicitComparison extends EffectivelyComparison, GuardCondition {
class ImplicitComparison extends EffectivelyComparison, GuardConditioninstanceof Expr{
ImplicitComparison() {
this instanceof FunctionExpr and
not getParent() instanceof ComparisonOperation
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -78,8 +78,8 @@ predicate isUpperBoundEndCheckedIteratorAccess(IteratorSource source, ContainerI
basicBlockOfIteratorAccess.contains(it) and
//guard is comprised of end check and an iterator access
DataFlow::localFlow(DataFlow::exprNode(referenceToOnePassedTheEndElement),
DataFlow::exprNode(upperBoundCheck.getChild(_))) and
upperBoundCheck.getChild(_) = checkedIteratorAccess and
DataFlow::exprNode(upperBoundCheck.(Expr).getChild(_))) and
upperBoundCheck.(Expr).getChild(_) = checkedIteratorAccess and
//make sure its the same iterator being checked in the guard as accessed
checkedIteratorAccess.getOwningContainer() = it.getOwningContainer() and
//if its the end call itself (or its parts), make sure its the same container providing its end as giving the iterator
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ class NoThrowAllocExprWrapperFunction extends Function {
n.getEnclosingFunction() = this and
DataFlow::localExprFlow(n, any(ReturnStmt rs).getExpr()) and
// Not checked in this wrapper function
not exists(GuardCondition gc | DataFlow::localExprFlow(n, gc.getAChild*()))
not exists(GuardCondition gc | DataFlow::localExprFlow(n, gc.(Expr).getAChild*()))
}

/** Gets the underlying nothrow allocation ultimately being wrapped. */
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,7 +56,7 @@ query predicate problems(FunctionCall fc, string message) {
"vsnwprintf_s"
]) and
not exists(GuardCondition gc |
DataFlow::localFlow(DataFlow::exprNode(fc), DataFlow::exprNode(gc.getAChild*()))
DataFlow::localFlow(DataFlow::exprNode(fc), DataFlow::exprNode(gc.(Expr).getAChild*()))
) and
message = "Return value from " + fc.getTarget().getName() + " is not tested for errors."
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp