mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
Merge pull request #4716 from criemen/escapestree-code-cleanup
C++: Simplify and generalize EscapesTree::addressMayEscapeMutablyAt
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user