C++: Address (my own) review comments.

This commit is contained in:
Mathias Vorreiter Pedersen
2024-04-16 13:53:27 +01:00
parent 8a92a4250f
commit 132bb9f1d6

View File

@@ -98,16 +98,11 @@ predicate callReaches(Call call, ControlFlowNode successor) {
)
}
// To avoid many false alarms like `static int a = 1;`
predicate initialisedAtDeclaration(GlobalVariable v) {
exists(VariableDeclarationEntry vde |
vde = v.getDefinition() and
vde.isDefinition()
)
}
/** Holds if `v` has an initializer. */
predicate initialisedAtDeclaration(GlobalVariable v) { exists(v.getInitializer()) }
// No need to initialize those variables
predicate isStdlibVariable(GlobalVariable v) { v.getName() = ["stdin", "stdout", "stderr"] }
/** Holds if `v` is a global variable that does not need to be initialized. */
predicate isStdlibVariable(GlobalVariable v) { v.hasGlobalName(["stdin", "stdout", "stderr"]) }
from GlobalVariable v, Function f
where