Skip to content

Commit f8daf8c

Browse files
committed
Convert MEM36-C to the new dataflow library
1 parent 3cb8899 commit f8daf8c

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

c/cert/src/rules/MEM36-C/DoNotModifyAlignmentOfMemoryWithRealloc.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import cpp
2121
import codingstandards.c.cert
2222
import codingstandards.cpp.Alignment
23-
import semmle.code.cpp.dataflow.DataFlow
23+
import semmle.code.cpp.dataflow.new.DataFlow
2424
import AlignedAllocToReallocFlow::PathGraph
2525

2626
int getStatedValue(Expr e) {

c/cert/test/rules/MEM36-C/DoNotModifyAlignmentOfMemoryWithRealloc.expected

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotModifyAlignmentOfMemoryWithRealloc.ql:31,36-44)
2-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotModifyAlignmentOfMemoryWithRealloc.ql:45,47-55)
3-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotModifyAlignmentOfMemoryWithRealloc.ql:46,22-30)
4-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotModifyAlignmentOfMemoryWithRealloc.ql:50,20-28)
5-
WARNING: module 'DataFlow' has been deprecated and may be removed in future (DoNotModifyAlignmentOfMemoryWithRealloc.ql:55,36-44)
61
edges
7-
| test.c:5:10:5:22 | call to aligned_alloc | test.c:15:8:15:28 | call to aligned_alloc_wrapper | provenance | |
2+
| test.c:4:7:4:27 | *aligned_alloc_wrapper | test.c:15:8:15:28 | call to aligned_alloc_wrapper | provenance | |
3+
| test.c:5:10:5:22 | call to aligned_alloc | test.c:4:7:4:27 | *aligned_alloc_wrapper | provenance | |
4+
| test.c:5:10:5:22 | call to aligned_alloc | test.c:5:10:5:22 | call to aligned_alloc | provenance | |
85
| test.c:8:29:8:31 | ptr | test.c:8:64:8:66 | ptr | provenance | |
9-
| test.c:15:8:15:28 | call to aligned_alloc_wrapper | test.c:16:24:16:25 | v1 | provenance | |
6+
| test.c:15:3:15:36 | ... = ... | test.c:16:24:16:25 | v1 | provenance | |
7+
| test.c:15:8:15:28 | call to aligned_alloc_wrapper | test.c:15:3:15:36 | ... = ... | provenance | |
108
| test.c:16:24:16:25 | v1 | test.c:8:29:8:31 | ptr | provenance | |
11-
| test.c:22:8:22:20 | call to aligned_alloc | test.c:23:16:23:17 | v3 | provenance | |
9+
| test.c:22:3:22:28 | ... = ... | test.c:23:16:23:17 | v3 | provenance | |
10+
| test.c:22:8:22:20 | call to aligned_alloc | test.c:22:3:22:28 | ... = ... | provenance | |
1211
nodes
12+
| test.c:4:7:4:27 | *aligned_alloc_wrapper | semmle.label | *aligned_alloc_wrapper |
13+
| test.c:5:10:5:22 | call to aligned_alloc | semmle.label | call to aligned_alloc |
1314
| test.c:5:10:5:22 | call to aligned_alloc | semmle.label | call to aligned_alloc |
1415
| test.c:8:29:8:31 | ptr | semmle.label | ptr |
1516
| test.c:8:64:8:66 | ptr | semmle.label | ptr |
17+
| test.c:15:3:15:36 | ... = ... | semmle.label | ... = ... |
1618
| test.c:15:8:15:28 | call to aligned_alloc_wrapper | semmle.label | call to aligned_alloc_wrapper |
1719
| test.c:16:24:16:25 | v1 | semmle.label | v1 |
20+
| test.c:22:3:22:28 | ... = ... | semmle.label | ... = ... |
1821
| test.c:22:8:22:20 | call to aligned_alloc | semmle.label | call to aligned_alloc |
1922
| test.c:23:16:23:17 | v3 | semmle.label | v3 |
2023
subpaths

0 commit comments

Comments
 (0)