Merge pull request #4716 from criemen/escapestree-code-cleanup

C++: Simplify and generalize EscapesTree::addressMayEscapeMutablyAt
This commit is contained in:
Jonas Jensen
2020-11-25 08:31:33 +01:00
committed by GitHub

View File

@@ -212,14 +212,9 @@ private predicate addressMayEscapeAt(Expr e) {
private predicate addressMayEscapeMutablyAt(Expr e) {
addressMayEscapeAt(e) and
exists(Type t | t = e.getType().getUnderlyingType() |
exists(PointerType pt |
pt = t
or
pt = t.(SpecifiedType).getBaseType()
|
not pt.getBaseType().isConst()
)
exists(Type t | t = e.getType().stripTopLevelSpecifiers() |
t instanceof PointerType and
not t.(PointerType).getBaseType().isConst()
or
t instanceof ReferenceType and
not t.(ReferenceType).getBaseType().isConst()