File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -50,5 +50,5 @@ class CStyleComment extends Comment {
50
50
* ```
51
51
*/
52
52
class CppStyleComment extends Comment {
53
- CppStyleComment ( ) { this .getContents ( ) .prefix ( 2 ) = "//" }
53
+ CppStyleComment ( ) { this .getContents ( ) .matches ( "//%" ) }
54
54
}
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ abstract class MutexType extends Type {
87
87
private Function mustlockCandidate ( ) {
88
88
exists ( string name | name = result .getName ( ) |
89
89
name = "lock" or
90
- name .suffix ( name . length ( ) - 10 ) = "mutex_lock"
90
+ name .matches ( "%mutex\\_lock" )
91
91
)
92
92
}
93
93
@@ -97,7 +97,7 @@ private Function mustlockCandidate() {
97
97
private Function trylockCandidate ( ) {
98
98
exists ( string name | name = result .getName ( ) |
99
99
name = "try_lock" or
100
- name .suffix ( name . length ( ) - 13 ) = "mutex_trylock"
100
+ name .matches ( "%mutex\\_trylock" )
101
101
)
102
102
}
103
103
@@ -107,7 +107,7 @@ private Function trylockCandidate() {
107
107
private Function unlockCandidate ( ) {
108
108
exists ( string name | name = result .getName ( ) |
109
109
name = "unlock" or
110
- name .suffix ( name . length ( ) - 12 ) = "mutex_unlock"
110
+ name .matches ( "%mutex\\_unlock" )
111
111
)
112
112
}
113
113
You can’t perform that action at this time.
0 commit comments