C#: Address review comments.

This commit is contained in:
Michael Nebel
2024-03-06 09:37:50 +01:00
parent e3380aa545
commit eda345a5b8
4 changed files with 12 additions and 19 deletions

View File

@@ -30,8 +30,6 @@ private module Input implements InputSig<CsharpDataFlow> {
n instanceof FlowInsensitiveFieldNode
}
predicate missingLocationExclude(Node n) { none() }
predicate postWithInFlowExclude(Node n) {
n instanceof FlowSummaryNode
or

View File

@@ -21,12 +21,7 @@ class RuntimeCallable extends Callable {
}
/** A run-time method. */
class RuntimeMethod extends RuntimeCallable {
RuntimeMethod() { this instanceof Method }
/** Holds if the method is `static`. */
predicate isStatic() { this.(Method).isStatic() }
}
class RuntimeMethod extends RuntimeCallable, Method { }
/** A run-time instance method. */
class RuntimeInstanceMethod extends RuntimeMethod {

View File

@@ -3,12 +3,12 @@ tooManyMatchingHandles
missingCil
csharpLocationViolation
matchingObjectMethods
| System.Boolean System.Object.Equals(System.Object) | System.Boolean System.Object.Equals(System.Object) |
| System.Boolean System.Object.Equals(System.Object,System.Object) | System.Boolean System.Object.Equals(System.Object,System.Object) |
| System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) | System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) |
| System.Int32 System.Object.GetHashCode() | System.Int32 System.Object.GetHashCode() |
| System.Object System.Object.MemberwiseClone() | System.Object System.Object.MemberwiseClone() |
| System.String System.Object.ToString() | System.String System.Object.ToString() |
| System.Type System.Object.GetType() | System.Type System.Object.GetType() |
| System.Void System.Object..ctor() | System.Void System.Object..ctor() |
| System.Void System.Object.Finalize() | System.Void System.Object.Finalize() |
| Equals(object) | System.Boolean System.Object.Equals(System.Object) |
| Equals(object, object) | System.Boolean System.Object.Equals(System.Object,System.Object) |
| GetHashCode() | System.Int32 System.Object.GetHashCode() |
| GetType() | System.Type System.Object.GetType() |
| MemberwiseClone() | System.Object System.Object.MemberwiseClone() |
| Object() | System.Void System.Object..ctor() |
| ReferenceEquals(object, object) | System.Boolean System.Object.ReferenceEquals(System.Object,System.Object) |
| ToString() | System.String System.Object.ToString() |
| ~Object() | System.Void System.Object.Finalize() |

View File

@@ -59,9 +59,9 @@ deprecated query predicate csharpLocationViolation(Element e) {
}
deprecated query predicate matchingObjectMethods(string s1, string s2) {
exists(DotNet::Callable m1, CIL::Method m2 |
exists(Callable m1, CIL::Method m2 |
m1.getDeclaringType().hasFullyQualifiedName("System", "Object") and
m1.matchesHandle(m2) and
m1.(DotNet::Callable).matchesHandle(m2) and
s1 = m1.toStringWithTypes() and
s2 = m2.toStringWithTypes()
)