Skip to content

Commit 98bf748

Browse files
committed
C++: Accept test changes.
1 parent 7364634 commit 98bf748

File tree

5 files changed

+102
-43
lines changed

5 files changed

+102
-43
lines changed

cpp/ql/test/library-tests/controlflow/guards-ir/tests.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ irGuards
450450
| test.c:126:12:126:26 | Call: call to test3_condition |
451451
| test.c:131:7:131:7 | Load: b |
452452
| test.c:137:7:137:7 | Constant: 0 |
453+
| test.c:146:7:146:8 | LogicalNot: ! ... |
453454
| test.c:146:8:146:8 | Load: x |
454455
| test.c:152:10:152:10 | Load: x |
455456
| test.c:152:15:152:15 | Load: y |
@@ -640,6 +641,7 @@ irGuardsControl
640641
| test.c:126:12:126:26 | Call: call to test3_condition | true | 127 | 127 |
641642
| test.c:131:7:131:7 | Load: b | true | 132 | 132 |
642643
| test.c:137:7:137:7 | Constant: 0 | false | 142 | 142 |
644+
| test.c:146:7:146:8 | LogicalNot: ! ... | true | 147 | 147 |
643645
| test.c:146:8:146:8 | Load: x | false | 147 | 147 |
644646
| test.c:152:10:152:10 | Load: x | true | 152 | 152 |
645647
| test.c:152:15:152:15 | Load: y | true | 152 | 152 |

cpp/ql/test/library-tests/ir/ir/aliased_ir.expected

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,43 +2770,65 @@ ir.cpp:
27702770
# 462| m462_2(int) = Uninitialized[x] : &:r462_1
27712771
# 463| r463_1(glval<bool>) = VariableAddress[a] :
27722772
# 463| r463_2(bool) = Load[a] : &:r463_1, m461_6
2773-
# 463| v463_3(void) = ConditionalBranch : r463_2
2774-
#-----| False -> Block 1
2775-
#-----| True -> Block 2
2773+
# 463| r463_3(bool) = LogicalNot : r463_2
2774+
# 463| v463_4(void) = ConditionalBranch : r463_3
2775+
#-----| False -> Block 5
2776+
#-----| True -> Block 1
27762777

27772778
# 464| Block 1
27782779
# 464| r464_1(int) = Constant[1] :
27792780
# 464| r464_2(glval<int>) = VariableAddress[x] :
27802781
# 464| m464_3(int) = Store[x] : &:r464_2, r464_1
2781-
#-----| Goto -> Block 2
2782+
#-----| Goto -> Block 5
27822783

27832784
# 467| Block 2
2784-
# 467| r467_1(glval<bool>) = VariableAddress[a] :
2785-
# 467| r467_2(bool) = Load[a] : &:r467_1, m461_6
2786-
# 467| v467_3(void) = ConditionalBranch : r467_2
2787-
#-----| False -> Block 4
2788-
#-----| True -> Block 3
2785+
# 467| r467_1(glval<bool>) = VariableAddress[#temp467:11] :
2786+
# 467| r467_2(bool) = Constant[0] :
2787+
# 467| m467_3(bool) = Store[#temp467:11] : &:r467_1, r467_2
2788+
#-----| Goto -> Block 3
27892789

27902790
# 467| Block 3
2791-
# 467| r467_4(glval<bool>) = VariableAddress[b] :
2792-
# 467| r467_5(bool) = Load[b] : &:r467_4, m461_8
2793-
# 467| v467_6(void) = ConditionalBranch : r467_5
2794-
#-----| False -> Block 4
2795-
#-----| True -> Block 5
2791+
# 467| m467_4(bool) = Phi : from 2:m467_3, from 4:m467_11
2792+
# 467| r467_5(glval<bool>) = VariableAddress[#temp467:11] :
2793+
# 467| r467_6(bool) = Load[#temp467:11] : &:r467_5, m467_4
2794+
# 467| r467_7(bool) = LogicalNot : r467_6
2795+
# 467| v467_8(void) = ConditionalBranch : r467_7
2796+
#-----| False -> Block 8
2797+
#-----| True -> Block 7
27962798

2797-
# 468| Block 4
2799+
# 467| Block 4
2800+
# 467| r467_9(glval<bool>) = VariableAddress[#temp467:11] :
2801+
# 467| r467_10(bool) = Constant[1] :
2802+
# 467| m467_11(bool) = Store[#temp467:11] : &:r467_9, r467_10
2803+
#-----| Goto -> Block 3
2804+
2805+
# 467| Block 5
2806+
# 467| r467_12(glval<bool>) = VariableAddress[a] :
2807+
# 467| r467_13(bool) = Load[a] : &:r467_12, m461_6
2808+
# 467| v467_14(void) = ConditionalBranch : r467_13
2809+
#-----| False -> Block 2
2810+
#-----| True -> Block 6
2811+
2812+
# 467| Block 6
2813+
# 467| r467_15(glval<bool>) = VariableAddress[b] :
2814+
# 467| r467_16(bool) = Load[b] : &:r467_15, m461_8
2815+
# 467| v467_17(void) = ConditionalBranch : r467_16
2816+
#-----| False -> Block 2
2817+
#-----| True -> Block 4
2818+
2819+
# 468| Block 7
27982820
# 468| r468_1(int) = Constant[2] :
27992821
# 468| r468_2(glval<int>) = VariableAddress[x] :
28002822
# 468| m468_3(int) = Store[x] : &:r468_2, r468_1
2801-
#-----| Goto -> Block 6
2823+
#-----| Goto -> Block 9
28022824

2803-
# 471| Block 5
2825+
# 471| Block 8
28042826
# 471| r471_1(int) = Constant[3] :
28052827
# 471| r471_2(glval<int>) = VariableAddress[x] :
28062828
# 471| m471_3(int) = Store[x] : &:r471_2, r471_1
2807-
#-----| Goto -> Block 6
2829+
#-----| Goto -> Block 9
28082830

2809-
# 473| Block 6
2831+
# 473| Block 9
28102832
# 473| v473_1(void) = NoOp :
28112833
# 461| v461_9(void) = ReturnVoid :
28122834
# 461| v461_10(void) = AliasedUse : m461_3

cpp/ql/test/library-tests/ir/ir/operand_locations.expected

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2398,16 +2398,27 @@
23982398
| ir.cpp:461:22:461:22 | Address | &:r461_5 |
23992399
| ir.cpp:461:30:461:30 | Address | &:r461_7 |
24002400
| ir.cpp:462:9:462:9 | Address | &:r462_1 |
2401+
| ir.cpp:463:9:463:10 | Condition | r463_3 |
24012402
| ir.cpp:463:10:463:10 | Address | &:r463_1 |
2402-
| ir.cpp:463:10:463:10 | Condition | r463_2 |
24032403
| ir.cpp:463:10:463:10 | Load | m461_6 |
2404+
| ir.cpp:463:10:463:10 | Unary | r463_2 |
24042405
| ir.cpp:464:9:464:9 | Address | &:r464_2 |
24052406
| ir.cpp:464:13:464:13 | StoreValue | r464_1 |
2406-
| ir.cpp:467:11:467:11 | Address | &:r467_1 |
2407-
| ir.cpp:467:11:467:11 | Condition | r467_2 |
2407+
| ir.cpp:467:9:467:17 | Condition | r467_7 |
2408+
| ir.cpp:467:11:467:11 | Address | &:r467_12 |
2409+
| ir.cpp:467:11:467:11 | Condition | r467_13 |
24082410
| ir.cpp:467:11:467:11 | Load | m461_6 |
2409-
| ir.cpp:467:16:467:16 | Address | &:r467_4 |
2410-
| ir.cpp:467:16:467:16 | Condition | r467_5 |
2411+
| ir.cpp:467:11:467:16 | Address | &:r467_1 |
2412+
| ir.cpp:467:11:467:16 | Address | &:r467_5 |
2413+
| ir.cpp:467:11:467:16 | Address | &:r467_9 |
2414+
| ir.cpp:467:11:467:16 | Load | m467_4 |
2415+
| ir.cpp:467:11:467:16 | Phi | from 2:m467_3 |
2416+
| ir.cpp:467:11:467:16 | Phi | from 4:m467_11 |
2417+
| ir.cpp:467:11:467:16 | StoreValue | r467_2 |
2418+
| ir.cpp:467:11:467:16 | StoreValue | r467_10 |
2419+
| ir.cpp:467:11:467:16 | Unary | r467_6 |
2420+
| ir.cpp:467:16:467:16 | Address | &:r467_15 |
2421+
| ir.cpp:467:16:467:16 | Condition | r467_16 |
24112422
| ir.cpp:467:16:467:16 | Load | m461_8 |
24122423
| ir.cpp:468:9:468:9 | Address | &:r468_2 |
24132424
| ir.cpp:468:13:468:13 | StoreValue | r468_1 |

cpp/ql/test/library-tests/ir/ir/raw_ir.expected

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2725,43 +2725,64 @@ ir.cpp:
27252725
# 462| mu462_2(int) = Uninitialized[x] : &:r462_1
27262726
# 463| r463_1(glval<bool>) = VariableAddress[a] :
27272727
# 463| r463_2(bool) = Load[a] : &:r463_1, ~m?
2728-
# 463| v463_3(void) = ConditionalBranch : r463_2
2729-
#-----| False -> Block 1
2730-
#-----| True -> Block 2
2728+
# 463| r463_3(bool) = LogicalNot : r463_2
2729+
# 463| v463_4(void) = ConditionalBranch : r463_3
2730+
#-----| False -> Block 5
2731+
#-----| True -> Block 1
27312732

27322733
# 464| Block 1
27332734
# 464| r464_1(int) = Constant[1] :
27342735
# 464| r464_2(glval<int>) = VariableAddress[x] :
27352736
# 464| mu464_3(int) = Store[x] : &:r464_2, r464_1
2736-
#-----| Goto -> Block 2
2737+
#-----| Goto -> Block 5
27372738

27382739
# 467| Block 2
2739-
# 467| r467_1(glval<bool>) = VariableAddress[a] :
2740-
# 467| r467_2(bool) = Load[a] : &:r467_1, ~m?
2741-
# 467| v467_3(void) = ConditionalBranch : r467_2
2742-
#-----| False -> Block 4
2743-
#-----| True -> Block 3
2740+
# 467| r467_1(glval<bool>) = VariableAddress[#temp467:11] :
2741+
# 467| r467_2(bool) = Constant[0] :
2742+
# 467| mu467_3(bool) = Store[#temp467:11] : &:r467_1, r467_2
2743+
#-----| Goto -> Block 3
27442744

27452745
# 467| Block 3
2746-
# 467| r467_4(glval<bool>) = VariableAddress[b] :
2747-
# 467| r467_5(bool) = Load[b] : &:r467_4, ~m?
2748-
# 467| v467_6(void) = ConditionalBranch : r467_5
2749-
#-----| False -> Block 4
2750-
#-----| True -> Block 5
2746+
# 467| r467_4(glval<bool>) = VariableAddress[#temp467:11] :
2747+
# 467| r467_5(bool) = Load[#temp467:11] : &:r467_4, ~m?
2748+
# 467| r467_6(bool) = LogicalNot : r467_5
2749+
# 467| v467_7(void) = ConditionalBranch : r467_6
2750+
#-----| False -> Block 8
2751+
#-----| True -> Block 7
27512752

2752-
# 468| Block 4
2753+
# 467| Block 4
2754+
# 467| r467_8(glval<bool>) = VariableAddress[#temp467:11] :
2755+
# 467| r467_9(bool) = Constant[1] :
2756+
# 467| mu467_10(bool) = Store[#temp467:11] : &:r467_8, r467_9
2757+
#-----| Goto -> Block 3
2758+
2759+
# 467| Block 5
2760+
# 467| r467_11(glval<bool>) = VariableAddress[a] :
2761+
# 467| r467_12(bool) = Load[a] : &:r467_11, ~m?
2762+
# 467| v467_13(void) = ConditionalBranch : r467_12
2763+
#-----| False -> Block 2
2764+
#-----| True -> Block 6
2765+
2766+
# 467| Block 6
2767+
# 467| r467_14(glval<bool>) = VariableAddress[b] :
2768+
# 467| r467_15(bool) = Load[b] : &:r467_14, ~m?
2769+
# 467| v467_16(void) = ConditionalBranch : r467_15
2770+
#-----| False -> Block 2
2771+
#-----| True -> Block 4
2772+
2773+
# 468| Block 7
27532774
# 468| r468_1(int) = Constant[2] :
27542775
# 468| r468_2(glval<int>) = VariableAddress[x] :
27552776
# 468| mu468_3(int) = Store[x] : &:r468_2, r468_1
2756-
#-----| Goto -> Block 6
2777+
#-----| Goto -> Block 9
27572778

2758-
# 471| Block 5
2779+
# 471| Block 8
27592780
# 471| r471_1(int) = Constant[3] :
27602781
# 471| r471_2(glval<int>) = VariableAddress[x] :
27612782
# 471| mu471_3(int) = Store[x] : &:r471_2, r471_1
2762-
#-----| Goto -> Block 6
2783+
#-----| Goto -> Block 9
27632784

2764-
# 473| Block 6
2785+
# 473| Block 9
27652786
# 473| v473_1(void) = NoOp :
27662787
# 461| v461_8(void) = ReturnVoid :
27672788
# 461| v461_9(void) = AliasedUse : ~m?

cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/ifs/ifs.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
edges
2+
| ifs.c:16:27:16:30 | argv indirection | ifs.c:50:9:50:10 | c5 indirection |
23
| ifs.c:16:27:16:30 | argv indirection | ifs.c:62:9:62:10 | c7 indirection |
34
| ifs.c:16:27:16:30 | argv indirection | ifs.c:69:9:69:10 | c8 indirection |
45
| ifs.c:16:27:16:30 | argv indirection | ifs.c:75:9:75:10 | i1 indirection |
@@ -12,6 +13,7 @@ edges
1213
| ifs.c:16:27:16:30 | argv indirection | ifs.c:124:9:124:10 | i9 indirection |
1314
nodes
1415
| ifs.c:16:27:16:30 | argv indirection | semmle.label | argv indirection |
16+
| ifs.c:50:9:50:10 | c5 indirection | semmle.label | c5 indirection |
1517
| ifs.c:62:9:62:10 | c7 indirection | semmle.label | c7 indirection |
1618
| ifs.c:69:9:69:10 | c8 indirection | semmle.label | c8 indirection |
1719
| ifs.c:75:9:75:10 | i1 indirection | semmle.label | i1 indirection |
@@ -25,6 +27,7 @@ nodes
2527
| ifs.c:124:9:124:10 | i9 indirection | semmle.label | i9 indirection |
2628
subpaths
2729
#select
30+
| ifs.c:50:9:50:10 | c5 indirection | ifs.c:16:27:16:30 | argv indirection | ifs.c:50:9:50:10 | c5 indirection | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | ifs.c:16:27:16:30 | argv indirection | a command-line argument |
2831
| ifs.c:62:9:62:10 | c7 indirection | ifs.c:16:27:16:30 | argv indirection | ifs.c:62:9:62:10 | c7 indirection | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | ifs.c:16:27:16:30 | argv indirection | a command-line argument |
2932
| ifs.c:69:9:69:10 | c8 indirection | ifs.c:16:27:16:30 | argv indirection | ifs.c:69:9:69:10 | c8 indirection | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | ifs.c:16:27:16:30 | argv indirection | a command-line argument |
3033
| ifs.c:75:9:75:10 | i1 indirection | ifs.c:16:27:16:30 | argv indirection | ifs.c:75:9:75:10 | i1 indirection | The value of this argument may come from $@ and is being used as a formatting argument to printf(format). | ifs.c:16:27:16:30 | argv indirection | a command-line argument |

0 commit comments

Comments
 (0)