mirror of
https://github.com/github/codeql.git
synced 2025-12-30 15:46:34 +01:00
15 lines
494 B
Plaintext
15 lines
494 B
Plaintext
import python
|
|
|
|
/* A call that returns a copy (or similar) of the argument */
|
|
deprecated predicate copy_call(ControlFlowNode fromnode, CallNode tonode) {
|
|
tonode.getFunction().(AttrNode).getObject("copy") = fromnode
|
|
or
|
|
exists(ModuleValue copy, string name | name = "copy" or name = "deepcopy" |
|
|
copy.attr(name).(FunctionValue).getACall() = tonode and
|
|
tonode.getArg(0) = fromnode
|
|
)
|
|
or
|
|
tonode.getFunction().pointsTo(Value::named("reversed")) and
|
|
tonode.getArg(0) = fromnode
|
|
}
|