mirror of
https://github.com/github/codeql.git
synced 2026-03-01 13:23:49 +01:00
C++: use Declaration.hasGlobalOrStdName
This commit is contained in:
@@ -17,12 +17,12 @@ import cpp
|
||||
class Allocation extends FunctionCall {
|
||||
Allocation() {
|
||||
exists(string name |
|
||||
this.getTarget().hasGlobalName(name) and
|
||||
this.getTarget().hasGlobalOrStdName(name) and
|
||||
(name = "malloc" or name = "calloc" or name = "realloc")
|
||||
)
|
||||
}
|
||||
|
||||
private string getName() { this.getTarget().hasGlobalName(result) }
|
||||
private string getName() { this.getTarget().hasGlobalOrStdName(result) }
|
||||
|
||||
int getSize() {
|
||||
this.getName() = "malloc" and
|
||||
|
||||
Reference in New Issue
Block a user