mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
18 lines
361 B
Plaintext
18 lines
361 B
Plaintext
/**
|
|
* @id py/examples/new-instance
|
|
* @name Create new object
|
|
* @description Finds places where we create a new instanceof `MyClass`
|
|
* @tags call
|
|
* constructor
|
|
* new
|
|
*/
|
|
|
|
import python
|
|
private import LegacyPointsTo
|
|
|
|
from Call new, ClassValue cls
|
|
where
|
|
cls.getName() = "MyClass" and
|
|
new.getFunc().(ExprWithPointsTo).pointsTo(cls)
|
|
select new
|