Python: Remove points-to from Module

This commit is contained in:
Taus
2025-10-30 12:04:31 +00:00
parent b93ce98612
commit 820d8e76c4
4 changed files with 21 additions and 12 deletions

View File

@@ -13,6 +13,7 @@
*/
import python
private import LegacyPointsTo
import Definition
/**
@@ -58,7 +59,7 @@ predicate unused_global(Name unused, GlobalVariable v) {
// indirectly
defn.getBasicBlock().reachesExit() and u.getScope() != unused.getScope()
) and
not unused.getEnclosingModule().getAnExport() = v.getId() and
not unused.getEnclosingModule().(ModuleWithPointsTo).getAnExport() = v.getId() and
not exists(unused.getParentNode().(ClassDef).getDefinedClass().getADecorator()) and
not exists(unused.getParentNode().(FunctionDef).getDefinedFunction().getADecorator()) and
unused.defines(v) and