Skip to content

Commit ebb05f4

Browse files
committed
checkpoint
1 parent 6a52db9 commit ebb05f4

File tree

2 files changed

+21
-34
lines changed

2 files changed

+21
-34
lines changed

cpp/common/src/codingstandards/cpp/Concurrency.qll

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,14 @@ class ConditionalFunction extends Function {
810810
/**
811811
* Models calls to thread specific storage function calls.
812812
*/
813-
abstract class ThreadSpecificStorageFunctionCall extends FunctionCall { }
813+
abstract class ThreadSpecificStorageFunctionCall extends FunctionCall {
814+
/**
815+
* Gets the key to which this call references.
816+
*/
817+
Expr getKey(){
818+
getArgument(0) = result
819+
}
820+
}
814821

815822
/**
816823
* Models calls to `tss_get`.
@@ -825,3 +832,15 @@ class TSSGetFunctionCall extends ThreadSpecificStorageFunctionCall {
825832
class TSSSetFunctionCall extends ThreadSpecificStorageFunctionCall {
826833
TSSSetFunctionCall() { getTarget().getName() = "tss_set" }
827834
}
835+
836+
/**
837+
* Models calls to `tss_create`
838+
*/
839+
class TSSCreateFunctionCall extends ThreadSpecificStorageFunctionCall {
840+
TSSCreateFunctionCall() { getTarget().getName() = "tss_create" }
841+
842+
// predicate hasDeallocator(){
843+
// getArgument(0) instanceof NULLMacro
844+
// }
845+
846+
}

cpp/common/src/codingstandards/cpp/exclusions/c/Concurrency4.qll

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import codingstandards.cpp.exclusions.RuleMetadata
66
newtype Concurrency4Query =
77
TCleanUpThreadSpecificStorageQuery() or
88
TAppropriateThreadObjectStorageDurationsQuery() or
9-
TThreadObjectStorageDurationsNotInitializedQuery() or
10-
TThreadWasPreviouslyJoinedOrDetachedQuery() or
11-
TDoNotReferToAnAtomicVariableTwiceInExpressionQuery()
9+
TThreadObjectStorageDurationsNotInitializedQuery()
1210

1311
predicate isConcurrency4QueryMetadata(Query query, string queryId, string ruleId) {
1412
query =
@@ -34,22 +32,6 @@ predicate isConcurrency4QueryMetadata(Query query, string queryId, string ruleId
3432
// `@id` for the `threadObjectStorageDurationsNotInitialized` query
3533
"c/cert/thread-object-storage-durations-not-initialized" and
3634
ruleId = "CON34-C"
37-
or
38-
query =
39-
// `Query` instance for the `threadWasPreviouslyJoinedOrDetached` query
40-
Concurrency4Package::threadWasPreviouslyJoinedOrDetachedQuery() and
41-
queryId =
42-
// `@id` for the `threadWasPreviouslyJoinedOrDetached` query
43-
"c/cert/thread-was-previously-joined-or-detached" and
44-
ruleId = "CON39-C"
45-
or
46-
query =
47-
// `Query` instance for the `doNotReferToAnAtomicVariableTwiceInExpression` query
48-
Concurrency4Package::doNotReferToAnAtomicVariableTwiceInExpressionQuery() and
49-
queryId =
50-
// `@id` for the `doNotReferToAnAtomicVariableTwiceInExpression` query
51-
"c/cert/do-not-refer-to-an-atomic-variable-twice-in-expression" and
52-
ruleId = "CON40-C"
5335
}
5436

5537
module Concurrency4Package {
@@ -73,18 +55,4 @@ module Concurrency4Package {
7355
// `Query` type for `threadObjectStorageDurationsNotInitialized` query
7456
TQueryC(TConcurrency4PackageQuery(TThreadObjectStorageDurationsNotInitializedQuery()))
7557
}
76-
77-
Query threadWasPreviouslyJoinedOrDetachedQuery() {
78-
//autogenerate `Query` type
79-
result =
80-
// `Query` type for `threadWasPreviouslyJoinedOrDetached` query
81-
TQueryC(TConcurrency4PackageQuery(TThreadWasPreviouslyJoinedOrDetachedQuery()))
82-
}
83-
84-
Query doNotReferToAnAtomicVariableTwiceInExpressionQuery() {
85-
//autogenerate `Query` type
86-
result =
87-
// `Query` type for `doNotReferToAnAtomicVariableTwiceInExpression` query
88-
TQueryC(TConcurrency4PackageQuery(TDoNotReferToAnAtomicVariableTwiceInExpressionQuery()))
89-
}
9058
}

0 commit comments

Comments
 (0)