Python: Solve problems with missing TTupleElementContent

Ruby uses 10 as their number. I considered doing the same, but didn't
really care _too_ much about it 🤷

14cfb82a8c/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll (L636)
This commit is contained in:
Rasmus Wriedt Larsen
2023-11-13 10:47:48 +01:00
parent c3fa3f26a7
commit ffc27b5301
2 changed files with 5 additions and 2 deletions

View File

@@ -588,6 +588,11 @@ newtype TContent =
or or
// Arguments can overflow and end up in the starred parameter tuple. // Arguments can overflow and end up in the starred parameter tuple.
exists(any(CallNode cn).getArg(index)) exists(any(CallNode cn).getArg(index))
or
// since flow summaries might use tuples, we ensure that we at least have valid
// TTupleElementContent for the 0..7 (7 was picked to match `small_tuple` in
// data-flow-private)
index in [0 .. 7]
} or } or
/** An element of a dictionary under a specific key. */ /** An element of a dictionary under a specific key. */
TDictionaryElementContent(string key) { TDictionaryElementContent(string key) {

View File

@@ -1,2 +0,0 @@
| compiled re.subn | ReturnValue.TupleElement[0] | TupleElement[0] |
| re.subn | ReturnValue.TupleElement[0] | TupleElement[0] |