Update FieldTarget.getBaseType()

It wasn't defined when `getBase()` was an EvalImplicitDerefInstruction.
Rewriting it like this means it should work no matter what type of
instruction `getBase()` is.
This commit is contained in:
Owen Mansel-Chan
2021-03-05 14:20:31 +00:00
parent b32b3157d4
commit b6dddd36e1

View File

@@ -1395,7 +1395,7 @@ module IR {
}
/** Get the type of the base of this field access, that is, the type that contains the field. */
Type getBaseType() { result = this.getBase().(EvalInstruction).getExpr().getType() }
Type getBaseType() { result = this.getBase().getResultType() }
override predicate refersTo(ValueEntity e) {
exists(SelectorExpr sel | this = MkLhs(_, sel) | sel.uses(e))