Allow write base to be inside an implicit dereference

This commit is contained in:
Sauyon Lee
2020-03-27 05:33:24 -07:00
parent e9b0f88946
commit 314787956b

View File

@@ -129,7 +129,10 @@ module ControlFlow {
/** Holds if this node sets the value of field `f` on `base` to `rhs`. */
predicate writesField(DataFlow::Node base, Field f, DataFlow::Node rhs) {
exists(IR::FieldTarget trg | trg = self.getLhs() |
trg.getBase() = base.asInstruction() and
(
trg.getBase() = base.asInstruction() or
trg.getBase() = MkImplicitDeref(base.asExpr())
) and
trg.getField() = f and
self.getRhs() = rhs.asInstruction()
)