github / github/codeql

Linking function definition with its declaration

Ouverte
#9,337 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
C++ question
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

I wrote this predicate to link the function definition with its declaration in case its definition is implemented in an external library. It works as expected but it takes time. So is there any other method to check for external functions (i.e. implemented in external libraries).

```
/**
* This predicate tries to link the function definition with its declaration
* defined in external libraries. The reason behind this is that when we try to
* get the definition of a function call, which is defined in an external lib, it fails.
*/
predicate bindFunctionDeclarationWithDefinition(Function fndeclaration, Function fndefinition) {
exists( | fndefinition.hasName(fndeclaration.getName()) and
not fndeclaration.hasEntryPoint() and
not fndeclaration = fndefinition)
}
```

Thanks.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.