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 {
9898
9999 /** Holds if this declaration is `unsafe`. */
100100 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+ )
105116 }
106117
107118 /** Holds if this declaration is `async`. */
You can’t perform that action at this time.
0 commit comments