github / github/codeql

Linking function definition with its declaration

未關閉
#9,337 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
C++ question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。