@@ -71,9 +71,7 @@ class Node extends TIRDataFlowNode {
71
71
* `x.set(taint())` is a partial definition of `x`, and `transfer(&x, taint())` is
72
72
* a partial definition of `&x`).
73
73
*/
74
- Expr asPartialDefinition ( ) {
75
- result = this .( PartialDefinitionNode ) .getInstruction ( ) .getUnconvertedResultExpression ( )
76
- }
74
+ Expr asPartialDefinition ( ) { result = this .( PartialDefinitionNode ) .getDefinedExpr ( ) }
77
75
78
76
/**
79
77
* DEPRECATED: See UninitializedNode.
@@ -251,14 +249,17 @@ abstract class PostUpdateNode extends InstructionNode {
251
249
* setY(&x); // a partial definition of the object `x`.
252
250
* ```
253
251
*/
254
- abstract private class PartialDefinitionNode extends PostUpdateNode , TInstructionNode { }
252
+ abstract private class PartialDefinitionNode extends PostUpdateNode , TInstructionNode {
253
+ abstract Expr getDefinedExpr ( ) ;
254
+ }
255
255
256
256
private class ExplicitFieldStoreQualifierNode extends PartialDefinitionNode {
257
257
override ChiInstruction instr ;
258
+ FieldAddressInstruction field ;
258
259
259
260
ExplicitFieldStoreQualifierNode ( ) {
260
261
not instr .isResultConflated ( ) and
261
- exists ( StoreInstruction store , FieldInstruction field |
262
+ exists ( StoreInstruction store |
262
263
instr .getPartial ( ) = store and field = store .getDestinationAddress ( )
263
264
)
264
265
}
@@ -268,6 +269,10 @@ private class ExplicitFieldStoreQualifierNode extends PartialDefinitionNode {
268
269
// DataFlowImplConsistency::Consistency. However, it's not clear what (if any) implications
269
270
// this consistency failure has.
270
271
override Node getPreUpdateNode ( ) { result .asInstruction ( ) = instr .getTotal ( ) }
272
+
273
+ override Expr getDefinedExpr ( ) {
274
+ result = field .getObjectAddress ( ) .getUnconvertedResultExpression ( )
275
+ }
271
276
}
272
277
273
278
/**
@@ -278,15 +283,18 @@ private class ExplicitFieldStoreQualifierNode extends PartialDefinitionNode {
278
283
*/
279
284
private class ExplicitSingleFieldStoreQualifierNode extends PartialDefinitionNode {
280
285
override StoreInstruction instr ;
286
+ FieldAddressInstruction field ;
281
287
282
288
ExplicitSingleFieldStoreQualifierNode ( ) {
283
- exists ( FieldAddressInstruction field |
284
- field = instr .getDestinationAddress ( ) and
285
- not exists ( ChiInstruction chi | chi .getPartial ( ) = instr )
286
- )
289
+ field = instr .getDestinationAddress ( ) and
290
+ not exists ( ChiInstruction chi | chi .getPartial ( ) = instr )
287
291
}
288
292
289
293
override Node getPreUpdateNode ( ) { none ( ) }
294
+
295
+ override Expr getDefinedExpr ( ) {
296
+ result = field .getObjectAddress ( ) .getUnconvertedResultExpression ( )
297
+ }
290
298
}
291
299
292
300
/**
0 commit comments