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