diff --git a/cpp/ql/test/library-tests/controlflow/guards-ir/tests.expected b/cpp/ql/test/library-tests/controlflow/guards-ir/tests.expected index 01b46187b69..0a50d6fdcab 100644 --- a/cpp/ql/test/library-tests/controlflow/guards-ir/tests.expected +++ b/cpp/ql/test/library-tests/controlflow/guards-ir/tests.expected @@ -450,6 +450,7 @@ irGuards | test.c:126:12:126:26 | Call: call to test3_condition | | test.c:131:7:131:7 | Load: b | | test.c:137:7:137:7 | Constant: 0 | +| test.c:146:7:146:8 | LogicalNot: ! ... | | test.c:146:8:146:8 | Load: x | | test.c:152:10:152:10 | Load: x | | test.c:152:15:152:15 | Load: y | @@ -640,6 +641,7 @@ irGuardsControl | test.c:126:12:126:26 | Call: call to test3_condition | true | 127 | 127 | | test.c:131:7:131:7 | Load: b | true | 132 | 132 | | test.c:137:7:137:7 | Constant: 0 | false | 142 | 142 | +| test.c:146:7:146:8 | LogicalNot: ! ... | true | 147 | 147 | | test.c:146:8:146:8 | Load: x | false | 147 | 147 | | test.c:152:10:152:10 | Load: x | true | 152 | 152 | | test.c:152:15:152:15 | Load: y | true | 152 | 152 | diff --git a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected index d7e3c36d204..9d56ffda040 100644 --- a/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/aliased_ir.expected @@ -2770,43 +2770,65 @@ ir.cpp: # 462| m462_2(int) = Uninitialized[x] : &:r462_1 # 463| r463_1(glval) = VariableAddress[a] : # 463| r463_2(bool) = Load[a] : &:r463_1, m461_6 -# 463| v463_3(void) = ConditionalBranch : r463_2 -#-----| False -> Block 1 -#-----| True -> Block 2 +# 463| r463_3(bool) = LogicalNot : r463_2 +# 463| v463_4(void) = ConditionalBranch : r463_3 +#-----| False -> Block 5 +#-----| True -> Block 1 # 464| Block 1 # 464| r464_1(int) = Constant[1] : # 464| r464_2(glval) = VariableAddress[x] : # 464| m464_3(int) = Store[x] : &:r464_2, r464_1 -#-----| Goto -> Block 2 +#-----| Goto -> Block 5 # 467| Block 2 -# 467| r467_1(glval) = VariableAddress[a] : -# 467| r467_2(bool) = Load[a] : &:r467_1, m461_6 -# 467| v467_3(void) = ConditionalBranch : r467_2 -#-----| False -> Block 4 -#-----| True -> Block 3 +# 467| r467_1(glval) = VariableAddress[#temp467:11] : +# 467| r467_2(bool) = Constant[0] : +# 467| m467_3(bool) = Store[#temp467:11] : &:r467_1, r467_2 +#-----| Goto -> Block 3 # 467| Block 3 -# 467| r467_4(glval) = VariableAddress[b] : -# 467| r467_5(bool) = Load[b] : &:r467_4, m461_8 -# 467| v467_6(void) = ConditionalBranch : r467_5 -#-----| False -> Block 4 -#-----| True -> Block 5 +# 467| m467_4(bool) = Phi : from 2:m467_3, from 4:m467_11 +# 467| r467_5(glval) = VariableAddress[#temp467:11] : +# 467| r467_6(bool) = Load[#temp467:11] : &:r467_5, m467_4 +# 467| r467_7(bool) = LogicalNot : r467_6 +# 467| v467_8(void) = ConditionalBranch : r467_7 +#-----| False -> Block 8 +#-----| True -> Block 7 -# 468| Block 4 +# 467| Block 4 +# 467| r467_9(glval) = VariableAddress[#temp467:11] : +# 467| r467_10(bool) = Constant[1] : +# 467| m467_11(bool) = Store[#temp467:11] : &:r467_9, r467_10 +#-----| Goto -> Block 3 + +# 467| Block 5 +# 467| r467_12(glval) = VariableAddress[a] : +# 467| r467_13(bool) = Load[a] : &:r467_12, m461_6 +# 467| v467_14(void) = ConditionalBranch : r467_13 +#-----| False -> Block 2 +#-----| True -> Block 6 + +# 467| Block 6 +# 467| r467_15(glval) = VariableAddress[b] : +# 467| r467_16(bool) = Load[b] : &:r467_15, m461_8 +# 467| v467_17(void) = ConditionalBranch : r467_16 +#-----| False -> Block 2 +#-----| True -> Block 4 + +# 468| Block 7 # 468| r468_1(int) = Constant[2] : # 468| r468_2(glval) = VariableAddress[x] : # 468| m468_3(int) = Store[x] : &:r468_2, r468_1 -#-----| Goto -> Block 6 +#-----| Goto -> Block 9 -# 471| Block 5 +# 471| Block 8 # 471| r471_1(int) = Constant[3] : # 471| r471_2(glval) = VariableAddress[x] : # 471| m471_3(int) = Store[x] : &:r471_2, r471_1 -#-----| Goto -> Block 6 +#-----| Goto -> Block 9 -# 473| Block 6 +# 473| Block 9 # 473| v473_1(void) = NoOp : # 461| v461_9(void) = ReturnVoid : # 461| v461_10(void) = AliasedUse : m461_3 diff --git a/cpp/ql/test/library-tests/ir/ir/operand_locations.expected b/cpp/ql/test/library-tests/ir/ir/operand_locations.expected index 39d238c1fae..c77c7f5e364 100644 --- a/cpp/ql/test/library-tests/ir/ir/operand_locations.expected +++ b/cpp/ql/test/library-tests/ir/ir/operand_locations.expected @@ -2398,16 +2398,27 @@ | ir.cpp:461:22:461:22 | Address | &:r461_5 | | ir.cpp:461:30:461:30 | Address | &:r461_7 | | ir.cpp:462:9:462:9 | Address | &:r462_1 | +| ir.cpp:463:9:463:10 | Condition | r463_3 | | ir.cpp:463:10:463:10 | Address | &:r463_1 | -| ir.cpp:463:10:463:10 | Condition | r463_2 | | ir.cpp:463:10:463:10 | Load | m461_6 | +| ir.cpp:463:10:463:10 | Unary | r463_2 | | ir.cpp:464:9:464:9 | Address | &:r464_2 | | ir.cpp:464:13:464:13 | StoreValue | r464_1 | -| ir.cpp:467:11:467:11 | Address | &:r467_1 | -| ir.cpp:467:11:467:11 | Condition | r467_2 | +| ir.cpp:467:9:467:17 | Condition | r467_7 | +| ir.cpp:467:11:467:11 | Address | &:r467_12 | +| ir.cpp:467:11:467:11 | Condition | r467_13 | | ir.cpp:467:11:467:11 | Load | m461_6 | -| ir.cpp:467:16:467:16 | Address | &:r467_4 | -| ir.cpp:467:16:467:16 | Condition | r467_5 | +| ir.cpp:467:11:467:16 | Address | &:r467_1 | +| ir.cpp:467:11:467:16 | Address | &:r467_5 | +| ir.cpp:467:11:467:16 | Address | &:r467_9 | +| ir.cpp:467:11:467:16 | Load | m467_4 | +| ir.cpp:467:11:467:16 | Phi | from 2:m467_3 | +| ir.cpp:467:11:467:16 | Phi | from 4:m467_11 | +| ir.cpp:467:11:467:16 | StoreValue | r467_2 | +| ir.cpp:467:11:467:16 | StoreValue | r467_10 | +| ir.cpp:467:11:467:16 | Unary | r467_6 | +| ir.cpp:467:16:467:16 | Address | &:r467_15 | +| ir.cpp:467:16:467:16 | Condition | r467_16 | | ir.cpp:467:16:467:16 | Load | m461_8 | | ir.cpp:468:9:468:9 | Address | &:r468_2 | | ir.cpp:468:13:468:13 | StoreValue | r468_1 | diff --git a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected index f43a105f70a..88b3f5dafd1 100644 --- a/cpp/ql/test/library-tests/ir/ir/raw_ir.expected +++ b/cpp/ql/test/library-tests/ir/ir/raw_ir.expected @@ -2725,43 +2725,64 @@ ir.cpp: # 462| mu462_2(int) = Uninitialized[x] : &:r462_1 # 463| r463_1(glval) = VariableAddress[a] : # 463| r463_2(bool) = Load[a] : &:r463_1, ~m? -# 463| v463_3(void) = ConditionalBranch : r463_2 -#-----| False -> Block 1 -#-----| True -> Block 2 +# 463| r463_3(bool) = LogicalNot : r463_2 +# 463| v463_4(void) = ConditionalBranch : r463_3 +#-----| False -> Block 5 +#-----| True -> Block 1 # 464| Block 1 # 464| r464_1(int) = Constant[1] : # 464| r464_2(glval) = VariableAddress[x] : # 464| mu464_3(int) = Store[x] : &:r464_2, r464_1 -#-----| Goto -> Block 2 +#-----| Goto -> Block 5 # 467| Block 2 -# 467| r467_1(glval) = VariableAddress[a] : -# 467| r467_2(bool) = Load[a] : &:r467_1, ~m? -# 467| v467_3(void) = ConditionalBranch : r467_2 -#-----| False -> Block 4 -#-----| True -> Block 3 +# 467| r467_1(glval) = VariableAddress[#temp467:11] : +# 467| r467_2(bool) = Constant[0] : +# 467| mu467_3(bool) = Store[#temp467:11] : &:r467_1, r467_2 +#-----| Goto -> Block 3 # 467| Block 3 -# 467| r467_4(glval) = VariableAddress[b] : -# 467| r467_5(bool) = Load[b] : &:r467_4, ~m? -# 467| v467_6(void) = ConditionalBranch : r467_5 -#-----| False -> Block 4 -#-----| True -> Block 5 +# 467| r467_4(glval) = VariableAddress[#temp467:11] : +# 467| r467_5(bool) = Load[#temp467:11] : &:r467_4, ~m? +# 467| r467_6(bool) = LogicalNot : r467_5 +# 467| v467_7(void) = ConditionalBranch : r467_6 +#-----| False -> Block 8 +#-----| True -> Block 7 -# 468| Block 4 +# 467| Block 4 +# 467| r467_8(glval) = VariableAddress[#temp467:11] : +# 467| r467_9(bool) = Constant[1] : +# 467| mu467_10(bool) = Store[#temp467:11] : &:r467_8, r467_9 +#-----| Goto -> Block 3 + +# 467| Block 5 +# 467| r467_11(glval) = VariableAddress[a] : +# 467| r467_12(bool) = Load[a] : &:r467_11, ~m? +# 467| v467_13(void) = ConditionalBranch : r467_12 +#-----| False -> Block 2 +#-----| True -> Block 6 + +# 467| Block 6 +# 467| r467_14(glval) = VariableAddress[b] : +# 467| r467_15(bool) = Load[b] : &:r467_14, ~m? +# 467| v467_16(void) = ConditionalBranch : r467_15 +#-----| False -> Block 2 +#-----| True -> Block 4 + +# 468| Block 7 # 468| r468_1(int) = Constant[2] : # 468| r468_2(glval) = VariableAddress[x] : # 468| mu468_3(int) = Store[x] : &:r468_2, r468_1 -#-----| Goto -> Block 6 +#-----| Goto -> Block 9 -# 471| Block 5 +# 471| Block 8 # 471| r471_1(int) = Constant[3] : # 471| r471_2(glval) = VariableAddress[x] : # 471| mu471_3(int) = Store[x] : &:r471_2, r471_1 -#-----| Goto -> Block 6 +#-----| Goto -> Block 9 -# 473| Block 6 +# 473| Block 9 # 473| v473_1(void) = NoOp : # 461| v461_8(void) = ReturnVoid : # 461| v461_9(void) = AliasedUse : ~m? diff --git a/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/ifs/ifs.expected b/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/ifs/ifs.expected index a71038f5713..33b8acd1182 100644 --- a/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/ifs/ifs.expected +++ b/cpp/ql/test/query-tests/Security/CWE/CWE-134/semmle/ifs/ifs.expected @@ -1,4 +1,5 @@ edges +| ifs.c:16:27:16:30 | argv indirection | ifs.c:50:9:50:10 | c5 indirection | | ifs.c:16:27:16:30 | argv indirection | ifs.c:62:9:62:10 | c7 indirection | | ifs.c:16:27:16:30 | argv indirection | ifs.c:69:9:69:10 | c8 indirection | | ifs.c:16:27:16:30 | argv indirection | ifs.c:75:9:75:10 | i1 indirection | @@ -12,6 +13,7 @@ edges | ifs.c:16:27:16:30 | argv indirection | ifs.c:124:9:124:10 | i9 indirection | nodes | ifs.c:16:27:16:30 | argv indirection | semmle.label | argv indirection | +| ifs.c:50:9:50:10 | c5 indirection | semmle.label | c5 indirection | | ifs.c:62:9:62:10 | c7 indirection | semmle.label | c7 indirection | | ifs.c:69:9:69:10 | c8 indirection | semmle.label | c8 indirection | | ifs.c:75:9:75:10 | i1 indirection | semmle.label | i1 indirection | @@ -25,6 +27,7 @@ nodes | ifs.c:124:9:124:10 | i9 indirection | semmle.label | i9 indirection | subpaths #select +| 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 | | 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 | | 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 | | 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 |