We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 234ca96 commit 508020eCopy full SHA for 508020e
1 file changed
cpp/misra/src/rules/RULE-21-6-1/DynamicMemoryShouldNotBeUsed.ql
@@ -266,10 +266,11 @@ where
266
267
(
268
call.getTarget() instanceof DynamicMemoryDeallocatingFunction and
269
- // not call.isCompilerGenerated() // Exclude RAII constructor calls.
270
- exists(Expr expr | expr != call.getAnImplicitDestructorCall())
+ (
+ call instanceof DestructorCall implies not call.isCompilerGenerated() // Exclude RAII constructor calls.
271
+ )
272
) and
- not call.getTarget() instanceof DynamicMemoryAllocatingFunction and
273
+ not call.getTarget() instanceof DynamicMemoryAllocatingFunction and // Exclude `realloc`.
274
message = "Call to '" + call.getTarget().getName() + "' that dynamically deallocates memory."
275
)
-select call, message
276
+select call, message
0 commit comments