From 0274eb6e00c4edf70e8ccab0f7abbc1003d2f017 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 14 Dec 2023 17:18:55 +0000 Subject: [PATCH 01/12] C: Accept test changes from #15107. --- .../DoNotPerformFileOperationsOnDevices.expected | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected b/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected index 06bf56cf8a..d8632eb3c1 100644 --- a/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected +++ b/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected @@ -1,12 +1,12 @@ edges -| test.c:20:15:20:23 | scanf output argument | test.c:21:8:21:16 | file_name indirection | -| test.c:45:15:45:23 | scanf output argument | test.c:46:29:46:37 | file_name indirection | +| test.c:20:15:20:23 | scanf output argument | test.c:21:8:21:16 | *file_name | +| test.c:45:15:45:23 | scanf output argument | test.c:46:29:46:37 | *file_name | nodes | test.c:20:15:20:23 | scanf output argument | semmle.label | scanf output argument | -| test.c:21:8:21:16 | file_name indirection | semmle.label | file_name indirection | +| test.c:21:8:21:16 | *file_name | semmle.label | *file_name | | test.c:45:15:45:23 | scanf output argument | semmle.label | scanf output argument | -| test.c:46:29:46:37 | file_name indirection | semmle.label | file_name indirection | +| test.c:46:29:46:37 | *file_name | semmle.label | *file_name | subpaths #select -| test.c:21:8:21:16 | file_name | test.c:20:15:20:23 | scanf output argument | test.c:21:8:21:16 | file_name indirection | This argument to a file access function is derived from $@ and then passed to func(file_name), which calls fopen((unnamed parameter 0)). | test.c:20:15:20:23 | scanf output argument | user input (value read by scanf) | -| test.c:46:29:46:37 | file_name | test.c:45:15:45:23 | scanf output argument | test.c:46:29:46:37 | file_name indirection | This argument to a file access function is derived from $@ and then passed to CreateFile(lpFileName). | test.c:45:15:45:23 | scanf output argument | user input (value read by scanf) | +| test.c:21:8:21:16 | file_name | test.c:20:15:20:23 | scanf output argument | test.c:21:8:21:16 | *file_name | This argument to a file access function is derived from $@ and then passed to func(file_name), which calls fopen((unnamed parameter 0)). | test.c:20:15:20:23 | scanf output argument | user input (value read by scanf) | +| test.c:46:29:46:37 | file_name | test.c:45:15:45:23 | scanf output argument | test.c:46:29:46:37 | *file_name | This argument to a file access function is derived from $@ and then passed to CreateFile(lpFileName). | test.c:45:15:45:23 | scanf output argument | user input (value read by scanf) | From f2425ad6fe898fb04ffe258c8c5312521336818f Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 22 Dec 2023 11:43:53 +0100 Subject: [PATCH 02/12] Use database extensionals instead of their wrapper classes in two predicates We are planning to change the charpred of `Function` in the CodeQL C++ library, which means the code changed here will no longer compile. By switching to the extensionals, the code will keep compiling. DIL before: ``` noinline `ConstantExprs::isFunction/1#600714be`( /* Element::Element */ interned unique entity el ) { exists(interned dontcare string _, interned dontcare int _1 | functions(el, _, _1) ) or exists(interned dontcare int _ | exprparents(el, _, el)) } noopt `ConstantExprs::callHasNoTarget/1#e6e8caa4`( /* @funbindexpr */ interned unique entity fc ) { exists(/* Function::Function */ interned entity f | funbind(fc, f) and not(`ConstantExprs::isFunction/1#600714be`(f)) ) } ``` DIL after: ``` noinline `ConstantExprs::isFunction/1#600714be`(/* @element */ interned unique entity el) { exists(interned dontcare string _, interned dontcare int _1 | functions(el, _, _1) ) or exists(interned dontcare int _ | exprparents(el, _, el)) } noopt `ConstantExprs::callHasNoTarget/1#e6e8caa4`( /* @funbindexpr */ interned unique entity fc ) { exists(/* @function */ interned entity f | funbind(fc, f) and not(`ConstantExprs::isFunction/1#600714be`(f)) ) } ``` --- .../cpp/enhancements/ControlFlowGraphEnhancements.qll | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/common/src/codingstandards/cpp/enhancements/ControlFlowGraphEnhancements.qll b/cpp/common/src/codingstandards/cpp/enhancements/ControlFlowGraphEnhancements.qll index 74d7e8e1c1..9dac58377c 100644 --- a/cpp/common/src/codingstandards/cpp/enhancements/ControlFlowGraphEnhancements.qll +++ b/cpp/common/src/codingstandards/cpp/enhancements/ControlFlowGraphEnhancements.qll @@ -10,8 +10,8 @@ import cpp * should be in this relation. */ pragma[noinline] -private predicate isFunction(Element el) { - el instanceof Function +private predicate isFunction(@element el) { + el instanceof @function or el.(Expr).getParent() = el } @@ -22,7 +22,7 @@ private predicate isFunction(Element el) { */ pragma[noopt] private predicate callHasNoTarget(@funbindexpr fc) { - exists(Function f | + exists(@function f | funbind(fc, f) and not isFunction(f) ) From 378f4fa481acda19ac3378c3107699b0c40ba5cc Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 2 Jan 2024 16:01:55 +0100 Subject: [PATCH 03/12] Resolve name clash with CodeQL defined `UserDefinedLiteral` --- .../A13-1-2/UserDefinedLiteralOperatorSuffixViolation.ql | 4 ++-- .../UserDefinedLiteralsOperatorsShallNotHaveSideEffects.ql | 4 ++-- ...lsOperatorsShallOnlyPerformConversionOfPassedParameters.ql | 4 ++-- .../rules/DCL51-CPP/UseOfReservedLiteralSuffixIdentifier.ql | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/autosar/src/rules/A13-1-2/UserDefinedLiteralOperatorSuffixViolation.ql b/cpp/autosar/src/rules/A13-1-2/UserDefinedLiteralOperatorSuffixViolation.ql index 7fe8bcdbe7..c739035596 100644 --- a/cpp/autosar/src/rules/A13-1-2/UserDefinedLiteralOperatorSuffixViolation.ql +++ b/cpp/autosar/src/rules/A13-1-2/UserDefinedLiteralOperatorSuffixViolation.ql @@ -15,9 +15,9 @@ import cpp import codingstandards.cpp.autosar -import codingstandards.cpp.UserDefinedLiteral +import codingstandards.cpp.UserDefinedLiteral as udl -from UserDefinedLiteral udl +from udl::UserDefinedLiteral udl where not isExcluded(udl, NamingPackage::userDefinedLiteralOperatorSuffixViolationQuery()) and not udl.hasCompliantSuffix() diff --git a/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallNotHaveSideEffects.ql b/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallNotHaveSideEffects.ql index 0cbb9f101e..b41a57f900 100644 --- a/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallNotHaveSideEffects.ql +++ b/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallNotHaveSideEffects.ql @@ -14,11 +14,11 @@ import cpp import codingstandards.cpp.autosar -import codingstandards.cpp.UserDefinedLiteral +import codingstandards.cpp.UserDefinedLiteral as udl import codingstandards.cpp.SideEffect import codingstandards.cpp.sideeffect.DefaultEffects -from UserDefinedLiteral udl, SideEffect e +from udl::UserDefinedLiteral udl, SideEffect e where not isExcluded(udl, SideEffects2Package::userDefinedLiteralsOperatorsShallNotHaveSideEffectsQuery()) and diff --git a/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallOnlyPerformConversionOfPassedParameters.ql b/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallOnlyPerformConversionOfPassedParameters.ql index b010e616cb..840d7423fb 100644 --- a/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallOnlyPerformConversionOfPassedParameters.ql +++ b/cpp/autosar/src/rules/A13-1-3/UserDefinedLiteralsOperatorsShallOnlyPerformConversionOfPassedParameters.ql @@ -16,10 +16,10 @@ import cpp import codingstandards.cpp.dataflow.TaintTracking import codingstandards.cpp.autosar -import codingstandards.cpp.UserDefinedLiteral +import codingstandards.cpp.UserDefinedLiteral as udl import codingstandards.cpp.SideEffect -from UserDefinedLiteral udl, Expr retExpr +from udl::UserDefinedLiteral udl, Expr retExpr where not isExcluded(udl, SideEffects2Package::userDefinedLiteralsOperatorsShallOnlyPerformConversionOfPassedParametersQuery()) and diff --git a/cpp/cert/src/rules/DCL51-CPP/UseOfReservedLiteralSuffixIdentifier.ql b/cpp/cert/src/rules/DCL51-CPP/UseOfReservedLiteralSuffixIdentifier.ql index f7dddb4d99..eb2163f667 100644 --- a/cpp/cert/src/rules/DCL51-CPP/UseOfReservedLiteralSuffixIdentifier.ql +++ b/cpp/cert/src/rules/DCL51-CPP/UseOfReservedLiteralSuffixIdentifier.ql @@ -15,9 +15,9 @@ import cpp import codingstandards.cpp.cert -import codingstandards.cpp.UserDefinedLiteral +import codingstandards.cpp.UserDefinedLiteral as udl -from UserDefinedLiteral udl +from udl::UserDefinedLiteral udl where not isExcluded(udl, NamingPackage::useOfReservedLiteralSuffixIdentifierQuery()) and not udl.hasCompliantSuffix() From 978777e689ae043e15292bc7a4a138c3006e994c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 10 Jan 2024 10:22:15 +0100 Subject: [PATCH 04/12] Fix ODR violations in AUTOSAR A2-10-5 test The CodeQL test framework assumes that all code will become part to the same nameless link target, which means that the duplicate declarations of `test3` and `test4` are ODR violations. Moreover, newer versions of the C/C++ frontend used in the C/C++ extractor will implement CWG 2387, which means that the instantiations of `number_two` will also cause ODR violations. Fix the above by renaming `test3` and `test4` in `test`b.cpp` and making the `number_two` variable templates `static`. --- ...mberObjectWithExternalOrInternalLinkageIsReused.expected | 4 ++-- cpp/autosar/test/rules/A2-10-5/test1a.cpp | 2 +- cpp/autosar/test/rules/A2-10-5/test1b.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected b/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected index 66d2b38c57..d6f496a3c6 100644 --- a/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected +++ b/cpp/autosar/test/rules/A2-10-5/IdentifierNameOfANonMemberObjectWithExternalOrInternalLinkageIsReused.expected @@ -1,6 +1,6 @@ | test1a.cpp:2:12:2:13 | g1 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:2:12:2:13 | g1 | g1 | test1b.cpp:2:12:2:13 | g1 | g1 | | test1a.cpp:6:12:6:13 | g3 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:6:12:6:13 | g3 | g3 | test1b.cpp:6:12:6:13 | g3 | g3 | -| test1a.cpp:17:43:17:43 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:17:43:17:43 | number_two | number_two | test1b.cpp:11:43:11:43 | number_two | number_two | +| test1a.cpp:17:50:17:50 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1a.cpp:17:50:17:50 | number_two | number_two | test1b.cpp:11:50:11:50 | number_two | number_two | | test1b.cpp:2:12:2:13 | g1 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:2:12:2:13 | g1 | g1 | test1a.cpp:2:12:2:13 | g1 | g1 | | test1b.cpp:6:12:6:13 | g3 | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:6:12:6:13 | g3 | g3 | test1a.cpp:6:12:6:13 | g3 | g3 | -| test1b.cpp:11:43:11:43 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:11:43:11:43 | number_two | number_two | test1a.cpp:17:43:17:43 | number_two | number_two | +| test1b.cpp:11:50:11:50 | number_two | Identifier name of non-member object $@ reuses the identifier name of non-member object $@. | test1b.cpp:11:50:11:50 | number_two | number_two | test1a.cpp:17:50:17:50 | number_two | number_two | diff --git a/cpp/autosar/test/rules/A2-10-5/test1a.cpp b/cpp/autosar/test/rules/A2-10-5/test1a.cpp index 80f63c3c69..749ad38b0f 100644 --- a/cpp/autosar/test/rules/A2-10-5/test1a.cpp +++ b/cpp/autosar/test/rules/A2-10-5/test1a.cpp @@ -14,7 +14,7 @@ int test() { return number_one; } long test2() { return number_one; } -template constexpr T number_two = T(1); // NON_COMPLIANT +template static constexpr T number_two = T(1); // NON_COMPLIANT int test3() { return number_two; } diff --git a/cpp/autosar/test/rules/A2-10-5/test1b.cpp b/cpp/autosar/test/rules/A2-10-5/test1b.cpp index 132588d5dd..342d739c4d 100644 --- a/cpp/autosar/test/rules/A2-10-5/test1b.cpp +++ b/cpp/autosar/test/rules/A2-10-5/test1b.cpp @@ -8,8 +8,8 @@ static int g3 = 0; // NON_COMPLIANT static void f1() {} // NON_COMPLIANT -template constexpr T number_two = T(1); // NON_COMPLIANT +template static constexpr T number_two = T(1); // NON_COMPLIANT -int test3() { return number_two; } +int test5() { return number_two; } -long test4() { return number_two; } \ No newline at end of file +long test6() { return number_two; } \ No newline at end of file From dc13ffedf5ae06862e823131f96138c1521d2f88 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 9 Feb 2024 10:51:39 +0000 Subject: [PATCH 05/12] Accept changes from github/codeql/15549 --- ...rithmeticOnNonArrayObjectPointers.expected | 18 +-- ...rSubtractAScaledIntegerToAPointer.expected | 10 +- ...rToMoreStrictlyAlignedPointerType.expected | 126 +++++++++--------- ...nctionPointerWithIncompatibleType.expected | 14 +- ...iableViaPointerOfIncompatibleType.expected | 22 +-- .../DoNotModifyConstantObjects.expected | 14 +- ...NotPerformFileOperationsOnDevices.expected | 4 +- ...odifyAlignmentOfMemoryWithRealloc.expected | 10 +- .../ConstLikeReturnValue.expected | 10 +- ...PointersAddressingDifferentArrays.expected | 16 +-- ...ionalOperatorsWithDifferingArrays.expected | 26 ++-- ...eMemoryAllocatedDynamicallyShared.expected | 8 +- ...sedToCompareNullTerminatedStrings.expected | 12 +- ...entOfAnArrayPassedToASmartPointer.expected | 12 +- ...UsedWithPointersToNonFinalClasses.expected | 22 +-- .../A5-1-7/LambdaPassedToTypeid.expected | 4 +- ...terArithmeticOnPolymorphicObjects.expected | 22 +-- ...ThroughAPointerOfTheIncorrectType.expected | 4 +- ...uctorCallForManuallyManagedObject.expected | 2 +- ...uctorCallForManuallyManagedObject.expected | 8 +- ...UndefinedMemberThroughNullPointer.expected | 4 +- ...PointersAddressingDifferentArrays.expected | 16 +-- ...ionalOperatorsWithDifferingArrays.expected | 26 ++-- ...alueStoredInUnrelatedSmartPointer.expected | 30 ++--- .../ThrowingOperatorNewReturnsNull.expected | 4 +- 25 files changed, 222 insertions(+), 222 deletions(-) diff --git a/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected b/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected index 8a7bfe553b..e5e0252e3a 100644 --- a/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected +++ b/c/cert/test/rules/ARR37-C/DoNotUsePointerArithmeticOnNonArrayObjectPointers.expected @@ -1,13 +1,13 @@ edges -| test.c:14:38:14:39 | p1 | test.c:18:10:18:11 | v1 | -| test.c:14:38:14:39 | p1 | test.c:19:10:19:11 | v2 | -| test.c:14:38:14:39 | p1 | test.c:20:10:20:11 | p1 | -| test.c:14:38:14:39 | p1 | test.c:21:10:21:11 | p1 | -| test.c:14:38:14:39 | p1 | test.c:22:9:22:10 | p1 | -| test.c:14:38:14:39 | p1 | test.c:23:13:23:14 | p1 | -| test.c:14:38:14:39 | p1 | test.c:24:9:24:10 | p1 | -| test.c:14:38:14:39 | p1 | test.c:25:9:25:10 | p1 | -| test.c:51:30:51:38 | & ... | test.c:14:38:14:39 | p1 | +| test.c:14:38:14:39 | p1 | test.c:18:10:18:11 | v1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:19:10:19:11 | v2 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:20:10:20:11 | p1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:21:10:21:11 | p1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:22:9:22:10 | p1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:23:13:23:14 | p1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:24:9:24:10 | p1 | provenance | | +| test.c:14:38:14:39 | p1 | test.c:25:9:25:10 | p1 | provenance | | +| test.c:51:30:51:38 | & ... | test.c:14:38:14:39 | p1 | provenance | | nodes | test.c:14:38:14:39 | p1 | semmle.label | p1 | | test.c:18:10:18:11 | v1 | semmle.label | v1 | diff --git a/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected b/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected index 1d3f5dcf13..bfd6b23128 100644 --- a/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected +++ b/c/cert/test/rules/ARR39-C/DoNotAddOrSubtractAScaledIntegerToAPointer.expected @@ -1,9 +1,9 @@ edges -| test.c:7:13:7:14 | p1 | test.c:9:9:9:10 | p1 | -| test.c:16:19:16:41 | ... - ... | test.c:18:26:18:31 | offset | -| test.c:16:19:16:41 | ... - ... | test.c:29:6:29:11 | offset | -| test.c:17:17:17:26 | sizeof() | test.c:23:9:23:12 | size | -| test.c:29:6:29:11 | offset | test.c:7:13:7:14 | p1 | +| test.c:7:13:7:14 | p1 | test.c:9:9:9:10 | p1 | provenance | | +| test.c:16:19:16:41 | ... - ... | test.c:18:26:18:31 | offset | provenance | | +| test.c:16:19:16:41 | ... - ... | test.c:29:6:29:11 | offset | provenance | | +| test.c:17:17:17:26 | sizeof() | test.c:23:9:23:12 | size | provenance | | +| test.c:29:6:29:11 | offset | test.c:7:13:7:14 | p1 | provenance | | nodes | test.c:7:13:7:14 | p1 | semmle.label | p1 | | test.c:9:9:9:10 | p1 | semmle.label | p1 | diff --git a/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected b/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected index a1c9a14fa2..c4bc63cc94 100644 --- a/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected +++ b/c/cert/test/rules/EXP36-C/DoNotCastPointerToMoreStrictlyAlignedPointerType.expected @@ -1,67 +1,67 @@ edges -| test.c:75:14:75:16 | & ... | test.c:76:11:76:12 | v1 | -| test.c:75:14:75:16 | & ... | test.c:77:12:77:13 | v1 | -| test.c:75:14:75:16 | & ... | test.c:78:10:78:11 | v1 | -| test.c:75:14:75:16 | & ... | test.c:79:12:79:13 | v1 | -| test.c:75:14:75:16 | & ... | test.c:80:11:80:12 | v1 | -| test.c:75:14:75:16 | & ... | test.c:81:13:81:14 | v1 | -| test.c:84:14:84:16 | & ... | test.c:85:11:85:12 | v2 | -| test.c:84:14:84:16 | & ... | test.c:86:12:86:13 | v2 | -| test.c:84:14:84:16 | & ... | test.c:87:10:87:11 | v2 | -| test.c:84:14:84:16 | & ... | test.c:88:12:88:13 | v2 | -| test.c:84:14:84:16 | & ... | test.c:89:11:89:12 | v2 | -| test.c:84:14:84:16 | & ... | test.c:90:13:90:14 | v2 | -| test.c:93:14:93:16 | & ... | test.c:94:11:94:12 | v3 | -| test.c:93:14:93:16 | & ... | test.c:95:12:95:13 | v3 | -| test.c:93:14:93:16 | & ... | test.c:96:10:96:11 | v3 | -| test.c:93:14:93:16 | & ... | test.c:97:12:97:13 | v3 | -| test.c:93:14:93:16 | & ... | test.c:98:11:98:12 | v3 | -| test.c:93:14:93:16 | & ... | test.c:99:13:99:14 | v3 | -| test.c:102:14:102:16 | & ... | test.c:103:11:103:12 | v4 | -| test.c:102:14:102:16 | & ... | test.c:104:12:104:13 | v4 | -| test.c:102:14:102:16 | & ... | test.c:105:10:105:11 | v4 | -| test.c:102:14:102:16 | & ... | test.c:106:12:106:13 | v4 | -| test.c:102:14:102:16 | & ... | test.c:107:11:107:12 | v4 | -| test.c:102:14:102:16 | & ... | test.c:108:13:108:14 | v4 | -| test.c:111:14:111:16 | & ... | test.c:112:11:112:12 | v5 | -| test.c:111:14:111:16 | & ... | test.c:113:12:113:13 | v5 | -| test.c:111:14:111:16 | & ... | test.c:114:10:114:11 | v5 | -| test.c:111:14:111:16 | & ... | test.c:115:12:115:13 | v5 | -| test.c:111:14:111:16 | & ... | test.c:116:11:116:12 | v5 | -| test.c:111:14:111:16 | & ... | test.c:117:13:117:14 | v5 | -| test.c:120:14:120:16 | & ... | test.c:121:11:121:12 | v6 | -| test.c:120:14:120:16 | & ... | test.c:122:12:122:13 | v6 | -| test.c:120:14:120:16 | & ... | test.c:123:10:123:11 | v6 | -| test.c:120:14:120:16 | & ... | test.c:124:12:124:13 | v6 | -| test.c:120:14:120:16 | & ... | test.c:125:11:125:12 | v6 | -| test.c:120:14:120:16 | & ... | test.c:126:13:126:14 | v6 | -| test.c:129:22:129:22 | v | test.c:130:17:130:17 | v | -| test.c:135:21:135:23 | & ... | test.c:129:22:129:22 | v | -| test.c:138:21:138:23 | & ... | test.c:129:22:129:22 | v | -| test.c:166:24:166:29 | call to malloc | test.c:167:13:167:15 | & ... | -| test.c:166:24:166:29 | call to malloc | test.c:168:16:168:17 | s1 | -| test.c:166:24:166:29 | call to malloc | test.c:169:13:169:14 | s1 | -| test.c:166:24:166:29 | call to malloc | test.c:169:13:169:14 | s1 | -| test.c:169:13:169:14 | s1 | test.c:129:22:129:22 | v | -| test.c:174:13:174:14 | s2 | test.c:129:22:129:22 | v | -| test.c:179:13:179:14 | s3 | test.c:129:22:129:22 | v | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:184:11:184:12 | v1 | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:185:10:185:11 | v1 | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:186:13:186:14 | v1 | -| test.c:183:14:183:26 | call to aligned_alloc | test.c:187:13:187:14 | v1 | -| test.c:187:13:187:14 | v1 | test.c:129:22:129:22 | v | -| test.c:189:14:189:26 | call to aligned_alloc | test.c:190:13:190:14 | v2 | -| test.c:190:13:190:14 | v2 | test.c:129:22:129:22 | v | -| test.c:222:8:222:9 | p2 | test.c:223:11:223:12 | v1 | -| test.c:222:8:222:9 | p2 | test.c:224:12:224:13 | v1 | -| test.c:222:8:222:9 | p2 | test.c:225:10:225:11 | v1 | -| test.c:222:8:222:9 | p2 | test.c:226:12:226:13 | v1 | -| test.c:222:8:222:9 | p2 | test.c:227:11:227:12 | v1 | -| test.c:222:8:222:9 | p2 | test.c:228:13:228:14 | v1 | -| test.c:238:13:238:14 | & ... | test.c:244:12:244:13 | ip | -| test.c:241:15:241:18 | & ... | test.c:247:9:247:12 | & ... | -| test.c:252:16:252:18 | & ... | test.c:254:11:254:13 | ps1 | -| test.c:252:16:252:18 | & ... | test.c:256:10:256:12 | ps1 | +| test.c:75:14:75:16 | & ... | test.c:76:11:76:12 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:77:12:77:13 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:78:10:78:11 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:79:12:79:13 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:80:11:80:12 | v1 | provenance | | +| test.c:75:14:75:16 | & ... | test.c:81:13:81:14 | v1 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:85:11:85:12 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:86:12:86:13 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:87:10:87:11 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:88:12:88:13 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:89:11:89:12 | v2 | provenance | | +| test.c:84:14:84:16 | & ... | test.c:90:13:90:14 | v2 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:94:11:94:12 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:95:12:95:13 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:96:10:96:11 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:97:12:97:13 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:98:11:98:12 | v3 | provenance | | +| test.c:93:14:93:16 | & ... | test.c:99:13:99:14 | v3 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:103:11:103:12 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:104:12:104:13 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:105:10:105:11 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:106:12:106:13 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:107:11:107:12 | v4 | provenance | | +| test.c:102:14:102:16 | & ... | test.c:108:13:108:14 | v4 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:112:11:112:12 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:113:12:113:13 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:114:10:114:11 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:115:12:115:13 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:116:11:116:12 | v5 | provenance | | +| test.c:111:14:111:16 | & ... | test.c:117:13:117:14 | v5 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:121:11:121:12 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:122:12:122:13 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:123:10:123:11 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:124:12:124:13 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:125:11:125:12 | v6 | provenance | | +| test.c:120:14:120:16 | & ... | test.c:126:13:126:14 | v6 | provenance | | +| test.c:129:22:129:22 | v | test.c:130:17:130:17 | v | provenance | | +| test.c:135:21:135:23 | & ... | test.c:129:22:129:22 | v | provenance | | +| test.c:138:21:138:23 | & ... | test.c:129:22:129:22 | v | provenance | | +| test.c:166:24:166:29 | call to malloc | test.c:167:13:167:15 | & ... | provenance | | +| test.c:166:24:166:29 | call to malloc | test.c:168:16:168:17 | s1 | provenance | | +| test.c:166:24:166:29 | call to malloc | test.c:169:13:169:14 | s1 | provenance | | +| test.c:166:24:166:29 | call to malloc | test.c:169:13:169:14 | s1 | provenance | | +| test.c:169:13:169:14 | s1 | test.c:129:22:129:22 | v | provenance | | +| test.c:174:13:174:14 | s2 | test.c:129:22:129:22 | v | provenance | | +| test.c:179:13:179:14 | s3 | test.c:129:22:129:22 | v | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:184:11:184:12 | v1 | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:185:10:185:11 | v1 | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:186:13:186:14 | v1 | provenance | | +| test.c:183:14:183:26 | call to aligned_alloc | test.c:187:13:187:14 | v1 | provenance | | +| test.c:187:13:187:14 | v1 | test.c:129:22:129:22 | v | provenance | | +| test.c:189:14:189:26 | call to aligned_alloc | test.c:190:13:190:14 | v2 | provenance | | +| test.c:190:13:190:14 | v2 | test.c:129:22:129:22 | v | provenance | | +| test.c:222:8:222:9 | p2 | test.c:223:11:223:12 | v1 | provenance | | +| test.c:222:8:222:9 | p2 | test.c:224:12:224:13 | v1 | provenance | | +| test.c:222:8:222:9 | p2 | test.c:225:10:225:11 | v1 | provenance | | +| test.c:222:8:222:9 | p2 | test.c:226:12:226:13 | v1 | provenance | | +| test.c:222:8:222:9 | p2 | test.c:227:11:227:12 | v1 | provenance | | +| test.c:222:8:222:9 | p2 | test.c:228:13:228:14 | v1 | provenance | | +| test.c:238:13:238:14 | & ... | test.c:244:12:244:13 | ip | provenance | | +| test.c:241:15:241:18 | & ... | test.c:247:9:247:12 | & ... | provenance | | +| test.c:252:16:252:18 | & ... | test.c:254:11:254:13 | ps1 | provenance | | +| test.c:252:16:252:18 | & ... | test.c:256:10:256:12 | ps1 | provenance | | nodes | test.c:7:11:7:13 | & ... | semmle.label | & ... | | test.c:8:12:8:14 | & ... | semmle.label | & ... | diff --git a/c/cert/test/rules/EXP37-C/DoNotCallFunctionPointerWithIncompatibleType.expected b/c/cert/test/rules/EXP37-C/DoNotCallFunctionPointerWithIncompatibleType.expected index 4c18bb2672..546c753ebb 100644 --- a/c/cert/test/rules/EXP37-C/DoNotCallFunctionPointerWithIncompatibleType.expected +++ b/c/cert/test/rules/EXP37-C/DoNotCallFunctionPointerWithIncompatibleType.expected @@ -1,11 +1,11 @@ edges -| test.c:48:68:48:70 | fns [f1] | test.c:49:3:49:5 | fns [f1] | -| test.c:49:3:49:5 | fns [f1] | test.c:49:8:49:9 | f1 | -| test.c:61:28:61:29 | f2 | test.c:62:3:62:11 | v1_called | -| test.c:73:3:73:5 | fns [post update] [f1] | test.c:75:45:75:48 | & ... [f1] | -| test.c:73:3:73:13 | ... = ... | test.c:73:3:73:5 | fns [post update] [f1] | -| test.c:73:12:73:13 | v2 | test.c:73:3:73:13 | ... = ... | -| test.c:75:45:75:48 | & ... [f1] | test.c:48:68:48:70 | fns [f1] | +| test.c:48:68:48:70 | fns [f1] | test.c:49:3:49:5 | fns [f1] | provenance | | +| test.c:49:3:49:5 | fns [f1] | test.c:49:8:49:9 | f1 | provenance | | +| test.c:61:28:61:29 | f2 | test.c:62:3:62:11 | v1_called | provenance | | +| test.c:73:3:73:5 | fns [post update] [f1] | test.c:75:45:75:48 | & ... [f1] | provenance | | +| test.c:73:3:73:13 | ... = ... | test.c:73:3:73:5 | fns [post update] [f1] | provenance | | +| test.c:73:12:73:13 | v2 | test.c:73:3:73:13 | ... = ... | provenance | | +| test.c:75:45:75:48 | & ... [f1] | test.c:48:68:48:70 | fns [f1] | provenance | | nodes | test.c:48:68:48:70 | fns [f1] | semmle.label | fns [f1] | | test.c:49:3:49:5 | fns [f1] | semmle.label | fns [f1] | diff --git a/c/cert/test/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.expected b/c/cert/test/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.expected index e42f003f0f..137017d53a 100644 --- a/c/cert/test/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.expected +++ b/c/cert/test/rules/EXP39-C/DoNotAccessVariableViaPointerOfIncompatibleType.expected @@ -1,15 +1,15 @@ edges -| test.c:49:8:49:9 | s3 | test.c:50:8:50:9 | s1 | -| test.c:60:16:60:18 | E1A | test.c:61:16:61:17 | e1 | -| test.c:60:16:60:18 | E1A | test.c:65:10:65:12 | & ... | -| test.c:68:22:68:22 | v | test.c:68:41:68:41 | v | -| test.c:72:13:72:15 | & ... | test.c:68:22:68:22 | v | -| test.c:74:13:74:15 | & ... | test.c:68:22:68:22 | v | -| test.c:97:32:97:37 | call to malloc | test.c:98:40:98:41 | s2 | -| test.c:97:32:97:37 | call to malloc | test.c:98:40:98:41 | s2 | -| test.c:98:32:98:38 | call to realloc | test.c:99:3:99:4 | s3 | -| test.c:98:32:98:38 | call to realloc | test.c:100:10:100:11 | s3 | -| test.c:98:40:98:41 | s2 | test.c:98:32:98:38 | call to realloc | +| test.c:49:8:49:9 | s3 | test.c:50:8:50:9 | s1 | provenance | | +| test.c:60:16:60:18 | E1A | test.c:61:16:61:17 | e1 | provenance | | +| test.c:60:16:60:18 | E1A | test.c:65:10:65:12 | & ... | provenance | | +| test.c:68:22:68:22 | v | test.c:68:41:68:41 | v | provenance | | +| test.c:72:13:72:15 | & ... | test.c:68:22:68:22 | v | provenance | | +| test.c:74:13:74:15 | & ... | test.c:68:22:68:22 | v | provenance | | +| test.c:97:32:97:37 | call to malloc | test.c:98:40:98:41 | s2 | provenance | | +| test.c:97:32:97:37 | call to malloc | test.c:98:40:98:41 | s2 | provenance | | +| test.c:98:32:98:38 | call to realloc | test.c:99:3:99:4 | s3 | provenance | | +| test.c:98:32:98:38 | call to realloc | test.c:100:10:100:11 | s3 | provenance | | +| test.c:98:40:98:41 | s2 | test.c:98:32:98:38 | call to realloc | provenance | | nodes | test.c:6:19:6:20 | & ... | semmle.label | & ... | | test.c:11:10:11:11 | & ... | semmle.label | & ... | diff --git a/c/cert/test/rules/EXP40-C/DoNotModifyConstantObjects.expected b/c/cert/test/rules/EXP40-C/DoNotModifyConstantObjects.expected index 3211c4fab1..bef45f3841 100644 --- a/c/cert/test/rules/EXP40-C/DoNotModifyConstantObjects.expected +++ b/c/cert/test/rules/EXP40-C/DoNotModifyConstantObjects.expected @@ -1,11 +1,11 @@ edges -| test.c:5:8:5:9 | & ... | test.c:6:4:6:5 | aa | -| test.c:26:15:26:15 | a | test.c:27:4:27:4 | a | -| test.c:34:13:34:14 | & ... | test.c:39:7:39:8 | p1 | -| test.c:39:7:39:8 | p1 | test.c:26:15:26:15 | a | -| test.c:40:7:40:9 | * ... | test.c:26:15:26:15 | a | -| test.c:59:7:59:8 | & ... | test.c:60:4:60:4 | p | -| test.c:79:11:79:16 | call to strchr | test.c:81:6:81:12 | ... ++ | +| test.c:5:8:5:9 | & ... | test.c:6:4:6:5 | aa | provenance | | +| test.c:26:15:26:15 | a | test.c:27:4:27:4 | a | provenance | | +| test.c:34:13:34:14 | & ... | test.c:39:7:39:8 | p1 | provenance | | +| test.c:39:7:39:8 | p1 | test.c:26:15:26:15 | a | provenance | | +| test.c:40:7:40:9 | * ... | test.c:26:15:26:15 | a | provenance | | +| test.c:59:7:59:8 | & ... | test.c:60:4:60:4 | p | provenance | | +| test.c:79:11:79:16 | call to strchr | test.c:81:6:81:12 | ... ++ | provenance | | nodes | test.c:5:8:5:9 | & ... | semmle.label | & ... | | test.c:6:4:6:5 | aa | semmle.label | aa | diff --git a/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected b/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected index d8632eb3c1..93d6de6b8a 100644 --- a/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected +++ b/c/cert/test/rules/FIO32-C/DoNotPerformFileOperationsOnDevices.expected @@ -1,6 +1,6 @@ edges -| test.c:20:15:20:23 | scanf output argument | test.c:21:8:21:16 | *file_name | -| test.c:45:15:45:23 | scanf output argument | test.c:46:29:46:37 | *file_name | +| test.c:20:15:20:23 | scanf output argument | test.c:21:8:21:16 | *file_name | provenance | | +| test.c:45:15:45:23 | scanf output argument | test.c:46:29:46:37 | *file_name | provenance | | nodes | test.c:20:15:20:23 | scanf output argument | semmle.label | scanf output argument | | test.c:21:8:21:16 | *file_name | semmle.label | *file_name | diff --git a/c/cert/test/rules/MEM36-C/DoNotModifyAlignmentOfMemoryWithRealloc.expected b/c/cert/test/rules/MEM36-C/DoNotModifyAlignmentOfMemoryWithRealloc.expected index 0592cb038d..0ae87f2ee8 100644 --- a/c/cert/test/rules/MEM36-C/DoNotModifyAlignmentOfMemoryWithRealloc.expected +++ b/c/cert/test/rules/MEM36-C/DoNotModifyAlignmentOfMemoryWithRealloc.expected @@ -1,9 +1,9 @@ edges -| test.c:5:10:5:22 | call to aligned_alloc | test.c:15:8:15:28 | call to aligned_alloc_wrapper | -| test.c:8:29:8:31 | ptr | test.c:8:64:8:66 | ptr | -| test.c:15:8:15:28 | call to aligned_alloc_wrapper | test.c:16:24:16:25 | v1 | -| test.c:16:24:16:25 | v1 | test.c:8:29:8:31 | ptr | -| test.c:22:8:22:20 | call to aligned_alloc | test.c:23:16:23:17 | v3 | +| test.c:5:10:5:22 | call to aligned_alloc | test.c:15:8:15:28 | call to aligned_alloc_wrapper | provenance | | +| test.c:8:29:8:31 | ptr | test.c:8:64:8:66 | ptr | provenance | | +| test.c:15:8:15:28 | call to aligned_alloc_wrapper | test.c:16:24:16:25 | v1 | provenance | | +| test.c:16:24:16:25 | v1 | test.c:8:29:8:31 | ptr | provenance | | +| test.c:22:8:22:20 | call to aligned_alloc | test.c:23:16:23:17 | v3 | provenance | | nodes | test.c:5:10:5:22 | call to aligned_alloc | semmle.label | call to aligned_alloc | | test.c:8:29:8:31 | ptr | semmle.label | ptr | diff --git a/c/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.expected b/c/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.expected index 94e63062c5..d62a413f98 100644 --- a/c/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.expected +++ b/c/common/test/rules/constlikereturnvalue/ConstLikeReturnValue.expected @@ -3,11 +3,11 @@ problems | test.c:64:5:64:9 | conv4 | test.c:61:11:61:20 | call to localeconv | test.c:64:5:64:9 | conv4 | The object returned by the function localeconv should not be modified. | | test.c:73:5:73:8 | conv | test.c:69:25:69:34 | call to localeconv | test.c:73:5:73:8 | conv | The object returned by the function localeconv should not be modified. | edges -| test.c:5:18:5:22 | c_str | test.c:8:8:8:12 | c_str | -| test.c:15:16:15:21 | call to getenv | test.c:21:9:21:12 | env1 | -| test.c:21:9:21:12 | env1 | test.c:5:18:5:22 | c_str | -| test.c:61:11:61:20 | call to localeconv | test.c:64:5:64:9 | conv4 | -| test.c:69:25:69:34 | call to localeconv | test.c:73:5:73:8 | conv | +| test.c:5:18:5:22 | c_str | test.c:8:8:8:12 | c_str | provenance | | +| test.c:15:16:15:21 | call to getenv | test.c:21:9:21:12 | env1 | provenance | | +| test.c:21:9:21:12 | env1 | test.c:5:18:5:22 | c_str | provenance | | +| test.c:61:11:61:20 | call to localeconv | test.c:64:5:64:9 | conv4 | provenance | | +| test.c:69:25:69:34 | call to localeconv | test.c:73:5:73:8 | conv | provenance | | nodes | test.c:5:18:5:22 | c_str | semmle.label | c_str | | test.c:8:8:8:12 | c_str | semmle.label | c_str | diff --git a/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected b/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected index d0ba3bdb5c..c595e7e5f7 100644 --- a/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected +++ b/c/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected @@ -4,14 +4,14 @@ problems | test.c:13:10:13:11 | p4 | test.c:5:14:5:15 | l2 | test.c:13:10:13:11 | p4 | Subtraction between left operand pointing to array $@ and other operand pointing to array $@. | test.c:3:7:3:8 | l2 | l2 | test.c:2:7:2:8 | l1 | l1 | | test.c:13:15:13:16 | l1 | test.c:13:15:13:16 | l1 | test.c:13:15:13:16 | l1 | Subtraction between right operand pointing to array $@ and other operand pointing to array $@. | test.c:2:7:2:8 | l1 | l1 | test.c:3:7:3:8 | l2 | l2 | edges -| test.c:4:14:4:15 | l1 | test.c:4:14:4:18 | access to array | -| test.c:4:14:4:18 | access to array | test.c:10:10:10:11 | p1 | -| test.c:4:14:4:18 | access to array | test.c:12:10:12:11 | p1 | -| test.c:5:14:5:15 | l2 | test.c:5:14:5:19 | access to array | -| test.c:5:14:5:19 | access to array | test.c:11:10:11:11 | p2 | -| test.c:5:14:5:19 | access to array | test.c:12:15:12:16 | p2 | -| test.c:5:14:5:19 | access to array | test.c:13:10:13:11 | p4 | -| test.c:5:14:5:19 | access to array | test.c:14:10:14:11 | p4 | +| test.c:4:14:4:15 | l1 | test.c:4:14:4:18 | access to array | provenance | | +| test.c:4:14:4:18 | access to array | test.c:10:10:10:11 | p1 | provenance | | +| test.c:4:14:4:18 | access to array | test.c:12:10:12:11 | p1 | provenance | | +| test.c:5:14:5:15 | l2 | test.c:5:14:5:19 | access to array | provenance | | +| test.c:5:14:5:19 | access to array | test.c:11:10:11:11 | p2 | provenance | | +| test.c:5:14:5:19 | access to array | test.c:12:15:12:16 | p2 | provenance | | +| test.c:5:14:5:19 | access to array | test.c:13:10:13:11 | p4 | provenance | | +| test.c:5:14:5:19 | access to array | test.c:14:10:14:11 | p4 | provenance | | nodes | test.c:4:14:4:15 | l1 | semmle.label | l1 | | test.c:4:14:4:18 | access to array | semmle.label | access to array | diff --git a/c/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected b/c/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected index 8db569a98d..05c0ed4ca0 100644 --- a/c/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected +++ b/c/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected @@ -10,19 +10,19 @@ problems | test.c:25:7:25:14 | ... >= ... | test.c:7:14:7:15 | l1 | test.c:25:7:25:8 | p1 | Compare operation >= comparing left operand pointing to array $@ and other operand pointing to array $@. | test.c:2:7:2:8 | l1 | l1 | test.c:4:7:4:8 | l3 | l3 | | test.c:25:7:25:14 | ... >= ... | test.c:25:13:25:14 | l3 | test.c:25:13:25:14 | l3 | Compare operation >= comparing right operand pointing to array $@ and other operand pointing to array $@. | test.c:4:7:4:8 | l3 | l3 | test.c:2:7:2:8 | l1 | l1 | edges -| test.c:6:13:6:14 | l1 | test.c:13:12:13:13 | p0 | -| test.c:7:14:7:15 | l1 | test.c:7:14:7:18 | access to array | -| test.c:7:14:7:18 | access to array | test.c:11:7:11:8 | p1 | -| test.c:7:14:7:18 | access to array | test.c:13:7:13:8 | p1 | -| test.c:7:14:7:18 | access to array | test.c:15:13:15:14 | p1 | -| test.c:7:14:7:18 | access to array | test.c:17:7:17:8 | p1 | -| test.c:7:14:7:18 | access to array | test.c:23:13:23:14 | p1 | -| test.c:7:14:7:18 | access to array | test.c:25:7:25:8 | p1 | -| test.c:8:14:8:15 | l1 | test.c:8:14:8:18 | access to array | -| test.c:8:14:8:18 | access to array | test.c:11:12:11:13 | p2 | -| test.c:8:14:8:18 | access to array | test.c:21:7:21:8 | p2 | -| test.c:9:14:9:15 | l2 | test.c:9:14:9:18 | access to array | -| test.c:9:14:9:18 | access to array | test.c:21:12:21:13 | p3 | +| test.c:6:13:6:14 | l1 | test.c:13:12:13:13 | p0 | provenance | | +| test.c:7:14:7:15 | l1 | test.c:7:14:7:18 | access to array | provenance | | +| test.c:7:14:7:18 | access to array | test.c:11:7:11:8 | p1 | provenance | | +| test.c:7:14:7:18 | access to array | test.c:13:7:13:8 | p1 | provenance | | +| test.c:7:14:7:18 | access to array | test.c:15:13:15:14 | p1 | provenance | | +| test.c:7:14:7:18 | access to array | test.c:17:7:17:8 | p1 | provenance | | +| test.c:7:14:7:18 | access to array | test.c:23:13:23:14 | p1 | provenance | | +| test.c:7:14:7:18 | access to array | test.c:25:7:25:8 | p1 | provenance | | +| test.c:8:14:8:15 | l1 | test.c:8:14:8:18 | access to array | provenance | | +| test.c:8:14:8:18 | access to array | test.c:11:12:11:13 | p2 | provenance | | +| test.c:8:14:8:18 | access to array | test.c:21:7:21:8 | p2 | provenance | | +| test.c:9:14:9:15 | l2 | test.c:9:14:9:18 | access to array | provenance | | +| test.c:9:14:9:18 | access to array | test.c:21:12:21:13 | p3 | provenance | | nodes | test.c:6:13:6:14 | l1 | semmle.label | l1 | | test.c:7:14:7:15 | l1 | semmle.label | l1 | diff --git a/c/common/test/rules/onlyfreememoryallocateddynamicallyshared/OnlyFreeMemoryAllocatedDynamicallyShared.expected b/c/common/test/rules/onlyfreememoryallocateddynamicallyshared/OnlyFreeMemoryAllocatedDynamicallyShared.expected index 5881d5e78f..a6c41a6d75 100644 --- a/c/common/test/rules/onlyfreememoryallocateddynamicallyshared/OnlyFreeMemoryAllocatedDynamicallyShared.expected +++ b/c/common/test/rules/onlyfreememoryallocateddynamicallyshared/OnlyFreeMemoryAllocatedDynamicallyShared.expected @@ -6,10 +6,10 @@ problems | test.c:18:36:18:38 | ptr | test.c:27:7:27:8 | & ... | test.c:18:36:18:38 | ptr | Free expression frees memory which was not dynamically allocated. | | test.c:26:8:26:8 | p | test.c:25:13:25:14 | & ... | test.c:26:8:26:8 | p | Free expression frees memory which was not dynamically allocated. | edges -| test.c:18:24:18:26 | ptr | test.c:18:36:18:38 | ptr | -| test.c:25:13:25:14 | & ... | test.c:26:8:26:8 | p | -| test.c:27:7:27:8 | & ... | test.c:28:15:28:15 | p | -| test.c:28:15:28:15 | p | test.c:18:24:18:26 | ptr | +| test.c:18:24:18:26 | ptr | test.c:18:36:18:38 | ptr | provenance | | +| test.c:25:13:25:14 | & ... | test.c:26:8:26:8 | p | provenance | | +| test.c:27:7:27:8 | & ... | test.c:28:15:28:15 | p | provenance | | +| test.c:28:15:28:15 | p | test.c:18:24:18:26 | ptr | provenance | | nodes | test.c:8:8:8:10 | g_p | semmle.label | g_p | | test.c:10:8:10:10 | g_p | semmle.label | g_p | diff --git a/c/misra/test/rules/RULE-21-14/MemcmpUsedToCompareNullTerminatedStrings.expected b/c/misra/test/rules/RULE-21-14/MemcmpUsedToCompareNullTerminatedStrings.expected index bdfec99b4a..cded1a0a89 100644 --- a/c/misra/test/rules/RULE-21-14/MemcmpUsedToCompareNullTerminatedStrings.expected +++ b/c/misra/test/rules/RULE-21-14/MemcmpUsedToCompareNullTerminatedStrings.expected @@ -1,10 +1,10 @@ edges -| test.c:12:13:12:15 | a | test.c:14:10:14:10 | a | -| test.c:12:13:12:15 | a | test.c:23:13:23:13 | a | -| test.c:12:13:12:15 | a | test.c:24:10:24:10 | a | -| test.c:13:13:13:15 | b | test.c:14:13:14:13 | b | -| test.c:18:15:18:28 | {...} | test.c:21:10:21:10 | e | -| test.c:19:15:19:28 | {...} | test.c:21:13:21:13 | f | +| test.c:12:13:12:15 | a | test.c:14:10:14:10 | a | provenance | | +| test.c:12:13:12:15 | a | test.c:23:13:23:13 | a | provenance | | +| test.c:12:13:12:15 | a | test.c:24:10:24:10 | a | provenance | | +| test.c:13:13:13:15 | b | test.c:14:13:14:13 | b | provenance | | +| test.c:18:15:18:28 | {...} | test.c:21:10:21:10 | e | provenance | | +| test.c:19:15:19:28 | {...} | test.c:21:13:21:13 | f | provenance | | nodes | test.c:10:10:10:12 | a | semmle.label | a | | test.c:10:15:10:17 | b | semmle.label | b | diff --git a/cpp/autosar/test/rules/A18-1-4/PointerToAnElementOfAnArrayPassedToASmartPointer.expected b/cpp/autosar/test/rules/A18-1-4/PointerToAnElementOfAnArrayPassedToASmartPointer.expected index dcf263fc54..5f752403dc 100644 --- a/cpp/autosar/test/rules/A18-1-4/PointerToAnElementOfAnArrayPassedToASmartPointer.expected +++ b/cpp/autosar/test/rules/A18-1-4/PointerToAnElementOfAnArrayPassedToASmartPointer.expected @@ -1,10 +1,10 @@ edges -| test.cpp:3:36:3:45 | new[] | test.cpp:19:27:19:44 | call to allocate_int_array | -| test.cpp:3:36:3:45 | new[] | test.cpp:23:12:23:29 | call to allocate_int_array | -| test.cpp:3:36:3:45 | new[] | test.cpp:27:20:27:37 | call to allocate_int_array | -| test.cpp:11:29:11:41 | call to unique_ptr | test.cpp:12:27:12:28 | v2 | -| test.cpp:12:27:12:28 | v2 | test.cpp:12:30:12:36 | call to release | -| test.cpp:27:20:27:37 | call to allocate_int_array | test.cpp:32:12:32:20 | int_array | +| test.cpp:3:36:3:45 | new[] | test.cpp:19:27:19:44 | call to allocate_int_array | provenance | | +| test.cpp:3:36:3:45 | new[] | test.cpp:23:12:23:29 | call to allocate_int_array | provenance | | +| test.cpp:3:36:3:45 | new[] | test.cpp:27:20:27:37 | call to allocate_int_array | provenance | | +| test.cpp:11:29:11:41 | call to unique_ptr | test.cpp:12:27:12:28 | v2 | provenance | | +| test.cpp:12:27:12:28 | v2 | test.cpp:12:30:12:36 | call to release | provenance | | +| test.cpp:27:20:27:37 | call to allocate_int_array | test.cpp:32:12:32:20 | int_array | provenance | | nodes | test.cpp:3:36:3:45 | new[] | semmle.label | new[] | | test.cpp:11:29:11:41 | call to unique_ptr | semmle.label | call to unique_ptr | diff --git a/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected b/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected index 4234d93b32..b47755725c 100644 --- a/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected +++ b/cpp/autosar/test/rules/A5-0-4/PointerArithmeticUsedWithPointersToNonFinalClasses.expected @@ -1,15 +1,15 @@ edges -| test.cpp:10:18:10:20 | foo | test.cpp:11:23:11:25 | foo | -| test.cpp:10:18:10:20 | foo | test.cpp:11:50:11:52 | foo | -| test.cpp:22:18:22:20 | foo | test.cpp:24:18:24:20 | foo | -| test.cpp:35:11:35:17 | new | test.cpp:38:6:38:7 | l1 | -| test.cpp:35:11:35:17 | new | test.cpp:39:6:39:7 | l1 | -| test.cpp:37:11:37:13 | & ... | test.cpp:40:6:40:7 | l3 | -| test.cpp:37:11:37:13 | & ... | test.cpp:41:6:41:7 | l3 | -| test.cpp:38:6:38:7 | l1 | test.cpp:10:18:10:20 | foo | -| test.cpp:39:6:39:7 | l1 | test.cpp:22:18:22:20 | foo | -| test.cpp:40:6:40:7 | l3 | test.cpp:10:18:10:20 | foo | -| test.cpp:41:6:41:7 | l3 | test.cpp:22:18:22:20 | foo | +| test.cpp:10:18:10:20 | foo | test.cpp:11:23:11:25 | foo | provenance | | +| test.cpp:10:18:10:20 | foo | test.cpp:11:50:11:52 | foo | provenance | | +| test.cpp:22:18:22:20 | foo | test.cpp:24:18:24:20 | foo | provenance | | +| test.cpp:35:11:35:17 | new | test.cpp:38:6:38:7 | l1 | provenance | | +| test.cpp:35:11:35:17 | new | test.cpp:39:6:39:7 | l1 | provenance | | +| test.cpp:37:11:37:13 | & ... | test.cpp:40:6:40:7 | l3 | provenance | | +| test.cpp:37:11:37:13 | & ... | test.cpp:41:6:41:7 | l3 | provenance | | +| test.cpp:38:6:38:7 | l1 | test.cpp:10:18:10:20 | foo | provenance | | +| test.cpp:39:6:39:7 | l1 | test.cpp:22:18:22:20 | foo | provenance | | +| test.cpp:40:6:40:7 | l3 | test.cpp:10:18:10:20 | foo | provenance | | +| test.cpp:41:6:41:7 | l3 | test.cpp:22:18:22:20 | foo | provenance | | nodes | test.cpp:10:18:10:20 | foo | semmle.label | foo | | test.cpp:11:23:11:25 | foo | semmle.label | foo | diff --git a/cpp/autosar/test/rules/A5-1-7/LambdaPassedToTypeid.expected b/cpp/autosar/test/rules/A5-1-7/LambdaPassedToTypeid.expected index 4b19073ded..6d65a7b5d5 100644 --- a/cpp/autosar/test/rules/A5-1-7/LambdaPassedToTypeid.expected +++ b/cpp/autosar/test/rules/A5-1-7/LambdaPassedToTypeid.expected @@ -1,6 +1,6 @@ edges -| test.cpp:5:13:5:30 | [...](...){...} | test.cpp:8:38:8:39 | l1 | -| test.cpp:6:13:6:30 | [...](...){...} | test.cpp:9:38:9:39 | l2 | +| test.cpp:5:13:5:30 | [...](...){...} | test.cpp:8:38:8:39 | l1 | provenance | | +| test.cpp:6:13:6:30 | [...](...){...} | test.cpp:9:38:9:39 | l2 | provenance | | nodes | test.cpp:5:13:5:30 | [...](...){...} | semmle.label | [...](...){...} | | test.cpp:6:13:6:30 | [...](...){...} | semmle.label | [...](...){...} | diff --git a/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected b/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected index 0ee15c65b5..eabb6d7515 100644 --- a/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected +++ b/cpp/cert/test/rules/CTR56-CPP/DoNotUsePointerArithmeticOnPolymorphicObjects.expected @@ -1,15 +1,15 @@ edges -| test.cpp:15:19:15:21 | foo | test.cpp:16:24:16:26 | foo | -| test.cpp:15:19:15:21 | foo | test.cpp:16:51:16:53 | foo | -| test.cpp:27:19:27:21 | foo | test.cpp:29:18:29:20 | foo | -| test.cpp:40:12:40:19 | new | test.cpp:43:6:43:7 | l1 | -| test.cpp:40:12:40:19 | new | test.cpp:44:6:44:7 | l1 | -| test.cpp:42:12:42:14 | & ... | test.cpp:45:6:45:7 | l3 | -| test.cpp:42:12:42:14 | & ... | test.cpp:46:6:46:7 | l3 | -| test.cpp:43:6:43:7 | l1 | test.cpp:15:19:15:21 | foo | -| test.cpp:44:6:44:7 | l1 | test.cpp:27:19:27:21 | foo | -| test.cpp:45:6:45:7 | l3 | test.cpp:15:19:15:21 | foo | -| test.cpp:46:6:46:7 | l3 | test.cpp:27:19:27:21 | foo | +| test.cpp:15:19:15:21 | foo | test.cpp:16:24:16:26 | foo | provenance | | +| test.cpp:15:19:15:21 | foo | test.cpp:16:51:16:53 | foo | provenance | | +| test.cpp:27:19:27:21 | foo | test.cpp:29:18:29:20 | foo | provenance | | +| test.cpp:40:12:40:19 | new | test.cpp:43:6:43:7 | l1 | provenance | | +| test.cpp:40:12:40:19 | new | test.cpp:44:6:44:7 | l1 | provenance | | +| test.cpp:42:12:42:14 | & ... | test.cpp:45:6:45:7 | l3 | provenance | | +| test.cpp:42:12:42:14 | & ... | test.cpp:46:6:46:7 | l3 | provenance | | +| test.cpp:43:6:43:7 | l1 | test.cpp:15:19:15:21 | foo | provenance | | +| test.cpp:44:6:44:7 | l1 | test.cpp:27:19:27:21 | foo | provenance | | +| test.cpp:45:6:45:7 | l3 | test.cpp:15:19:15:21 | foo | provenance | | +| test.cpp:46:6:46:7 | l3 | test.cpp:27:19:27:21 | foo | provenance | | nodes | test.cpp:15:19:15:21 | foo | semmle.label | foo | | test.cpp:16:24:16:26 | foo | semmle.label | foo | diff --git a/cpp/cert/test/rules/EXP51-CPP/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectType.expected b/cpp/cert/test/rules/EXP51-CPP/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectType.expected index a50daa096e..9c6e6dd071 100644 --- a/cpp/cert/test/rules/EXP51-CPP/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectType.expected +++ b/cpp/cert/test/rules/EXP51-CPP/DoNotDeleteAnArrayThroughAPointerOfTheIncorrectType.expected @@ -1,6 +1,6 @@ edges -| test.cpp:6:19:6:37 | new[] | test.cpp:9:12:9:13 | l1 | -| test.cpp:7:22:7:40 | new[] | test.cpp:10:12:10:13 | l2 | +| test.cpp:6:19:6:37 | new[] | test.cpp:9:12:9:13 | l1 | provenance | | +| test.cpp:7:22:7:40 | new[] | test.cpp:10:12:10:13 | l2 | provenance | | nodes | test.cpp:6:19:6:37 | new[] | semmle.label | new[] | | test.cpp:7:22:7:40 | new[] | semmle.label | new[] | diff --git a/cpp/cert/test/rules/MEM53-CPP/MissingConstructorCallForManuallyManagedObject.expected b/cpp/cert/test/rules/MEM53-CPP/MissingConstructorCallForManuallyManagedObject.expected index e64315e044..860fec1d80 100644 --- a/cpp/cert/test/rules/MEM53-CPP/MissingConstructorCallForManuallyManagedObject.expected +++ b/cpp/cert/test/rules/MEM53-CPP/MissingConstructorCallForManuallyManagedObject.expected @@ -1,5 +1,5 @@ edges -| test.cpp:65:21:65:34 | call to operator new | test.cpp:67:26:67:32 | call to realloc | +| test.cpp:65:21:65:34 | call to operator new | test.cpp:67:26:67:32 | call to realloc | provenance | | nodes | test.cpp:16:26:16:31 | call to malloc | semmle.label | call to malloc | | test.cpp:17:38:17:43 | call to malloc | semmle.label | call to malloc | diff --git a/cpp/cert/test/rules/MEM53-CPP/MissingDestructorCallForManuallyManagedObject.expected b/cpp/cert/test/rules/MEM53-CPP/MissingDestructorCallForManuallyManagedObject.expected index 00ed15c370..f7f4705ef3 100644 --- a/cpp/cert/test/rules/MEM53-CPP/MissingDestructorCallForManuallyManagedObject.expected +++ b/cpp/cert/test/rules/MEM53-CPP/MissingDestructorCallForManuallyManagedObject.expected @@ -1,8 +1,8 @@ edges -| test.cpp:16:26:16:31 | call to malloc | test.cpp:22:8:22:9 | a1 | -| test.cpp:17:38:17:43 | call to malloc | test.cpp:23:8:23:9 | a2 | -| test.cpp:18:26:18:39 | call to operator new | test.cpp:26:21:26:22 | a3 | -| test.cpp:20:29:20:42 | call to operator new | test.cpp:27:21:27:22 | a4 | +| test.cpp:16:26:16:31 | call to malloc | test.cpp:22:8:22:9 | a1 | provenance | | +| test.cpp:17:38:17:43 | call to malloc | test.cpp:23:8:23:9 | a2 | provenance | | +| test.cpp:18:26:18:39 | call to operator new | test.cpp:26:21:26:22 | a3 | provenance | | +| test.cpp:20:29:20:42 | call to operator new | test.cpp:27:21:27:22 | a4 | provenance | | nodes | test.cpp:16:26:16:31 | call to malloc | semmle.label | call to malloc | | test.cpp:17:38:17:43 | call to malloc | semmle.label | call to malloc | diff --git a/cpp/common/test/rules/accessofundefinedmemberthroughnullpointer/AccessOfUndefinedMemberThroughNullPointer.expected b/cpp/common/test/rules/accessofundefinedmemberthroughnullpointer/AccessOfUndefinedMemberThroughNullPointer.expected index a4e40cc6cb..7a43b3757e 100644 --- a/cpp/common/test/rules/accessofundefinedmemberthroughnullpointer/AccessOfUndefinedMemberThroughNullPointer.expected +++ b/cpp/common/test/rules/accessofundefinedmemberthroughnullpointer/AccessOfUndefinedMemberThroughNullPointer.expected @@ -2,8 +2,8 @@ problems | test.cpp:10:3:10:13 | call to expression | test.cpp:8:22:8:28 | 0 | test.cpp:10:9:10:10 | l2 | A null pointer-to-member value from $@ is passed as the second operand to a pointer-to-member expression. | test.cpp:8:22:8:28 | test.cpp:8:22:8:28 | initialization | | test.cpp:11:8:11:9 | l3 | test.cpp:9:17:9:23 | 0 | test.cpp:11:8:11:9 | l3 | A null pointer-to-member value from $@ is passed as the second operand to a pointer-to-member expression. | test.cpp:9:17:9:23 | test.cpp:9:17:9:23 | initialization | edges -| test.cpp:8:22:8:28 | 0 | test.cpp:10:9:10:10 | l2 | -| test.cpp:9:17:9:23 | 0 | test.cpp:11:8:11:9 | l3 | +| test.cpp:8:22:8:28 | 0 | test.cpp:10:9:10:10 | l2 | provenance | | +| test.cpp:9:17:9:23 | 0 | test.cpp:11:8:11:9 | l3 | provenance | | nodes | test.cpp:8:22:8:28 | 0 | semmle.label | 0 | | test.cpp:9:17:9:23 | 0 | semmle.label | 0 | diff --git a/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected b/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected index 537228a000..dcbc6d05bc 100644 --- a/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected +++ b/cpp/common/test/rules/donotsubtractpointersaddressingdifferentarrays/DoNotSubtractPointersAddressingDifferentArrays.expected @@ -4,14 +4,14 @@ problems | test.cpp:13:10:13:11 | p4 | test.cpp:5:14:5:15 | l2 | test.cpp:13:10:13:11 | p4 | Subtraction between left operand pointing to array $@ and other operand pointing to array $@. | test.cpp:3:7:3:8 | l2 | l2 | test.cpp:2:7:2:8 | l1 | l1 | | test.cpp:13:15:13:16 | l1 | test.cpp:13:15:13:16 | l1 | test.cpp:13:15:13:16 | l1 | Subtraction between right operand pointing to array $@ and other operand pointing to array $@. | test.cpp:2:7:2:8 | l1 | l1 | test.cpp:3:7:3:8 | l2 | l2 | edges -| test.cpp:4:14:4:15 | l1 | test.cpp:4:14:4:18 | access to array | -| test.cpp:4:14:4:18 | access to array | test.cpp:10:10:10:11 | p1 | -| test.cpp:4:14:4:18 | access to array | test.cpp:12:10:12:11 | p1 | -| test.cpp:5:14:5:15 | l2 | test.cpp:5:14:5:19 | access to array | -| test.cpp:5:14:5:19 | access to array | test.cpp:11:10:11:11 | p2 | -| test.cpp:5:14:5:19 | access to array | test.cpp:12:15:12:16 | p2 | -| test.cpp:5:14:5:19 | access to array | test.cpp:13:10:13:11 | p4 | -| test.cpp:5:14:5:19 | access to array | test.cpp:14:10:14:11 | p4 | +| test.cpp:4:14:4:15 | l1 | test.cpp:4:14:4:18 | access to array | provenance | | +| test.cpp:4:14:4:18 | access to array | test.cpp:10:10:10:11 | p1 | provenance | | +| test.cpp:4:14:4:18 | access to array | test.cpp:12:10:12:11 | p1 | provenance | | +| test.cpp:5:14:5:15 | l2 | test.cpp:5:14:5:19 | access to array | provenance | | +| test.cpp:5:14:5:19 | access to array | test.cpp:11:10:11:11 | p2 | provenance | | +| test.cpp:5:14:5:19 | access to array | test.cpp:12:15:12:16 | p2 | provenance | | +| test.cpp:5:14:5:19 | access to array | test.cpp:13:10:13:11 | p4 | provenance | | +| test.cpp:5:14:5:19 | access to array | test.cpp:14:10:14:11 | p4 | provenance | | nodes | test.cpp:4:14:4:15 | l1 | semmle.label | l1 | | test.cpp:4:14:4:18 | access to array | semmle.label | access to array | diff --git a/cpp/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected b/cpp/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected index 22ddfd123a..f02c9a5712 100644 --- a/cpp/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected +++ b/cpp/common/test/rules/donotuserelationaloperatorswithdifferingarrays/DoNotUseRelationalOperatorsWithDifferingArrays.expected @@ -10,19 +10,19 @@ problems | test.cpp:25:7:25:14 | ... >= ... | test.cpp:7:14:7:15 | l1 | test.cpp:25:7:25:8 | p1 | Compare operation >= comparing left operand pointing to array $@ and other operand pointing to array $@. | test.cpp:2:7:2:8 | l1 | l1 | test.cpp:4:7:4:8 | l3 | l3 | | test.cpp:25:7:25:14 | ... >= ... | test.cpp:25:13:25:14 | l3 | test.cpp:25:13:25:14 | l3 | Compare operation >= comparing right operand pointing to array $@ and other operand pointing to array $@. | test.cpp:4:7:4:8 | l3 | l3 | test.cpp:2:7:2:8 | l1 | l1 | edges -| test.cpp:6:13:6:14 | l1 | test.cpp:13:12:13:13 | p0 | -| test.cpp:7:14:7:15 | l1 | test.cpp:7:14:7:18 | access to array | -| test.cpp:7:14:7:18 | access to array | test.cpp:11:7:11:8 | p1 | -| test.cpp:7:14:7:18 | access to array | test.cpp:13:7:13:8 | p1 | -| test.cpp:7:14:7:18 | access to array | test.cpp:15:13:15:14 | p1 | -| test.cpp:7:14:7:18 | access to array | test.cpp:17:7:17:8 | p1 | -| test.cpp:7:14:7:18 | access to array | test.cpp:23:13:23:14 | p1 | -| test.cpp:7:14:7:18 | access to array | test.cpp:25:7:25:8 | p1 | -| test.cpp:8:14:8:15 | l1 | test.cpp:8:14:8:18 | access to array | -| test.cpp:8:14:8:18 | access to array | test.cpp:11:12:11:13 | p2 | -| test.cpp:8:14:8:18 | access to array | test.cpp:21:7:21:8 | p2 | -| test.cpp:9:14:9:15 | l2 | test.cpp:9:14:9:18 | access to array | -| test.cpp:9:14:9:18 | access to array | test.cpp:21:12:21:13 | p3 | +| test.cpp:6:13:6:14 | l1 | test.cpp:13:12:13:13 | p0 | provenance | | +| test.cpp:7:14:7:15 | l1 | test.cpp:7:14:7:18 | access to array | provenance | | +| test.cpp:7:14:7:18 | access to array | test.cpp:11:7:11:8 | p1 | provenance | | +| test.cpp:7:14:7:18 | access to array | test.cpp:13:7:13:8 | p1 | provenance | | +| test.cpp:7:14:7:18 | access to array | test.cpp:15:13:15:14 | p1 | provenance | | +| test.cpp:7:14:7:18 | access to array | test.cpp:17:7:17:8 | p1 | provenance | | +| test.cpp:7:14:7:18 | access to array | test.cpp:23:13:23:14 | p1 | provenance | | +| test.cpp:7:14:7:18 | access to array | test.cpp:25:7:25:8 | p1 | provenance | | +| test.cpp:8:14:8:15 | l1 | test.cpp:8:14:8:18 | access to array | provenance | | +| test.cpp:8:14:8:18 | access to array | test.cpp:11:12:11:13 | p2 | provenance | | +| test.cpp:8:14:8:18 | access to array | test.cpp:21:7:21:8 | p2 | provenance | | +| test.cpp:9:14:9:15 | l2 | test.cpp:9:14:9:18 | access to array | provenance | | +| test.cpp:9:14:9:18 | access to array | test.cpp:21:12:21:13 | p3 | provenance | | nodes | test.cpp:6:13:6:14 | l1 | semmle.label | l1 | | test.cpp:7:14:7:15 | l1 | semmle.label | l1 | diff --git a/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected b/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected index 3d00ff0d6a..0b23493cfa 100644 --- a/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected +++ b/cpp/common/test/rules/ownedpointervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.expected @@ -6,21 +6,21 @@ problems | test.cpp:12:28:12:29 | v2 | test.cpp:10:8:10:17 | new | test.cpp:12:28:12:29 | v2 | Raw pointer flows to initialize multiple unrelated smart pointers. | | test.cpp:17:27:17:28 | v1 | test.cpp:16:13:16:22 | new | test.cpp:17:27:17:28 | v1 | Raw pointer flows to initialize multiple unrelated smart pointers. | edges -| test.cpp:3:14:3:15 | v1 | test.cpp:5:27:5:28 | v1 | -| test.cpp:3:14:3:15 | v1 | test.cpp:5:27:5:28 | v1 | -| test.cpp:3:14:3:15 | v1 | test.cpp:7:28:7:29 | v2 | -| test.cpp:4:13:4:14 | v1 | test.cpp:7:28:7:29 | v2 | -| test.cpp:5:27:5:28 | v1 | test.cpp:5:27:5:29 | call to shared_ptr | -| test.cpp:5:27:5:29 | call to shared_ptr | test.cpp:6:28:6:29 | p1 | -| test.cpp:5:27:5:29 | call to shared_ptr | test.cpp:6:28:6:29 | p1 | -| test.cpp:6:28:6:29 | p1 | test.cpp:6:31:6:33 | call to get | -| test.cpp:6:28:6:29 | p1 | test.cpp:6:31:6:33 | call to get | -| test.cpp:8:8:8:14 | 0 | test.cpp:9:28:9:29 | v2 | -| test.cpp:10:8:10:17 | new | test.cpp:11:28:11:29 | v2 | -| test.cpp:10:8:10:17 | new | test.cpp:12:28:12:29 | v2 | -| test.cpp:16:13:16:22 | new | test.cpp:17:27:17:28 | v1 | -| test.cpp:16:13:16:22 | new | test.cpp:19:6:19:7 | v1 | -| test.cpp:19:6:19:7 | v1 | test.cpp:3:14:3:15 | v1 | +| test.cpp:3:14:3:15 | v1 | test.cpp:5:27:5:28 | v1 | provenance | | +| test.cpp:3:14:3:15 | v1 | test.cpp:5:27:5:28 | v1 | provenance | | +| test.cpp:3:14:3:15 | v1 | test.cpp:7:28:7:29 | v2 | provenance | | +| test.cpp:4:13:4:14 | v1 | test.cpp:7:28:7:29 | v2 | provenance | | +| test.cpp:5:27:5:28 | v1 | test.cpp:5:27:5:29 | call to shared_ptr | provenance | | +| test.cpp:5:27:5:29 | call to shared_ptr | test.cpp:6:28:6:29 | p1 | provenance | | +| test.cpp:5:27:5:29 | call to shared_ptr | test.cpp:6:28:6:29 | p1 | provenance | | +| test.cpp:6:28:6:29 | p1 | test.cpp:6:31:6:33 | call to get | provenance | | +| test.cpp:6:28:6:29 | p1 | test.cpp:6:31:6:33 | call to get | provenance | | +| test.cpp:8:8:8:14 | 0 | test.cpp:9:28:9:29 | v2 | provenance | | +| test.cpp:10:8:10:17 | new | test.cpp:11:28:11:29 | v2 | provenance | | +| test.cpp:10:8:10:17 | new | test.cpp:12:28:12:29 | v2 | provenance | | +| test.cpp:16:13:16:22 | new | test.cpp:17:27:17:28 | v1 | provenance | | +| test.cpp:16:13:16:22 | new | test.cpp:19:6:19:7 | v1 | provenance | | +| test.cpp:19:6:19:7 | v1 | test.cpp:3:14:3:15 | v1 | provenance | | nodes | test.cpp:3:14:3:15 | v1 | semmle.label | v1 | | test.cpp:4:13:4:14 | v1 | semmle.label | v1 | diff --git a/cpp/common/test/rules/throwingoperatornewreturnsnull/ThrowingOperatorNewReturnsNull.expected b/cpp/common/test/rules/throwingoperatornewreturnsnull/ThrowingOperatorNewReturnsNull.expected index ae8a0d626b..5e047a77da 100644 --- a/cpp/common/test/rules/throwingoperatornewreturnsnull/ThrowingOperatorNewReturnsNull.expected +++ b/cpp/common/test/rules/throwingoperatornewreturnsnull/ThrowingOperatorNewReturnsNull.expected @@ -3,8 +3,8 @@ problems | test.cpp:12:5:12:19 | return ... | test.cpp:12:12:12:18 | 0 | test.cpp:12:12:12:18 | 0 | operator new(size_t) may return null instead of throwing a std::bad_alloc exception. | | test.cpp:14:5:14:33 | return ... | test.cpp:4:10:4:23 | call to operator new | test.cpp:14:12:14:26 | call to can_return_null | operator new(size_t) may return null instead of throwing a std::bad_alloc exception. | edges -| test.cpp:4:10:4:23 | call to operator new | test.cpp:14:12:14:26 | call to can_return_null | -| test.cpp:8:23:8:23 | 0 | test.cpp:10:12:10:24 | localVariable | +| test.cpp:4:10:4:23 | call to operator new | test.cpp:14:12:14:26 | call to can_return_null | provenance | | +| test.cpp:8:23:8:23 | 0 | test.cpp:10:12:10:24 | localVariable | provenance | | nodes | test.cpp:4:10:4:23 | call to operator new | semmle.label | call to operator new | | test.cpp:8:23:8:23 | 0 | semmle.label | 0 | From 0b02e6b06e40c2c52cfd625155d12d09ea91074d Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 9 Feb 2024 12:39:56 +0000 Subject: [PATCH 06/12] Accept changes from github/codeql/15549 --- .../PlacementNewInsufficientStorage.expected | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cpp/common/test/rules/placementnewinsufficientstorage/PlacementNewInsufficientStorage.expected b/cpp/common/test/rules/placementnewinsufficientstorage/PlacementNewInsufficientStorage.expected index 3c38e192bc..a4c3bb1df6 100644 --- a/cpp/common/test/rules/placementnewinsufficientstorage/PlacementNewInsufficientStorage.expected +++ b/cpp/common/test/rules/placementnewinsufficientstorage/PlacementNewInsufficientStorage.expected @@ -7,18 +7,18 @@ problems | test.cpp:100:16:100:39 | new | test.cpp:65:36:65:38 | call to pop | test.cpp:100:21:100:28 | badAlloc | Placement new expression is used with an insufficiently large memory allocation from $@. | test.cpp:65:36:65:38 | call to pop | call to pop | | test.cpp:113:7:113:32 | new[] | test.cpp:113:14:113:21 | badAlloc | test.cpp:113:14:113:21 | badAlloc | Placement new expression is used with an insufficiently large memory allocation from $@. | test.cpp:113:14:113:21 | badAlloc | badAlloc | edges -| test.cpp:18:36:18:49 | call to operator new | test.cpp:19:21:19:44 | correctlyAllocatedMemory | -| test.cpp:24:37:24:50 | call to operator new | test.cpp:25:21:25:45 | correctlyAllocatedMemory2 | -| test.cpp:29:32:29:45 | call to operator new | test.cpp:31:21:31:40 | badlyAllocatedMemory | -| test.cpp:35:33:35:46 | call to operator new | test.cpp:37:21:37:41 | badlyAllocatedMemory2 | -| test.cpp:62:16:62:29 | call to operator new | test.cpp:67:12:67:17 | memory | -| test.cpp:62:16:62:29 | call to operator new | test.cpp:67:12:67:17 | memory | -| test.cpp:65:36:65:38 | call to pop | test.cpp:67:12:67:17 | memory | -| test.cpp:65:36:65:38 | call to pop | test.cpp:67:12:67:17 | memory | -| test.cpp:67:12:67:17 | memory | test.cpp:94:32:94:39 | call to allocate | -| test.cpp:67:12:67:17 | memory | test.cpp:98:31:98:38 | call to allocate | -| test.cpp:94:32:94:39 | call to allocate | test.cpp:95:21:95:29 | goodAlloc | -| test.cpp:98:31:98:38 | call to allocate | test.cpp:100:21:100:28 | badAlloc | +| test.cpp:18:36:18:49 | call to operator new | test.cpp:19:21:19:44 | correctlyAllocatedMemory | provenance | | +| test.cpp:24:37:24:50 | call to operator new | test.cpp:25:21:25:45 | correctlyAllocatedMemory2 | provenance | | +| test.cpp:29:32:29:45 | call to operator new | test.cpp:31:21:31:40 | badlyAllocatedMemory | provenance | | +| test.cpp:35:33:35:46 | call to operator new | test.cpp:37:21:37:41 | badlyAllocatedMemory2 | provenance | | +| test.cpp:62:16:62:29 | call to operator new | test.cpp:67:12:67:17 | memory | provenance | | +| test.cpp:62:16:62:29 | call to operator new | test.cpp:67:12:67:17 | memory | provenance | | +| test.cpp:65:36:65:38 | call to pop | test.cpp:67:12:67:17 | memory | provenance | | +| test.cpp:65:36:65:38 | call to pop | test.cpp:67:12:67:17 | memory | provenance | | +| test.cpp:67:12:67:17 | memory | test.cpp:94:32:94:39 | call to allocate | provenance | | +| test.cpp:67:12:67:17 | memory | test.cpp:98:31:98:38 | call to allocate | provenance | | +| test.cpp:94:32:94:39 | call to allocate | test.cpp:95:21:95:29 | goodAlloc | provenance | | +| test.cpp:98:31:98:38 | call to allocate | test.cpp:100:21:100:28 | badAlloc | provenance | | nodes | test.cpp:18:36:18:49 | call to operator new | semmle.label | call to operator new | | test.cpp:19:21:19:44 | correctlyAllocatedMemory | semmle.label | correctlyAllocatedMemory | From a2eefa47691998e45b1e0b053ee535711b35dc34 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 28 Feb 2024 11:40:17 +0100 Subject: [PATCH 07/12] Update test after frontend update --- .../UserDefinedConversionOperatorsShouldNotBeUsed.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected b/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected index e757cdf984..14e68ab4a9 100644 --- a/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected +++ b/cpp/autosar/test/rules/A13-5-3/UserDefinedConversionOperatorsShouldNotBeUsed.expected @@ -1,4 +1,4 @@ | test.cpp:33:7:33:7 | call to operator A | User-defined conversion operators should not be used. | | test.cpp:35:24:35:24 | call to operator A * | User-defined conversion operators should not be used. | -| test.cpp:37:15:37:15 | call to operator B::array_A * | User-defined conversion operators should not be used. | +| test.cpp:37:15:37:15 | call to operator A (*)[3] | User-defined conversion operators should not be used. | | test.cpp:41:7:41:7 | call to operator A * | User-defined conversion operators should not be used. | From 0c3a1a50374ac68baed2ef0e6b858338077e8480 Mon Sep 17 00:00:00 2001 From: lcartey <5377966+lcartey@users.noreply.github.com> Date: Tue, 8 Oct 2024 14:32:43 +0000 Subject: [PATCH 08/12] Upgrading `github/codeql` dependency to 2.16.6 --- c/cert/src/codeql-pack.lock.yml | 14 +++++++------- c/cert/src/qlpack.yml | 2 +- c/cert/test/codeql-pack.lock.yml | 14 +++++++------- c/common/src/codeql-pack.lock.yml | 14 +++++++------- c/common/src/qlpack.yml | 2 +- c/common/test/codeql-pack.lock.yml | 14 +++++++------- c/misra/src/codeql-pack.lock.yml | 14 +++++++------- c/misra/src/qlpack.yml | 2 +- c/misra/test/codeql-pack.lock.yml | 14 +++++++------- cpp/autosar/src/codeql-pack.lock.yml | 14 +++++++------- cpp/autosar/src/qlpack.yml | 2 +- cpp/autosar/test/codeql-pack.lock.yml | 14 +++++++------- cpp/cert/src/codeql-pack.lock.yml | 14 +++++++------- cpp/cert/src/qlpack.yml | 2 +- cpp/cert/test/codeql-pack.lock.yml | 14 +++++++------- cpp/common/src/codeql-pack.lock.yml | 14 +++++++------- cpp/common/src/qlpack.yml | 2 +- cpp/common/test/codeql-pack.lock.yml | 14 +++++++------- cpp/misra/src/codeql-pack.lock.yml | 14 +++++++------- cpp/misra/src/qlpack.yml | 2 +- cpp/misra/test/codeql-pack.lock.yml | 14 +++++++------- cpp/report/src/codeql-pack.lock.yml | 14 +++++++------- cpp/report/src/qlpack.yml | 2 +- .../generate_modules/queries/codeql-pack.lock.yml | 14 +++++++------- scripts/generate_modules/queries/qlpack.yml | 2 +- supported_codeql_configs.json | 6 +++--- 26 files changed, 124 insertions(+), 124 deletions(-) diff --git a/c/cert/src/codeql-pack.lock.yml b/c/cert/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/c/cert/src/codeql-pack.lock.yml +++ b/c/cert/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/c/cert/src/qlpack.yml b/c/cert/src/qlpack.yml index f0daa6334a..a55d7391da 100644 --- a/c/cert/src/qlpack.yml +++ b/c/cert/src/qlpack.yml @@ -5,4 +5,4 @@ suites: codeql-suites license: MIT dependencies: codeql/common-c-coding-standards: '*' - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/c/cert/test/codeql-pack.lock.yml b/c/cert/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/c/cert/test/codeql-pack.lock.yml +++ b/c/cert/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/c/common/src/codeql-pack.lock.yml b/c/common/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/c/common/src/codeql-pack.lock.yml +++ b/c/common/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/c/common/src/qlpack.yml b/c/common/src/qlpack.yml index 5f18365483..f1b5271d74 100644 --- a/c/common/src/qlpack.yml +++ b/c/common/src/qlpack.yml @@ -3,4 +3,4 @@ version: 2.36.0-dev license: MIT dependencies: codeql/common-cpp-coding-standards: '*' - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/c/common/test/codeql-pack.lock.yml b/c/common/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/c/common/test/codeql-pack.lock.yml +++ b/c/common/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/c/misra/src/codeql-pack.lock.yml b/c/misra/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/c/misra/src/codeql-pack.lock.yml +++ b/c/misra/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/c/misra/src/qlpack.yml b/c/misra/src/qlpack.yml index 9d0ed62e06..7839b51dd3 100644 --- a/c/misra/src/qlpack.yml +++ b/c/misra/src/qlpack.yml @@ -6,4 +6,4 @@ license: MIT default-suite-file: codeql-suites/misra-c-default.qls dependencies: codeql/common-c-coding-standards: '*' - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/c/misra/test/codeql-pack.lock.yml b/c/misra/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/c/misra/test/codeql-pack.lock.yml +++ b/c/misra/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/autosar/src/codeql-pack.lock.yml b/cpp/autosar/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/autosar/src/codeql-pack.lock.yml +++ b/cpp/autosar/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/autosar/src/qlpack.yml b/cpp/autosar/src/qlpack.yml index 93a0f4bd9a..fede5b3e69 100644 --- a/cpp/autosar/src/qlpack.yml +++ b/cpp/autosar/src/qlpack.yml @@ -5,4 +5,4 @@ suites: codeql-suites license: MIT dependencies: codeql/common-cpp-coding-standards: '*' - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/cpp/autosar/test/codeql-pack.lock.yml b/cpp/autosar/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/autosar/test/codeql-pack.lock.yml +++ b/cpp/autosar/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/cert/src/codeql-pack.lock.yml b/cpp/cert/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/cert/src/codeql-pack.lock.yml +++ b/cpp/cert/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/cert/src/qlpack.yml b/cpp/cert/src/qlpack.yml index 3a85e2aa20..f7cd4a0291 100644 --- a/cpp/cert/src/qlpack.yml +++ b/cpp/cert/src/qlpack.yml @@ -4,5 +4,5 @@ description: CERT C++ 2016 suites: codeql-suites license: MIT dependencies: - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 codeql/common-cpp-coding-standards: '*' diff --git a/cpp/cert/test/codeql-pack.lock.yml b/cpp/cert/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/cert/test/codeql-pack.lock.yml +++ b/cpp/cert/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/common/src/codeql-pack.lock.yml b/cpp/common/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/common/src/codeql-pack.lock.yml +++ b/cpp/common/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/common/src/qlpack.yml b/cpp/common/src/qlpack.yml index b7f90b4cd3..69483ef611 100644 --- a/cpp/common/src/qlpack.yml +++ b/cpp/common/src/qlpack.yml @@ -2,6 +2,6 @@ name: codeql/common-cpp-coding-standards version: 2.36.0-dev license: MIT dependencies: - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 dataExtensions: - ext/*.model.yml diff --git a/cpp/common/test/codeql-pack.lock.yml b/cpp/common/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/common/test/codeql-pack.lock.yml +++ b/cpp/common/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/misra/src/codeql-pack.lock.yml b/cpp/misra/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/misra/src/codeql-pack.lock.yml +++ b/cpp/misra/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/misra/src/qlpack.yml b/cpp/misra/src/qlpack.yml index b713614f68..19a37a8650 100644 --- a/cpp/misra/src/qlpack.yml +++ b/cpp/misra/src/qlpack.yml @@ -5,4 +5,4 @@ default-suite: codeql-suites/misra-cpp-default.qls license: MIT dependencies: codeql/common-cpp-coding-standards: '*' - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/cpp/misra/test/codeql-pack.lock.yml b/cpp/misra/test/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/misra/test/codeql-pack.lock.yml +++ b/cpp/misra/test/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/report/src/codeql-pack.lock.yml b/cpp/report/src/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/cpp/report/src/codeql-pack.lock.yml +++ b/cpp/report/src/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/cpp/report/src/qlpack.yml b/cpp/report/src/qlpack.yml index f90669908d..b37f2ca9ad 100644 --- a/cpp/report/src/qlpack.yml +++ b/cpp/report/src/qlpack.yml @@ -2,4 +2,4 @@ name: codeql/report-cpp-coding-standards version: 2.36.0-dev license: MIT dependencies: - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/scripts/generate_modules/queries/codeql-pack.lock.yml b/scripts/generate_modules/queries/codeql-pack.lock.yml index 4edf97c6f8..2cbbccee53 100644 --- a/scripts/generate_modules/queries/codeql-pack.lock.yml +++ b/scripts/generate_modules/queries/codeql-pack.lock.yml @@ -2,17 +2,17 @@ lockVersion: 1.0.0 dependencies: codeql/cpp-all: - version: 0.12.2 + version: 0.12.9 codeql/dataflow: - version: 0.1.5 + version: 0.2.3 codeql/rangeanalysis: - version: 0.0.4 + version: 0.0.11 codeql/ssa: - version: 0.2.5 + version: 0.2.12 codeql/tutorial: - version: 0.2.5 + version: 0.2.12 codeql/typetracking: - version: 0.2.5 + version: 0.2.12 codeql/util: - version: 0.2.5 + version: 0.2.12 compiled: false diff --git a/scripts/generate_modules/queries/qlpack.yml b/scripts/generate_modules/queries/qlpack.yml index 4ab2483c04..fea871b973 100644 --- a/scripts/generate_modules/queries/qlpack.yml +++ b/scripts/generate_modules/queries/qlpack.yml @@ -2,4 +2,4 @@ name: codeql/standard-library-extraction-cpp-coding-standards version: 0.0.0 license: MIT dependencies: - codeql/cpp-all: 0.12.2 + codeql/cpp-all: 0.12.9 diff --git a/supported_codeql_configs.json b/supported_codeql_configs.json index a97c7d83d2..e8b2597100 100644 --- a/supported_codeql_configs.json +++ b/supported_codeql_configs.json @@ -1,9 +1,9 @@ { "supported_environment": [ { - "codeql_cli": "2.15.5", - "codeql_standard_library": "codeql-cli/v2.15.5", - "codeql_cli_bundle": "codeql-bundle-v2.15.5" + "codeql_cli": "2.16.6", + "codeql_standard_library": "codeql-cli/v2.16.6", + "codeql_cli_bundle": "codeql-bundle-v2.16.6" } ], "supported_language": [ From def30fb63abb445c4e27410536f08d06387e8434 Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Tue, 8 Oct 2024 22:44:30 +0100 Subject: [PATCH 09/12] Update CodeQL dependency change note --- ...10-07-upgrade-to-2.15.5.md => 2024-10-08-upgrade-to-2.16.6.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename change_notes/{2024-10-07-upgrade-to-2.15.5.md => 2024-10-08-upgrade-to-2.16.6.md} (100%) diff --git a/change_notes/2024-10-07-upgrade-to-2.15.5.md b/change_notes/2024-10-08-upgrade-to-2.16.6.md similarity index 100% rename from change_notes/2024-10-07-upgrade-to-2.15.5.md rename to change_notes/2024-10-08-upgrade-to-2.16.6.md From 896242cf1218e32041f37449a63ec0bcb756a18e Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Tue, 8 Oct 2024 22:48:06 +0100 Subject: [PATCH 10/12] Update release note --- change_notes/2024-10-08-upgrade-to-2.16.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/change_notes/2024-10-08-upgrade-to-2.16.6.md b/change_notes/2024-10-08-upgrade-to-2.16.6.md index d3d4151e78..a087679667 100644 --- a/change_notes/2024-10-08-upgrade-to-2.16.6.md +++ b/change_notes/2024-10-08-upgrade-to-2.16.6.md @@ -1 +1 @@ -- Updated the CodeQL version to `2.15.5`. \ No newline at end of file +- Updated the CodeQL version to `2.16.6`. \ No newline at end of file From d0540e450382754719c7a0bc0d3010a7a6e88ce6 Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Wed, 9 Oct 2024 23:19:04 +0100 Subject: [PATCH 11/12] M0-1-2: Remove reference to GuardCondition In the upgrade to 2.16.6 GuardCondition has been modified to use the IR instead of the AST mode it used before. One of the consequences of this change is that GuardConditions no longer exist for uninstantiated templates (because the IR does not apply for uninstantiated templates). Instead of using GuardCondition we can use the same logic for deducing infeasible paths for uninstantiated templates as for non template code. This avoids the dependency on GuardCondition, and provides consistency with the rest of the query, while shortening the query. --- change_notes/2024-10-08-upgrade-to-2.16.6.md | 4 +- .../src/rules/M0-1-2/InfeasiblePath.ql | 185 +----------------- 2 files changed, 12 insertions(+), 177 deletions(-) diff --git a/change_notes/2024-10-08-upgrade-to-2.16.6.md b/change_notes/2024-10-08-upgrade-to-2.16.6.md index a087679667..9f1e11d3d3 100644 --- a/change_notes/2024-10-08-upgrade-to-2.16.6.md +++ b/change_notes/2024-10-08-upgrade-to-2.16.6.md @@ -1 +1,3 @@ -- Updated the CodeQL version to `2.16.6`. \ No newline at end of file +- Updated the CodeQL version to `2.16.6`. +- `M0-1-2` - `InfeasiblePath.ql`: + - This query may now report additional results within templates where a relational operation is performed which has a constant value given the specified arguments. \ No newline at end of file diff --git a/cpp/autosar/src/rules/M0-1-2/InfeasiblePath.ql b/cpp/autosar/src/rules/M0-1-2/InfeasiblePath.ql index 76ccdead69..83e056472b 100644 --- a/cpp/autosar/src/rules/M0-1-2/InfeasiblePath.ql +++ b/cpp/autosar/src/rules/M0-1-2/InfeasiblePath.ql @@ -151,186 +151,19 @@ predicate isConstantRelationalOperation( * Holds if the `ConditionalNode` has an infeasible `path` for the reason given in `explanation`. */ predicate hasInfeasiblePath(ConditionalControlFlowNode node, string message) { - //deal with the infeasible in all uninstantiated templates separately - node.isFromUninstantiatedTemplate(_) and - node instanceof ConditionControllingUnreachable and - message = "The path is unreachable in a template." - or exists(boolean infeasiblePath, string explanation | - ( - not node.isFromUninstantiatedTemplate(_) and - not node.isFromTemplateInstantiation(_) and - message = "The " + infeasiblePath + " path is infeasible because " + explanation + "." - ) and - ( - hasCFGDeducedInfeasiblePath(node, infeasiblePath, explanation) and - not isConstantRelationalOperation(node, infeasiblePath, _) - or - isConstantRelationalOperation(node, infeasiblePath, explanation) - ) + not node.isFromTemplateInstantiation(_) and + if node.isFromUninstantiatedTemplate(_) + then message = "The path is unreachable in a template." + else message = "The " + infeasiblePath + " path is infeasible because " + explanation + "." + | + hasCFGDeducedInfeasiblePath(node, infeasiblePath, explanation) and + not isConstantRelationalOperation(node, infeasiblePath, _) + or + isConstantRelationalOperation(node, infeasiblePath, explanation) ) } -/** - * A newtype representing "unreachable" blocks in the program. We use a newtype here to avoid - * reporting the same block in multiple `Function` instances created from one function in a template. - */ -private newtype TUnreachableBasicBlock = - TUnreachableNonTemplateBlock(BasicBlock bb) { - bb.isUnreachable() and - // Exclude anything template related from this case - not bb.getEnclosingFunction().isFromTemplateInstantiation(_) and - not bb.getEnclosingFunction().isFromUninstantiatedTemplate(_) and - // Exclude compiler generated basic blocks - not isCompilerGenerated(bb) - } or - /** - * A `BasicBlock` that occurs in at least one `Function` instance for a template. `BasicBlock`s - * are matched up across templates by location. - */ - TUnreachableTemplateBlock( - string filepath, int startline, int startcolumn, int endline, int endcolumn, - GuardCondition uninstantiatedGuardCondition - ) { - exists(BasicBlock bb | - // BasicBlock occurs in this location - bb.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and - // And is contained in the `uninstantiatedFunction` only - // not from anything constructed from it - // because we want infeasible paths independent of parameters - exists(Function enclosing | enclosing = bb.getEnclosingFunction() | - //guard is in the template function - ( - enclosing.getBlock().getAChild*() = uninstantiatedGuardCondition and - //function template - enclosing.isFromUninstantiatedTemplate(_) and - uninstantiatedGuardCondition.isFromUninstantiatedTemplate(_) and - //true condition is unreachable: basic block starts on same line as guard - ( - not exists(uninstantiatedGuardCondition.getATrueSuccessor()) and - bb.hasLocationInfo(filepath, uninstantiatedGuardCondition.getLocation().getStartLine(), - startcolumn, endline, endcolumn) - or - //false condition is unreachable: false basic block starts on one line after its true basic block - not exists(uninstantiatedGuardCondition.getAFalseSuccessor()) and - bb.hasLocationInfo(filepath, - uninstantiatedGuardCondition.getATrueSuccessor().getLocation().getEndLine() + 1, - startcolumn, endline, endcolumn) - ) - ) - ) and - // And is unreachable - bb.isUnreachable() and - // //Exclude compiler generated control flow nodes - not isCompilerGenerated(bb) and - //Exclude nodes affected by macros, because our find-the-same-basic-block-by-location doesn't - //work in that case - not bb.(ControlFlowNode).isAffectedByMacro() - ) - } - -/** - * An unreachable basic block. - */ -class UnreachableBasicBlock extends TUnreachableBasicBlock { - /** Gets a `BasicBlock` which is represented by this set of unreachable basic blocks. */ - BasicBlock getABasicBlock() { none() } - - /** Gets a `GuardCondition` instance which we treat as the original GuardCondition. */ - GuardCondition getGuardCondition() { none() } - - predicate hasLocationInfo( - string filepath, int startline, int startcolumn, int endline, int endcolumn - ) { - none() - } - - string toString() { result = "default" } -} - -/** - * A non-templated unreachable basic block. - */ -class UnreachableNonTemplateBlock extends UnreachableBasicBlock, TUnreachableNonTemplateBlock { - BasicBlock getBasicBlock() { this = TUnreachableNonTemplateBlock(result) } - - override BasicBlock getABasicBlock() { result = getBasicBlock() } - - override GuardCondition getGuardCondition() { result.controls(getBasicBlock(), true) } - - override predicate hasLocationInfo( - string filepath, int startline, int startcolumn, int endline, int endcolumn - ) { - getBasicBlock().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) - } - - override string toString() { result = getBasicBlock().toString() } -} - -/** - * A templated unreachable basic block. - */ -class UnreachableTemplateBlock extends UnreachableBasicBlock, TUnreachableTemplateBlock { - override BasicBlock getABasicBlock() { - exists( - string filepath, int startline, int startcolumn, int endline, int endcolumn, - GuardCondition uninstantiatedGuardCondition - | - this = - TUnreachableTemplateBlock(filepath, startline, startcolumn, endline, endcolumn, - uninstantiatedGuardCondition) and - result.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and - exists(Function enclosing | - //guard is in the template function - ( - enclosing.getBlock().getAChild*() = uninstantiatedGuardCondition and - //function template - enclosing.isFromUninstantiatedTemplate(_) and - uninstantiatedGuardCondition.isFromUninstantiatedTemplate(_) and - //true condition is unreachable: basic block starts on same line as guard - ( - not exists(uninstantiatedGuardCondition.getATrueSuccessor()) and - this.hasLocationInfo(filepath, - uninstantiatedGuardCondition.getLocation().getStartLine(), startcolumn, endline, - endcolumn) - or - //false condition is unreachable: false basic block starts on one line after its true basic block - not exists(uninstantiatedGuardCondition.getAFalseSuccessor()) and - this.hasLocationInfo(filepath, - uninstantiatedGuardCondition.getATrueSuccessor().getLocation().getEndLine() + 1, - startcolumn, endline, endcolumn) - ) - ) - ) - | - result.isUnreachable() and - // Exclude compiler generated control flow nodes - not isCompilerGenerated(result) and - // Exclude nodes affected by macros, because our find-the-same-basic-block-by-location doesn't - // work in that case - not result.(ControlFlowNode).isAffectedByMacro() - ) - } - - override GuardCondition getGuardCondition() { - this = TUnreachableTemplateBlock(_, _, _, _, _, result) - } - - override predicate hasLocationInfo( - string filepath, int startline, int startcolumn, int endline, int endcolumn - ) { - this = TUnreachableTemplateBlock(filepath, startline, startcolumn, endline, endcolumn, _) - } - - override string toString() { result = getABasicBlock().toString() } -} - -class ConditionControllingUnreachable extends GuardCondition { - ConditionControllingUnreachable() { - exists(UnreachableTemplateBlock b | this = b.getGuardCondition()) - } -} - from ConditionalControlFlowNode cond, string explanation where not isExcluded(cond, DeadCodePackage::infeasiblePathQuery()) and From 68c1dafa713f5654e2aacd9b9be6a957ae6999ac Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Tue, 22 Oct 2024 21:26:58 +0100 Subject: [PATCH 12/12] Add test case --- cpp/autosar/test/rules/M0-1-2/InfeasiblePath.expected | 1 + cpp/autosar/test/rules/M0-1-2/test.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/cpp/autosar/test/rules/M0-1-2/InfeasiblePath.expected b/cpp/autosar/test/rules/M0-1-2/InfeasiblePath.expected index 9cb237e8b3..b5528014d1 100644 --- a/cpp/autosar/test/rules/M0-1-2/InfeasiblePath.expected +++ b/cpp/autosar/test/rules/M0-1-2/InfeasiblePath.expected @@ -8,3 +8,4 @@ | test.cpp:86:9:86:14 | ... < ... | The true path is infeasible because 0 (max value: 0) is always less than or equal to a (minimum value: 0). | | test.cpp:117:7:117:7 | 0 | The path is unreachable in a template. | | test.cpp:123:7:123:8 | ! ... | The path is unreachable in a template. | +| test.cpp:137:7:137:12 | ... > ... | The path is unreachable in a template. | diff --git a/cpp/autosar/test/rules/M0-1-2/test.cpp b/cpp/autosar/test/rules/M0-1-2/test.cpp index 31c564d8a5..f36cbc790d 100644 --- a/cpp/autosar/test/rules/M0-1-2/test.cpp +++ b/cpp/autosar/test/rules/M0-1-2/test.cpp @@ -131,4 +131,15 @@ void test_infeasible_instantiates() { template_infeasible_true_path(); template_infeasible_false_path(); template_infeasible_false_path(); +} + +template int template_infeasible_relation() { + if (i > -1) { // NON_COMPLIANT - true path is infeasible in all circumstances + return 3; + } +} + +void test_infeasible_relation() { + template_infeasible_relation<0>(); + template_infeasible_relation<1>(); } \ No newline at end of file