C++: use Declaration.hasGlobalOrStdName

This commit is contained in:
Robert Marsh
2019-07-11 16:00:41 -07:00
parent bff68a00ac
commit 03f72d207c
32 changed files with 138 additions and 125 deletions

View File

@@ -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