Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix exclusion ids for a number of rules#324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lcartey merged 1 commit intomainfromlcartey/fix-query-suppression-ids
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,7 @@ import semmle.code.cpp.models.interfaces.Deallocation

from Expr e, string type
where
not isExcluded(e, BannedPackage::memoryAllocDeallocFunctionsOfStdlibhUsedQuery()) and
not isExcluded(e, BannedPackage::stdLibDynamicMemoryAllocationUsedQuery()) and
(
e.(FunctionCall).getTarget().(AllocationFunction).requiresDealloc() and
type = "allocation"
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,11 +17,10 @@ import codingstandards.c.Pointers

from CStyleCast cast, Type typeFrom, Type typeTo
where
not isExcluded(cast, Pointers1Package::castBetweenObjectPointerAndDifferentObjectTypeQuery()) and
not isExcluded(cast, Pointers1Package::conversionBetweenPointerToObjectAndIntegerTypeQuery()) and
typeFrom = cast.getExpr().getUnderlyingType() and
typeTo = cast.getUnderlyingType() and
[typeFrom, typeTo] instanceof IntegralType and
[typeFrom, typeTo] instanceof PointerToObjectType and
not isNullPointerConstant(cast.getExpr())
select cast,
"Cast performed between a pointer to object type and a pointer to an integer type."
select cast, "Cast performed between a pointer to object type and a pointer to an integer type."
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,7 +40,7 @@ private string wcharInputOutput() {

from FunctionCall fc, Function f
where
not isExcluded(fc, BannedPackage::standardHeaderFileUsedSignalhQuery()) and
not isExcluded(fc, BannedPackage::standardLibraryInputoutputFunctionsUsedQuery()) and
fc.getTarget() = f and
(
f.getName() = stdInputOutput() and
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,7 @@ import codingstandards.c.misra

from FunctionCall fc, Function f
where
not isExcluded(fc, BannedPackage::terminationFunctionsOfStdlibhUsedQuery()) and
not isExcluded(fc, BannedPackage::bsearchAndQsortOfStdlibhUsedQuery()) and
f = fc.getTarget() and
f.getName() = ["qsort", "bsearch"] and
f.getFile().getBaseName() = "stdlib.h"
Expand Down
6 changes: 6 additions & 0 deletionschange_notes/2023-07-5-fix-suppression-ids.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
* A number of rules had the wrong query ids attached for deviation purposes. This means they could not be deviated against using the correct ID, but could be incidentally suppressed when deviating a different rule. We have fixed this behavior for the following rules:
- `RULE-11-4`
- `DIR-4-12`
- `RULE-21-6`
- `RULE-21-9`
- `MEM51-CPP`
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,7 +26,7 @@ predicate matching(string allocKind, string deleteKind) {

from Expr alloc, Expr free, Expr freed, string allocKind, string deleteKind
where
not isExcluded(freed,FreedPackage::newDeleteArrayMismatchQuery()) and
not isExcluded(freed,AllocationsPackage::properlyDeallocateDynamicallyAllocatedResourcesQuery()) and
allocReaches(freed, alloc, allocKind) and
freeExprOrIndirect(free, freed, deleteKind) and
not matching(allocKind, deleteKind)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp