File tree 2 files changed +9
-2
lines changed
java/ql/lib/semmle/code/java/dataflow 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -144,13 +144,14 @@ class SsaVariable extends Definition {
144
144
SsaSourceVariable getSourceVariable ( ) { result = super .getSourceVariable ( ) }
145
145
146
146
/** Gets the `ControlFlowNode` at which this SSA variable is defined. */
147
+ pragma [ nomagic]
147
148
ControlFlowNode getCfgNode ( ) {
148
149
exists ( BasicBlock bb , int i , int j |
149
150
this .definesAt ( _, bb , i ) and
150
151
// untracked definitions are inserted just before reads
151
152
( if this instanceof UntrackedDef then j = i + 1 else j = i ) and
152
153
// phi nodes are inserted at position `-1`
153
- result = bb .getNode ( max ( [ j , 0 ] ) )
154
+ result = bb .getNode ( 0 . maximum ( j ) )
154
155
)
155
156
}
156
157
Original file line number Diff line number Diff line change @@ -465,10 +465,16 @@ private module Cached {
465
465
)
466
466
}
467
467
468
+ bindingset [ call, f]
469
+ pragma [ inline_late]
470
+ private predicate updatesNamedField0 ( Call call , TrackedField f , Callable setter ) {
471
+ updatesNamedField ( call , f , setter )
472
+ }
473
+
468
474
cached
469
475
predicate defUpdatesNamedField ( SsaImplicitUpdate def , TrackedField f , Callable setter ) {
470
476
f = def .getSourceVariable ( ) and
471
- updatesNamedField ( def .getCfgNode ( ) .asCall ( ) , f , setter )
477
+ updatesNamedField0 ( def .getCfgNode ( ) .asCall ( ) , f , setter )
472
478
}
473
479
474
480
cached
You can’t perform that action at this time.
0 commit comments