mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Merge from master
This commit is contained in:
@@ -27,7 +27,8 @@ class DangerousExpression extends Expr {
|
||||
e instanceof MethodCall
|
||||
or
|
||||
e instanceof ArrayAccess
|
||||
)
|
||||
) and
|
||||
not exists(Expr e | this = e.getParent*() | e.(Call).getTarget().getAParameter().isOutOrRef())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ class Test
|
||||
var b = true;
|
||||
b &= c.Method(); // GOOD
|
||||
b |= c[0]; // GOOD
|
||||
|
||||
if (c == null | c.Method(out _)) ; // GOOD
|
||||
if (c == null | (c.Method() | c.Method(out _))) ; // GOOD
|
||||
}
|
||||
|
||||
class C
|
||||
@@ -28,6 +31,7 @@ class Test
|
||||
public string Property { get; set; }
|
||||
public bool this[int i] { get { return false; } set { } }
|
||||
public bool Method() { return false; }
|
||||
public bool Method(out int x) { x = 0; return false; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user