Skip to content

Commit 4ea795b

Browse files
committed
Autoformat docs ql files
1 parent f4f4de3 commit 4ea795b

30 files changed

+66
-80
lines changed

docs/codeql/ql-training/query-examples/cpp/bad-overflow-guard-1.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ where
55
a.getAnOperand() = v.getAnAccess() and
66
cmp.getAnOperand() = a and
77
cmp.getAnOperand() = v.getAnAccess()
8-
select cmp, "Overflow check."
8+
select cmp, "Overflow check."

docs/codeql/ql-training/query-examples/cpp/bad-overflow-guard-2.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ where
66
cmp.getAnOperand() = a and
77
cmp.getAnOperand() = v.getAnAccess() and
88
forall(Expr op | op = a.getAnOperand() | isSmall(op))
9-
select cmp, "Bad overflow check."
9+
select cmp, "Bad overflow check."

docs/codeql/ql-training/query-examples/cpp/bad-overflow-guard-3.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ where
99
cmp.getAnOperand() = v.getAnAccess() and
1010
forall(Expr op | op = a.getAnOperand() | isSmall(op)) and
1111
not isSmall(a.getExplicitlyConverted())
12-
select cmp, "Bad overflow check"
12+
select cmp, "Bad overflow check"
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import cpp
2-
2+
33
from FunctionCall alloc, FunctionCall free, LocalScopeVariable v
4-
where allocationCall(alloc)
5-
and alloc = v.getAnAssignedValue()
6-
and freeCall(free, v.getAnAccess())
7-
and alloc.getASuccessor+() = free
4+
where
5+
allocationCall(alloc) and
6+
alloc = v.getAnAssignedValue() and
7+
freeCall(free, v.getAnAccess()) and
8+
alloc.getASuccessor+() = free
89
select alloc, free
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import cpp
2-
2+
33
from FunctionCall free, LocalScopeVariable v, VariableAccess u
4-
where freeCall(free, v.getAnAccess())
5-
and u = v.getAnAccess()
6-
and u.isRValue()
7-
and free.getASuccessor+() = u
8-
select free, u
4+
where
5+
freeCall(free, v.getAnAccess()) and
6+
u = v.getAnAccess() and
7+
u.isRValue() and
8+
free.getASuccessor+() = u
9+
select free, u

docs/codeql/ql-training/query-examples/cpp/control-flow-cpp-3.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ where
77
use = lv.getAnAccess() and
88
use = def.getASuccessor+()
99
)
10-
select lv, def
10+
select lv, def

docs/codeql/ql-training/query-examples/cpp/control-flow-cpp-4.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ predicate isReachable(BasicBlock bb) {
77

88
from BasicBlock bb
99
where not isReachable(bb)
10-
select bb
10+
select bb
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import cpp
22

3-
from ExprCall c, PointerDereferenceExpr deref, VariableAccess va,
4-
Access fnacc
5-
where c.getLocation().getFile().getBaseName() = "cjpeg.c" and
6-
c.getLocation().getStartLine() = 640 and
7-
deref = c.getExpr() and
8-
va = deref.getOperand() and
9-
fnacc = va.getTarget().getAnAssignedValue()
10-
select c, fnacc.getTarget()
3+
from ExprCall c, PointerDereferenceExpr deref, VariableAccess va, Access fnacc
4+
where
5+
c.getLocation().getFile().getBaseName() = "cjpeg.c" and
6+
c.getLocation().getStartLine() = 640 and
7+
deref = c.getExpr() and
8+
va = deref.getOperand() and
9+
fnacc = va.getTarget().getAnAssignedValue()
10+
select c, fnacc.getTarget()

docs/codeql/ql-training/query-examples/cpp/data-flow-cpp-1.ql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import cpp
22
import semmle.code.cpp.commons.Printf
33

44
from Call c, FormattingFunction ff, Expr format
5-
where c.getTarget() = ff and
6-
format = c.getArgument(ff.getFormatParameterIndex()) and
7-
not format instanceof StringLiteral
8-
select format, "Non-constant format string."
5+
where
6+
c.getTarget() = ff and
7+
format = c.getArgument(ff.getFormatParameterIndex()) and
8+
not format instanceof StringLiteral
9+
select format, "Non-constant format string."

docs/codeql/ql-training/query-examples/cpp/data-flow-cpp-2.ql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import semmle.code.cpp.commons.Printf
55
class SourceNode extends DataFlow::Node { /* ... */ }
66

77
from FormattingFunction f, Call c, SourceNode src, DataFlow::Node arg
8-
where c.getTarget() = f and
9-
arg.asExpr() = c.getArgument(f.getFormatParameterIndex()) and
10-
DataFlow::localFlow(src, arg) and
11-
not src.asExpr() instanceof StringLiteral
8+
where
9+
c.getTarget() = f and
10+
arg.asExpr() = c.getArgument(f.getFormatParameterIndex()) and
11+
DataFlow::localFlow(src, arg) and
12+
not src.asExpr() instanceof StringLiteral
1213
select arg, "Non-constant format string."

0 commit comments

Comments
 (0)