Commit Graph

163 Commits

Author SHA1 Message Date
Chris Smowton
3129c3dd69 Remove commented-out debug code 2022-05-10 14:52:10 +01:00
Chris Smowton
d330033908 Make objects-map-changed warning non-fatal 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
3c4b5202e3 Fix type aliases for instantiated generic types 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
ac081dc47a Make TypeParamParent map global 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
aa62fabe26 Fix another place where type could be nil 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
06d139848d Fix panic when type is unknown 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
2e8b9a9a7d Fix extractor crash when missing type information 2022-05-10 14:52:10 +01:00
Owen Mansel-Chan
4e71ab5cfc Update comment above first extraction of packages 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
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
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
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
Chris Smowton
ee85d6c368 Undo whitespace change 2022-02-01 12:04:38 +00:00
Owen Mansel-Chan
613a85bcfb Add ErrorExpr to dbscheme 2022-02-01 11:52:51 +00:00
Chris Smowton
e0a3ec85f3 Path transformer: use fully resolved path
This makes source locations consistent between databases that do and don't use the `SEMMLE_PATH_TRANSFORMER` option in the case where the original source location isn't its own realpath (i.e, some parent directory is a symbolic link).
2022-01-05 16:31:31 +00:00
Owen Mansel-Chan
d0c9aacd54 Distinguish variadic and non-variadic signature types in extractor 2021-12-01 09:33:44 -05:00
Owen Mansel-Chan
d35a46e2f3 Always extract an empty interface type 2021-11-26 15:04:05 -05:00
Owen Mansel-Chan
245d85ae97 Update dbscheme to add table for variadic signature types 2021-11-01 16:00:49 +00:00
Sauyon Lee
74da4820ee Add comment to HasEllpsisTable 2021-10-27 08:51:58 -07:00
Chris Smowton
c13229d581 Revert "Merge pull request #554 from xhd2015/accelerate_go_list"
This reverts commit e5a2b6081d, reversing
changes made to ee893b252c.
2021-09-16 17:16:59 +01:00
Sauyon Lee
f9ce06b4c0 Check for nil when getting package info 2021-09-02 11:25:58 -07:00
Sauyon Lee
7d3c504c3c Fix godoc 2021-09-02 11:25:57 -07:00
Sauyon Lee
89c9c7060c Remove unnecessary environment set 2021-09-02 11:25:57 -07:00
Sauyon Lee
6ed6193973 Remove redundant map assignments and fix some typos 2021-09-02 11:25:57 -07:00
xhd2015
8532605be7 Accelerating go-extractor by using 'go list -deps' instead of just 'go list'
Change-Id: Icc77214809a0bb8536d751f21194690d58663dc5
2021-09-02 11:25:57 -07:00
Tom Hvitved
a9a0cffb01 Drop redundant columns from files and folders relations 2021-08-26 13:41:44 +02:00
Sauyon Lee
f20922dcc7 Handle - positions in errors 2021-08-19 14:02:29 -07:00
Sauyon Lee
bfe6e7510d Evaluate symlinks for the dummy file 2021-04-27 08:32:21 -07:00
Sauyon Lee
fa5cb652d8 Fix lines of code counting 2021-04-27 01:18:20 -07:00
Sauyon Lee
f15b65d07e Extract dummy files for errors with no location 2021-04-21 21:14:40 -07:00
Sauyon Lee
488f7f5b9b Use pre-transformed path for extractor fileinfo 2021-04-21 21:14:40 -07:00
Chris Smowton
90c4b5d63f Switch to using HTML entities for escaping 2021-04-21 21:14:39 -07:00
Chris Smowton
06c958e61f Extractor: tolerate curly braces in struct field tags, directory names
These previously produced malformed TRAP. I have checked the other uses of GlobalID and don't see any others that should require escaping.
2021-04-21 21:14:39 -07:00
Sauyon Lee
4451920ada fixup windows 2021-03-31 08:56:34 -07:00
Sauyon Lee
cd6fb7d699 Extract files for error locations
Co-authored-by: Chris Smowton <smowton@github.com>
2021-03-31 03:37:55 -07:00
Chris Smowton
23b8af3a56 Tolerate empty-string CODEQL_PLATFORM
This is normal when invoked with tracing disabled, so we also don't log when this happens.
2021-03-29 11:34:50 +01:00
Chris Smowton
aef0a07a50 Prefer CODEQL_* environment variables when set 2021-03-25 16:20:16 +00:00