Commit Graph

40697 Commits

Author SHA1 Message Date
Owen Mansel-Chan
4e71ab5cfc Update comment above first extraction of packages 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
25b91d8155 Update tests 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
8c15199ca9 Use generic struct field not instantiated one in Uses
We do not extract instantiated named types, and instead use the generic
type. But fields of the underlying struct of an instantiated named types
are obtained from the Uses map. We solve this keeping track of which
objects should be overridden by which other objects.
2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
8276ca04b4 Use generic method not instantiated one in Uses 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
253ca2bb67 Address review comments 2 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
59aa7426ec Add comments about entities without a parent scope 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
9abc7ea617 Address review comments 1 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
4828430fd4 Extract all object types before emitting them
Note that `extractObjectType` calls `extractType` which may add
additional objects to the list that `ForEachObject` loops over, so
we should emit object types as a second pass.
2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
4fa972fdc5 Rename variable for clarity 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
1da5399652 Fix obvious test failures 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
0194eb98d7 Add an upgrade and downgrade script 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
4d9937d1c6 Add tests 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
63d1663eb2 bug fix: label pointer-typed receivers correctly
We were trying to convert the object's type to a named type
to iterate through its methods, forgetting that it could also be
a pointer to a named type.

This bug was exposed because we no longer extract an object's
type before extracting it (unless it is a receiver), and when we
extracted a named type we extract its methods and when
extracting a method we extract its receiver and we always give
it the correct label in that situation.
2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
92c331402d Extract type parameters in types, not just decls 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
213fa1fec2 Break out of loop when a match has been found 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
982f11f8c7 Make ScopedObjectID take a function
This is so that ExtractType() won't be called except in the case
of a receiver variable, which is important for extracting type
parameters.
2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
f908a6f1dc Rename parm to param for clarity 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
1e08201632 Extract type param declarations 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
3510f2cdcd Support non-basic interfaces in extractor 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
a05a525755 Extract generic type instantiations to new table 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
e84db95f9c Extract generic function instantiations to new table 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
b8ab46d969 Add QL class for type parameter types 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
3952b1c07a Extract type parameter types (and update dbscheme) 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
f7dcb11816 Extract uninstantiated generic types only 2022-05-10 14:52:09 +01:00
Owen Mansel-Chan
7f0a37913f Use Go 1.18 2022-05-10 14:52:09 +01:00
Mathias Vorreiter Pedersen
1d10f14629 Merge pull request #9100 from redsun82/swift-tbd-rework
Swift: changes required for TBD node rework
2022-05-10 13:31:43 +01:00
Rasmus Wriedt Larsen
2b6e0cfb44 Merge pull request #8340 from yoff/python/simple-csrf
python: minimal CSRF implementation
2022-05-10 13:36:38 +02:00
Rasmus Wriedt Larsen
cb17e2a649 Merge pull request #8595 from porcupineyhairs/pypam
Python : Add query to detect PAM authorization bypass
2022-05-10 13:35:12 +02:00
Erik Krogh Kristensen
09360bce20 Merge pull request #9085 from erik-krogh/cash
JS: add model for the cash library
2022-05-10 13:20:57 +02:00
Paolo Tranquilli
bf71e4c500 Swift: getPrimaryQlClass -> getAPrimaryQlClass 2022-05-10 12:42:18 +02:00
Tom Hvitved
712fe002b9 Data flow: Sync files 2022-05-10 12:41:10 +02:00
Tom Hvitved
bfabfc3601 Data flow: Add Configuration::includeHiddenNodes() 2022-05-10 12:40:46 +02:00
Paolo Tranquilli
0b9dc9703f Swift: changes required for TBD node rework
These changes are required to allow a new type-safe approach to TBD
nodes, that will come in a separate commit.

This introduces:
* the possibility to add properties to the root `Element`
* a functor taking tags to the corresponding binding trap entry
* `hasProp()` methods for optional properties in QL
* `getPrimaryQlClass()` method
2022-05-10 11:59:25 +02:00
Rasmus Lerchedahl Petersen
aa3d7babf4 python: fix bad merge
caused by an optimistic attempt at solving a
merge conflict in the online GUI.
2022-05-10 11:37:41 +02:00
Rasmus Wriedt Larsen
2421076d2f Merge pull request #8696 from RasmusWL/new-nosql-examples
Python: Improve experimental modeling for `pymongo`
2022-05-10 11:03:05 +02:00
yoff
6c3e2db7fd Merge branch 'main' into python/simple-csrf 2022-05-10 10:55:28 +02:00
Cornelius Riemenschneider
7aa3d0fd26 Merge pull request #9091 from github/criemen/dotnet-lua-tracing-config
C#: Port the existing compiler-tracing.spec files to Lua.
2022-05-10 10:54:20 +02:00
Anders Schack-Mulligen
f85e06c2e4 Dataflow: Sync. 2022-05-10 10:12:39 +02:00
Cornelius Riemenschneider
40503aa368 Address review. 2022-05-10 08:06:25 +00:00
Harry Maclean
a6cab022f6 Ruby: Add missing import 2022-05-10 17:32:01 +12:00
Harry Maclean
7b63493fa9 Ruby: Fix identification IO.open args 2022-05-10 17:32:00 +12:00
Harry Maclean
79c6dc1af0 Refactor IO/File modelling
The main goal here is to get rid of the duplicate definitions of module
`IO`, which currently exist in both `frameworks/core/IO.qll` and
`frameworks/Files.qll`.

We do this by moving the classes inside `Files::IO` to `core/IO.qll`,
but moving most of the actual definitions of those classes to an
internal module `core.internal.FileOrIO`. This means both `Files.qll`
and `IO.qll` can depend on them without leaking them to end users.
2022-05-10 17:32:00 +12:00
Harry Maclean
2d12ad6238 Ruby: Model IO.popen
This method is very similar to `Kernel.system`: it executes its
arguments as a system command in various ways.
2022-05-10 17:32:00 +12:00
yoff
b6605bc330 Merge pull request #8634 from RasmusWL/promote-xxe
Python: Promote XXE and XML-bomb queries
2022-05-09 21:54:55 +02:00
Rasmus Lerchedahl Petersen
1c7e533144 python: format 2022-05-09 21:22:27 +02:00
Erik Krogh Kristensen
e80ee46fe4 add model for the cash library 2022-05-09 21:01:07 +02:00
Mathias Vorreiter Pedersen
66ca01a717 Merge pull request #9094 from redsun82/swift-codegen-predicate-properties
Swift codegen: add predicate properties
2022-05-09 17:17:10 +01:00
luchua-bc
75e7148912 Standardize the query and update qldoc 2022-05-09 16:10:11 +00:00
Paolo Tranquilli
c08e6fdc1e Swift codegen: add predicate properties
Properties marked with `predicate` in the schema are now accepted.

* in the dbscheme, they will translate to a table with a single `id`
  column (and the table name will not be pluralized)
* in C++ classes, they will translate to `bool` fields
* in QL classes, they will translate to predicates

Closes https://github.com/github/codeql-c-team/issues/1016
2022-05-09 17:50:49 +02:00
Paolo Tranquilli
effa9ee207 Merge pull request #9034 from redsun82/swift-cpp-gen
Swift: add structured C++ generated classes
2022-05-09 17:49:23 +02:00