Skip to content

Commit 027ed5e

Browse files
committed
CPP: Docs improvements to DeleteOrDeleteArrayExpr
1 parent 417b9c9 commit 027ed5e

File tree

1 file changed

+9
-8
lines changed
  • cpp/ql/lib/semmle/code/cpp/exprs

1 file changed

+9
-8
lines changed

cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -949,13 +949,13 @@ class DeleteOrDeleteArrayExpr extends Expr, TDeleteOrDeleteArrayExpr {
949949
DestructorCall getDestructorCall() { result = this.getChild(1) }
950950

951951
/**
952-
* Gets the destructor to be called to destroy the object(s), if any.
952+
* Gets the destructor to be called to destroy the object/array, if any.
953953
*/
954954
Destructor getDestructor() { result = this.getDestructorCall().getTarget() }
955955

956956
/**
957-
* Gets the `operator delete` that deallocates storage. Does not hold
958-
* if the type being destroyed has a virtual destructor. In that case, the
957+
* Gets the `operator delete` or `operator delete[]` that deallocates storage.
958+
* Does not hold if the type being destroyed has a virtual destructor. In that case, the
959959
* `operator delete` that will be called is determined at runtime based on the
960960
* dynamic type of the object.
961961
*/
@@ -969,10 +969,10 @@ class DeleteOrDeleteArrayExpr extends Expr, TDeleteOrDeleteArrayExpr {
969969
deprecated FunctionCall getAllocatorCall() { result = this.getChild(0) }
970970

971971
/**
972-
* Gets the call to a non-default `operator delete` that deallocates storage, if any.
972+
* Gets the call to a non-default `operator delete`/`delete[]` that deallocates storage, if any.
973973
*
974974
* This will only be present when the type being deleted has a custom `operator delete` and
975-
* is not a class with a virtual destructor.
975+
* does not have a virtual destructor.
976976
*/
977977
FunctionCall getDeallocatorCall() { result = this.getChild(0) }
978978

@@ -997,12 +997,13 @@ class DeleteOrDeleteArrayExpr extends Expr, TDeleteOrDeleteArrayExpr {
997997
}
998998

999999
/**
1000-
* Gets the object being deleted.
1000+
* Gets the object/array being deleted.
10011001
*/
1002-
Expr getExpr() {
1002+
Expr getExpr() {
10031003
// If there is a destuctor call, the object being deleted is the qualifier
10041004
// otherwise it is the third child.
1005-
result = this.getChild(3) or result = this.getDestructorCall().getQualifier() }
1005+
result = this.getChild(3) or result = this.getDestructorCall().getQualifier()
1006+
}
10061007
}
10071008

10081009
/**

0 commit comments

Comments
 (0)