@@ -192,46 +192,24 @@ private class ArrayContent extends Content, TArrayContent {
192
192
override Type getType ( ) { none ( ) }
193
193
}
194
194
195
- private predicate storeStepNoChi ( Node node1 , Content f , PostUpdateNode node2 ) {
196
- exists ( FieldAddressInstruction fa , StoreInstruction store |
197
- store = node2 .asInstruction ( ) and
198
- store .getDestinationAddress ( ) = fa and
199
- store .getSourceValue ( ) = node1 .asInstruction ( ) and
200
- f .( FieldContent ) .getField ( ) = fa .getField ( )
201
- )
202
- }
203
-
204
- private predicate storeStepChi ( Node node1 , Content f , PostUpdateNode node2 ) {
205
- exists ( FieldAddressInstruction fa , StoreInstruction store |
206
- node1 .asInstruction ( ) = store and
207
- store .getDestinationAddress ( ) = fa and
208
- node2 .asInstruction ( ) .( ChiInstruction ) .getPartial ( ) = store and
209
- f .( FieldContent ) .getField ( ) = fa .getField ( )
210
- )
211
- }
212
-
213
195
/**
214
196
* Holds if data can flow from `node1` to `node2` via an assignment to `f`.
215
197
* Thus, `node2` references an object with a field `f` that contains the
216
198
* value of `node1`.
217
199
*/
218
- predicate storeStep ( Node node1 , Content f , PostUpdateNode node2 ) {
219
- storeStepNoChi ( node1 , f , node2 ) or
220
- storeStepChi ( node1 , f , node2 )
200
+ predicate storeStep ( Node node1 , Content f , StoreStepNode node2 ) {
201
+ node2 . getStoredValue ( ) = node1 and
202
+ f . ( FieldContent ) . getField ( ) = node2 . getAField ( )
221
203
}
222
204
223
205
/**
224
206
* Holds if data can flow from `node1` to `node2` via a read of `f`.
225
207
* Thus, `node1` references an object with a field `f` whose value ends up in
226
208
* `node2`.
227
209
*/
228
- predicate readStep ( Node node1 , Content f , Node node2 ) {
229
- exists ( FieldAddressInstruction fa , LoadInstruction load |
230
- load .getSourceAddress ( ) = fa and
231
- node1 .asInstruction ( ) = load .getSourceValueOperand ( ) .getAnyDef ( ) and
232
- fa .getField ( ) = f .( FieldContent ) .getField ( ) and
233
- load = node2 .asInstruction ( )
234
- )
210
+ predicate readStep ( Node node1 , Content f , ReadStepNode node2 ) {
211
+ node2 .getReadValue ( ) = node1 and
212
+ f .( FieldContent ) .getField ( ) = node2 .getAField ( )
235
213
}
236
214
237
215
/**
0 commit comments