@@ -27,12 +27,6 @@ module SsaInput implements SsaImplCommon::InputSig<Location> {
2727 */
2828 predicate variableWrite ( BasicBlock bb , int i , SourceVariable v , boolean certain ) {
2929 (
30- exists ( Scope scope | scope = v .( ThisParameter ) .getDeclaringScope ( ) |
31- // We consider the `this` variable to have a single write at the entry to a method block
32- scope = bb .( BasicBlocks:: EntryBasicBlock ) .getScope ( ) and
33- i = 0
34- )
35- or
3630 uninitializedWrite ( bb , i , v )
3731 or
3832 variableWriteActual ( bb , i , v , _)
@@ -138,9 +132,7 @@ private module Cached {
138132 * AST write access is `write`.
139133 */
140134 cached
141- predicate variableWriteActual (
142- Cfg:: BasicBlock bb , int i , Variable v , VarWriteAccessCfgNode write
143- ) {
135+ predicate variableWriteActual ( Cfg:: BasicBlock bb , int i , Variable v , VarWriteAccessCfgNode write ) {
144136 exists ( Cfg:: CfgNode n |
145137 write .getVariable ( ) = v and
146138 n = bb .getNode ( i )
@@ -277,7 +269,8 @@ private Parameter getANonPipelineParameter(FunctionBase f) {
277269class NormalParameter extends Parameter {
278270 NormalParameter ( ) {
279271 not this instanceof PipelineParameter and
280- not this instanceof PipelineByPropertyNameParameter
272+ not this instanceof PipelineByPropertyNameParameter and
273+ not this instanceof ThisParameter
281274 }
282275
283276 int getIndexExcludingPipelines ( ) {
@@ -295,18 +288,18 @@ class NormalParameter extends Parameter {
295288
296289private newtype TParameterExt =
297290 TNormalParameter ( NormalParameter p ) or
298- TSelfMethodParameter ( Method m )
291+ TThisMethodParameter ( Method m )
299292
300- /** A normal parameter or an implicit `self ` parameter. */
293+ /** A normal parameter or an implicit `this ` parameter. */
301294class ParameterExt extends TParameterExt {
302295 NormalParameter asParameter ( ) { this = TNormalParameter ( result ) }
303296
304- Method asThis ( ) { this = TSelfMethodParameter ( result ) }
297+ Method asThis ( ) { this = TThisMethodParameter ( result ) }
305298
306299 predicate isInitializedBy ( WriteDefinition def ) {
307300 def = getParameterDef ( this .asParameter ( ) )
308301 or
309- def .( Ssa:: ThisDefinition ) .getSourceVariable ( ) .getDeclaringScope ( ) = this .asThis ( ) .( Scope )
302+ def .( Ssa:: ThisDefinition ) .getSourceVariable ( ) .getDeclaringScope ( ) = this .asThis ( ) .getBody ( )
310303 }
311304
312305 string toString ( ) { result = [ this .asParameter ( ) .toString ( ) , this .asThis ( ) .toString ( ) ] }
0 commit comments