Merge pull request #16817 from hvitved/csharp/multi-body-dataflow-dispatch

C#: Restrict multi-body dataflow dispatch based on file-system distance
This commit is contained in:
Tom Hvitved
2024-08-13 12:15:22 +02:00
committed by GitHub
13 changed files with 370 additions and 96 deletions

View File

@@ -810,18 +810,18 @@ module Flow<LocationSig Location, InputSig<Location> Input> implements OutputSig
private class TSynthesizedCaptureNode = TSynthRead or TSynthThisQualifier or TSynthPhi;
class SynthesizedCaptureNode extends ClosureNode, TSynthesizedCaptureNode {
Callable getEnclosingCallable() {
exists(BasicBlock bb | this = TSynthRead(_, bb, _, _) and result = bb.getEnclosingCallable())
BasicBlock getBasicBlock() {
this = TSynthRead(_, result, _, _)
or
exists(BasicBlock bb |
this = TSynthThisQualifier(bb, _, _) and result = bb.getEnclosingCallable()
)
this = TSynthThisQualifier(result, _, _)
or
exists(CaptureSsa::DefinitionExt phi, BasicBlock bb |
this = TSynthPhi(phi) and phi.definesAt(_, bb, _, _) and result = bb.getEnclosingCallable()
exists(CaptureSsa::DefinitionExt phi |
this = TSynthPhi(phi) and phi.definesAt(_, result, _, _)
)
}
Callable getEnclosingCallable() { result = this.getBasicBlock().getEnclosingCallable() }
predicate isVariableAccess(CapturedVariable v) {
this = TSynthRead(v, _, _, _)
or