Skip to content

Commit 28ee756

Browse files
authored
Merge pull request github#2934 from geoffw0/add_tests
C++: Test and typos.
2 parents 8219110 + c6b0d4b commit 28ee756

File tree

10 files changed

+30
-19
lines changed

10 files changed

+30
-19
lines changed

cpp/ql/src/semmle/code/cpp/ir/dataflow/DefaultTaintTracking.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private predicate modelTaintToParameter(Function f, int parameterIn, int paramet
267267

268268
/**
269269
* Holds if `chi` is on the chain of chi-instructions for all aliased memory.
270-
* Taint shoud not pass through these instructions since they tend to mix up
270+
* Taint should not pass through these instructions since they tend to mix up
271271
* unrelated objects.
272272
*/
273273
private predicate isChiForAllAliasedMemory(Instruction instr) {

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/IRVariable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ IRTempVariable getIRTempVariable(Language::AST ast, TempVariableTag tag) {
176176

177177
/**
178178
* A temporary variable introduced by IR construction. The most common examples are the variable
179-
* generated to hold the return value of afunction, or the variable generated to hold the result of
179+
* generated to hold the return value of a function, or the variable generated to hold the result of
180180
* a condition operator (`a ? b : c`).
181181
*/
182182
class IRTempVariable extends IRGeneratedVariable, IRAutomaticVariable, TIRTempVariable {

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/IRVariable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ IRTempVariable getIRTempVariable(Language::AST ast, TempVariableTag tag) {
176176

177177
/**
178178
* A temporary variable introduced by IR construction. The most common examples are the variable
179-
* generated to hold the return value of afunction, or the variable generated to hold the result of
179+
* generated to hold the return value of a function, or the variable generated to hold the result of
180180
* a condition operator (`a ? b : c`).
181181
*/
182182
class IRTempVariable extends IRGeneratedVariable, IRAutomaticVariable, TIRTempVariable {

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/IRVariable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ IRTempVariable getIRTempVariable(Language::AST ast, TempVariableTag tag) {
176176

177177
/**
178178
* A temporary variable introduced by IR construction. The most common examples are the variable
179-
* generated to hold the return value of afunction, or the variable generated to hold the result of
179+
* generated to hold the return value of a function, or the variable generated to hold the result of
180180
* a condition operator (`a ? b : c`).
181181
*/
182182
class IRTempVariable extends IRGeneratedVariable, IRAutomaticVariable, TIRTempVariable {

cpp/ql/test/library-tests/declarationEntry/declarationEntry/declarationEntry.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@
2727
| declarationEntry.cpp:31:4:31:19 | myMemberVariable | declarationEntry.cpp:31:4:31:19 | definition of myMemberVariable | 1 | 1 |
2828
| declarationEntry.cpp:34:22:34:28 | mtc_int | declarationEntry.cpp:34:22:34:28 | definition of mtc_int | 1 | 1 |
2929
| declarationEntry.cpp:35:24:35:32 | mtc_short | declarationEntry.cpp:35:24:35:32 | definition of mtc_short | 1 | 1 |
30+
| macro.c:2:1:2:3 | foo | macro.c:2:1:2:3 | declaration of foo | 1 | 1 |
31+
| macro.c:4:5:4:8 | main | macro.c:4:5:4:8 | definition of main | 1 | 1 |
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
| declarationEntry.c:2:6:2:20 | declaration of myFirstFunction | |
2-
| declarationEntry.c:4:6:4:21 | definition of mySecondFunction | |
3-
| declarationEntry.c:8:6:8:20 | definition of myThirdFunction | |
4-
| declarationEntry.c:13:2:13:2 | declaration of myFourthFunction | isImplicit |
5-
| declarationEntry.c:14:2:14:2 | declaration of myFifthFunction | isImplicit |
6-
| declarationEntry.c:17:6:17:21 | declaration of myFourthFunction | |
7-
| declarationEntry.cpp:9:6:9:15 | declaration of myFunction | |
8-
| declarationEntry.cpp:11:6:11:15 | definition of myFunction | |
9-
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | |
10-
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | |
11-
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | |
12-
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | |
1+
| declarationEntry.c:2:6:2:20 | declaration of myFirstFunction | | 1 | c_linkage |
2+
| declarationEntry.c:4:6:4:21 | definition of mySecondFunction | | 1 | c_linkage |
3+
| declarationEntry.c:8:6:8:20 | definition of myThirdFunction | | 1 | c_linkage |
4+
| declarationEntry.c:13:2:13:2 | declaration of myFourthFunction | isImplicit | 1 | c_linkage |
5+
| declarationEntry.c:14:2:14:2 | declaration of myFifthFunction | isImplicit | 1 | c_linkage |
6+
| declarationEntry.c:17:6:17:21 | declaration of myFourthFunction | | 1 | c_linkage |
7+
| declarationEntry.cpp:9:6:9:15 | declaration of myFunction | | 0 | |
8+
| declarationEntry.cpp:11:6:11:15 | definition of myFunction | | 0 | |
9+
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | | 0 | |
10+
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | | 0 | |
11+
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | | 0 | |
12+
| declarationEntry.cpp:28:7:28:7 | declaration of operator= | | 0 | |
13+
| macro.c:2:1:2:3 | declaration of foo | | 2 | c_linkage, static |
14+
| macro.c:4:5:4:8 | definition of main | | 1 | c_linkage |

cpp/ql/test/library-tests/declarationEntry/declarationEntry/fde.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import cpp
22

33
from FunctionDeclarationEntry fde, string imp
44
where if fde.isImplicit() then imp = "isImplicit" else imp = ""
5-
select fde, imp
5+
select fde, imp, count(fde.getASpecifier()), concat(fde.getASpecifier().toString(), ", ")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#define Foo static void foo()
2+
Foo;
3+
4+
int main()
5+
{
6+
return 0;
7+
}

csharp/ql/src/semmle/code/csharp/ir/implementation/raw/IRVariable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ IRTempVariable getIRTempVariable(Language::AST ast, TempVariableTag tag) {
176176

177177
/**
178178
* A temporary variable introduced by IR construction. The most common examples are the variable
179-
* generated to hold the return value of afunction, or the variable generated to hold the result of
179+
* generated to hold the return value of a function, or the variable generated to hold the result of
180180
* a condition operator (`a ? b : c`).
181181
*/
182182
class IRTempVariable extends IRGeneratedVariable, IRAutomaticVariable, TIRTempVariable {

csharp/ql/src/semmle/code/csharp/ir/implementation/unaliased_ssa/IRVariable.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ IRTempVariable getIRTempVariable(Language::AST ast, TempVariableTag tag) {
176176

177177
/**
178178
* A temporary variable introduced by IR construction. The most common examples are the variable
179-
* generated to hold the return value of afunction, or the variable generated to hold the result of
179+
* generated to hold the return value of a function, or the variable generated to hold the result of
180180
* a condition operator (`a ? b : c`).
181181
*/
182182
class IRTempVariable extends IRGeneratedVariable, IRAutomaticVariable, TIRTempVariable {

0 commit comments

Comments
 (0)