Skip to content

Commit 2b1ebfe

Browse files
author
Nikita Kraiouchkine
committed
Remove duplicate MaxAlignT code
1 parent bfa0863 commit 2b1ebfe

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import cpp
1616
import codingstandards.c.cert
17-
import codingstandards.cpp.Allocations
17+
import codingstandards.cpp.Alignment
1818
import semmle.code.cpp.dataflow.DataFlow
1919
import DataFlow::PathGraph
2020

cpp/common/src/codingstandards/cpp/Allocations.qll

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,3 @@ predicate freeExprOrIndirect(Expr free, Expr freed, string kind) {
168168
free.(FunctionCall).getArgument(arg) = freed
169169
)
170170
}
171-
172-
class MaxAlignT extends TypedefType {
173-
MaxAlignT() { getName() = "max_align_t" }
174-
}
175-
176-
/**
177-
* Gets the alignment for `max_align_t`, assuming there is a single consistent alignment for the
178-
* database.
179-
*
180-
* In theory, each compilation of each file can have a different `max_align_t` value (for example,
181-
* if the same file is compiled under different compilers in the same database). We don't have the
182-
* fine-grained data to determine which compilation each operator new call is from, so only hold in
183-
* cases where there's a single clear alignment for the whole database.
184-
*/
185-
int getGlobalMaxAlignT() {
186-
count(MaxAlignT m | | m.getAlignment()) = 1 and
187-
result = any(MaxAlignT t).getAlignment()
188-
}

0 commit comments

Comments
 (0)