File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
csharp/ql/lib/semmle/code/csharp Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -98,10 +98,21 @@ class Modifiable extends Declaration, @modifiable {
98
98
99
99
/** Holds if this declaration is `unsafe`. */
100
100
predicate isUnsafe ( ) {
101
- this .hasModifier ( "unsafe" ) or
102
- this .( Parameterizable ) .getAParameter ( ) .getType ( ) instanceof PointerType or
103
- this .( Property ) .getType ( ) instanceof PointerType or
104
- this .( Callable ) .getReturnType ( ) instanceof PointerType
101
+ this .hasModifier ( "unsafe" )
102
+ or
103
+ exists ( Type t , Type child |
104
+ t = this .( Parameterizable ) .getAParameter ( ) .getType ( ) or
105
+ t = this .( Property ) .getType ( ) or
106
+ t = this .( Callable ) .getReturnType ( ) or
107
+ t = this .( DelegateType ) .getReturnType ( )
108
+ |
109
+ child = t .getAChild * ( ) and
110
+ (
111
+ child instanceof PointerType
112
+ or
113
+ child instanceof FunctionPointerType
114
+ )
115
+ )
105
116
}
106
117
107
118
/** Holds if this declaration is `async`. */
You can’t perform that action at this time.
0 commit comments