Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 798a350

Browse filesBrowse files
committed
Use instanceof extension with AllocationExpr
This prevents a negative recursion issue following a change to how Guards.qll is implemented in the codeql repo
1 parent 7b4aede commit 798a350
Copy full SHA for 798a350

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎cpp/autosar/src/rules/A18-5-8/UnnecessaryUseOfDynamicStorage.ql

Copy file name to clipboardExpand all lines: cpp/autosar/src/rules/A18-5-8/UnnecessaryUseOfDynamicStorage.ql
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ class MakeSharedOrUnique extends FunctionCall, CandidateFunctionLocalHeapAllocat
6464
* An `AllocationExpr` that allocates heap memory, where the memory is freed on at least one path
6565
* through the enclosing function.
6666
*/
67-
class AllocationExprFunctionLocal extends AllocationExpr, CandidateFunctionLocalHeapAllocationExpr {
67+
class AllocationExprFunctionLocal extends CandidateFunctionLocalHeapAllocationExpr instanceof AllocationExpr {
6868
AllocationExprFunctionLocal() {
6969
this.getSizeBytes() < 1024 and
7070
TaintTracking::localExprTaint(this, any(DeallocationExpr de).getFreedExpr())
7171
}
7272

73-
override int getHeapSizeBytes() { result = this.getSizeBytes() }
73+
override int getHeapSizeBytes() { result = super.getSizeBytes() }
7474

7575
DeallocationExpr getADeallocation() { TaintTracking::localExprTaint(this, result.getFreedExpr()) }
7676

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.