mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C#: Restrict CfgScope
This commit is contained in:
@@ -15,11 +15,19 @@ class CfgScope extends Element, @top_level_exprorstmt_parent {
|
|||||||
CfgScope() {
|
CfgScope() {
|
||||||
this.getFile().fromSource() and
|
this.getFile().fromSource() and
|
||||||
(
|
(
|
||||||
this instanceof Callable
|
this =
|
||||||
|
any(Callable c |
|
||||||
|
c.(Constructor).hasInitializer()
|
||||||
|
or
|
||||||
|
InitializerSplitting::constructorInitializes(c, _)
|
||||||
|
or
|
||||||
|
c.hasBody()
|
||||||
|
)
|
||||||
or
|
or
|
||||||
// For now, static initializer values have their own scope. Eventually, they
|
// For now, static initializer values have their own scope. Eventually, they
|
||||||
// should be treated like instance initializers.
|
// should be treated like instance initializers.
|
||||||
this.(Assignable).(Modifiable).isStatic()
|
this.(Assignable).(Modifiable).isStatic() and
|
||||||
|
expr_parent_top_level_adjusted2(_, _, this)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user