Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff 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, GuardCondition instanceof Expr {
ImplicitComparison() {
this instanceof FunctionExpr and
not getParent() instanceof ComparisonOperation
Expand Down
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 number Diff line number Diff 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