Skip to content

Commit 9651122

Browse files
committed
Add improvements to readofuninitializedmemory and testcase
1 parent 6956667 commit 9651122

File tree

5 files changed

+764
-10
lines changed

5 files changed

+764
-10
lines changed

cpp/common/src/codingstandards/cpp/lifetimes/CppObjects.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ class AggregateLiteralObjectIdentity extends AggregateLiteral, ObjectIdentityBas
262262
class AllocatedObjectIdentity extends AllocationExpr, ObjectIdentityBase {
263263
AllocatedObjectIdentity() {
264264
this.(FunctionCall).getTarget().(AllocationFunction).requiresDealloc()
265+
or
266+
this = any(NewOrNewArrayExpr new | not exists(new.getPlacementPointer()))
265267
}
266268

267269
override StorageDuration getStorageDuration() { result.isAllocated() }

0 commit comments

Comments
 (0)