Skip to content

Commit fe14e0a

Browse files
authored
Merge pull request #145 from rdmarsh2/rdmarsh2/allocation-expr-instanceof
A18-5-8: Use `instanceof` extension with AllocationExpr
2 parents 19c5636 + fea9922 commit fe14e0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines 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)