Merge pull request #1483 from markshannon/merge-121

Merge rc/1.21 into master
This commit is contained in:
Taus
2019-06-21 14:11:07 +02:00
committed by GitHub
28 changed files with 119 additions and 68 deletions

View File

@@ -1,3 +1,4 @@
| 1 | ControlFlowNode for unicode_literals | ImportMember | 1 |
| 2 | ControlFlowNode for C | class C | 2 |
| 2 | ControlFlowNode for ClassExpr | class C | 2 |
| 2 | ControlFlowNode for object | builtin-class object | 2 |

View File

@@ -1,9 +1,3 @@
/**
* @name UseFromDefinition
* @description Insert description here...
* @kind table
* @problem.severity warning
*/
import python

View File

@@ -98,6 +98,7 @@
| Module pointsto_test | 76 | ControlFlowNode for sys | Module sys |
| Module pointsto_test | 76 | ControlFlowNode for type | builtin-class type |
| Module pointsto_test | 76 | ControlFlowNode for type() | builtin-class module |
| Module pointsto_test | 77 | ControlFlowNode for unknown | ImportMember |
| Module pointsto_test | 78 | ControlFlowNode for type | builtin-class type |
| Module pointsto_test | 79 | ControlFlowNode for Dict | Dict |
| Module pointsto_test | 79 | ControlFlowNode for Tuple | Tuple |

View File

@@ -106,6 +106,7 @@
| 76 | ControlFlowNode for sys | Module sys |
| 76 | ControlFlowNode for type | builtin-class type |
| 76 | ControlFlowNode for type() | builtin-class module |
| 77 | ControlFlowNode for unknown | ImportMember |
| 78 | ControlFlowNode for type | builtin-class type |
| 79 | ControlFlowNode for Dict | Dict |
| 79 | ControlFlowNode for Tuple | Tuple |

View File

@@ -1144,6 +1144,7 @@ WARNING: Predicate points_to has been deprecated and may be removed in future (P
| t_type.py:7 | ControlFlowNode for sys | Module sys | builtin-class module | 1 | import |
| t_type.py:7 | ControlFlowNode for type | builtin-class type | builtin-class type | 7 | import |
| t_type.py:7 | ControlFlowNode for type() | builtin-class module | builtin-class type | 7 | import |
| t_type.py:8 | ControlFlowNode for unknown | ImportMember | *UNKNOWN TYPE* | 8 | import |
| t_type.py:9 | ControlFlowNode for type | builtin-class type | builtin-class type | 9 | import |
| t_type.py:9 | ControlFlowNode for type() | *UNKNOWN TYPE* | *UNKNOWN TYPE* | 9 | import |
| t_type.py:10 | ControlFlowNode for Dict | Dict | builtin-class dict | 10 | import |

View File

@@ -1,5 +1,3 @@
WARNING: Predicate getSource has been deprecated and may be removed in future (TestEvaluate.ql:14,16-25)
WARNING: Predicate getSource has been deprecated and may be removed in future (TestEvaluate.ql:16,20-29)
| b_condition.py:7 | Compare | true | x | NoneType None |
| b_condition.py:13 | Compare | false | x | NoneType None |
| b_condition.py:19 | UnaryExpr | true | x | NoneType None |

View File

@@ -5,13 +5,13 @@ import semmle.python.pointsto.PointsToContext
import Util
from ControlFlowNode test, ControlFlowNode use, Value val, boolean eval, PointsToContext ctx, ControlFlowNode origin, string what
from ControlFlowNode test, ControlFlowNode use, ObjectInternal val, boolean eval, PointsToContext ctx, ControlFlowNode origin, string what
where
not use instanceof NameConstantNode and
not use.getNode() instanceof ImmutableLiteral and
eval = Conditionals::testEvaluates(test, use, ctx, val, origin) and
(
what = val.getSource().toString()
what = val.getSource().(Object).toString()
or
not exists(val.getSource()) and what = origin.getNode().toString()
)

View File

@@ -0,0 +1,3 @@
| sqlite3 | 2 | 1 |
| sqlite3.__init__ | 2 | 1 |
| sqlite3.dump | 2 | 1 |

View File

@@ -0,0 +1,7 @@
import python
from string name, int mcnt
where mcnt = strictcount(Module m | m.getName() = name) and mcnt > 1
select name, mcnt, strictcount(ModuleValue val | val.getName() = name)

View File

@@ -0,0 +1,2 @@
semmle-extractor-options: -R .
optimize: true

View File

@@ -0,0 +1 @@
import sqlite3.dump