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 {
5050 * ```
5151 */
5252class CppStyleComment extends Comment {
53- CppStyleComment ( ) { this .getContents ( ) .prefix ( 2 ) = "//" }
53+ CppStyleComment ( ) { this .getContents ( ) .matches ( "//%" ) }
5454}
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ abstract class MutexType extends Type {
8787private Function mustlockCandidate ( ) {
8888 exists ( string name | name = result .getName ( ) |
8989 name = "lock" or
90- name .suffix ( name . length ( ) - 10 ) = "mutex_lock"
90+ name .matches ( "%mutex\\_lock" )
9191 )
9292}
9393
@@ -97,7 +97,7 @@ private Function mustlockCandidate() {
9797private Function trylockCandidate ( ) {
9898 exists ( string name | name = result .getName ( ) |
9999 name = "try_lock" or
100- name .suffix ( name . length ( ) - 13 ) = "mutex_trylock"
100+ name .matches ( "%mutex\\_trylock" )
101101 )
102102}
103103
@@ -107,7 +107,7 @@ private Function trylockCandidate() {
107107private Function unlockCandidate ( ) {
108108 exists ( string name | name = result .getName ( ) |
109109 name = "unlock" or
110- name .suffix ( name . length ( ) - 12 ) = "mutex_unlock"
110+ name .matches ( "%mutex\\_unlock" )
111111 )
112112}
113113
You can’t perform that action at this time.
0 commit comments