@@ -27,12 +27,6 @@ module SsaInput implements SsaImplCommon::InputSig<Location> {
27
27
*/
28
28
predicate variableWrite ( BasicBlock bb , int i , SourceVariable v , boolean certain ) {
29
29
(
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
36
30
uninitializedWrite ( bb , i , v )
37
31
or
38
32
variableWriteActual ( bb , i , v , _)
@@ -138,9 +132,7 @@ private module Cached {
138
132
* AST write access is `write`.
139
133
*/
140
134
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 ) {
144
136
exists ( Cfg:: CfgNode n |
145
137
write .getVariable ( ) = v and
146
138
n = bb .getNode ( i )
@@ -277,7 +269,8 @@ private Parameter getANonPipelineParameter(FunctionBase f) {
277
269
class NormalParameter extends Parameter {
278
270
NormalParameter ( ) {
279
271
not this instanceof PipelineParameter and
280
- not this instanceof PipelineByPropertyNameParameter
272
+ not this instanceof PipelineByPropertyNameParameter and
273
+ not this instanceof ThisParameter
281
274
}
282
275
283
276
int getIndexExcludingPipelines ( ) {
@@ -295,18 +288,18 @@ class NormalParameter extends Parameter {
295
288
296
289
private newtype TParameterExt =
297
290
TNormalParameter ( NormalParameter p ) or
298
- TSelfMethodParameter ( Method m )
291
+ TThisMethodParameter ( Method m )
299
292
300
- /** A normal parameter or an implicit `self ` parameter. */
293
+ /** A normal parameter or an implicit `this ` parameter. */
301
294
class ParameterExt extends TParameterExt {
302
295
NormalParameter asParameter ( ) { this = TNormalParameter ( result ) }
303
296
304
- Method asThis ( ) { this = TSelfMethodParameter ( result ) }
297
+ Method asThis ( ) { this = TThisMethodParameter ( result ) }
305
298
306
299
predicate isInitializedBy ( WriteDefinition def ) {
307
300
def = getParameterDef ( this .asParameter ( ) )
308
301
or
309
- def .( Ssa:: ThisDefinition ) .getSourceVariable ( ) .getDeclaringScope ( ) = this .asThis ( ) .( Scope )
302
+ def .( Ssa:: ThisDefinition ) .getSourceVariable ( ) .getDeclaringScope ( ) = this .asThis ( ) .getBody ( )
310
303
}
311
304
312
305
string toString ( ) { result = [ this .asParameter ( ) .toString ( ) , this .asThis ( ) .toString ( ) ] }
0 commit comments