diff --git a/MODULE.bazel b/MODULE.bazel index d2add26c88d5..49d664250831 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -15,7 +15,7 @@ local_path_override( # see https://registry.bazel.build/ for a list of available packages bazel_dep(name = "platforms", version = "0.0.10") -bazel_dep(name = "rules_go", version = "0.49.0") +bazel_dep(name = "rules_go", version = "0.49.0-codeql.1") bazel_dep(name = "rules_pkg", version = "0.10.1") bazel_dep(name = "rules_nodejs", version = "6.2.0-codeql.1") bazel_dep(name = "rules_python", version = "0.32.2") @@ -153,7 +153,7 @@ use_repo( ) go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") -go_sdk.download(version = "1.22.2") +go_sdk.download(version = "1.23.0") go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//go/extractor:go.mod") diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index b78fb9013050..2eaadaf3006a 100644 --- a/docs/codeql/reusables/supported-versions-compilers.rst +++ b/docs/codeql/reusables/supported-versions-compilers.rst @@ -16,7 +16,7 @@ .NET Core up to 3.1 .NET 5, .NET 6, .NET 7, .NET 8","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``" - Go (aka Golang), "Go up to 1.22", "Go 1.11 or more recent", ``.go`` + Go (aka Golang), "Go up to 1.23", "Go 1.11 or more recent", ``.go`` Java,"Java 7 to 22 [5]_","javac (OpenJDK and Oracle JDK), Eclipse compiler for Java (ECJ) [6]_",``.java`` diff --git a/go/actions/test/action.yml b/go/actions/test/action.yml index cc92ede59b9a..366619fd55e9 100644 --- a/go/actions/test/action.yml +++ b/go/actions/test/action.yml @@ -4,7 +4,7 @@ inputs: go-test-version: description: Which Go version to use for running the tests required: false - default: ~1.22.0 + default: "1.23.0" run-code-checks: description: Whether to run formatting, code and qhelp generation checks required: false diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/go.dbscheme b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/go.dbscheme new file mode 100644 index 000000000000..a58b81b1b4c4 --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/go.dbscheme @@ -0,0 +1,546 @@ +/** Auto-generated dbscheme; do not edit. */ + + +/** Duplicate code **/ + +duplicateCode( + unique int id : @duplication, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +similarCode( + unique int id : @similarity, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +@duplication_or_similarity = @duplication | @similarity; + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref); + +/** External data **/ + +externalData( + int id : @externalDataElement, + varchar(900) path : string ref, + int column: int ref, + varchar(900) value : string ref +); + +snapshotDate(unique date snapshotDate : date ref); + +sourceLocationPrefix(varchar(900) prefix : string ref); + + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +compilations(unique int id: @compilation, string cwd: string ref); + +#keyset[id, num] +compilation_args(int id: @compilation ref, int num: int ref, string arg: string ref); + +#keyset[id, num, kind] +compilation_time(int id: @compilation ref, int num: int ref, int kind: int ref, float secs: float ref); + +diagnostic_for(unique int diagnostic: @diagnostic ref, int compilation: @compilation ref, int file_number: int ref, int file_number_diagnostic_number: int ref); + +compilation_finished(unique int id: @compilation ref, float cpu_seconds: float ref, float elapsed_seconds: float ref); + +#keyset[id, num] +compilation_compiling_files(int id: @compilation ref, int num: int ref, int file: @file ref); + +diagnostics(unique int id: @diagnostic, int severity: int ref, string error_tag: string ref, string error_message: string ref, + string full_error_message: string ref, int location: @location ref); + +locations_default(unique int id: @location_default, int file: @file ref, int beginLine: int ref, int beginColumn: int ref, + int endLine: int ref, int endColumn: int ref); + +numlines(int element_id: @sourceline ref, int num_lines: int ref, int num_code: int ref, int num_comment: int ref); + +files(unique int id: @file, string name: string ref); + +folders(unique int id: @folder, string name: string ref); + +containerparent(int parent: @container ref, unique int child: @container ref); + +has_location(unique int locatable: @locatable ref, int location: @location ref); + +#keyset[parent, idx] +comment_groups(unique int id: @comment_group, int parent: @file ref, int idx: int ref); + +comments(unique int id: @comment, int kind: int ref, int parent: @comment_group ref, int idx: int ref, string text: string ref); + +doc_comments(unique int node: @documentable ref, int comment: @comment_group ref); + +#keyset[parent, idx] +exprs(unique int id: @expr, int kind: int ref, int parent: @exprparent ref, int idx: int ref); + +literals(unique int expr: @expr ref, string value: string ref, string raw: string ref); + +constvalues(unique int expr: @expr ref, string value: string ref, string exact: string ref); + +fields(unique int id: @field, int parent: @fieldparent ref, int idx: int ref); + +typeparamdecls(unique int id: @typeparamdecl, int parent: @typeparamdeclparent ref, int idx: int ref); + +#keyset[parent, idx] +stmts(unique int id: @stmt, int kind: int ref, int parent: @stmtparent ref, int idx: int ref); + +#keyset[parent, idx] +decls(unique int id: @decl, int kind: int ref, int parent: @declparent ref, int idx: int ref); + +#keyset[parent, idx] +specs(unique int id: @spec, int kind: int ref, int parent: @gendecl ref, int idx: int ref); + +scopes(unique int id: @scope, int kind: int ref); + +scopenesting(unique int inner: @scope ref, int outer: @scope ref); + +scopenodes(unique int node: @scopenode ref, int scope: @localscope ref); + +objects(unique int id: @object, int kind: int ref, string name: string ref); + +objectscopes(unique int object: @object ref, int scope: @scope ref); + +objecttypes(unique int object: @object ref, int tp: @type ref); + +methodreceivers(unique int method: @object ref, int receiver: @object ref); + +fieldstructs(unique int field: @object ref, int struct: @structtype ref); + +methodhosts(int method: @object ref, int host: @namedtype ref); + +defs(int ident: @ident ref, int object: @object ref); + +uses(int ident: @ident ref, int object: @object ref); + +types(unique int id: @type, int kind: int ref); + +type_of(unique int expr: @expr ref, int tp: @type ref); + +typename(unique int tp: @type ref, string name: string ref); + +key_type(unique int map: @maptype ref, int tp: @type ref); + +element_type(unique int container: @containertype ref, int tp: @type ref); + +base_type(unique int ptr: @pointertype ref, int tp: @type ref); + +underlying_type(unique int named: @namedtype ref, int tp: @type ref); + +#keyset[parent, index] +component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref); + +array_length(unique int tp: @arraytype ref, string len: string ref); + +type_objects(unique int tp: @type ref, int object: @object ref); + +packages(unique int id: @package, string name: string ref, string path: string ref, int scope: @packagescope ref); + +#keyset[parent, idx] +modexprs(unique int id: @modexpr, int kind: int ref, int parent: @modexprparent ref, int idx: int ref); + +#keyset[parent, idx] +modtokens(string token: string ref, int parent: @modexpr ref, int idx: int ref); + +#keyset[package, idx] +errors(unique int id: @error, int kind: int ref, string msg: string ref, string rawpos: string ref, + string file: string ref, int line: int ref, int col: int ref, int package: @package ref, int idx: int ref); + +has_ellipsis(int id: @callorconversionexpr ref); + +variadic(int id: @signaturetype ref); + +#keyset[parent, idx] +typeparam(unique int tp: @typeparamtype ref, string name: string ref, int bound: @compositetype ref, + int parent: @typeparamparentobject ref, int idx: int ref); + +@container = @file | @folder; + +@locatable = @xmllocatable | @node | @localscope; + +@node = @documentable | @exprparent | @modexprparent | @fieldparent | @stmtparent | @declparent | @typeparamdeclparent + | @scopenode | @comment_group | @comment; + +@documentable = @file | @field | @typeparamdecl | @spec | @gendecl | @funcdecl | @modexpr; + +@exprparent = @funcdef | @file | @expr | @field | @stmt | @decl | @typeparamdecl | @spec; + +@modexprparent = @file | @modexpr; + +@fieldparent = @decl | @structtypeexpr | @functypeexpr | @interfacetypeexpr; + +@stmtparent = @funcdef | @stmt | @decl; + +@declparent = @file | @declstmt; + +@typeparamdeclparent = @funcdecl | @typespec; + +@funcdef = @funclit | @funcdecl; + +@scopenode = @file | @functypeexpr | @blockstmt | @ifstmt | @caseclause | @switchstmt | @commclause | @loopstmt; + +@location = @location_default; + +@sourceline = @locatable; + +case @comment.kind of + 0 = @slashslashcomment +| 1 = @slashstarcomment; + +case @expr.kind of + 0 = @badexpr +| 1 = @ident +| 2 = @ellipsis +| 3 = @intlit +| 4 = @floatlit +| 5 = @imaglit +| 6 = @charlit +| 7 = @stringlit +| 8 = @funclit +| 9 = @compositelit +| 10 = @parenexpr +| 11 = @selectorexpr +| 12 = @indexexpr +| 13 = @genericfunctioninstantiationexpr +| 14 = @generictypeinstantiationexpr +| 15 = @sliceexpr +| 16 = @typeassertexpr +| 17 = @callorconversionexpr +| 18 = @starexpr +| 19 = @keyvalueexpr +| 20 = @arraytypeexpr +| 21 = @structtypeexpr +| 22 = @functypeexpr +| 23 = @interfacetypeexpr +| 24 = @maptypeexpr +| 25 = @typesetliteralexpr +| 26 = @plusexpr +| 27 = @minusexpr +| 28 = @notexpr +| 29 = @complementexpr +| 30 = @derefexpr +| 31 = @addressexpr +| 32 = @arrowexpr +| 33 = @lorexpr +| 34 = @landexpr +| 35 = @eqlexpr +| 36 = @neqexpr +| 37 = @lssexpr +| 38 = @leqexpr +| 39 = @gtrexpr +| 40 = @geqexpr +| 41 = @addexpr +| 42 = @subexpr +| 43 = @orexpr +| 44 = @xorexpr +| 45 = @mulexpr +| 46 = @quoexpr +| 47 = @remexpr +| 48 = @shlexpr +| 49 = @shrexpr +| 50 = @andexpr +| 51 = @andnotexpr +| 52 = @sendchantypeexpr +| 53 = @recvchantypeexpr +| 54 = @sendrcvchantypeexpr; + +@basiclit = @intlit | @floatlit | @imaglit | @charlit | @stringlit; + +@operatorexpr = @logicalexpr | @arithmeticexpr | @bitwiseexpr | @unaryexpr | @binaryexpr; + +@logicalexpr = @logicalunaryexpr | @logicalbinaryexpr; + +@arithmeticexpr = @arithmeticunaryexpr | @arithmeticbinaryexpr; + +@bitwiseexpr = @bitwiseunaryexpr | @bitwisebinaryexpr; + +@unaryexpr = @logicalunaryexpr | @bitwiseunaryexpr | @arithmeticunaryexpr | @derefexpr | @addressexpr | @arrowexpr; + +@logicalunaryexpr = @notexpr; + +@bitwiseunaryexpr = @complementexpr; + +@arithmeticunaryexpr = @plusexpr | @minusexpr; + +@binaryexpr = @logicalbinaryexpr | @bitwisebinaryexpr | @arithmeticbinaryexpr | @comparison; + +@logicalbinaryexpr = @lorexpr | @landexpr; + +@bitwisebinaryexpr = @shiftexpr | @orexpr | @xorexpr | @andexpr | @andnotexpr; + +@arithmeticbinaryexpr = @addexpr | @subexpr | @mulexpr | @quoexpr | @remexpr; + +@shiftexpr = @shlexpr | @shrexpr; + +@comparison = @equalitytest | @relationalcomparison; + +@equalitytest = @eqlexpr | @neqexpr; + +@relationalcomparison = @lssexpr | @leqexpr | @gtrexpr | @geqexpr; + +@chantypeexpr = @sendchantypeexpr | @recvchantypeexpr | @sendrcvchantypeexpr; + +case @stmt.kind of + 0 = @badstmt +| 1 = @declstmt +| 2 = @emptystmt +| 3 = @labeledstmt +| 4 = @exprstmt +| 5 = @sendstmt +| 6 = @incstmt +| 7 = @decstmt +| 8 = @gostmt +| 9 = @deferstmt +| 10 = @returnstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @gotostmt +| 14 = @fallthroughstmt +| 15 = @blockstmt +| 16 = @ifstmt +| 17 = @caseclause +| 18 = @exprswitchstmt +| 19 = @typeswitchstmt +| 20 = @commclause +| 21 = @selectstmt +| 22 = @forstmt +| 23 = @rangestmt +| 24 = @assignstmt +| 25 = @definestmt +| 26 = @addassignstmt +| 27 = @subassignstmt +| 28 = @mulassignstmt +| 29 = @quoassignstmt +| 30 = @remassignstmt +| 31 = @andassignstmt +| 32 = @orassignstmt +| 33 = @xorassignstmt +| 34 = @shlassignstmt +| 35 = @shrassignstmt +| 36 = @andnotassignstmt; + +@incdecstmt = @incstmt | @decstmt; + +@assignment = @simpleassignstmt | @compoundassignstmt; + +@simpleassignstmt = @assignstmt | @definestmt; + +@compoundassignstmt = @addassignstmt | @subassignstmt | @mulassignstmt | @quoassignstmt | @remassignstmt + | @andassignstmt | @orassignstmt | @xorassignstmt | @shlassignstmt | @shrassignstmt | @andnotassignstmt; + +@branchstmt = @breakstmt | @continuestmt | @gotostmt | @fallthroughstmt; + +@switchstmt = @exprswitchstmt | @typeswitchstmt; + +@loopstmt = @forstmt | @rangestmt; + +case @decl.kind of + 0 = @baddecl +| 1 = @importdecl +| 2 = @constdecl +| 3 = @typedecl +| 4 = @vardecl +| 5 = @funcdecl; + +@gendecl = @importdecl | @constdecl | @typedecl | @vardecl; + +case @spec.kind of + 0 = @importspec +| 1 = @valuespec +| 2 = @typedefspec +| 3 = @aliasspec; + +@typespec = @typedefspec | @aliasspec; + +case @object.kind of + 0 = @pkgobject +| 1 = @decltypeobject +| 2 = @builtintypeobject +| 3 = @declconstobject +| 4 = @builtinconstobject +| 5 = @declvarobject +| 6 = @declfunctionobject +| 7 = @builtinfunctionobject +| 8 = @labelobject; + +@typeparamparentobject = @decltypeobject | @declfunctionobject; + +@declobject = @decltypeobject | @declconstobject | @declvarobject | @declfunctionobject; + +@builtinobject = @builtintypeobject | @builtinconstobject | @builtinfunctionobject; + +@typeobject = @decltypeobject | @builtintypeobject; + +@valueobject = @constobject | @varobject | @functionobject; + +@constobject = @declconstobject | @builtinconstobject; + +@varobject = @declvarobject; + +@functionobject = @declfunctionobject | @builtinfunctionobject; + +case @scope.kind of + 0 = @universescope +| 1 = @packagescope +| 2 = @localscope; + +case @type.kind of + 0 = @invalidtype +| 1 = @boolexprtype +| 2 = @inttype +| 3 = @int8type +| 4 = @int16type +| 5 = @int32type +| 6 = @int64type +| 7 = @uinttype +| 8 = @uint8type +| 9 = @uint16type +| 10 = @uint32type +| 11 = @uint64type +| 12 = @uintptrtype +| 13 = @float32type +| 14 = @float64type +| 15 = @complex64type +| 16 = @complex128type +| 17 = @stringexprtype +| 18 = @unsafepointertype +| 19 = @boolliteraltype +| 20 = @intliteraltype +| 21 = @runeliteraltype +| 22 = @floatliteraltype +| 23 = @complexliteraltype +| 24 = @stringliteraltype +| 25 = @nilliteraltype +| 26 = @typeparamtype +| 27 = @arraytype +| 28 = @slicetype +| 29 = @structtype +| 30 = @pointertype +| 31 = @interfacetype +| 32 = @tupletype +| 33 = @signaturetype +| 34 = @maptype +| 35 = @sendchantype +| 36 = @recvchantype +| 37 = @sendrcvchantype +| 38 = @namedtype +| 39 = @typesetliteraltype; + +@basictype = @booltype | @numerictype | @stringtype | @literaltype | @invalidtype | @unsafepointertype; + +@booltype = @boolexprtype | @boolliteraltype; + +@numerictype = @integertype | @floattype | @complextype; + +@integertype = @signedintegertype | @unsignedintegertype; + +@signedintegertype = @inttype | @int8type | @int16type | @int32type | @int64type | @intliteraltype | @runeliteraltype; + +@unsignedintegertype = @uinttype | @uint8type | @uint16type | @uint32type | @uint64type | @uintptrtype; + +@floattype = @float32type | @float64type | @floatliteraltype; + +@complextype = @complex64type | @complex128type | @complexliteraltype; + +@stringtype = @stringexprtype | @stringliteraltype; + +@literaltype = @boolliteraltype | @intliteraltype | @runeliteraltype | @floatliteraltype | @complexliteraltype + | @stringliteraltype | @nilliteraltype; + +@compositetype = @typeparamtype | @containertype | @structtype | @pointertype | @interfacetype | @tupletype + | @signaturetype | @namedtype | @typesetliteraltype; + +@containertype = @arraytype | @slicetype | @maptype | @chantype; + +@chantype = @sendchantype | @recvchantype | @sendrcvchantype; + +case @modexpr.kind of + 0 = @modcommentblock +| 1 = @modline +| 2 = @modlineblock +| 3 = @modlparen +| 4 = @modrparen; + +case @error.kind of + 0 = @unknownerror +| 1 = @listerror +| 2 = @parseerror +| 3 = @typeerror; + diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/objects.ql b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/objects.ql new file mode 100644 index 000000000000..a07513486852 --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/objects.ql @@ -0,0 +1,14 @@ +class Type_ extends @type { + string toString() { result = "Type" } +} + +// The schema for types and typename are: +// +// types(unique int id: @type, int kind: int ref); +// objects(unique int id: @object, int kind: int ref, string name: string ref); +from Type_ type, int object, int kind +where + objects(type, object) and + types(type, kind) and + kind != 40 // @typealias +select type, object diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/old.dbscheme b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/old.dbscheme new file mode 100644 index 000000000000..60e1b7912d7c --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/old.dbscheme @@ -0,0 +1,549 @@ +/** Auto-generated dbscheme; do not edit. */ + + +/** Duplicate code **/ + +duplicateCode( + unique int id : @duplication, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +similarCode( + unique int id : @similarity, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +@duplication_or_similarity = @duplication | @similarity; + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref); + +/** External data **/ + +externalData( + int id : @externalDataElement, + varchar(900) path : string ref, + int column: int ref, + varchar(900) value : string ref +); + +snapshotDate(unique date snapshotDate : date ref); + +sourceLocationPrefix(varchar(900) prefix : string ref); + + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +compilations(unique int id: @compilation, string cwd: string ref); + +#keyset[id, num] +compilation_args(int id: @compilation ref, int num: int ref, string arg: string ref); + +#keyset[id, num, kind] +compilation_time(int id: @compilation ref, int num: int ref, int kind: int ref, float secs: float ref); + +diagnostic_for(unique int diagnostic: @diagnostic ref, int compilation: @compilation ref, int file_number: int ref, int file_number_diagnostic_number: int ref); + +compilation_finished(unique int id: @compilation ref, float cpu_seconds: float ref, float elapsed_seconds: float ref); + +#keyset[id, num] +compilation_compiling_files(int id: @compilation ref, int num: int ref, int file: @file ref); + +diagnostics(unique int id: @diagnostic, int severity: int ref, string error_tag: string ref, string error_message: string ref, + string full_error_message: string ref, int location: @location ref); + +locations_default(unique int id: @location_default, int file: @file ref, int beginLine: int ref, int beginColumn: int ref, + int endLine: int ref, int endColumn: int ref); + +numlines(int element_id: @sourceline ref, int num_lines: int ref, int num_code: int ref, int num_comment: int ref); + +files(unique int id: @file, string name: string ref); + +folders(unique int id: @folder, string name: string ref); + +containerparent(int parent: @container ref, unique int child: @container ref); + +has_location(unique int locatable: @locatable ref, int location: @location ref); + +#keyset[parent, idx] +comment_groups(unique int id: @comment_group, int parent: @file ref, int idx: int ref); + +comments(unique int id: @comment, int kind: int ref, int parent: @comment_group ref, int idx: int ref, string text: string ref); + +doc_comments(unique int node: @documentable ref, int comment: @comment_group ref); + +#keyset[parent, idx] +exprs(unique int id: @expr, int kind: int ref, int parent: @exprparent ref, int idx: int ref); + +literals(unique int expr: @expr ref, string value: string ref, string raw: string ref); + +constvalues(unique int expr: @expr ref, string value: string ref, string exact: string ref); + +fields(unique int id: @field, int parent: @fieldparent ref, int idx: int ref); + +typeparamdecls(unique int id: @typeparamdecl, int parent: @typeparamdeclparent ref, int idx: int ref); + +#keyset[parent, idx] +stmts(unique int id: @stmt, int kind: int ref, int parent: @stmtparent ref, int idx: int ref); + +#keyset[parent, idx] +decls(unique int id: @decl, int kind: int ref, int parent: @declparent ref, int idx: int ref); + +#keyset[parent, idx] +specs(unique int id: @spec, int kind: int ref, int parent: @gendecl ref, int idx: int ref); + +scopes(unique int id: @scope, int kind: int ref); + +scopenesting(unique int inner: @scope ref, int outer: @scope ref); + +scopenodes(unique int node: @scopenode ref, int scope: @localscope ref); + +objects(unique int id: @object, int kind: int ref, string name: string ref); + +objectscopes(unique int object: @object ref, int scope: @scope ref); + +objecttypes(unique int object: @object ref, int tp: @type ref); + +methodreceivers(unique int method: @object ref, int receiver: @object ref); + +fieldstructs(unique int field: @object ref, int struct: @structtype ref); + +methodhosts(int method: @object ref, int host: @namedtype ref); + +defs(int ident: @ident ref, int object: @object ref); + +uses(int ident: @ident ref, int object: @object ref); + +types(unique int id: @type, int kind: int ref); + +type_of(unique int expr: @expr ref, int tp: @type ref); + +typename(unique int tp: @type ref, string name: string ref); + +key_type(unique int map: @maptype ref, int tp: @type ref); + +element_type(unique int container: @containertype ref, int tp: @type ref); + +base_type(unique int ptr: @pointertype ref, int tp: @type ref); + +underlying_type(unique int named: @namedtype ref, int tp: @type ref); + +alias_rhs(unique int alias: @typealias ref, int tp: @type ref); + +#keyset[parent, index] +component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref); + +array_length(unique int tp: @arraytype ref, string len: string ref); + +type_objects(unique int tp: @type ref, int object: @object ref); + +packages(unique int id: @package, string name: string ref, string path: string ref, int scope: @packagescope ref); + +#keyset[parent, idx] +modexprs(unique int id: @modexpr, int kind: int ref, int parent: @modexprparent ref, int idx: int ref); + +#keyset[parent, idx] +modtokens(string token: string ref, int parent: @modexpr ref, int idx: int ref); + +#keyset[package, idx] +errors(unique int id: @error, int kind: int ref, string msg: string ref, string rawpos: string ref, + string file: string ref, int line: int ref, int col: int ref, int package: @package ref, int idx: int ref); + +has_ellipsis(int id: @callorconversionexpr ref); + +variadic(int id: @signaturetype ref); + +#keyset[parent, idx] +typeparam(unique int tp: @typeparamtype ref, string name: string ref, int bound: @compositetype ref, + int parent: @typeparamparentobject ref, int idx: int ref); + +@container = @file | @folder; + +@locatable = @xmllocatable | @node | @localscope; + +@node = @documentable | @exprparent | @modexprparent | @fieldparent | @stmtparent | @declparent | @typeparamdeclparent + | @scopenode | @comment_group | @comment; + +@documentable = @file | @field | @typeparamdecl | @spec | @gendecl | @funcdecl | @modexpr; + +@exprparent = @funcdef | @file | @expr | @field | @stmt | @decl | @typeparamdecl | @spec; + +@modexprparent = @file | @modexpr; + +@fieldparent = @decl | @structtypeexpr | @functypeexpr | @interfacetypeexpr; + +@stmtparent = @funcdef | @stmt | @decl; + +@declparent = @file | @declstmt; + +@typeparamdeclparent = @funcdecl | @typespec; + +@funcdef = @funclit | @funcdecl; + +@scopenode = @file | @functypeexpr | @blockstmt | @ifstmt | @caseclause | @switchstmt | @commclause | @loopstmt; + +@location = @location_default; + +@sourceline = @locatable; + +case @comment.kind of + 0 = @slashslashcomment +| 1 = @slashstarcomment; + +case @expr.kind of + 0 = @badexpr +| 1 = @ident +| 2 = @ellipsis +| 3 = @intlit +| 4 = @floatlit +| 5 = @imaglit +| 6 = @charlit +| 7 = @stringlit +| 8 = @funclit +| 9 = @compositelit +| 10 = @parenexpr +| 11 = @selectorexpr +| 12 = @indexexpr +| 13 = @genericfunctioninstantiationexpr +| 14 = @generictypeinstantiationexpr +| 15 = @sliceexpr +| 16 = @typeassertexpr +| 17 = @callorconversionexpr +| 18 = @starexpr +| 19 = @keyvalueexpr +| 20 = @arraytypeexpr +| 21 = @structtypeexpr +| 22 = @functypeexpr +| 23 = @interfacetypeexpr +| 24 = @maptypeexpr +| 25 = @typesetliteralexpr +| 26 = @plusexpr +| 27 = @minusexpr +| 28 = @notexpr +| 29 = @complementexpr +| 30 = @derefexpr +| 31 = @addressexpr +| 32 = @arrowexpr +| 33 = @lorexpr +| 34 = @landexpr +| 35 = @eqlexpr +| 36 = @neqexpr +| 37 = @lssexpr +| 38 = @leqexpr +| 39 = @gtrexpr +| 40 = @geqexpr +| 41 = @addexpr +| 42 = @subexpr +| 43 = @orexpr +| 44 = @xorexpr +| 45 = @mulexpr +| 46 = @quoexpr +| 47 = @remexpr +| 48 = @shlexpr +| 49 = @shrexpr +| 50 = @andexpr +| 51 = @andnotexpr +| 52 = @sendchantypeexpr +| 53 = @recvchantypeexpr +| 54 = @sendrcvchantypeexpr; + +@basiclit = @intlit | @floatlit | @imaglit | @charlit | @stringlit; + +@operatorexpr = @logicalexpr | @arithmeticexpr | @bitwiseexpr | @unaryexpr | @binaryexpr; + +@logicalexpr = @logicalunaryexpr | @logicalbinaryexpr; + +@arithmeticexpr = @arithmeticunaryexpr | @arithmeticbinaryexpr; + +@bitwiseexpr = @bitwiseunaryexpr | @bitwisebinaryexpr; + +@unaryexpr = @logicalunaryexpr | @bitwiseunaryexpr | @arithmeticunaryexpr | @derefexpr | @addressexpr | @arrowexpr; + +@logicalunaryexpr = @notexpr; + +@bitwiseunaryexpr = @complementexpr; + +@arithmeticunaryexpr = @plusexpr | @minusexpr; + +@binaryexpr = @logicalbinaryexpr | @bitwisebinaryexpr | @arithmeticbinaryexpr | @comparison; + +@logicalbinaryexpr = @lorexpr | @landexpr; + +@bitwisebinaryexpr = @shiftexpr | @orexpr | @xorexpr | @andexpr | @andnotexpr; + +@arithmeticbinaryexpr = @addexpr | @subexpr | @mulexpr | @quoexpr | @remexpr; + +@shiftexpr = @shlexpr | @shrexpr; + +@comparison = @equalitytest | @relationalcomparison; + +@equalitytest = @eqlexpr | @neqexpr; + +@relationalcomparison = @lssexpr | @leqexpr | @gtrexpr | @geqexpr; + +@chantypeexpr = @sendchantypeexpr | @recvchantypeexpr | @sendrcvchantypeexpr; + +case @stmt.kind of + 0 = @badstmt +| 1 = @declstmt +| 2 = @emptystmt +| 3 = @labeledstmt +| 4 = @exprstmt +| 5 = @sendstmt +| 6 = @incstmt +| 7 = @decstmt +| 8 = @gostmt +| 9 = @deferstmt +| 10 = @returnstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @gotostmt +| 14 = @fallthroughstmt +| 15 = @blockstmt +| 16 = @ifstmt +| 17 = @caseclause +| 18 = @exprswitchstmt +| 19 = @typeswitchstmt +| 20 = @commclause +| 21 = @selectstmt +| 22 = @forstmt +| 23 = @rangestmt +| 24 = @assignstmt +| 25 = @definestmt +| 26 = @addassignstmt +| 27 = @subassignstmt +| 28 = @mulassignstmt +| 29 = @quoassignstmt +| 30 = @remassignstmt +| 31 = @andassignstmt +| 32 = @orassignstmt +| 33 = @xorassignstmt +| 34 = @shlassignstmt +| 35 = @shrassignstmt +| 36 = @andnotassignstmt; + +@incdecstmt = @incstmt | @decstmt; + +@assignment = @simpleassignstmt | @compoundassignstmt; + +@simpleassignstmt = @assignstmt | @definestmt; + +@compoundassignstmt = @addassignstmt | @subassignstmt | @mulassignstmt | @quoassignstmt | @remassignstmt + | @andassignstmt | @orassignstmt | @xorassignstmt | @shlassignstmt | @shrassignstmt | @andnotassignstmt; + +@branchstmt = @breakstmt | @continuestmt | @gotostmt | @fallthroughstmt; + +@switchstmt = @exprswitchstmt | @typeswitchstmt; + +@loopstmt = @forstmt | @rangestmt; + +case @decl.kind of + 0 = @baddecl +| 1 = @importdecl +| 2 = @constdecl +| 3 = @typedecl +| 4 = @vardecl +| 5 = @funcdecl; + +@gendecl = @importdecl | @constdecl | @typedecl | @vardecl; + +case @spec.kind of + 0 = @importspec +| 1 = @valuespec +| 2 = @typedefspec +| 3 = @aliasspec; + +@typespec = @typedefspec | @aliasspec; + +case @object.kind of + 0 = @pkgobject +| 1 = @decltypeobject +| 2 = @builtintypeobject +| 3 = @declconstobject +| 4 = @builtinconstobject +| 5 = @declvarobject +| 6 = @declfunctionobject +| 7 = @builtinfunctionobject +| 8 = @labelobject; + +@typeparamparentobject = @decltypeobject | @declfunctionobject; + +@declobject = @decltypeobject | @declconstobject | @declvarobject | @declfunctionobject; + +@builtinobject = @builtintypeobject | @builtinconstobject | @builtinfunctionobject; + +@typeobject = @decltypeobject | @builtintypeobject; + +@valueobject = @constobject | @varobject | @functionobject; + +@constobject = @declconstobject | @builtinconstobject; + +@varobject = @declvarobject; + +@functionobject = @declfunctionobject | @builtinfunctionobject; + +case @scope.kind of + 0 = @universescope +| 1 = @packagescope +| 2 = @localscope; + +case @type.kind of + 0 = @invalidtype +| 1 = @boolexprtype +| 2 = @inttype +| 3 = @int8type +| 4 = @int16type +| 5 = @int32type +| 6 = @int64type +| 7 = @uinttype +| 8 = @uint8type +| 9 = @uint16type +| 10 = @uint32type +| 11 = @uint64type +| 12 = @uintptrtype +| 13 = @float32type +| 14 = @float64type +| 15 = @complex64type +| 16 = @complex128type +| 17 = @stringexprtype +| 18 = @unsafepointertype +| 19 = @boolliteraltype +| 20 = @intliteraltype +| 21 = @runeliteraltype +| 22 = @floatliteraltype +| 23 = @complexliteraltype +| 24 = @stringliteraltype +| 25 = @nilliteraltype +| 26 = @typeparamtype +| 27 = @arraytype +| 28 = @slicetype +| 29 = @structtype +| 30 = @pointertype +| 31 = @interfacetype +| 32 = @tupletype +| 33 = @signaturetype +| 34 = @maptype +| 35 = @sendchantype +| 36 = @recvchantype +| 37 = @sendrcvchantype +| 38 = @namedtype +| 39 = @typesetliteraltype +| 40 = @typealias; + +@basictype = @booltype | @numerictype | @stringtype | @literaltype | @invalidtype | @unsafepointertype; + +@booltype = @boolexprtype | @boolliteraltype; + +@numerictype = @integertype | @floattype | @complextype; + +@integertype = @signedintegertype | @unsignedintegertype; + +@signedintegertype = @inttype | @int8type | @int16type | @int32type | @int64type | @intliteraltype | @runeliteraltype; + +@unsignedintegertype = @uinttype | @uint8type | @uint16type | @uint32type | @uint64type | @uintptrtype; + +@floattype = @float32type | @float64type | @floatliteraltype; + +@complextype = @complex64type | @complex128type | @complexliteraltype; + +@stringtype = @stringexprtype | @stringliteraltype; + +@literaltype = @boolliteraltype | @intliteraltype | @runeliteraltype | @floatliteraltype | @complexliteraltype + | @stringliteraltype | @nilliteraltype; + +@compositetype = @typeparamtype | @containertype | @structtype | @pointertype | @interfacetype | @tupletype + | @signaturetype | @namedtype | @typesetliteraltype | @typealias; + +@containertype = @arraytype | @slicetype | @maptype | @chantype; + +@chantype = @sendchantype | @recvchantype | @sendrcvchantype; + +case @modexpr.kind of + 0 = @modcommentblock +| 1 = @modline +| 2 = @modlineblock +| 3 = @modlparen +| 4 = @modrparen; + +case @error.kind of + 0 = @unknownerror +| 1 = @listerror +| 2 = @parseerror +| 3 = @typeerror; + diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/type_objects.ql b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/type_objects.ql new file mode 100644 index 000000000000..8f37c41cab82 --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/type_objects.ql @@ -0,0 +1,18 @@ +class Type_ extends @type { + string toString() { result = "Type" } +} + +class Object_ extends @object { + string toString() { result = "Object" } +} + +// The schema for types and typename are: +// +// types(unique int id: @type, int kind: int ref); +// type_objects(unique int tp: @type ref, int object: @object ref); +from Type_ type, Object_ object, int kind +where + type_objects(type, object) and + types(type, kind) and + kind != 40 // @typealias +select type, object diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/typename.ql b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/typename.ql new file mode 100644 index 000000000000..d92ed426f067 --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/typename.ql @@ -0,0 +1,14 @@ +class Type_ extends @type { + string toString() { result = "Type" } +} + +// The schema for types and typename are: +// +// types(unique int id: @type, int kind: int ref); +// typename(unique int tp: @type ref, string name: string ref); +from Type_ type, string name, int kind +where + typename(type, name) and + types(type, kind) and + kind != 40 // @typealias +select type, name diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/types.ql b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/types.ql new file mode 100644 index 000000000000..50be9e74a07d --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/types.ql @@ -0,0 +1,12 @@ +class Type_ extends @type { + string toString() { result = "Type" } +} + +// The schema for types is: +// +// types(unique int id: @type, int kind: int ref); +from Type_ type, int kind +where + types(type, kind) and + kind != 40 // @typealias +select type, kind diff --git a/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/upgrade.properties b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/upgrade.properties new file mode 100644 index 000000000000..fc4ebba17590 --- /dev/null +++ b/go/downgrades/60e1b7912d7c68066b13c776b07c2da5fc13342a/upgrade.properties @@ -0,0 +1,7 @@ +description: Remove support for type aliases +compatibility: full + +alias_rhs.rel: delete +types.rel: run types.qlo +typename.rel: run typename.qlo +type_objects.rel: run type_objects.qlo diff --git a/go/extractor/autobuilder/build-environment.go b/go/extractor/autobuilder/build-environment.go index 4659fef71dfb..cc3dc62c02dc 100644 --- a/go/extractor/autobuilder/build-environment.go +++ b/go/extractor/autobuilder/build-environment.go @@ -12,7 +12,7 @@ import ( ) var minGoVersion = util.NewSemVer("1.11") -var maxGoVersion = util.NewSemVer("1.22") +var maxGoVersion = util.NewSemVer("1.23") type versionInfo struct { goModVersion util.SemVer // The version of Go found in the go directive in the `go.mod` file. diff --git a/go/extractor/dbscheme/tables.go b/go/extractor/dbscheme/tables.go index e987cb402ae4..b51dfabf5ca1 100644 --- a/go/extractor/dbscheme/tables.go +++ b/go/extractor/dbscheme/tables.go @@ -861,6 +861,9 @@ var NamedType = TypeKind.NewBranch("@namedtype", CompositeType) // TypeSetLiteral is the type of type set literals var TypeSetLiteral = TypeKind.NewBranch("@typesetliteraltype", CompositeType) +// TypeAlias is the type of type aliases +var TypeAlias = TypeKind.NewBranch("@typealias", CompositeType) + // PackageType is the type of packages var PackageType = NewPrimaryKeyType("@package") @@ -1142,6 +1145,12 @@ var UnderlyingTypeTable = NewTable("underlying_type", EntityColumn(TypeType, "tp"), ) +// AliasRhsTable is the table associating type aliases with their RHS. +var AliasRhsTable = NewTable("alias_rhs", + EntityColumn(TypeAlias, "alias").Unique(), + EntityColumn(TypeType, "tp"), +) + // ComponentTypesTable is the table associating composite types with their component types var ComponentTypesTable = NewTable("component_types", EntityColumn(CompositeType, "parent"), diff --git a/go/extractor/extractor.go b/go/extractor/extractor.go index 4926d8e3e13a..3712b7c93937 100644 --- a/go/extractor/extractor.go +++ b/go/extractor/extractor.go @@ -1607,15 +1607,7 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label { extractUnderlyingType(tw, lbl, underlying) trackInstantiatedStructFields(tw, tp, origintp) - entitylbl, exists := tw.Labeler.LookupObjectID(origintp.Obj(), lbl) - if entitylbl == trap.InvalidLabel { - log.Printf("Omitting type-object binding for unknown object %v.\n", origintp.Obj()) - } else { - if !exists { - extractObject(tw, origintp.Obj(), entitylbl) - } - dbscheme.TypeObjectTable.Emit(tw, lbl, entitylbl) - } + extractTypeObject(tw, lbl, origintp.Obj()) // ensure all methods have labels - note that methods do not have a // parent scope, so they are not dealt with by `extractScopes` @@ -1647,6 +1639,12 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label { } extractComponentType(tw, lbl, i, tildeStr, term.Type()) } + case *types.Alias: + kind = dbscheme.TypeAlias.Index() + dbscheme.TypeNameTable.Emit(tw, lbl, tp.Obj().Name()) + dbscheme.AliasRhsTable.Emit(tw, lbl, extractType(tw, tp.Rhs())) + + extractTypeObject(tw, lbl, tp.Obj()) default: log.Fatalf("unexpected type %T", tp) } @@ -1790,6 +1788,19 @@ func getTypeLabel(tw *trap.Writer, tp types.Type) (trap.Label, bool) { fmt.Fprintf(&b, "{%s}", compLbl) } lbl = tw.Labeler.GlobalID(fmt.Sprintf("%s;typesetliteraltype", b.String())) + case *types.Alias: + // Ensure that the definition of the aliased type gets extracted + // (which may be an alias in itself). + extractType(tw, tp.Rhs()) + + entitylbl, exists := tw.Labeler.LookupObjectID(tp.Obj(), lbl) + if entitylbl == trap.InvalidLabel { + panic(fmt.Sprintf("Cannot construct label for alias type %v (underlying object is %v).\n", tp, tp.Obj())) + } + if !exists { + extractObject(tw, tp.Obj(), entitylbl) + } + lbl = tw.Labeler.GlobalID(fmt.Sprintf("{%s};aliastype", entitylbl)) default: log.Fatalf("(getTypeLabel) unexpected type %T", tp) } @@ -1798,6 +1809,19 @@ func getTypeLabel(tw *trap.Writer, tp types.Type) (trap.Label, bool) { return lbl, exists } +// extractTypeObject extracts a single type object and emits it to the type object table. +func extractTypeObject(tw *trap.Writer, lbl trap.Label, entity *types.TypeName) { + entitylbl, exists := tw.Labeler.LookupObjectID(entity, lbl) + if entitylbl == trap.InvalidLabel { + log.Printf("Omitting type-object binding for unknown object %v.\n", entity) + } else { + if !exists { + extractObject(tw, entity, entitylbl) + } + dbscheme.TypeObjectTable.Emit(tw, lbl, entitylbl) + } +} + // extractKeyType extracts `key` as the key type of the map type `mp` func extractKeyType(tw *trap.Writer, mp trap.Label, key types.Type) { dbscheme.KeyTypeTable.Emit(tw, mp, extractType(tw, key)) diff --git a/go/extractor/go.mod b/go/extractor/go.mod index 42366f172863..7d78ce08e67d 100644 --- a/go/extractor/go.mod +++ b/go/extractor/go.mod @@ -1,6 +1,8 @@ module github.com/github/codeql-go/extractor -go 1.22.0 +go 1.23 + +toolchain go1.23.0 // when updating this, run // bazel run @rules_go//go -- mod tidy diff --git a/go/ql/lib/change-notes/2024-08-22-go-1.23-supported.md b/go/ql/lib/change-notes/2024-08-22-go-1.23-supported.md new file mode 100644 index 000000000000..d1526a0ee1ec --- /dev/null +++ b/go/ql/lib/change-notes/2024-08-22-go-1.23-supported.md @@ -0,0 +1,4 @@ +--- +category: majorAnalysis +--- +* Go 1.23 has been included in the range of supported Go versions. diff --git a/go/ql/lib/go.dbscheme b/go/ql/lib/go.dbscheme index a58b81b1b4c4..60e1b7912d7c 100644 --- a/go/ql/lib/go.dbscheme +++ b/go/ql/lib/go.dbscheme @@ -204,6 +204,8 @@ base_type(unique int ptr: @pointertype ref, int tp: @type ref); underlying_type(unique int named: @namedtype ref, int tp: @type ref); +alias_rhs(unique int alias: @typealias ref, int tp: @type ref); + #keyset[parent, index] component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref); @@ -501,7 +503,8 @@ case @type.kind of | 36 = @recvchantype | 37 = @sendrcvchantype | 38 = @namedtype -| 39 = @typesetliteraltype; +| 39 = @typesetliteraltype +| 40 = @typealias; @basictype = @booltype | @numerictype | @stringtype | @literaltype | @invalidtype | @unsafepointertype; @@ -525,7 +528,7 @@ case @type.kind of | @stringliteraltype | @nilliteraltype; @compositetype = @typeparamtype | @containertype | @structtype | @pointertype | @interfacetype | @tupletype - | @signaturetype | @namedtype | @typesetliteraltype; + | @signaturetype | @namedtype | @typesetliteraltype | @typealias; @containertype = @arraytype | @slicetype | @maptype | @chantype; diff --git a/go/ql/lib/semmle/go/Types.qll b/go/ql/lib/semmle/go/Types.qll index 026b009aa3fa..76522e410e9d 100644 --- a/go/ql/lib/semmle/go/Types.qll +++ b/go/ql/lib/semmle/go/Types.qll @@ -1007,6 +1007,25 @@ class NamedType extends @namedtype, CompositeType { override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } } +/** An alias type. */ +class AliasType extends @typealias, CompositeType { + /** Gets the aliased type (i.e. that appears on the RHS of the alias definition). */ + Type getRhs() { alias_rhs(this, result) } + + override Type getUnderlyingType() { result = unalias(this).getUnderlyingType() } +} + +/** + * Gets the non-alias type at the end of the alias chain starting at `t`. + * + * If `t` is not an alias type then `result` is `t`. + */ +Type unalias(Type t) { + not t instanceof AliasType and result = t + or + result = unalias(t.(AliasType).getRhs()) +} + /** * A type that implements the builtin interface `error`. */ diff --git a/go/ql/lib/upgrades/90fa7836e0a239f69bbebffcf342e92c240d54bc/go.dbscheme.stats b/go/ql/lib/upgrades/90fa7836e0a239f69bbebffcf342e92c240d54bc/go.dbscheme.stats new file mode 100644 index 000000000000..b18e8556fb24 --- /dev/null +++ b/go/ql/lib/upgrades/90fa7836e0a239f69bbebffcf342e92c240d54bc/go.dbscheme.stats @@ -0,0 +1,15183 @@ + + + + @similarity + 0 + + + @duplication + 0 + + + @xmldtd + 0 + + + @xmlelement + 504 + + + @xmlattribute + 408 + + + @externalDataElement + 0 + + + @xmlnamespace + 0 + + + @xmlcomment + 30 + + + @xmlcharacters + 869 + + + @compilation + 1 + + + @diagnostic + 0 + + + @file + 529 + + + @folder + 210 + + + @comment_group + 12083 + + + @slashslashcomment + 24878 + + + @slashstarcomment + 846 + + + @ident + 237316 + + + @ellipsis + 141 + + + @intlit + 7683 + + + @floatlit + 27 + + + @charlit + 838 + + + @stringlit + 24892 + + + @funclit + 678 + + + @compositelit + 2704 + + + @parenexpr + 343 + + + @selectorexpr + 54353 + + + @indexexpr + 4581 + + + @sliceexpr + 836 + + + @typeassertexpr + 2127 + + + @callorconversionexpr + 32041 + + + @starexpr + 10360 + + + @keyvalueexpr + 5616 + + + @arraytypeexpr + 3465 + + + @structtypeexpr + 1207 + + + @functypeexpr + 6015 + + + @interfacetypeexpr + 509 + + + @maptypeexpr + 1013 + + + @minusexpr + 270 + + + @notexpr + 1190 + + + @complementexpr + 21 + + + @addressexpr + 1739 + + + @arrowexpr + 92 + + + @lorexpr + 612 + + + @landexpr + 1234 + + + @eqlexpr + 3244 + + + @neqexpr + 4103 + + + @lssexpr + 785 + + + @leqexpr + 248 + + + @gtrexpr + 619 + + + @geqexpr + 270 + + + @addexpr + 1272 + + + @subexpr + 557 + + + @orexpr + 146 + + + @xorexpr + 14 + + + @mulexpr + 207 + + + @quoexpr + 53 + + + @remexpr + 24 + + + @shlexpr + 164 + + + @shrexpr + 57 + + + @andexpr + 235 + + + @andnotexpr + 19 + + + @sendchantypeexpr + 7 + + + @recvchantypeexpr + 9 + + + @sendrcvchantypeexpr + 101 + + + @badexpr + 0 + + + @imaglit + 0 + + + @plusexpr + 0 + + + @derefexpr + 0 + + + @field + 19974 + + + @location_default + 539178 + + + @declstmt + 1454 + + + @labeledstmt + 49 + + + @exprstmt + 7605 + + + @sendstmt + 69 + + + @incstmt + 614 + + + @decstmt + 71 + + + @gostmt + 72 + + + @deferstmt + 358 + + + @returnstmt + 9225 + + + @breakstmt + 301 + + + @continuestmt + 606 + + + @gotostmt + 8 + + + @fallthroughstmt + 7 + + + @blockstmt + 19358 + + + @ifstmt + 9728 + + + @caseclause + 3476 + + + @exprswitchstmt + 378 + + + @typeswitchstmt + 400 + + + @commclause + 72 + + + @selectstmt + 35 + + + @forstmt + 654 + + + @rangestmt + 2135 + + + @assignstmt + 7478 + + + @definestmt + 9514 + + + @addassignstmt + 223 + + + @subassignstmt + 18 + + + @mulassignstmt + 5 + + + @quoassignstmt + 3 + + + @orassignstmt + 63 + + + @xorassignstmt + 3 + + + @shlassignstmt + 2 + + + @shrassignstmt + 3 + + + @andnotassignstmt + 3 + + + @badstmt + 0 + + + @emptystmt + 0 + + + @remassignstmt + 0 + + + @andassignstmt + 0 + + + @importdecl + 479 + + + @constdecl + 280 + + + @typedecl + 1349 + + + @vardecl + 1769 + + + @funcdecl + 4813 + + + @baddecl + 0 + + + @importspec + 3468 + + + @valuespec + 3056 + + + @typedefspec + 1349 + + + @aliasspec + 16 + + + @universescope + 1 + + + @packagescope + 346 + + + @localscope + 36428 + + + @pkgobject + 3468 + + + @decltypeobject + 3602 + + + @builtintypeobject + 20 + + + @declconstobject + 8857 + + + @builtinconstobject + 4 + + + @declvarobject + 51098 + + + @declfunctionobject + 17793 + + + @builtinfunctionobject + 18 + + + @labelobject + 49 + + + @invalidtype + 1 + + + @boolexprtype + 1 + + + @inttype + 1 + + + @int8type + 1 + + + @int16type + 1 + + + @int32type + 1 + + + @int64type + 1 + + + @uinttype + 1 + + + @uint8type + 1 + + + @uint16type + 1 + + + @uint32type + 1 + + + @uint64type + 1 + + + @uintptrtype + 1 + + + @float32type + 1 + + + @float64type + 1 + + + @complex64type + 1 + + + @complex128type + 1 + + + @stringexprtype + 1 + + + @unsafepointertype + 1 + + + @boolliteraltype + 1 + + + @intliteraltype + 1 + + + @runeliteraltype + 1 + + + @floatliteraltype + 1 + + + @stringliteraltype + 1 + + + @nilliteraltype + 1 + + + @arraytype + 293 + + + @slicetype + 637 + + + @structtype + 2409 + + + @pointertype + 1903 + + + @interfacetype + 247 + + + @tupletype + 559 + + + @signaturetype + 8010 + + + @maptype + 430 + + + @sendchantype + 13 + + + @recvchantype + 10 + + + @sendrcvchantype + 29 + + + @namedtype + 3567 + + + @complexliteraltype + 0 + + + @package + 346 + + + @modline + 6 + + + @modlineblock + 1 + + + @modlparen + 1 + + + @modrparen + 1 + + + @modcommentblock + 0 + + + @unknownerror + 0 + + + @listerror + 0 + + + @parseerror + 0 + + + @typeerror + 0 + + + + + duplicateCode + 0 + + + id + 0 + + + relativePath + 0 + + + equivClass + 0 + + + + + id + relativePath + + + 12 + + + 1 + 2 + 1 + + + + + + + id + equivClass + + + 12 + + + 1 + 2 + 1 + + + + + + + relativePath + id + + + 12 + + + + + + relativePath + equivClass + + + 12 + + + + + + equivClass + id + + + 12 + + + + + + equivClass + relativePath + + + 12 + + + + + + + + similarCode + 0 + + + id + 0 + + + relativePath + 0 + + + equivClass + 0 + + + + + id + relativePath + + + 12 + + + 1 + 2 + 1 + + + + + + + id + equivClass + + + 12 + + + 1 + 2 + 1 + + + + + + + relativePath + id + + + 12 + + + + + + relativePath + equivClass + + + 12 + + + + + + equivClass + id + + + 12 + + + + + + equivClass + relativePath + + + 12 + + + + + + + + tokens + 0 + + + id + 0 + + + offset + 0 + + + beginLine + 0 + + + beginColumn + 0 + + + endLine + 0 + + + endColumn + 0 + + + + + id + offset + + + 12 + + + + + + id + beginLine + + + 12 + + + + + + id + beginColumn + + + 12 + + + + + + id + endLine + + + 12 + + + + + + id + endColumn + + + 12 + + + + + + offset + id + + + 12 + + + + + + offset + beginLine + + + 12 + + + + + + offset + beginColumn + + + 12 + + + + + + offset + endLine + + + 12 + + + + + + offset + endColumn + + + 12 + + + + + + beginLine + id + + + 12 + + + + + + beginLine + offset + + + 12 + + + + + + beginLine + beginColumn + + + 12 + + + + + + beginLine + endLine + + + 12 + + + + + + beginLine + endColumn + + + 12 + + + + + + beginColumn + id + + + 12 + + + + + + beginColumn + offset + + + 12 + + + + + + beginColumn + beginLine + + + 12 + + + + + + beginColumn + endLine + + + 12 + + + + + + beginColumn + endColumn + + + 12 + + + + + + endLine + id + + + 12 + + + + + + endLine + offset + + + 12 + + + + + + endLine + beginLine + + + 12 + + + + + + endLine + beginColumn + + + 12 + + + + + + endLine + endColumn + + + 12 + + + + + + endColumn + id + + + 12 + + + + + + endColumn + offset + + + 12 + + + + + + endColumn + beginLine + + + 12 + + + + + + endColumn + beginColumn + + + 12 + + + + + + endColumn + endLine + + + 12 + + + + + + + + externalData + 0 + + + id + 0 + + + path + 0 + + + column + 0 + + + value + 0 + + + + + id + path + + + 12 + + + + + + id + column + + + 12 + + + + + + id + value + + + 12 + + + + + + path + id + + + 12 + + + + + + path + column + + + 12 + + + + + + path + value + + + 12 + + + + + + column + id + + + 12 + + + + + + column + path + + + 12 + + + + + + column + value + + + 12 + + + + + + value + id + + + 12 + + + + + + value + path + + + 12 + + + + + + value + column + + + 12 + + + + + + + + snapshotDate + 0 + + + snapshotDate + 0 + + + + + + sourceLocationPrefix + 1 + + + prefix + 1 + + + + + + xmlEncoding + 0 + + + id + 0 + + + encoding + 0 + + + + + id + encoding + + + 12 + + + 1 + 2 + 1 + + + + + + + encoding + id + + + 12 + + + + + + + + xmlDTDs + 0 + + + id + 0 + + + root + 0 + + + publicId + 0 + + + systemId + 0 + + + fileid + 0 + + + + + id + root + + + 12 + + + 1 + 2 + 1 + + + + + + + id + publicId + + + 12 + + + 1 + 2 + 1 + + + + + + + id + systemId + + + 12 + + + 1 + 2 + 1 + + + + + + + id + fileid + + + 12 + + + 1 + 2 + 1 + + + + + + + root + id + + + 12 + + + + + + root + publicId + + + 12 + + + + + + root + systemId + + + 12 + + + + + + root + fileid + + + 12 + + + + + + publicId + id + + + 12 + + + + + + publicId + root + + + 12 + + + + + + publicId + systemId + + + 12 + + + + + + publicId + fileid + + + 12 + + + + + + systemId + id + + + 12 + + + + + + systemId + root + + + 12 + + + + + + systemId + publicId + + + 12 + + + + + + systemId + fileid + + + 12 + + + + + + fileid + id + + + 12 + + + + + + fileid + root + + + 12 + + + + + + fileid + publicId + + + 12 + + + + + + fileid + systemId + + + 12 + + + + + + + + xmlElements + 504 + + + id + 504 + + + name + 38 + + + parentid + 199 + + + idx + 86 + + + fileid + 14 + + + + + id + name + + + 12 + + + 1 + 2 + 504 + + + + + + + id + parentid + + + 12 + + + 1 + 2 + 504 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 504 + + + + + + + id + fileid + + + 12 + + + 1 + 2 + 504 + + + + + + + name + id + + + 12 + + + 1 + 2 + 11 + + + 2 + 3 + 3 + + + 3 + 4 + 4 + + + 4 + 6 + 3 + + + 7 + 12 + 3 + + + 12 + 14 + 2 + + + 14 + 16 + 3 + + + 16 + 22 + 3 + + + 27 + 40 + 3 + + + 55 + 101 + 3 + + + + + + + name + parentid + + + 12 + + + 1 + 2 + 15 + + + 2 + 3 + 4 + + + 3 + 4 + 4 + + + 4 + 5 + 3 + + + 5 + 6 + 1 + + + 6 + 7 + 3 + + + 7 + 18 + 3 + + + 18 + 22 + 3 + + + 29 + 76 + 2 + + + + + + + name + idx + + + 12 + + + 1 + 2 + 12 + + + 2 + 3 + 4 + + + 3 + 4 + 5 + + + 4 + 5 + 1 + + + 5 + 6 + 3 + + + 6 + 9 + 3 + + + 10 + 11 + 2 + + + 13 + 15 + 3 + + + 15 + 17 + 3 + + + 17 + 41 + 2 + + + + + + + name + fileid + + + 12 + + + 1 + 2 + 18 + + + 2 + 3 + 7 + + + 3 + 4 + 3 + + + 4 + 5 + 1 + + + 5 + 6 + 4 + + + 7 + 11 + 3 + + + 11 + 14 + 2 + + + + + + + parentid + id + + + 12 + + + 1 + 2 + 116 + + + 2 + 3 + 37 + + + 3 + 4 + 22 + + + 4 + 8 + 15 + + + 8 + 61 + 9 + + + + + + + parentid + name + + + 12 + + + 1 + 2 + 160 + + + 2 + 3 + 23 + + + 3 + 8 + 16 + + + + + + + parentid + idx + + + 12 + + + 1 + 2 + 116 + + + 2 + 3 + 37 + + + 3 + 4 + 22 + + + 4 + 8 + 15 + + + 8 + 61 + 9 + + + + + + + parentid + fileid + + + 12 + + + 1 + 2 + 199 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 54 + + + 2 + 3 + 4 + + + 3 + 4 + 11 + + + 4 + 6 + 6 + + + 6 + 21 + 7 + + + 40 + 141 + 4 + + + + + + + idx + name + + + 12 + + + 1 + 2 + 54 + + + 2 + 3 + 5 + + + 3 + 4 + 11 + + + 4 + 5 + 6 + + + 5 + 12 + 7 + + + 14 + 26 + 3 + + + + + + + idx + parentid + + + 12 + + + 1 + 2 + 54 + + + 2 + 3 + 4 + + + 3 + 4 + 11 + + + 4 + 6 + 6 + + + 6 + 21 + 7 + + + 40 + 141 + 4 + + + + + + + idx + fileid + + + 12 + + + 1 + 2 + 54 + + + 2 + 3 + 4 + + + 3 + 4 + 11 + + + 4 + 5 + 8 + + + 5 + 13 + 7 + + + 13 + 15 + 2 + + + + + + + fileid + id + + + 12 + + + 2 + 3 + 1 + + + 7 + 8 + 1 + + + 8 + 9 + 2 + + + 10 + 11 + 1 + + + 16 + 17 + 1 + + + 18 + 19 + 1 + + + 20 + 21 + 1 + + + 21 + 22 + 2 + + + 58 + 59 + 1 + + + 100 + 101 + 1 + + + 107 + 108 + 1 + + + 108 + 109 + 1 + + + + + + + fileid + name + + + 12 + + + 2 + 3 + 1 + + + 3 + 4 + 2 + + + 4 + 5 + 1 + + + 5 + 6 + 2 + + + 6 + 7 + 2 + + + 8 + 9 + 2 + + + 11 + 12 + 1 + + + 16 + 17 + 1 + + + 17 + 18 + 1 + + + 19 + 20 + 1 + + + + + + + fileid + parentid + + + 12 + + + 2 + 3 + 2 + + + 4 + 5 + 1 + + + 6 + 7 + 2 + + + 7 + 8 + 3 + + + 9 + 10 + 1 + + + 10 + 11 + 1 + + + 20 + 21 + 1 + + + 23 + 24 + 1 + + + 47 + 48 + 1 + + + 49 + 50 + 1 + + + + + + + fileid + idx + + + 12 + + + 1 + 2 + 1 + + + 3 + 4 + 2 + + + 4 + 5 + 1 + + + 7 + 8 + 3 + + + 8 + 9 + 1 + + + 13 + 14 + 1 + + + 14 + 15 + 1 + + + 16 + 17 + 1 + + + 30 + 31 + 1 + + + 34 + 35 + 1 + + + 67 + 68 + 1 + + + + + + + + + xmlAttrs + 408 + + + id + 408 + + + elementid + 288 + + + name + 28 + + + value + 235 + + + idx + 6 + + + fileid + 14 + + + + + id + elementid + + + 12 + + + 1 + 2 + 408 + + + + + + + id + name + + + 12 + + + 1 + 2 + 408 + + + + + + + id + value + + + 12 + + + 1 + 2 + 408 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 408 + + + + + + + id + fileid + + + 12 + + + 1 + 2 + 408 + + + + + + + elementid + id + + + 12 + + + 1 + 2 + 195 + + + 2 + 3 + 69 + + + 3 + 4 + 23 + + + 6 + 7 + 1 + + + + + + + elementid + name + + + 12 + + + 1 + 2 + 195 + + + 2 + 3 + 69 + + + 3 + 4 + 23 + + + 6 + 7 + 1 + + + + + + + elementid + value + + + 12 + + + 1 + 2 + 195 + + + 2 + 3 + 70 + + + 3 + 4 + 22 + + + 4 + 5 + 1 + + + + + + + elementid + idx + + + 12 + + + 1 + 2 + 195 + + + 2 + 3 + 69 + + + 3 + 4 + 23 + + + 6 + 7 + 1 + + + + + + + elementid + fileid + + + 12 + + + 1 + 2 + 288 + + + + + + + name + id + + + 12 + + + 1 + 2 + 12 + + + 2 + 3 + 3 + + + 3 + 4 + 4 + + + 5 + 15 + 2 + + + 21 + 22 + 2 + + + 22 + 23 + 2 + + + 45 + 97 + 2 + + + 132 + 133 + 1 + + + + + + + name + elementid + + + 12 + + + 1 + 2 + 12 + + + 2 + 3 + 3 + + + 3 + 4 + 4 + + + 5 + 15 + 2 + + + 21 + 22 + 2 + + + 22 + 23 + 2 + + + 45 + 97 + 2 + + + 132 + 133 + 1 + + + + + + + name + value + + + 12 + + + 1 + 2 + 16 + + + 2 + 3 + 2 + + + 3 + 4 + 3 + + + 11 + 12 + 1 + + + 15 + 16 + 2 + + + 21 + 36 + 2 + + + 41 + 75 + 2 + + + + + + + name + idx + + + 12 + + + 1 + 2 + 19 + + + 2 + 3 + 5 + + + 3 + 4 + 4 + + + + + + + name + fileid + + + 12 + + + 1 + 2 + 18 + + + 2 + 3 + 2 + + + 3 + 4 + 2 + + + 4 + 6 + 2 + + + 10 + 11 + 3 + + + 13 + 14 + 1 + + + + + + + value + id + + + 12 + + + 1 + 2 + 171 + + + 2 + 3 + 32 + + + 3 + 5 + 18 + + + 5 + 13 + 14 + + + + + + + value + elementid + + + 12 + + + 1 + 2 + 174 + + + 2 + 3 + 29 + + + 3 + 5 + 18 + + + 5 + 13 + 14 + + + + + + + value + name + + + 12 + + + 1 + 2 + 230 + + + 2 + 4 + 5 + + + + + + + value + idx + + + 12 + + + 1 + 2 + 224 + + + 2 + 4 + 11 + + + + + + + value + fileid + + + 12 + + + 1 + 2 + 193 + + + 2 + 3 + 32 + + + 3 + 7 + 10 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 3 + + + 24 + 25 + 1 + + + 93 + 94 + 1 + + + 288 + 289 + 1 + + + + + + + idx + elementid + + + 12 + + + 1 + 2 + 3 + + + 24 + 25 + 1 + + + 93 + 94 + 1 + + + 288 + 289 + 1 + + + + + + + idx + name + + + 12 + + + 1 + 2 + 3 + + + 8 + 9 + 1 + + + 14 + 15 + 1 + + + 16 + 17 + 1 + + + + + + + idx + value + + + 12 + + + 1 + 2 + 3 + + + 23 + 24 + 1 + + + 64 + 65 + 1 + + + 157 + 158 + 1 + + + + + + + idx + fileid + + + 12 + + + 1 + 2 + 3 + + + 6 + 7 + 1 + + + 12 + 13 + 1 + + + 14 + 15 + 1 + + + + + + + fileid + id + + + 12 + + + 2 + 3 + 1 + + + 4 + 5 + 1 + + + 10 + 11 + 2 + + + 11 + 12 + 1 + + + 12 + 13 + 1 + + + 17 + 18 + 1 + + + 18 + 19 + 1 + + + 19 + 20 + 1 + + + 22 + 23 + 1 + + + 48 + 49 + 1 + + + 73 + 74 + 2 + + + 89 + 90 + 1 + + + + + + + fileid + elementid + + + 12 + + + 1 + 2 + 1 + + + 4 + 5 + 1 + + + 8 + 9 + 2 + + + 9 + 10 + 1 + + + 11 + 12 + 1 + + + 12 + 13 + 2 + + + 16 + 17 + 1 + + + 17 + 18 + 1 + + + 18 + 19 + 1 + + + 42 + 43 + 1 + + + 63 + 64 + 1 + + + 67 + 68 + 1 + + + + + + + fileid + name + + + 12 + + + 2 + 3 + 2 + + + 3 + 4 + 2 + + + 4 + 5 + 4 + + + 5 + 6 + 1 + + + 6 + 7 + 2 + + + 7 + 8 + 2 + + + 23 + 24 + 1 + + + + + + + fileid + value + + + 12 + + + 2 + 3 + 1 + + + 3 + 4 + 1 + + + 6 + 7 + 1 + + + 8 + 9 + 2 + + + 9 + 10 + 1 + + + 10 + 11 + 1 + + + 13 + 14 + 1 + + + 14 + 15 + 1 + + + 18 + 19 + 1 + + + 32 + 33 + 1 + + + 54 + 55 + 1 + + + 60 + 61 + 1 + + + 61 + 62 + 1 + + + + + + + fileid + idx + + + 12 + + + 1 + 2 + 2 + + + 2 + 3 + 6 + + + 3 + 4 + 5 + + + 6 + 7 + 1 + + + + + + + + + xmlNs + 0 + + + id + 0 + + + prefixName + 0 + + + URI + 0 + + + fileid + 0 + + + + + id + prefixName + + + 12 + + + + + + id + URI + + + 12 + + + + + + id + fileid + + + 12 + + + + + + prefixName + id + + + 12 + + + + + + prefixName + URI + + + 12 + + + + + + prefixName + fileid + + + 12 + + + + + + URI + id + + + 12 + + + + + + URI + prefixName + + + 12 + + + + + + URI + fileid + + + 12 + + + + + + fileid + id + + + 12 + + + + + + fileid + prefixName + + + 12 + + + + + + fileid + URI + + + 12 + + + + + + + + xmlHasNs + 0 + + + elementId + 0 + + + nsId + 0 + + + fileid + 0 + + + + + elementId + nsId + + + 12 + + + + + + elementId + fileid + + + 12 + + + + + + nsId + elementId + + + 12 + + + + + + nsId + fileid + + + 12 + + + + + + fileid + elementId + + + 12 + + + + + + fileid + nsId + + + 12 + + + + + + + + xmlComments + 30 + + + id + 30 + + + text + 18 + + + parentid + 20 + + + fileid + 10 + + + + + id + text + + + 12 + + + 1 + 2 + 30 + + + + + + + id + parentid + + + 12 + + + 1 + 2 + 30 + + + + + + + id + fileid + + + 12 + + + 1 + 2 + 30 + + + + + + + text + id + + + 12 + + + 1 + 2 + 13 + + + 2 + 3 + 3 + + + 4 + 5 + 1 + + + 7 + 8 + 1 + + + + + + + text + parentid + + + 12 + + + 1 + 2 + 14 + + + 2 + 3 + 2 + + + 4 + 5 + 1 + + + 7 + 8 + 1 + + + + + + + text + fileid + + + 12 + + + 1 + 2 + 15 + + + 2 + 3 + 2 + + + 7 + 8 + 1 + + + + + + + parentid + id + + + 12 + + + 1 + 2 + 15 + + + 2 + 3 + 3 + + + 4 + 5 + 1 + + + 5 + 6 + 1 + + + + + + + parentid + text + + + 12 + + + 1 + 2 + 15 + + + 2 + 3 + 3 + + + 3 + 4 + 1 + + + 5 + 6 + 1 + + + + + + + parentid + fileid + + + 12 + + + 1 + 2 + 20 + + + + + + + fileid + id + + + 12 + + + 1 + 2 + 6 + + + 2 + 3 + 1 + + + 4 + 5 + 1 + + + 8 + 9 + 1 + + + 10 + 11 + 1 + + + + + + + fileid + text + + + 12 + + + 1 + 2 + 6 + + + 2 + 3 + 1 + + + 4 + 5 + 1 + + + 5 + 6 + 1 + + + 9 + 10 + 1 + + + + + + + fileid + parentid + + + 12 + + + 1 + 2 + 7 + + + 3 + 4 + 1 + + + 5 + 6 + 2 + + + + + + + + + xmlChars + 869 + + + id + 869 + + + text + 427 + + + parentid + 432 + + + idx + 87 + + + isCDATA + 1 + + + fileid + 14 + + + + + id + text + + + 12 + + + 1 + 2 + 869 + + + + + + + id + parentid + + + 12 + + + 1 + 2 + 869 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 869 + + + + + + + id + isCDATA + + + 12 + + + 1 + 2 + 869 + + + + + + + id + fileid + + + 12 + + + 1 + 2 + 869 + + + + + + + text + id + + + 12 + + + 1 + 2 + 339 + + + 2 + 3 + 53 + + + 3 + 49 + 33 + + + 68 + 90 + 2 + + + + + + + text + parentid + + + 12 + + + 1 + 2 + 342 + + + 2 + 3 + 50 + + + 3 + 28 + 33 + + + 28 + 32 + 2 + + + + + + + text + idx + + + 12 + + + 1 + 2 + 400 + + + 2 + 58 + 27 + + + + + + + text + isCDATA + + + 12 + + + 1 + 2 + 427 + + + + + + + text + fileid + + + 12 + + + 1 + 2 + 380 + + + 2 + 4 + 36 + + + 4 + 11 + 11 + + + + + + + parentid + id + + + 12 + + + 1 + 2 + 302 + + + 2 + 3 + 53 + + + 3 + 4 + 28 + + + 4 + 7 + 34 + + + 7 + 60 + 15 + + + + + + + parentid + text + + + 12 + + + 1 + 2 + 314 + + + 2 + 3 + 67 + + + 3 + 5 + 37 + + + 5 + 26 + 14 + + + + + + + parentid + idx + + + 12 + + + 1 + 2 + 302 + + + 2 + 3 + 53 + + + 3 + 4 + 28 + + + 4 + 7 + 34 + + + 7 + 60 + 15 + + + + + + + parentid + isCDATA + + + 12 + + + 1 + 2 + 432 + + + + + + + parentid + fileid + + + 12 + + + 1 + 2 + 432 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 55 + + + 2 + 3 + 3 + + + 3 + 4 + 11 + + + 4 + 7 + 7 + + + 8 + 28 + 7 + + + 41 + 408 + 4 + + + + + + + idx + text + + + 12 + + + 1 + 2 + 55 + + + 2 + 3 + 3 + + + 3 + 4 + 12 + + + 4 + 7 + 7 + + + 7 + 28 + 7 + + + 44 + 251 + 3 + + + + + + + idx + parentid + + + 12 + + + 1 + 2 + 55 + + + 2 + 3 + 3 + + + 3 + 4 + 11 + + + 4 + 7 + 7 + + + 8 + 28 + 7 + + + 41 + 408 + 4 + + + + + + + idx + isCDATA + + + 12 + + + 1 + 2 + 87 + + + + + + + idx + fileid + + + 12 + + + 1 + 2 + 55 + + + 2 + 3 + 3 + + + 3 + 4 + 12 + + + 4 + 5 + 7 + + + 5 + 12 + 7 + + + 13 + 15 + 3 + + + + + + + isCDATA + id + + + 12 + + + 869 + 870 + 1 + + + + + + + isCDATA + text + + + 12 + + + 427 + 428 + 1 + + + + + + + isCDATA + parentid + + + 12 + + + 432 + 433 + 1 + + + + + + + isCDATA + idx + + + 12 + + + 87 + 88 + 1 + + + + + + + isCDATA + fileid + + + 12 + + + 14 + 15 + 1 + + + + + + + fileid + id + + + 12 + + + 5 + 6 + 1 + + + 13 + 14 + 1 + + + 14 + 15 + 2 + + + 17 + 18 + 1 + + + 28 + 29 + 1 + + + 30 + 31 + 1 + + + 34 + 35 + 1 + + + 35 + 36 + 1 + + + 36 + 37 + 1 + + + 80 + 81 + 1 + + + 177 + 178 + 1 + + + 191 + 192 + 1 + + + 195 + 196 + 1 + + + + + + + fileid + text + + + 12 + + + 3 + 4 + 1 + + + 7 + 8 + 2 + + + 9 + 10 + 1 + + + 13 + 14 + 1 + + + 15 + 16 + 1 + + + 18 + 19 + 1 + + + 24 + 25 + 1 + + + 25 + 26 + 1 + + + 26 + 27 + 1 + + + 49 + 50 + 1 + + + 100 + 101 + 1 + + + 105 + 106 + 1 + + + 118 + 119 + 1 + + + + + + + fileid + parentid + + + 12 + + + 3 + 4 + 1 + + + 7 + 8 + 1 + + + 9 + 10 + 2 + + + 10 + 11 + 1 + + + 14 + 15 + 1 + + + 15 + 16 + 2 + + + 18 + 19 + 1 + + + 20 + 21 + 1 + + + 33 + 34 + 1 + + + 88 + 89 + 1 + + + 95 + 96 + 1 + + + 96 + 97 + 1 + + + + + + + fileid + idx + + + 12 + + + 2 + 3 + 1 + + + 4 + 5 + 2 + + + 5 + 6 + 1 + + + 7 + 8 + 3 + + + 9 + 10 + 1 + + + 13 + 14 + 1 + + + 15 + 16 + 2 + + + 32 + 33 + 1 + + + 35 + 36 + 1 + + + 65 + 66 + 1 + + + + + + + fileid + isCDATA + + + 12 + + + 1 + 2 + 14 + + + + + + + + + xmllocations + 1825 + + + xmlElement + 1825 + + + location + 1825 + + + + + xmlElement + location + + + 12 + + + 1 + 2 + 1825 + + + + + + + location + xmlElement + + + 12 + + + 1 + 2 + 1825 + + + + + + + + + compilations + 1 + + + id + 1 + + + cwd + 1 + + + + + id + cwd + + + 12 + + + 1 + 2 + 1 + + + + + + + cwd + id + + + 12 + + + 1 + 2 + 1 + + + + + + + + + compilation_args + 3 + + + id + 1 + + + num + 3 + + + arg + 3 + + + + + id + num + + + 12 + + + 3 + 4 + 1 + + + + + + + id + arg + + + 12 + + + 3 + 4 + 1 + + + + + + + num + id + + + 12 + + + 1 + 2 + 3 + + + + + + + num + arg + + + 12 + + + 1 + 2 + 3 + + + + + + + arg + id + + + 12 + + + 1 + 2 + 3 + + + + + + + arg + num + + + 12 + + + 1 + 2 + 3 + + + + + + + + + compilation_time + 0 + + + id + 0 + + + num + 0 + + + kind + 0 + + + secs + 0 + + + + + id + num + + + 12 + + + + + + id + kind + + + 12 + + + + + + id + secs + + + 12 + + + + + + num + id + + + 12 + + + + + + num + kind + + + 12 + + + + + + num + secs + + + 12 + + + + + + kind + id + + + 12 + + + + + + kind + num + + + 12 + + + + + + kind + secs + + + 12 + + + + + + secs + id + + + 12 + + + + + + secs + num + + + 12 + + + + + + secs + kind + + + 12 + + + + + + + + diagnostic_for + 0 + + + diagnostic + 0 + + + compilation + 0 + + + file_number + 0 + + + file_number_diagnostic_number + 0 + + + + + diagnostic + compilation + + + 12 + + + 1 + 2 + 1 + + + + + + + diagnostic + file_number + + + 12 + + + 1 + 2 + 1 + + + + + + + diagnostic + file_number_diagnostic_number + + + 12 + + + 1 + 2 + 1 + + + + + + + compilation + diagnostic + + + 12 + + + + + + compilation + file_number + + + 12 + + + + + + compilation + file_number_diagnostic_number + + + 12 + + + + + + file_number + diagnostic + + + 12 + + + + + + file_number + compilation + + + 12 + + + + + + file_number + file_number_diagnostic_number + + + 12 + + + + + + file_number_diagnostic_number + diagnostic + + + 12 + + + + + + file_number_diagnostic_number + compilation + + + 12 + + + + + + file_number_diagnostic_number + file_number + + + 12 + + + + + + + + compilation_finished + 1 + + + id + 1 + + + cpu_seconds + 1 + + + elapsed_seconds + 1 + + + + + id + cpu_seconds + + + 12 + + + 1 + 2 + 1 + + + + + + + id + elapsed_seconds + + + 12 + + + 1 + 2 + 1 + + + + + + + cpu_seconds + id + + + 12 + + + 1 + 2 + 1 + + + + + + + cpu_seconds + elapsed_seconds + + + 12 + + + 1 + 2 + 1 + + + + + + + elapsed_seconds + id + + + 12 + + + 1 + 2 + 1 + + + + + + + elapsed_seconds + cpu_seconds + + + 12 + + + 1 + 2 + 1 + + + + + + + + + compilation_compiling_files + 515 + + + id + 1 + + + num + 515 + + + file + 515 + + + + + id + num + + + 12 + + + 515 + 516 + 1 + + + + + + + id + file + + + 12 + + + 515 + 516 + 1 + + + + + + + num + id + + + 12 + + + 1 + 2 + 515 + + + + + + + num + file + + + 12 + + + 1 + 2 + 515 + + + + + + + file + id + + + 12 + + + 1 + 2 + 515 + + + + + + + file + num + + + 12 + + + 1 + 2 + 515 + + + + + + + + + diagnostics + 0 + + + id + 0 + + + severity + 0 + + + error_tag + 0 + + + error_message + 0 + + + full_error_message + 0 + + + location + 0 + + + + + id + severity + + + 12 + + + 1 + 2 + 1 + + + + + + + id + error_tag + + + 12 + + + 1 + 2 + 1 + + + + + + + id + error_message + + + 12 + + + 1 + 2 + 1 + + + + + + + id + full_error_message + + + 12 + + + 1 + 2 + 1 + + + + + + + id + location + + + 12 + + + 1 + 2 + 1 + + + + + + + severity + id + + + 12 + + + + + + severity + error_tag + + + 12 + + + + + + severity + error_message + + + 12 + + + + + + severity + full_error_message + + + 12 + + + + + + severity + location + + + 12 + + + + + + error_tag + id + + + 12 + + + + + + error_tag + severity + + + 12 + + + + + + error_tag + error_message + + + 12 + + + + + + error_tag + full_error_message + + + 12 + + + + + + error_tag + location + + + 12 + + + + + + error_message + id + + + 12 + + + + + + error_message + severity + + + 12 + + + + + + error_message + error_tag + + + 12 + + + + + + error_message + full_error_message + + + 12 + + + + + + error_message + location + + + 12 + + + + + + full_error_message + id + + + 12 + + + + + + full_error_message + severity + + + 12 + + + + + + full_error_message + error_tag + + + 12 + + + + + + full_error_message + error_message + + + 12 + + + + + + full_error_message + location + + + 12 + + + + + + location + id + + + 12 + + + + + + location + severity + + + 12 + + + + + + location + error_tag + + + 12 + + + + + + location + error_message + + + 12 + + + + + + location + full_error_message + + + 12 + + + + + + + + locations_default + 539178 + + + id + 539178 + + + file + 529 + + + beginLine + 10312 + + + beginColumn + 211 + + + endLine + 10378 + + + endColumn + 274 + + + + + id + file + + + 12 + + + 1 + 2 + 539178 + + + + + + + id + beginLine + + + 12 + + + 1 + 2 + 539178 + + + + + + + id + beginColumn + + + 12 + + + 1 + 2 + 539178 + + + + + + + id + endLine + + + 12 + + + 1 + 2 + 539178 + + + + + + + id + endColumn + + + 12 + + + 1 + 2 + 539178 + + + + + + + file + id + + + 12 + + + 4 + 39 + 41 + + + 39 + 120 + 40 + + + 120 + 208 + 40 + + + 210 + 290 + 40 + + + 291 + 372 + 40 + + + 372 + 453 + 41 + + + 456 + 563 + 40 + + + 565 + 769 + 40 + + + 774 + 1007 + 40 + + + 1012 + 1339 + 42 + + + 1347 + 1700 + 40 + + + 1701 + 2804 + 40 + + + 2873 + 6918 + 40 + + + 8171 + 11207 + 5 + + + + + + + file + beginLine + + + 12 + + + 3 + 15 + 44 + + + 15 + 27 + 42 + + + 27 + 46 + 40 + + + 46 + 63 + 43 + + + 63 + 78 + 40 + + + 78 + 94 + 41 + + + 95 + 120 + 40 + + + 120 + 152 + 41 + + + 152 + 188 + 40 + + + 189 + 247 + 41 + + + 249 + 325 + 40 + + + 336 + 544 + 40 + + + 554 + 10233 + 37 + + + + + + + file + beginColumn + + + 12 + + + 3 + 16 + 40 + + + 16 + 34 + 40 + + + 34 + 44 + 40 + + + 45 + 51 + 44 + + + 51 + 58 + 41 + + + 58 + 63 + 47 + + + 63 + 68 + 44 + + + 68 + 73 + 43 + + + 73 + 80 + 47 + + + 80 + 86 + 43 + + + 86 + 98 + 42 + + + 98 + 115 + 42 + + + 115 + 157 + 16 + + + + + + + file + endLine + + + 12 + + + 3 + 16 + 41 + + + 16 + 31 + 40 + + + 31 + 52 + 40 + + + 52 + 73 + 43 + + + 73 + 92 + 42 + + + 92 + 111 + 40 + + + 111 + 139 + 40 + + + 139 + 180 + 40 + + + 180 + 219 + 40 + + + 223 + 293 + 40 + + + 294 + 370 + 40 + + + 373 + 616 + 40 + + + 617 + 1835 + 40 + + + 2166 + 10377 + 3 + + + + + + + file + endColumn + + + 12 + + + 4 + 21 + 42 + + + 22 + 45 + 41 + + + 46 + 59 + 43 + + + 59 + 65 + 40 + + + 65 + 71 + 42 + + + 71 + 76 + 47 + + + 76 + 81 + 40 + + + 81 + 85 + 48 + + + 85 + 91 + 41 + + + 91 + 97 + 42 + + + 97 + 105 + 41 + + + 105 + 119 + 42 + + + 119 + 166 + 20 + + + + + + + beginLine + id + + + 12 + + + 1 + 2 + 6869 + + + 2 + 7 + 843 + + + 7 + 20 + 796 + + + 20 + 80 + 780 + + + 80 + 698 + 774 + + + 699 + 1775 + 250 + + + + + + + beginLine + file + + + 12 + + + 1 + 2 + 6947 + + + 2 + 3 + 868 + + + 3 + 6 + 899 + + + 6 + 24 + 774 + + + 24 + 304 + 774 + + + 305 + 530 + 50 + + + + + + + beginLine + beginColumn + + + 12 + + + 1 + 2 + 6894 + + + 2 + 5 + 789 + + + 5 + 11 + 780 + + + 11 + 30 + 796 + + + 30 + 72 + 779 + + + 72 + 115 + 274 + + + + + + + beginLine + endLine + + + 12 + + + 1 + 2 + 7630 + + + 2 + 3 + 1017 + + + 3 + 6 + 779 + + + 6 + 21 + 792 + + + 21 + 315 + 94 + + + + + + + beginLine + endColumn + + + 12 + + + 1 + 2 + 6871 + + + 2 + 5 + 793 + + + 5 + 12 + 789 + + + 12 + 33 + 778 + + + 33 + 81 + 781 + + + 81 + 127 + 300 + + + + + + + beginColumn + id + + + 12 + + + 1 + 2 + 29 + + + 2 + 4 + 19 + + + 4 + 9 + 16 + + + 10 + 22 + 16 + + + 22 + 62 + 16 + + + 62 + 141 + 16 + + + 144 + 330 + 16 + + + 330 + 759 + 16 + + + 781 + 1804 + 16 + + + 1846 + 3757 + 16 + + + 4042 + 8613 + 16 + + + 8764 + 22092 + 16 + + + 28067 + 55590 + 3 + + + + + + + beginColumn + file + + + 12 + + + 1 + 2 + 36 + + + 2 + 4 + 14 + + + 4 + 10 + 18 + + + 10 + 22 + 17 + + + 22 + 48 + 17 + + + 49 + 96 + 17 + + + 96 + 180 + 16 + + + 180 + 292 + 16 + + + 297 + 382 + 16 + + + 383 + 430 + 16 + + + 431 + 463 + 16 + + + 463 + 530 + 12 + + + + + + + beginColumn + beginLine + + + 12 + + + 1 + 2 + 36 + + + 2 + 4 + 13 + + + 4 + 9 + 16 + + + 9 + 20 + 16 + + + 20 + 53 + 16 + + + 55 + 103 + 16 + + + 107 + 209 + 16 + + + 221 + 412 + 16 + + + 422 + 682 + 16 + + + 706 + 975 + 16 + + + 977 + 1410 + 16 + + + 1417 + 1983 + 16 + + + 2809 + 10184 + 2 + + + + + + + beginColumn + endLine + + + 12 + + + 1 + 2 + 36 + + + 2 + 4 + 13 + + + 4 + 9 + 16 + + + 9 + 21 + 19 + + + 24 + 55 + 16 + + + 58 + 128 + 16 + + + 131 + 226 + 16 + + + 231 + 453 + 16 + + + 480 + 769 + 16 + + + 783 + 1037 + 16 + + + 1057 + 1521 + 16 + + + 1526 + 10180 + 15 + + + + + + + beginColumn + endColumn + + + 12 + + + 1 + 2 + 31 + + + 2 + 3 + 16 + + + 3 + 6 + 17 + + + 6 + 12 + 17 + + + 12 + 21 + 16 + + + 21 + 28 + 16 + + + 28 + 35 + 17 + + + 35 + 45 + 16 + + + 46 + 56 + 16 + + + 56 + 77 + 17 + + + 77 + 101 + 17 + + + 101 + 201 + 15 + + + + + + + endLine + id + + + 12 + + + 1 + 2 + 6731 + + + 2 + 6 + 903 + + + 6 + 16 + 817 + + + 16 + 58 + 785 + + + 58 + 457 + 779 + + + 458 + 1734 + 363 + + + + + + + endLine + file + + + 12 + + + 1 + 2 + 6847 + + + 2 + 3 + 810 + + + 3 + 5 + 787 + + + 5 + 14 + 802 + + + 14 + 104 + 780 + + + 105 + 530 + 352 + + + + + + + endLine + beginLine + + + 12 + + + 1 + 2 + 7766 + + + 2 + 3 + 956 + + + 3 + 7 + 860 + + + 7 + 27 + 785 + + + 27 + 31 + 11 + + + + + + + endLine + beginColumn + + + 12 + + + 1 + 2 + 6749 + + + 2 + 4 + 616 + + + 4 + 8 + 878 + + + 8 + 21 + 799 + + + 21 + 53 + 779 + + + 53 + 113 + 557 + + + + + + + endLine + endColumn + + + 12 + + + 1 + 2 + 6792 + + + 2 + 5 + 936 + + + 5 + 12 + 801 + + + 12 + 34 + 791 + + + 34 + 83 + 787 + + + 83 + 127 + 271 + + + + + + + endColumn + id + + + 12 + + + 1 + 2 + 33 + + + 2 + 3 + 60 + + + 3 + 9 + 23 + + + 9 + 40 + 21 + + + 43 + 111 + 21 + + + 121 + 347 + 21 + + + 369 + 1229 + 21 + + + 1267 + 3311 + 21 + + + 3642 + 7560 + 21 + + + 7682 + 12716 + 21 + + + 12740 + 20483 + 11 + + + + + + + endColumn + file + + + 12 + + + 1 + 2 + 94 + + + 2 + 6 + 19 + + + 6 + 16 + 21 + + + 16 + 45 + 21 + + + 45 + 110 + 21 + + + 123 + 281 + 21 + + + 290 + 393 + 21 + + + 395 + 445 + 21 + + + 446 + 468 + 21 + + + 470 + 530 + 14 + + + + + + + endColumn + beginLine + + + 12 + + + 1 + 2 + 94 + + + 2 + 6 + 19 + + + 6 + 21 + 21 + + + 21 + 52 + 21 + + + 54 + 154 + 21 + + + 157 + 449 + 21 + + + 455 + 808 + 21 + + + 814 + 1132 + 21 + + + 1145 + 1769 + 21 + + + 1792 + 2365 + 14 + + + + + + + endColumn + beginColumn + + + 12 + + + 1 + 2 + 39 + + + 2 + 3 + 56 + + + 3 + 7 + 23 + + + 7 + 18 + 21 + + + 18 + 27 + 24 + + + 27 + 37 + 22 + + + 37 + 49 + 23 + + + 49 + 63 + 22 + + + 63 + 74 + 20 + + + 74 + 102 + 21 + + + 103 + 172 + 3 + + + + + + + endColumn + endLine + + + 12 + + + 1 + 2 + 94 + + + 2 + 6 + 19 + + + 6 + 21 + 21 + + + 21 + 52 + 21 + + + 53 + 153 + 21 + + + 156 + 444 + 21 + + + 446 + 789 + 21 + + + 806 + 1121 + 21 + + + 1138 + 1726 + 21 + + + 1787 + 2357 + 14 + + + + + + + + + numlines + 514 + + + element_id + 514 + + + num_lines + 309 + + + num_code + 350 + + + num_comment + 150 + + + + + element_id + num_lines + + + 12 + + + 1 + 2 + 514 + + + + + + + element_id + num_code + + + 12 + + + 1 + 2 + 514 + + + + + + + element_id + num_comment + + + 12 + + + 1 + 2 + 514 + + + + + + + num_lines + element_id + + + 12 + + + 1 + 2 + 183 + + + 2 + 3 + 74 + + + 3 + 4 + 32 + + + 4 + 7 + 20 + + + + + + + num_lines + num_code + + + 12 + + + 1 + 2 + 187 + + + 2 + 3 + 82 + + + 3 + 4 + 23 + + + 4 + 7 + 17 + + + + + + + num_lines + num_comment + + + 12 + + + 1 + 2 + 188 + + + 2 + 3 + 79 + + + 3 + 4 + 28 + + + 4 + 7 + 14 + + + + + + + num_code + element_id + + + 12 + + + 1 + 2 + 252 + + + 2 + 3 + 65 + + + 3 + 5 + 28 + + + 6 + 18 + 5 + + + + + + + num_code + num_lines + + + 12 + + + 1 + 2 + 256 + + + 2 + 3 + 67 + + + 3 + 18 + 27 + + + + + + + num_code + num_comment + + + 12 + + + 1 + 2 + 259 + + + 2 + 3 + 63 + + + 3 + 7 + 27 + + + 17 + 18 + 1 + + + + + + + num_comment + element_id + + + 12 + + + 1 + 2 + 65 + + + 2 + 3 + 27 + + + 3 + 4 + 17 + + + 4 + 5 + 7 + + + 5 + 6 + 10 + + + 6 + 10 + 12 + + + 10 + 31 + 12 + + + + + + + num_comment + num_lines + + + 12 + + + 1 + 2 + 65 + + + 2 + 3 + 27 + + + 3 + 4 + 18 + + + 4 + 5 + 7 + + + 5 + 6 + 10 + + + 6 + 10 + 13 + + + 10 + 25 + 10 + + + + + + + num_comment + num_code + + + 12 + + + 1 + 2 + 66 + + + 2 + 3 + 27 + + + 3 + 4 + 17 + + + 4 + 5 + 6 + + + 5 + 6 + 10 + + + 6 + 9 + 12 + + + 9 + 24 + 12 + + + + + + + + + files + 529 + + + id + 529 + + + name + 529 + + + + + id + name + + + 12 + + + 1 + 2 + 529 + + + + + + + name + id + + + 12 + + + 1 + 2 + 529 + + + + + + + + + folders + 210 + + + id + 210 + + + name + 210 + + + + + id + name + + + 12 + + + 1 + 2 + 210 + + + + + + + name + id + + + 12 + + + 1 + 2 + 210 + + + + + + + + + containerparent + 738 + + + parent + 210 + + + child + 738 + + + + + parent + child + + + 12 + + + 1 + 2 + 115 + + + 2 + 3 + 32 + + + 3 + 4 + 12 + + + 4 + 6 + 19 + + + 6 + 12 + 16 + + + 13 + 38 + 16 + + + + + + + child + parent + + + 12 + + + 1 + 2 + 738 + + + + + + + + + has_location + 599339 + + + locatable + 599339 + + + location + 537353 + + + + + locatable + location + + + 12 + + + 1 + 2 + 599339 + + + + + + + location + locatable + + + 12 + + + 1 + 2 + 475682 + + + 2 + 3 + 61627 + + + 3 + 75 + 44 + + + + + + + + + comment_groups + 12083 + + + id + 12083 + + + parent + 509 + + + idx + 720 + + + + + id + parent + + + 12 + + + 1 + 2 + 12083 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 12083 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 44 + + + 2 + 3 + 45 + + + 3 + 4 + 32 + + + 4 + 5 + 27 + + + 5 + 7 + 38 + + + 7 + 10 + 47 + + + 10 + 13 + 34 + + + 13 + 17 + 47 + + + 17 + 23 + 40 + + + 23 + 29 + 40 + + + 29 + 38 + 39 + + + 38 + 70 + 39 + + + 70 + 721 + 37 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 44 + + + 2 + 3 + 45 + + + 3 + 4 + 32 + + + 4 + 5 + 27 + + + 5 + 7 + 38 + + + 7 + 10 + 47 + + + 10 + 13 + 34 + + + 13 + 17 + 47 + + + 17 + 23 + 40 + + + 23 + 29 + 40 + + + 29 + 38 + 39 + + + 38 + 70 + 39 + + + 70 + 721 + 37 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 429 + + + 2 + 3 + 53 + + + 3 + 8 + 66 + + + 8 + 16 + 57 + + + 16 + 44 + 54 + + + 44 + 311 + 54 + + + 323 + 510 + 7 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 429 + + + 2 + 3 + 53 + + + 3 + 8 + 66 + + + 8 + 16 + 57 + + + 16 + 44 + 54 + + + 44 + 311 + 54 + + + 323 + 510 + 7 + + + + + + + + + comments + 25724 + + + id + 25724 + + + kind + 2 + + + parent + 12083 + + + idx + 156 + + + text + 20683 + + + + + id + kind + + + 12 + + + 1 + 2 + 25724 + + + + + + + id + parent + + + 12 + + + 1 + 2 + 25724 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 25724 + + + + + + + id + text + + + 12 + + + 1 + 2 + 25724 + + + + + + + kind + id + + + 12 + + + 846 + 847 + 1 + + + 24878 + 24879 + 1 + + + + + + + kind + parent + + + 12 + + + 846 + 847 + 1 + + + 11239 + 11240 + 1 + + + + + + + kind + idx + + + 12 + + + 2 + 3 + 1 + + + 156 + 157 + 1 + + + + + + + kind + text + + + 12 + + + 690 + 691 + 1 + + + 19993 + 19994 + 1 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 7828 + + + 2 + 3 + 1787 + + + 3 + 4 + 1289 + + + 4 + 11 + 937 + + + 11 + 157 + 242 + + + + + + + parent + kind + + + 12 + + + 1 + 2 + 12081 + + + 2 + 3 + 2 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 7828 + + + 2 + 3 + 1787 + + + 3 + 4 + 1289 + + + 4 + 11 + 937 + + + 11 + 157 + 242 + + + + + + + parent + text + + + 12 + + + 1 + 2 + 7828 + + + 2 + 3 + 1817 + + + 3 + 4 + 1275 + + + 4 + 10 + 937 + + + 10 + 131 + 226 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 36 + + + 2 + 4 + 13 + + + 4 + 5 + 16 + + + 5 + 7 + 12 + + + 7 + 9 + 12 + + + 9 + 11 + 6 + + + 12 + 14 + 13 + + + 14 + 24 + 13 + + + 26 + 52 + 12 + + + 59 + 218 + 12 + + + 242 + 12084 + 11 + + + + + + + idx + kind + + + 12 + + + 1 + 2 + 154 + + + 2 + 3 + 2 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 36 + + + 2 + 4 + 13 + + + 4 + 5 + 16 + + + 5 + 7 + 12 + + + 7 + 9 + 12 + + + 9 + 11 + 6 + + + 12 + 14 + 13 + + + 14 + 24 + 13 + + + 26 + 52 + 12 + + + 59 + 218 + 12 + + + 242 + 12084 + 11 + + + + + + + idx + text + + + 12 + + + 1 + 2 + 36 + + + 2 + 4 + 14 + + + 4 + 5 + 18 + + + 5 + 7 + 14 + + + 7 + 9 + 11 + + + 9 + 12 + 14 + + + 12 + 17 + 12 + + + 19 + 36 + 13 + + + 39 + 128 + 12 + + + 165 + 10500 + 12 + + + + + + + text + id + + + 12 + + + 1 + 2 + 19550 + + + 2 + 1935 + 1133 + + + + + + + text + kind + + + 12 + + + 1 + 2 + 20683 + + + + + + + text + parent + + + 12 + + + 1 + 2 + 19575 + + + 2 + 828 + 1108 + + + + + + + text + idx + + + 12 + + + 1 + 2 + 20523 + + + 2 + 107 + 160 + + + + + + + + + doc_comments + 4330 + + + node + 4330 + + + comment + 4330 + + + + + node + comment + + + 12 + + + 1 + 2 + 4330 + + + + + + + comment + node + + + 12 + + + 1 + 2 + 4330 + + + + + + + + + exprs + 414037 + + + id + 414037 + + + kind + 48 + + + parent + 219324 + + + idx + 5163 + + + + + id + kind + + + 12 + + + 1 + 2 + 414037 + + + + + + + id + parent + + + 12 + + + 1 + 2 + 414037 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 414037 + + + + + + + kind + id + + + 12 + + + 7 + 20 + 4 + + + 21 + 54 + 4 + + + 57 + 142 + 4 + + + 146 + 236 + 4 + + + 248 + 344 + 4 + + + 509 + 620 + 4 + + + 678 + 839 + 4 + + + 1013 + 1235 + 4 + + + 1272 + 2705 + 4 + + + 3244 + 4582 + 4 + + + 5616 + 10361 + 4 + + + 24892 + 237317 + 4 + + + + + + + kind + parent + + + 12 + + + 7 + 20 + 4 + + + 21 + 54 + 4 + + + 57 + 142 + 4 + + + 144 + 207 + 4 + + + 233 + 324 + 4 + + + 509 + 613 + 4 + + + 676 + 790 + 4 + + + 1013 + 1226 + 4 + + + 1239 + 1949 + 4 + + + 2582 + 3985 + 4 + + + 4252 + 10115 + 4 + + + 14086 + 154744 + 4 + + + + + + + kind + idx + + + 12 + + + 1 + 2 + 3 + + + 2 + 3 + 8 + + + 3 + 4 + 10 + + + 4 + 5 + 6 + + + 5 + 7 + 4 + + + 7 + 8 + 4 + + + 8 + 14 + 3 + + + 15 + 22 + 4 + + + 23 + 34 + 4 + + + 1057 + 5164 + 2 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 65804 + + + 2 + 3 + 133334 + + + 3 + 5 + 17889 + + + 5 + 5144 + 2297 + + + + + + + parent + kind + + + 12 + + + 1 + 2 + 137263 + + + 2 + 3 + 75813 + + + 3 + 7 + 6248 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 65804 + + + 2 + 3 + 133334 + + + 3 + 5 + 17889 + + + 5 + 5144 + 2297 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 3910 + + + 2 + 3 + 183 + + + 3 + 4 + 782 + + + 4 + 180006 + 288 + + + + + + + idx + kind + + + 12 + + + 1 + 2 + 4087 + + + 2 + 3 + 1033 + + + 3 + 48 + 43 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 3910 + + + 2 + 3 + 183 + + + 3 + 4 + 782 + + + 4 + 180006 + 288 + + + + + + + + + literals + 270756 + + + expr + 270756 + + + value + 25795 + + + raw + 27594 + + + + + expr + value + + + 12 + + + 1 + 2 + 270756 + + + + + + + expr + raw + + + 12 + + + 1 + 2 + 270756 + + + + + + + value + expr + + + 12 + + + 1 + 2 + 14635 + + + 2 + 3 + 3291 + + + 3 + 4 + 1783 + + + 4 + 6 + 1931 + + + 6 + 12 + 1968 + + + 12 + 139 + 1935 + + + 139 + 6840 + 252 + + + + + + + value + raw + + + 12 + + + 1 + 2 + 24051 + + + 2 + 5 + 1744 + + + + + + + raw + expr + + + 12 + + + 1 + 2 + 16038 + + + 2 + 3 + 3521 + + + 3 + 4 + 1869 + + + 4 + 7 + 2553 + + + 7 + 18 + 2129 + + + 18 + 6833 + 1484 + + + + + + + raw + value + + + 12 + + + 1 + 2 + 27594 + + + + + + + + + constvalues + 43931 + + + expr + 43931 + + + value + 16896 + + + exact + 16897 + + + + + expr + value + + + 12 + + + 1 + 2 + 43931 + + + + + + + expr + exact + + + 12 + + + 1 + 2 + 43931 + + + + + + + value + expr + + + 12 + + + 1 + 2 + 14932 + + + 2 + 4 + 1388 + + + 4 + 6766 + 576 + + + + + + + value + exact + + + 12 + + + 1 + 2 + 16895 + + + 2 + 3 + 1 + + + + + + + exact + expr + + + 12 + + + 1 + 2 + 14933 + + + 2 + 4 + 1388 + + + 4 + 6766 + 576 + + + + + + + exact + value + + + 12 + + + 1 + 2 + 16897 + + + + + + + + + fields + 19974 + + + id + 19974 + + + parent + 9600 + + + idx + 57 + + + + + id + parent + + + 12 + + + 1 + 2 + 19974 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 19974 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 4790 + + + 2 + 3 + 2214 + + + 3 + 4 + 1363 + + + 4 + 5 + 653 + + + 5 + 53 + 580 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 4790 + + + 2 + 3 + 2214 + + + 3 + 4 + 1363 + + + 4 + 5 + 653 + + + 5 + 53 + 580 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 14 + + + 2 + 3 + 8 + + + 3 + 6 + 5 + + + 6 + 11 + 5 + + + 12 + 18 + 5 + + + 19 + 31 + 5 + + + 46 + 105 + 5 + + + 115 + 633 + 5 + + + 914 + 7063 + 5 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 14 + + + 2 + 3 + 8 + + + 3 + 6 + 5 + + + 6 + 11 + 5 + + + 12 + 18 + 5 + + + 19 + 31 + 5 + + + 46 + 105 + 5 + + + 115 + 633 + 5 + + + 914 + 7063 + 5 + + + + + + + + + stmts + 73990 + + + id + 73990 + + + kind + 33 + + + parent + 41543 + + + idx + 81 + + + + + id + kind + + + 12 + + + 1 + 2 + 73990 + + + + + + + id + parent + + + 12 + + + 1 + 2 + 73990 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 73990 + + + + + + + kind + id + + + 12 + + + 2 + 3 + 1 + + + 3 + 4 + 4 + + + 5 + 9 + 3 + + + 18 + 50 + 3 + + + 63 + 72 + 3 + + + 72 + 224 + 3 + + + 301 + 379 + 3 + + + 400 + 615 + 3 + + + 654 + 2136 + 3 + + + 3476 + 7606 + 3 + + + 9225 + 9729 + 3 + + + 19358 + 19359 + 1 + + + + + + + kind + parent + + + 12 + + + 2 + 3 + 1 + + + 3 + 4 + 4 + + + 5 + 9 + 3 + + + 17 + 35 + 3 + + + 47 + 69 + 3 + + + 69 + 205 + 3 + + + 301 + 367 + 3 + + + 385 + 586 + 3 + + + 606 + 1154 + 3 + + + 1719 + 5672 + 3 + + + 5912 + 9226 + 3 + + + 18820 + 18821 + 1 + + + + + + + kind + idx + + + 12 + + + 1 + 2 + 1 + + + 2 + 3 + 5 + + + 3 + 5 + 2 + + + 5 + 8 + 3 + + + 8 + 9 + 3 + + + 9 + 13 + 3 + + + 13 + 16 + 3 + + + 16 + 17 + 2 + + + 17 + 27 + 3 + + + 27 + 33 + 3 + + + 44 + 47 + 3 + + + 55 + 82 + 2 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 29362 + + + 2 + 3 + 6137 + + + 3 + 5 + 3650 + + + 5 + 82 + 2394 + + + + + + + parent + kind + + + 12 + + + 1 + 2 + 31418 + + + 2 + 3 + 5760 + + + 3 + 5 + 3597 + + + 5 + 11 + 768 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 29362 + + + 2 + 3 + 6137 + + + 3 + 5 + 3650 + + + 5 + 82 + 2394 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 6 + + + 2 + 3 + 20 + + + 5 + 6 + 3 + + + 7 + 8 + 11 + + + 10 + 15 + 7 + + + 15 + 27 + 7 + + + 27 + 70 + 7 + + + 85 + 262 + 7 + + + 314 + 1279 + 7 + + + 1720 + 24879 + 6 + + + + + + + idx + kind + + + 12 + + + 1 + 2 + 12 + + + 2 + 3 + 22 + + + 3 + 5 + 7 + + + 5 + 6 + 6 + + + 6 + 7 + 4 + + + 7 + 9 + 7 + + + 9 + 13 + 7 + + + 13 + 18 + 7 + + + 20 + 28 + 6 + + + 29 + 34 + 3 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 6 + + + 2 + 3 + 20 + + + 5 + 6 + 3 + + + 7 + 8 + 11 + + + 10 + 15 + 7 + + + 15 + 27 + 7 + + + 27 + 70 + 7 + + + 85 + 262 + 7 + + + 314 + 1279 + 7 + + + 1720 + 24879 + 6 + + + + + + + + + decls + 8690 + + + id + 8690 + + + kind + 5 + + + parent + 1951 + + + idx + 226 + + + + + id + kind + + + 12 + + + 1 + 2 + 8690 + + + + + + + id + parent + + + 12 + + + 1 + 2 + 8690 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 8690 + + + + + + + kind + id + + + 12 + + + 280 + 281 + 1 + + + 479 + 480 + 1 + + + 1349 + 1350 + 1 + + + 1769 + 1770 + 1 + + + 4813 + 4814 + 1 + + + + + + + kind + parent + + + 12 + + + 196 + 197 + 1 + + + 336 + 337 + 1 + + + 478 + 479 + 1 + + + 483 + 484 + 1 + + + 1566 + 1567 + 1 + + + + + + + kind + idx + + + 12 + + + 2 + 3 + 1 + + + 39 + 40 + 1 + + + 105 + 106 + 1 + + + 219 + 220 + 1 + + + 225 + 226 + 1 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 1460 + + + 2 + 6 + 149 + + + 6 + 12 + 155 + + + 12 + 36 + 147 + + + 36 + 227 + 40 + + + + + + + parent + kind + + + 12 + + + 1 + 2 + 1463 + + + 2 + 3 + 111 + + + 3 + 4 + 185 + + + 4 + 5 + 141 + + + 5 + 6 + 51 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 1460 + + + 2 + 6 + 149 + + + 6 + 12 + 155 + + + 12 + 36 + 147 + + + 36 + 227 + 40 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 4 + + + 2 + 3 + 30 + + + 3 + 4 + 18 + + + 4 + 5 + 66 + + + 5 + 6 + 2 + + + 6 + 7 + 31 + + + 7 + 11 + 17 + + + 11 + 31 + 17 + + + 31 + 65 + 17 + + + 67 + 275 + 17 + + + 323 + 1952 + 7 + + + + + + + idx + kind + + + 12 + + + 1 + 2 + 7 + + + 2 + 3 + 113 + + + 3 + 4 + 69 + + + 4 + 5 + 35 + + + 5 + 6 + 2 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 4 + + + 2 + 3 + 30 + + + 3 + 4 + 18 + + + 4 + 5 + 66 + + + 5 + 6 + 2 + + + 6 + 7 + 31 + + + 7 + 11 + 17 + + + 11 + 31 + 17 + + + 31 + 65 + 17 + + + 67 + 275 + 17 + + + 323 + 1952 + 7 + + + + + + + + + specs + 7889 + + + id + 7889 + + + kind + 4 + + + parent + 3877 + + + idx + 108 + + + + + id + kind + + + 12 + + + 1 + 2 + 7889 + + + + + + + id + parent + + + 12 + + + 1 + 2 + 7889 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 7889 + + + + + + + kind + id + + + 12 + + + 16 + 17 + 1 + + + 1349 + 1350 + 1 + + + 3056 + 3057 + 1 + + + 3468 + 3469 + 1 + + + + + + + kind + parent + + + 12 + + + 16 + 17 + 1 + + + 479 + 480 + 1 + + + 1333 + 1334 + 1 + + + 2049 + 2050 + 1 + + + + + + + kind + idx + + + 12 + + + 1 + 2 + 1 + + + 14 + 15 + 1 + + + 36 + 37 + 1 + + + 108 + 109 + 1 + + + + + + + parent + id + + + 12 + + + 1 + 2 + 3206 + + + 2 + 6 + 343 + + + 6 + 18 + 298 + + + 18 + 109 + 30 + + + + + + + parent + kind + + + 12 + + + 1 + 2 + 3877 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 3206 + + + 2 + 6 + 343 + + + 6 + 18 + 298 + + + 18 + 109 + 30 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 53 + + + 2 + 3 + 19 + + + 3 + 6 + 9 + + + 6 + 28 + 9 + + + 30 + 156 + 9 + + + 188 + 3878 + 9 + + + + + + + idx + kind + + + 12 + + + 1 + 2 + 72 + + + 2 + 3 + 22 + + + 3 + 4 + 13 + + + 4 + 5 + 1 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 53 + + + 2 + 3 + 19 + + + 3 + 6 + 9 + + + 6 + 28 + 9 + + + 30 + 156 + 9 + + + 188 + 3878 + 9 + + + + + + + + + scopes + 36775 + + + id + 36775 + + + kind + 3 + + + + + id + kind + + + 12 + + + 1 + 2 + 36775 + + + + + + + kind + id + + + 12 + + + 1 + 2 + 1 + + + 346 + 347 + 1 + + + 36428 + 36429 + 1 + + + + + + + + + scopenesting + 36774 + + + inner + 36774 + + + outer + 21713 + + + + + inner + outer + + + 12 + + + 1 + 2 + 36774 + + + + + + + outer + inner + + + 12 + + + 1 + 2 + 16964 + + + 2 + 3 + 2474 + + + 3 + 7 + 1759 + + + 7 + 347 + 516 + + + + + + + + + scopenodes + 36428 + + + node + 36428 + + + scope + 36428 + + + + + node + scope + + + 12 + + + 1 + 2 + 36428 + + + + + + + scope + node + + + 12 + + + 1 + 2 + 36428 + + + + + + + + + objects + 84909 + + + id + 84909 + + + kind + 9 + + + name + 30576 + + + + + id + kind + + + 12 + + + 1 + 2 + 84909 + + + + + + + id + name + + + 12 + + + 1 + 2 + 84909 + + + + + + + kind + id + + + 12 + + + 4 + 5 + 1 + + + 18 + 19 + 1 + + + 20 + 21 + 1 + + + 49 + 50 + 1 + + + 3468 + 3469 + 1 + + + 3602 + 3603 + 1 + + + 8857 + 8858 + 1 + + + 17793 + 17794 + 1 + + + 51098 + 51099 + 1 + + + + + + + kind + name + + + 12 + + + 4 + 5 + 1 + + + 18 + 19 + 1 + + + 20 + 21 + 1 + + + 38 + 39 + 1 + + + 203 + 204 + 1 + + + 3004 + 3005 + 1 + + + 8418 + 8419 + 1 + + + 10132 + 10133 + 1 + + + 10913 + 10914 + 1 + + + + + + + name + id + + + 12 + + + 1 + 2 + 25286 + + + 2 + 3 + 2613 + + + 3 + 20 + 2304 + + + 20 + 2222 + 373 + + + + + + + name + kind + + + 12 + + + 1 + 2 + 28809 + + + 2 + 6 + 1767 + + + + + + + + + objectscopes + 54774 + + + object + 54774 + + + scope + 13947 + + + + + object + scope + + + 12 + + + 1 + 2 + 54774 + + + + + + + scope + object + + + 12 + + + 1 + 2 + 7112 + + + 2 + 3 + 2972 + + + 3 + 4 + 1274 + + + 4 + 6 + 1264 + + + 6 + 15 + 1055 + + + 15 + 2694 + 270 + + + + + + + + + objecttypes + 84907 + + + object + 84907 + + + tp + 13462 + + + + + object + tp + + + 12 + + + 1 + 2 + 84907 + + + + + + + tp + object + + + 12 + + + 1 + 2 + 7893 + + + 2 + 3 + 2114 + + + 3 + 4 + 892 + + + 4 + 7 + 1190 + + + 7 + 25 + 1011 + + + 25 + 4267 + 362 + + + + + + + + + methodreceivers + 9873 + + + method + 9873 + + + receiver + 9873 + + + + + method + receiver + + + 12 + + + 1 + 2 + 9873 + + + + + + + receiver + method + + + 12 + + + 1 + 2 + 9873 + + + + + + + + + fieldstructs + 10934 + + + field + 10934 + + + struct + 2408 + + + + + field + struct + + + 12 + + + 1 + 2 + 10934 + + + + + + + struct + field + + + 12 + + + 1 + 2 + 260 + + + 2 + 3 + 677 + + + 3 + 4 + 468 + + + 4 + 5 + 292 + + + 5 + 6 + 194 + + + 6 + 8 + 208 + + + 8 + 13 + 199 + + + 13 + 65 + 110 + + + + + + + + + methodhosts + 838 + + + method + 699 + + + host + 258 + + + + + method + host + + + 12 + + + 1 + 2 + 625 + + + 2 + 3 + 56 + + + 3 + 16 + 18 + + + + + + + host + method + + + 12 + + + 1 + 2 + 99 + + + 2 + 3 + 56 + + + 3 + 4 + 37 + + + 4 + 5 + 20 + + + 5 + 6 + 15 + + + 6 + 11 + 21 + + + 11 + 53 + 10 + + + + + + + + + defs + 40703 + + + ident + 40703 + + + object + 40490 + + + + + ident + object + + + 12 + + + 1 + 2 + 40703 + + + + + + + object + ident + + + 12 + + + 1 + 2 + 40383 + + + 2 + 15 + 107 + + + + + + + + + uses + 195902 + + + ident + 195902 + + + object + 41616 + + + + + ident + object + + + 12 + + + 1 + 2 + 195902 + + + + + + + object + ident + + + 12 + + + 1 + 2 + 15493 + + + 2 + 3 + 9727 + + + 3 + 4 + 5056 + + + 4 + 5 + 2974 + + + 5 + 7 + 3203 + + + 7 + 14 + 3336 + + + 14 + 6833 + 1827 + + + + + + + + + types + 18132 + + + id + 18132 + + + kind + 37 + + + + + id + kind + + + 12 + + + 1 + 2 + 18132 + + + + + + + kind + id + + + 12 + + + 1 + 2 + 25 + + + 10 + 30 + 3 + + + 247 + 431 + 3 + + + 559 + 1904 + 3 + + + 2409 + 8011 + 3 + + + + + + + + + type_of + 397965 + + + expr + 397965 + + + tp + 8687 + + + + + expr + tp + + + 12 + + + 1 + 2 + 397965 + + + + + + + tp + expr + + + 12 + + + 1 + 2 + 2019 + + + 2 + 3 + 967 + + + 3 + 4 + 711 + + + 4 + 5 + 388 + + + 5 + 7 + 780 + + + 7 + 10 + 772 + + + 10 + 15 + 734 + + + 15 + 23 + 700 + + + 23 + 43 + 652 + + + 43 + 143 + 652 + + + 143 + 46949 + 312 + + + + + + + + + typename + 3567 + + + tp + 3567 + + + name + 2983 + + + + + tp + name + + + 12 + + + 1 + 2 + 3567 + + + + + + + name + tp + + + 12 + + + 1 + 2 + 2660 + + + 2 + 4 + 267 + + + 4 + 17 + 56 + + + + + + + + + key_type + 430 + + + map + 430 + + + tp + 149 + + + + + map + tp + + + 12 + + + 1 + 2 + 430 + + + + + + + tp + map + + + 12 + + + 1 + 2 + 106 + + + 2 + 3 + 17 + + + 3 + 6 + 12 + + + 6 + 13 + 12 + + + 20 + 136 + 2 + + + + + + + + + element_type + 1412 + + + container + 1412 + + + tp + 916 + + + + + container + tp + + + 12 + + + 1 + 2 + 1412 + + + + + + + tp + container + + + 12 + + + 1 + 2 + 773 + + + 2 + 3 + 94 + + + 3 + 68 + 49 + + + + + + + + + base_type + 1903 + + + ptr + 1903 + + + tp + 1903 + + + + + ptr + tp + + + 12 + + + 1 + 2 + 1903 + + + + + + + tp + ptr + + + 12 + + + 1 + 2 + 1903 + + + + + + + + + underlying_type + 3567 + + + named + 3567 + + + tp + 2755 + + + + + named + tp + + + 12 + + + 1 + 2 + 3567 + + + + + + + tp + named + + + 12 + + + 1 + 2 + 2582 + + + 2 + 154 + 173 + + + + + + + + + component_types + 36474 + + + parent + 11221 + + + index + 74 + + + name + 5540 + + + tp + 4295 + + + + + parent + index + + + 12 + + + 1 + 2 + 1198 + + + 2 + 3 + 3864 + + + 3 + 4 + 2953 + + + 4 + 5 + 1446 + + + 5 + 6 + 780 + + + 6 + 13 + 860 + + + 13 + 65 + 120 + + + + + + + parent + name + + + 12 + + + 1 + 2 + 8936 + + + 2 + 3 + 733 + + + 3 + 6 + 1008 + + + 6 + 64 + 544 + + + + + + + parent + tp + + + 12 + + + 1 + 2 + 2194 + + + 2 + 3 + 4537 + + + 3 + 4 + 2475 + + + 4 + 5 + 1110 + + + 5 + 12 + 848 + + + 12 + 52 + 57 + + + + + + + index + parent + + + 12 + + + 1 + 2 + 15 + + + 2 + 4 + 6 + + + 4 + 7 + 4 + + + 8 + 13 + 6 + + + 13 + 18 + 6 + + + 18 + 28 + 6 + + + 29 + 49 + 6 + + + 52 + 82 + 6 + + + 89 + 193 + 6 + + + 232 + 824 + 6 + + + 1505 + 6458 + 6 + + + 10274 + 10275 + 1 + + + + + + + index + name + + + 12 + + + 1 + 2 + 22 + + + 2 + 6 + 6 + + + 6 + 9 + 6 + + + 9 + 16 + 4 + + + 16 + 24 + 6 + + + 24 + 37 + 6 + + + 39 + 61 + 6 + + + 69 + 116 + 6 + + + 153 + 379 + 6 + + + 475 + 1260 + 6 + + + + + + + index + tp + + + 12 + + + 1 + 2 + 15 + + + 2 + 4 + 6 + + + 4 + 7 + 6 + + + 7 + 11 + 5 + + + 11 + 14 + 5 + + + 15 + 19 + 6 + + + 20 + 27 + 5 + + + 29 + 44 + 6 + + + 45 + 72 + 6 + + + 86 + 161 + 6 + + + 224 + 1436 + 6 + + + 1878 + 2153 + 2 + + + + + + + name + parent + + + 12 + + + 1 + 2 + 3941 + + + 2 + 3 + 851 + + + 3 + 6 + 484 + + + 6 + 8917 + 264 + + + + + + + name + index + + + 12 + + + 1 + 2 + 4284 + + + 2 + 3 + 737 + + + 3 + 6 + 440 + + + 6 + 28 + 79 + + + + + + + name + tp + + + 12 + + + 1 + 2 + 4599 + + + 2 + 3 + 518 + + + 3 + 21 + 416 + + + 21 + 3014 + 7 + + + + + + + tp + parent + + + 12 + + + 1 + 2 + 2055 + + + 2 + 3 + 812 + + + 3 + 4 + 408 + + + 4 + 6 + 394 + + + 6 + 11 + 342 + + + 11 + 2187 + 284 + + + + + + + tp + index + + + 12 + + + 1 + 2 + 2111 + + + 2 + 3 + 859 + + + 3 + 4 + 580 + + + 4 + 5 + 352 + + + 5 + 10 + 328 + + + 10 + 51 + 65 + + + + + + + tp + name + + + 12 + + + 1 + 2 + 2897 + + + 2 + 3 + 865 + + + 3 + 5 + 343 + + + 5 + 738 + 190 + + + + + + + + + array_length + 293 + + + tp + 293 + + + len + 103 + + + + + tp + len + + + 12 + + + 1 + 2 + 293 + + + + + + + len + tp + + + 12 + + + 1 + 2 + 62 + + + 2 + 3 + 15 + + + 3 + 4 + 7 + + + 4 + 7 + 8 + + + 7 + 15 + 7 + + + 15 + 26 + 4 + + + + + + + + + type_objects + 3567 + + + tp + 3567 + + + object + 3567 + + + + + tp + object + + + 12 + + + 1 + 2 + 3567 + + + + + + + object + tp + + + 12 + + + 1 + 2 + 3567 + + + + + + + + + packages + 346 + + + id + 346 + + + name + 281 + + + path + 346 + + + scope + 346 + + + + + id + name + + + 12 + + + 1 + 2 + 346 + + + + + + + id + path + + + 12 + + + 1 + 2 + 346 + + + + + + + id + scope + + + 12 + + + 1 + 2 + 346 + + + + + + + name + id + + + 12 + + + 1 + 2 + 255 + + + 2 + 3 + 23 + + + 3 + 40 + 3 + + + + + + + name + path + + + 12 + + + 1 + 2 + 255 + + + 2 + 3 + 23 + + + 3 + 40 + 3 + + + + + + + name + scope + + + 12 + + + 1 + 2 + 255 + + + 2 + 3 + 23 + + + 3 + 40 + 3 + + + + + + + path + id + + + 12 + + + 1 + 2 + 346 + + + + + + + path + name + + + 12 + + + 1 + 2 + 346 + + + + + + + path + scope + + + 12 + + + 1 + 2 + 346 + + + + + + + scope + id + + + 12 + + + 1 + 2 + 346 + + + + + + + scope + name + + + 12 + + + 1 + 2 + 346 + + + + + + + scope + path + + + 12 + + + 1 + 2 + 346 + + + + + + + + + modexprs + 9 + + + id + 9 + + + kind + 4 + + + parent + 2 + + + idx + 6 + + + + + id + kind + + + 12 + + + 1 + 2 + 9 + + + + + + + id + parent + + + 12 + + + 1 + 2 + 9 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 9 + + + + + + + kind + id + + + 12 + + + 1 + 2 + 3 + + + 6 + 7 + 1 + + + + + + + kind + parent + + + 12 + + + 1 + 2 + 3 + + + 2 + 3 + 1 + + + + + + + kind + idx + + + 12 + + + 1 + 2 + 3 + + + 5 + 6 + 1 + + + + + + + parent + id + + + 12 + + + 3 + 4 + 1 + + + 6 + 7 + 1 + + + + + + + parent + kind + + + 12 + + + 2 + 3 + 1 + + + 3 + 4 + 1 + + + + + + + parent + idx + + + 12 + + + 3 + 4 + 1 + + + 6 + 7 + 1 + + + + + + + idx + id + + + 12 + + + 1 + 2 + 3 + + + 2 + 3 + 3 + + + + + + + idx + kind + + + 12 + + + 1 + 2 + 4 + + + 2 + 3 + 2 + + + + + + + idx + parent + + + 12 + + + 1 + 2 + 3 + + + 2 + 3 + 3 + + + + + + + + + modtokens + 13 + + + token + 13 + + + parent + 7 + + + idx + 2 + + + + + token + parent + + + 12 + + + 1 + 2 + 13 + + + + + + + token + idx + + + 12 + + + 1 + 2 + 13 + + + + + + + parent + token + + + 12 + + + 1 + 2 + 1 + + + 2 + 3 + 6 + + + + + + + parent + idx + + + 12 + + + 1 + 2 + 1 + + + 2 + 3 + 6 + + + + + + + idx + token + + + 12 + + + 6 + 7 + 1 + + + 7 + 8 + 1 + + + + + + + idx + parent + + + 12 + + + 6 + 7 + 1 + + + 7 + 8 + 1 + + + + + + + + + errors + 0 + + + id + 0 + + + kind + 0 + + + msg + 0 + + + rawpos + 0 + + + file + 0 + + + line + 0 + + + col + 0 + + + package + 0 + + + idx + 0 + + + + + id + kind + + + 12 + + + 1 + 2 + 1 + + + + + + + id + msg + + + 12 + + + 1 + 2 + 1 + + + + + + + id + rawpos + + + 12 + + + 1 + 2 + 1 + + + + + + + id + file + + + 12 + + + 1 + 2 + 1 + + + + + + + id + line + + + 12 + + + 1 + 2 + 1 + + + + + + + id + col + + + 12 + + + 1 + 2 + 1 + + + + + + + id + package + + + 12 + + + 1 + 2 + 1 + + + + + + + id + idx + + + 12 + + + 1 + 2 + 1 + + + + + + + kind + id + + + 12 + + + + + + kind + msg + + + 12 + + + + + + kind + rawpos + + + 12 + + + + + + kind + file + + + 12 + + + + + + kind + line + + + 12 + + + + + + kind + col + + + 12 + + + + + + kind + package + + + 12 + + + + + + kind + idx + + + 12 + + + + + + msg + id + + + 12 + + + + + + msg + kind + + + 12 + + + + + + msg + rawpos + + + 12 + + + + + + msg + file + + + 12 + + + + + + msg + line + + + 12 + + + + + + msg + col + + + 12 + + + + + + msg + package + + + 12 + + + + + + msg + idx + + + 12 + + + + + + rawpos + id + + + 12 + + + + + + rawpos + kind + + + 12 + + + + + + rawpos + msg + + + 12 + + + + + + rawpos + file + + + 12 + + + + + + rawpos + line + + + 12 + + + + + + rawpos + col + + + 12 + + + + + + rawpos + package + + + 12 + + + + + + rawpos + idx + + + 12 + + + + + + file + id + + + 12 + + + + + + file + kind + + + 12 + + + + + + file + msg + + + 12 + + + + + + file + rawpos + + + 12 + + + + + + file + line + + + 12 + + + + + + file + col + + + 12 + + + + + + file + package + + + 12 + + + + + + file + idx + + + 12 + + + + + + line + id + + + 12 + + + + + + line + kind + + + 12 + + + + + + line + msg + + + 12 + + + + + + line + rawpos + + + 12 + + + + + + line + file + + + 12 + + + + + + line + col + + + 12 + + + + + + line + package + + + 12 + + + + + + line + idx + + + 12 + + + + + + col + id + + + 12 + + + + + + col + kind + + + 12 + + + + + + col + msg + + + 12 + + + + + + col + rawpos + + + 12 + + + + + + col + file + + + 12 + + + + + + col + line + + + 12 + + + + + + col + package + + + 12 + + + + + + col + idx + + + 12 + + + + + + package + id + + + 12 + + + + + + package + kind + + + 12 + + + + + + package + msg + + + 12 + + + + + + package + rawpos + + + 12 + + + + + + package + file + + + 12 + + + + + + package + line + + + 12 + + + + + + package + col + + + 12 + + + + + + package + idx + + + 12 + + + + + + idx + id + + + 12 + + + + + + idx + kind + + + 12 + + + + + + idx + msg + + + 12 + + + + + + idx + rawpos + + + 12 + + + + + + idx + file + + + 12 + + + + + + idx + line + + + 12 + + + + + + idx + col + + + 12 + + + + + + idx + package + + + 12 + + + + + + + + has_ellipsis + 268 + + + id + 268 + + + + + + diff --git a/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/go.dbscheme b/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/go.dbscheme new file mode 100644 index 000000000000..60e1b7912d7c --- /dev/null +++ b/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/go.dbscheme @@ -0,0 +1,549 @@ +/** Auto-generated dbscheme; do not edit. */ + + +/** Duplicate code **/ + +duplicateCode( + unique int id : @duplication, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +similarCode( + unique int id : @similarity, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +@duplication_or_similarity = @duplication | @similarity; + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref); + +/** External data **/ + +externalData( + int id : @externalDataElement, + varchar(900) path : string ref, + int column: int ref, + varchar(900) value : string ref +); + +snapshotDate(unique date snapshotDate : date ref); + +sourceLocationPrefix(varchar(900) prefix : string ref); + + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +compilations(unique int id: @compilation, string cwd: string ref); + +#keyset[id, num] +compilation_args(int id: @compilation ref, int num: int ref, string arg: string ref); + +#keyset[id, num, kind] +compilation_time(int id: @compilation ref, int num: int ref, int kind: int ref, float secs: float ref); + +diagnostic_for(unique int diagnostic: @diagnostic ref, int compilation: @compilation ref, int file_number: int ref, int file_number_diagnostic_number: int ref); + +compilation_finished(unique int id: @compilation ref, float cpu_seconds: float ref, float elapsed_seconds: float ref); + +#keyset[id, num] +compilation_compiling_files(int id: @compilation ref, int num: int ref, int file: @file ref); + +diagnostics(unique int id: @diagnostic, int severity: int ref, string error_tag: string ref, string error_message: string ref, + string full_error_message: string ref, int location: @location ref); + +locations_default(unique int id: @location_default, int file: @file ref, int beginLine: int ref, int beginColumn: int ref, + int endLine: int ref, int endColumn: int ref); + +numlines(int element_id: @sourceline ref, int num_lines: int ref, int num_code: int ref, int num_comment: int ref); + +files(unique int id: @file, string name: string ref); + +folders(unique int id: @folder, string name: string ref); + +containerparent(int parent: @container ref, unique int child: @container ref); + +has_location(unique int locatable: @locatable ref, int location: @location ref); + +#keyset[parent, idx] +comment_groups(unique int id: @comment_group, int parent: @file ref, int idx: int ref); + +comments(unique int id: @comment, int kind: int ref, int parent: @comment_group ref, int idx: int ref, string text: string ref); + +doc_comments(unique int node: @documentable ref, int comment: @comment_group ref); + +#keyset[parent, idx] +exprs(unique int id: @expr, int kind: int ref, int parent: @exprparent ref, int idx: int ref); + +literals(unique int expr: @expr ref, string value: string ref, string raw: string ref); + +constvalues(unique int expr: @expr ref, string value: string ref, string exact: string ref); + +fields(unique int id: @field, int parent: @fieldparent ref, int idx: int ref); + +typeparamdecls(unique int id: @typeparamdecl, int parent: @typeparamdeclparent ref, int idx: int ref); + +#keyset[parent, idx] +stmts(unique int id: @stmt, int kind: int ref, int parent: @stmtparent ref, int idx: int ref); + +#keyset[parent, idx] +decls(unique int id: @decl, int kind: int ref, int parent: @declparent ref, int idx: int ref); + +#keyset[parent, idx] +specs(unique int id: @spec, int kind: int ref, int parent: @gendecl ref, int idx: int ref); + +scopes(unique int id: @scope, int kind: int ref); + +scopenesting(unique int inner: @scope ref, int outer: @scope ref); + +scopenodes(unique int node: @scopenode ref, int scope: @localscope ref); + +objects(unique int id: @object, int kind: int ref, string name: string ref); + +objectscopes(unique int object: @object ref, int scope: @scope ref); + +objecttypes(unique int object: @object ref, int tp: @type ref); + +methodreceivers(unique int method: @object ref, int receiver: @object ref); + +fieldstructs(unique int field: @object ref, int struct: @structtype ref); + +methodhosts(int method: @object ref, int host: @namedtype ref); + +defs(int ident: @ident ref, int object: @object ref); + +uses(int ident: @ident ref, int object: @object ref); + +types(unique int id: @type, int kind: int ref); + +type_of(unique int expr: @expr ref, int tp: @type ref); + +typename(unique int tp: @type ref, string name: string ref); + +key_type(unique int map: @maptype ref, int tp: @type ref); + +element_type(unique int container: @containertype ref, int tp: @type ref); + +base_type(unique int ptr: @pointertype ref, int tp: @type ref); + +underlying_type(unique int named: @namedtype ref, int tp: @type ref); + +alias_rhs(unique int alias: @typealias ref, int tp: @type ref); + +#keyset[parent, index] +component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref); + +array_length(unique int tp: @arraytype ref, string len: string ref); + +type_objects(unique int tp: @type ref, int object: @object ref); + +packages(unique int id: @package, string name: string ref, string path: string ref, int scope: @packagescope ref); + +#keyset[parent, idx] +modexprs(unique int id: @modexpr, int kind: int ref, int parent: @modexprparent ref, int idx: int ref); + +#keyset[parent, idx] +modtokens(string token: string ref, int parent: @modexpr ref, int idx: int ref); + +#keyset[package, idx] +errors(unique int id: @error, int kind: int ref, string msg: string ref, string rawpos: string ref, + string file: string ref, int line: int ref, int col: int ref, int package: @package ref, int idx: int ref); + +has_ellipsis(int id: @callorconversionexpr ref); + +variadic(int id: @signaturetype ref); + +#keyset[parent, idx] +typeparam(unique int tp: @typeparamtype ref, string name: string ref, int bound: @compositetype ref, + int parent: @typeparamparentobject ref, int idx: int ref); + +@container = @file | @folder; + +@locatable = @xmllocatable | @node | @localscope; + +@node = @documentable | @exprparent | @modexprparent | @fieldparent | @stmtparent | @declparent | @typeparamdeclparent + | @scopenode | @comment_group | @comment; + +@documentable = @file | @field | @typeparamdecl | @spec | @gendecl | @funcdecl | @modexpr; + +@exprparent = @funcdef | @file | @expr | @field | @stmt | @decl | @typeparamdecl | @spec; + +@modexprparent = @file | @modexpr; + +@fieldparent = @decl | @structtypeexpr | @functypeexpr | @interfacetypeexpr; + +@stmtparent = @funcdef | @stmt | @decl; + +@declparent = @file | @declstmt; + +@typeparamdeclparent = @funcdecl | @typespec; + +@funcdef = @funclit | @funcdecl; + +@scopenode = @file | @functypeexpr | @blockstmt | @ifstmt | @caseclause | @switchstmt | @commclause | @loopstmt; + +@location = @location_default; + +@sourceline = @locatable; + +case @comment.kind of + 0 = @slashslashcomment +| 1 = @slashstarcomment; + +case @expr.kind of + 0 = @badexpr +| 1 = @ident +| 2 = @ellipsis +| 3 = @intlit +| 4 = @floatlit +| 5 = @imaglit +| 6 = @charlit +| 7 = @stringlit +| 8 = @funclit +| 9 = @compositelit +| 10 = @parenexpr +| 11 = @selectorexpr +| 12 = @indexexpr +| 13 = @genericfunctioninstantiationexpr +| 14 = @generictypeinstantiationexpr +| 15 = @sliceexpr +| 16 = @typeassertexpr +| 17 = @callorconversionexpr +| 18 = @starexpr +| 19 = @keyvalueexpr +| 20 = @arraytypeexpr +| 21 = @structtypeexpr +| 22 = @functypeexpr +| 23 = @interfacetypeexpr +| 24 = @maptypeexpr +| 25 = @typesetliteralexpr +| 26 = @plusexpr +| 27 = @minusexpr +| 28 = @notexpr +| 29 = @complementexpr +| 30 = @derefexpr +| 31 = @addressexpr +| 32 = @arrowexpr +| 33 = @lorexpr +| 34 = @landexpr +| 35 = @eqlexpr +| 36 = @neqexpr +| 37 = @lssexpr +| 38 = @leqexpr +| 39 = @gtrexpr +| 40 = @geqexpr +| 41 = @addexpr +| 42 = @subexpr +| 43 = @orexpr +| 44 = @xorexpr +| 45 = @mulexpr +| 46 = @quoexpr +| 47 = @remexpr +| 48 = @shlexpr +| 49 = @shrexpr +| 50 = @andexpr +| 51 = @andnotexpr +| 52 = @sendchantypeexpr +| 53 = @recvchantypeexpr +| 54 = @sendrcvchantypeexpr; + +@basiclit = @intlit | @floatlit | @imaglit | @charlit | @stringlit; + +@operatorexpr = @logicalexpr | @arithmeticexpr | @bitwiseexpr | @unaryexpr | @binaryexpr; + +@logicalexpr = @logicalunaryexpr | @logicalbinaryexpr; + +@arithmeticexpr = @arithmeticunaryexpr | @arithmeticbinaryexpr; + +@bitwiseexpr = @bitwiseunaryexpr | @bitwisebinaryexpr; + +@unaryexpr = @logicalunaryexpr | @bitwiseunaryexpr | @arithmeticunaryexpr | @derefexpr | @addressexpr | @arrowexpr; + +@logicalunaryexpr = @notexpr; + +@bitwiseunaryexpr = @complementexpr; + +@arithmeticunaryexpr = @plusexpr | @minusexpr; + +@binaryexpr = @logicalbinaryexpr | @bitwisebinaryexpr | @arithmeticbinaryexpr | @comparison; + +@logicalbinaryexpr = @lorexpr | @landexpr; + +@bitwisebinaryexpr = @shiftexpr | @orexpr | @xorexpr | @andexpr | @andnotexpr; + +@arithmeticbinaryexpr = @addexpr | @subexpr | @mulexpr | @quoexpr | @remexpr; + +@shiftexpr = @shlexpr | @shrexpr; + +@comparison = @equalitytest | @relationalcomparison; + +@equalitytest = @eqlexpr | @neqexpr; + +@relationalcomparison = @lssexpr | @leqexpr | @gtrexpr | @geqexpr; + +@chantypeexpr = @sendchantypeexpr | @recvchantypeexpr | @sendrcvchantypeexpr; + +case @stmt.kind of + 0 = @badstmt +| 1 = @declstmt +| 2 = @emptystmt +| 3 = @labeledstmt +| 4 = @exprstmt +| 5 = @sendstmt +| 6 = @incstmt +| 7 = @decstmt +| 8 = @gostmt +| 9 = @deferstmt +| 10 = @returnstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @gotostmt +| 14 = @fallthroughstmt +| 15 = @blockstmt +| 16 = @ifstmt +| 17 = @caseclause +| 18 = @exprswitchstmt +| 19 = @typeswitchstmt +| 20 = @commclause +| 21 = @selectstmt +| 22 = @forstmt +| 23 = @rangestmt +| 24 = @assignstmt +| 25 = @definestmt +| 26 = @addassignstmt +| 27 = @subassignstmt +| 28 = @mulassignstmt +| 29 = @quoassignstmt +| 30 = @remassignstmt +| 31 = @andassignstmt +| 32 = @orassignstmt +| 33 = @xorassignstmt +| 34 = @shlassignstmt +| 35 = @shrassignstmt +| 36 = @andnotassignstmt; + +@incdecstmt = @incstmt | @decstmt; + +@assignment = @simpleassignstmt | @compoundassignstmt; + +@simpleassignstmt = @assignstmt | @definestmt; + +@compoundassignstmt = @addassignstmt | @subassignstmt | @mulassignstmt | @quoassignstmt | @remassignstmt + | @andassignstmt | @orassignstmt | @xorassignstmt | @shlassignstmt | @shrassignstmt | @andnotassignstmt; + +@branchstmt = @breakstmt | @continuestmt | @gotostmt | @fallthroughstmt; + +@switchstmt = @exprswitchstmt | @typeswitchstmt; + +@loopstmt = @forstmt | @rangestmt; + +case @decl.kind of + 0 = @baddecl +| 1 = @importdecl +| 2 = @constdecl +| 3 = @typedecl +| 4 = @vardecl +| 5 = @funcdecl; + +@gendecl = @importdecl | @constdecl | @typedecl | @vardecl; + +case @spec.kind of + 0 = @importspec +| 1 = @valuespec +| 2 = @typedefspec +| 3 = @aliasspec; + +@typespec = @typedefspec | @aliasspec; + +case @object.kind of + 0 = @pkgobject +| 1 = @decltypeobject +| 2 = @builtintypeobject +| 3 = @declconstobject +| 4 = @builtinconstobject +| 5 = @declvarobject +| 6 = @declfunctionobject +| 7 = @builtinfunctionobject +| 8 = @labelobject; + +@typeparamparentobject = @decltypeobject | @declfunctionobject; + +@declobject = @decltypeobject | @declconstobject | @declvarobject | @declfunctionobject; + +@builtinobject = @builtintypeobject | @builtinconstobject | @builtinfunctionobject; + +@typeobject = @decltypeobject | @builtintypeobject; + +@valueobject = @constobject | @varobject | @functionobject; + +@constobject = @declconstobject | @builtinconstobject; + +@varobject = @declvarobject; + +@functionobject = @declfunctionobject | @builtinfunctionobject; + +case @scope.kind of + 0 = @universescope +| 1 = @packagescope +| 2 = @localscope; + +case @type.kind of + 0 = @invalidtype +| 1 = @boolexprtype +| 2 = @inttype +| 3 = @int8type +| 4 = @int16type +| 5 = @int32type +| 6 = @int64type +| 7 = @uinttype +| 8 = @uint8type +| 9 = @uint16type +| 10 = @uint32type +| 11 = @uint64type +| 12 = @uintptrtype +| 13 = @float32type +| 14 = @float64type +| 15 = @complex64type +| 16 = @complex128type +| 17 = @stringexprtype +| 18 = @unsafepointertype +| 19 = @boolliteraltype +| 20 = @intliteraltype +| 21 = @runeliteraltype +| 22 = @floatliteraltype +| 23 = @complexliteraltype +| 24 = @stringliteraltype +| 25 = @nilliteraltype +| 26 = @typeparamtype +| 27 = @arraytype +| 28 = @slicetype +| 29 = @structtype +| 30 = @pointertype +| 31 = @interfacetype +| 32 = @tupletype +| 33 = @signaturetype +| 34 = @maptype +| 35 = @sendchantype +| 36 = @recvchantype +| 37 = @sendrcvchantype +| 38 = @namedtype +| 39 = @typesetliteraltype +| 40 = @typealias; + +@basictype = @booltype | @numerictype | @stringtype | @literaltype | @invalidtype | @unsafepointertype; + +@booltype = @boolexprtype | @boolliteraltype; + +@numerictype = @integertype | @floattype | @complextype; + +@integertype = @signedintegertype | @unsignedintegertype; + +@signedintegertype = @inttype | @int8type | @int16type | @int32type | @int64type | @intliteraltype | @runeliteraltype; + +@unsignedintegertype = @uinttype | @uint8type | @uint16type | @uint32type | @uint64type | @uintptrtype; + +@floattype = @float32type | @float64type | @floatliteraltype; + +@complextype = @complex64type | @complex128type | @complexliteraltype; + +@stringtype = @stringexprtype | @stringliteraltype; + +@literaltype = @boolliteraltype | @intliteraltype | @runeliteraltype | @floatliteraltype | @complexliteraltype + | @stringliteraltype | @nilliteraltype; + +@compositetype = @typeparamtype | @containertype | @structtype | @pointertype | @interfacetype | @tupletype + | @signaturetype | @namedtype | @typesetliteraltype | @typealias; + +@containertype = @arraytype | @slicetype | @maptype | @chantype; + +@chantype = @sendchantype | @recvchantype | @sendrcvchantype; + +case @modexpr.kind of + 0 = @modcommentblock +| 1 = @modline +| 2 = @modlineblock +| 3 = @modlparen +| 4 = @modrparen; + +case @error.kind of + 0 = @unknownerror +| 1 = @listerror +| 2 = @parseerror +| 3 = @typeerror; + diff --git a/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/old.dbscheme b/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/old.dbscheme new file mode 100644 index 000000000000..a58b81b1b4c4 --- /dev/null +++ b/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/old.dbscheme @@ -0,0 +1,546 @@ +/** Auto-generated dbscheme; do not edit. */ + + +/** Duplicate code **/ + +duplicateCode( + unique int id : @duplication, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +similarCode( + unique int id : @similarity, + varchar(900) relativePath : string ref, + int equivClass : int ref); + +@duplication_or_similarity = @duplication | @similarity; + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref); + +/** External data **/ + +externalData( + int id : @externalDataElement, + varchar(900) path : string ref, + int column: int ref, + varchar(900) value : string ref +); + +snapshotDate(unique date snapshotDate : date ref); + +sourceLocationPrefix(varchar(900) prefix : string ref); + + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +compilations(unique int id: @compilation, string cwd: string ref); + +#keyset[id, num] +compilation_args(int id: @compilation ref, int num: int ref, string arg: string ref); + +#keyset[id, num, kind] +compilation_time(int id: @compilation ref, int num: int ref, int kind: int ref, float secs: float ref); + +diagnostic_for(unique int diagnostic: @diagnostic ref, int compilation: @compilation ref, int file_number: int ref, int file_number_diagnostic_number: int ref); + +compilation_finished(unique int id: @compilation ref, float cpu_seconds: float ref, float elapsed_seconds: float ref); + +#keyset[id, num] +compilation_compiling_files(int id: @compilation ref, int num: int ref, int file: @file ref); + +diagnostics(unique int id: @diagnostic, int severity: int ref, string error_tag: string ref, string error_message: string ref, + string full_error_message: string ref, int location: @location ref); + +locations_default(unique int id: @location_default, int file: @file ref, int beginLine: int ref, int beginColumn: int ref, + int endLine: int ref, int endColumn: int ref); + +numlines(int element_id: @sourceline ref, int num_lines: int ref, int num_code: int ref, int num_comment: int ref); + +files(unique int id: @file, string name: string ref); + +folders(unique int id: @folder, string name: string ref); + +containerparent(int parent: @container ref, unique int child: @container ref); + +has_location(unique int locatable: @locatable ref, int location: @location ref); + +#keyset[parent, idx] +comment_groups(unique int id: @comment_group, int parent: @file ref, int idx: int ref); + +comments(unique int id: @comment, int kind: int ref, int parent: @comment_group ref, int idx: int ref, string text: string ref); + +doc_comments(unique int node: @documentable ref, int comment: @comment_group ref); + +#keyset[parent, idx] +exprs(unique int id: @expr, int kind: int ref, int parent: @exprparent ref, int idx: int ref); + +literals(unique int expr: @expr ref, string value: string ref, string raw: string ref); + +constvalues(unique int expr: @expr ref, string value: string ref, string exact: string ref); + +fields(unique int id: @field, int parent: @fieldparent ref, int idx: int ref); + +typeparamdecls(unique int id: @typeparamdecl, int parent: @typeparamdeclparent ref, int idx: int ref); + +#keyset[parent, idx] +stmts(unique int id: @stmt, int kind: int ref, int parent: @stmtparent ref, int idx: int ref); + +#keyset[parent, idx] +decls(unique int id: @decl, int kind: int ref, int parent: @declparent ref, int idx: int ref); + +#keyset[parent, idx] +specs(unique int id: @spec, int kind: int ref, int parent: @gendecl ref, int idx: int ref); + +scopes(unique int id: @scope, int kind: int ref); + +scopenesting(unique int inner: @scope ref, int outer: @scope ref); + +scopenodes(unique int node: @scopenode ref, int scope: @localscope ref); + +objects(unique int id: @object, int kind: int ref, string name: string ref); + +objectscopes(unique int object: @object ref, int scope: @scope ref); + +objecttypes(unique int object: @object ref, int tp: @type ref); + +methodreceivers(unique int method: @object ref, int receiver: @object ref); + +fieldstructs(unique int field: @object ref, int struct: @structtype ref); + +methodhosts(int method: @object ref, int host: @namedtype ref); + +defs(int ident: @ident ref, int object: @object ref); + +uses(int ident: @ident ref, int object: @object ref); + +types(unique int id: @type, int kind: int ref); + +type_of(unique int expr: @expr ref, int tp: @type ref); + +typename(unique int tp: @type ref, string name: string ref); + +key_type(unique int map: @maptype ref, int tp: @type ref); + +element_type(unique int container: @containertype ref, int tp: @type ref); + +base_type(unique int ptr: @pointertype ref, int tp: @type ref); + +underlying_type(unique int named: @namedtype ref, int tp: @type ref); + +#keyset[parent, index] +component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref); + +array_length(unique int tp: @arraytype ref, string len: string ref); + +type_objects(unique int tp: @type ref, int object: @object ref); + +packages(unique int id: @package, string name: string ref, string path: string ref, int scope: @packagescope ref); + +#keyset[parent, idx] +modexprs(unique int id: @modexpr, int kind: int ref, int parent: @modexprparent ref, int idx: int ref); + +#keyset[parent, idx] +modtokens(string token: string ref, int parent: @modexpr ref, int idx: int ref); + +#keyset[package, idx] +errors(unique int id: @error, int kind: int ref, string msg: string ref, string rawpos: string ref, + string file: string ref, int line: int ref, int col: int ref, int package: @package ref, int idx: int ref); + +has_ellipsis(int id: @callorconversionexpr ref); + +variadic(int id: @signaturetype ref); + +#keyset[parent, idx] +typeparam(unique int tp: @typeparamtype ref, string name: string ref, int bound: @compositetype ref, + int parent: @typeparamparentobject ref, int idx: int ref); + +@container = @file | @folder; + +@locatable = @xmllocatable | @node | @localscope; + +@node = @documentable | @exprparent | @modexprparent | @fieldparent | @stmtparent | @declparent | @typeparamdeclparent + | @scopenode | @comment_group | @comment; + +@documentable = @file | @field | @typeparamdecl | @spec | @gendecl | @funcdecl | @modexpr; + +@exprparent = @funcdef | @file | @expr | @field | @stmt | @decl | @typeparamdecl | @spec; + +@modexprparent = @file | @modexpr; + +@fieldparent = @decl | @structtypeexpr | @functypeexpr | @interfacetypeexpr; + +@stmtparent = @funcdef | @stmt | @decl; + +@declparent = @file | @declstmt; + +@typeparamdeclparent = @funcdecl | @typespec; + +@funcdef = @funclit | @funcdecl; + +@scopenode = @file | @functypeexpr | @blockstmt | @ifstmt | @caseclause | @switchstmt | @commclause | @loopstmt; + +@location = @location_default; + +@sourceline = @locatable; + +case @comment.kind of + 0 = @slashslashcomment +| 1 = @slashstarcomment; + +case @expr.kind of + 0 = @badexpr +| 1 = @ident +| 2 = @ellipsis +| 3 = @intlit +| 4 = @floatlit +| 5 = @imaglit +| 6 = @charlit +| 7 = @stringlit +| 8 = @funclit +| 9 = @compositelit +| 10 = @parenexpr +| 11 = @selectorexpr +| 12 = @indexexpr +| 13 = @genericfunctioninstantiationexpr +| 14 = @generictypeinstantiationexpr +| 15 = @sliceexpr +| 16 = @typeassertexpr +| 17 = @callorconversionexpr +| 18 = @starexpr +| 19 = @keyvalueexpr +| 20 = @arraytypeexpr +| 21 = @structtypeexpr +| 22 = @functypeexpr +| 23 = @interfacetypeexpr +| 24 = @maptypeexpr +| 25 = @typesetliteralexpr +| 26 = @plusexpr +| 27 = @minusexpr +| 28 = @notexpr +| 29 = @complementexpr +| 30 = @derefexpr +| 31 = @addressexpr +| 32 = @arrowexpr +| 33 = @lorexpr +| 34 = @landexpr +| 35 = @eqlexpr +| 36 = @neqexpr +| 37 = @lssexpr +| 38 = @leqexpr +| 39 = @gtrexpr +| 40 = @geqexpr +| 41 = @addexpr +| 42 = @subexpr +| 43 = @orexpr +| 44 = @xorexpr +| 45 = @mulexpr +| 46 = @quoexpr +| 47 = @remexpr +| 48 = @shlexpr +| 49 = @shrexpr +| 50 = @andexpr +| 51 = @andnotexpr +| 52 = @sendchantypeexpr +| 53 = @recvchantypeexpr +| 54 = @sendrcvchantypeexpr; + +@basiclit = @intlit | @floatlit | @imaglit | @charlit | @stringlit; + +@operatorexpr = @logicalexpr | @arithmeticexpr | @bitwiseexpr | @unaryexpr | @binaryexpr; + +@logicalexpr = @logicalunaryexpr | @logicalbinaryexpr; + +@arithmeticexpr = @arithmeticunaryexpr | @arithmeticbinaryexpr; + +@bitwiseexpr = @bitwiseunaryexpr | @bitwisebinaryexpr; + +@unaryexpr = @logicalunaryexpr | @bitwiseunaryexpr | @arithmeticunaryexpr | @derefexpr | @addressexpr | @arrowexpr; + +@logicalunaryexpr = @notexpr; + +@bitwiseunaryexpr = @complementexpr; + +@arithmeticunaryexpr = @plusexpr | @minusexpr; + +@binaryexpr = @logicalbinaryexpr | @bitwisebinaryexpr | @arithmeticbinaryexpr | @comparison; + +@logicalbinaryexpr = @lorexpr | @landexpr; + +@bitwisebinaryexpr = @shiftexpr | @orexpr | @xorexpr | @andexpr | @andnotexpr; + +@arithmeticbinaryexpr = @addexpr | @subexpr | @mulexpr | @quoexpr | @remexpr; + +@shiftexpr = @shlexpr | @shrexpr; + +@comparison = @equalitytest | @relationalcomparison; + +@equalitytest = @eqlexpr | @neqexpr; + +@relationalcomparison = @lssexpr | @leqexpr | @gtrexpr | @geqexpr; + +@chantypeexpr = @sendchantypeexpr | @recvchantypeexpr | @sendrcvchantypeexpr; + +case @stmt.kind of + 0 = @badstmt +| 1 = @declstmt +| 2 = @emptystmt +| 3 = @labeledstmt +| 4 = @exprstmt +| 5 = @sendstmt +| 6 = @incstmt +| 7 = @decstmt +| 8 = @gostmt +| 9 = @deferstmt +| 10 = @returnstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @gotostmt +| 14 = @fallthroughstmt +| 15 = @blockstmt +| 16 = @ifstmt +| 17 = @caseclause +| 18 = @exprswitchstmt +| 19 = @typeswitchstmt +| 20 = @commclause +| 21 = @selectstmt +| 22 = @forstmt +| 23 = @rangestmt +| 24 = @assignstmt +| 25 = @definestmt +| 26 = @addassignstmt +| 27 = @subassignstmt +| 28 = @mulassignstmt +| 29 = @quoassignstmt +| 30 = @remassignstmt +| 31 = @andassignstmt +| 32 = @orassignstmt +| 33 = @xorassignstmt +| 34 = @shlassignstmt +| 35 = @shrassignstmt +| 36 = @andnotassignstmt; + +@incdecstmt = @incstmt | @decstmt; + +@assignment = @simpleassignstmt | @compoundassignstmt; + +@simpleassignstmt = @assignstmt | @definestmt; + +@compoundassignstmt = @addassignstmt | @subassignstmt | @mulassignstmt | @quoassignstmt | @remassignstmt + | @andassignstmt | @orassignstmt | @xorassignstmt | @shlassignstmt | @shrassignstmt | @andnotassignstmt; + +@branchstmt = @breakstmt | @continuestmt | @gotostmt | @fallthroughstmt; + +@switchstmt = @exprswitchstmt | @typeswitchstmt; + +@loopstmt = @forstmt | @rangestmt; + +case @decl.kind of + 0 = @baddecl +| 1 = @importdecl +| 2 = @constdecl +| 3 = @typedecl +| 4 = @vardecl +| 5 = @funcdecl; + +@gendecl = @importdecl | @constdecl | @typedecl | @vardecl; + +case @spec.kind of + 0 = @importspec +| 1 = @valuespec +| 2 = @typedefspec +| 3 = @aliasspec; + +@typespec = @typedefspec | @aliasspec; + +case @object.kind of + 0 = @pkgobject +| 1 = @decltypeobject +| 2 = @builtintypeobject +| 3 = @declconstobject +| 4 = @builtinconstobject +| 5 = @declvarobject +| 6 = @declfunctionobject +| 7 = @builtinfunctionobject +| 8 = @labelobject; + +@typeparamparentobject = @decltypeobject | @declfunctionobject; + +@declobject = @decltypeobject | @declconstobject | @declvarobject | @declfunctionobject; + +@builtinobject = @builtintypeobject | @builtinconstobject | @builtinfunctionobject; + +@typeobject = @decltypeobject | @builtintypeobject; + +@valueobject = @constobject | @varobject | @functionobject; + +@constobject = @declconstobject | @builtinconstobject; + +@varobject = @declvarobject; + +@functionobject = @declfunctionobject | @builtinfunctionobject; + +case @scope.kind of + 0 = @universescope +| 1 = @packagescope +| 2 = @localscope; + +case @type.kind of + 0 = @invalidtype +| 1 = @boolexprtype +| 2 = @inttype +| 3 = @int8type +| 4 = @int16type +| 5 = @int32type +| 6 = @int64type +| 7 = @uinttype +| 8 = @uint8type +| 9 = @uint16type +| 10 = @uint32type +| 11 = @uint64type +| 12 = @uintptrtype +| 13 = @float32type +| 14 = @float64type +| 15 = @complex64type +| 16 = @complex128type +| 17 = @stringexprtype +| 18 = @unsafepointertype +| 19 = @boolliteraltype +| 20 = @intliteraltype +| 21 = @runeliteraltype +| 22 = @floatliteraltype +| 23 = @complexliteraltype +| 24 = @stringliteraltype +| 25 = @nilliteraltype +| 26 = @typeparamtype +| 27 = @arraytype +| 28 = @slicetype +| 29 = @structtype +| 30 = @pointertype +| 31 = @interfacetype +| 32 = @tupletype +| 33 = @signaturetype +| 34 = @maptype +| 35 = @sendchantype +| 36 = @recvchantype +| 37 = @sendrcvchantype +| 38 = @namedtype +| 39 = @typesetliteraltype; + +@basictype = @booltype | @numerictype | @stringtype | @literaltype | @invalidtype | @unsafepointertype; + +@booltype = @boolexprtype | @boolliteraltype; + +@numerictype = @integertype | @floattype | @complextype; + +@integertype = @signedintegertype | @unsignedintegertype; + +@signedintegertype = @inttype | @int8type | @int16type | @int32type | @int64type | @intliteraltype | @runeliteraltype; + +@unsignedintegertype = @uinttype | @uint8type | @uint16type | @uint32type | @uint64type | @uintptrtype; + +@floattype = @float32type | @float64type | @floatliteraltype; + +@complextype = @complex64type | @complex128type | @complexliteraltype; + +@stringtype = @stringexprtype | @stringliteraltype; + +@literaltype = @boolliteraltype | @intliteraltype | @runeliteraltype | @floatliteraltype | @complexliteraltype + | @stringliteraltype | @nilliteraltype; + +@compositetype = @typeparamtype | @containertype | @structtype | @pointertype | @interfacetype | @tupletype + | @signaturetype | @namedtype | @typesetliteraltype; + +@containertype = @arraytype | @slicetype | @maptype | @chantype; + +@chantype = @sendchantype | @recvchantype | @sendrcvchantype; + +case @modexpr.kind of + 0 = @modcommentblock +| 1 = @modline +| 2 = @modlineblock +| 3 = @modlparen +| 4 = @modrparen; + +case @error.kind of + 0 = @unknownerror +| 1 = @listerror +| 2 = @parseerror +| 3 = @typeerror; + diff --git a/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/upgrade.properties b/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/upgrade.properties new file mode 100644 index 000000000000..e4cdd2164e44 --- /dev/null +++ b/go/ql/lib/upgrades/a58b81b1b4c4cccc8ca11731c1db86622f33af57/upgrade.properties @@ -0,0 +1,2 @@ +description: Add support for type aliases +compatibility: full diff --git a/go/ql/src/experimental/CWE-79/HTMLTemplateEscapingPassthrough.ql b/go/ql/src/experimental/CWE-79/HTMLTemplateEscapingPassthrough.ql index 7918b9694ea5..6591aa0aa147 100644 --- a/go/ql/src/experimental/CWE-79/HTMLTemplateEscapingPassthrough.ql +++ b/go/ql/src/experimental/CWE-79/HTMLTemplateEscapingPassthrough.ql @@ -41,7 +41,7 @@ module UntrustedToPassthroughTypeConversionConfig implements DataFlow::ConfigSig additional predicate isSinkToPassthroughType(DataFlow::TypeCastNode sink, PassthroughTypeName name) { exists(Type typ | typ = sink.getResultType() and - typ.getUnderlyingType*().hasQualifiedName("html/template", name) + unalias(typ).hasQualifiedName("html/template", name) ) } @@ -80,7 +80,7 @@ module PassthroughTypeConversionToTemplateExecutionCallConfig implements DataFlo ) { exists(Type typ | typ = source.getResultType() and - typ.getUnderlyingType*().hasQualifiedName("html/template", name) + unalias(typ).hasQualifiedName("html/template", name) ) } diff --git a/go/ql/test/extractor-tests/diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected b/go/ql/test/extractor-tests/diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected index aa526b3e7505..abe30bd00880 100644 --- a/go/ql/test/extractor-tests/diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected +++ b/go/ql/test/extractor-tests/diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected @@ -1,4 +1,4 @@ -| -:0:0:0:0 | package ; expected main | +| -:0:0:0:0 | package ; expected package main | | broken2/test1.go:4:2:4:2 | undefined: fmt | | broken2/test1.go:5:2:5:2 | undefined: fmt | | broken2/test1.go:5:14:5:14 | undefined: a | diff --git a/go/ql/test/library-tests/semmle/go/Decl/TypeEntities.expected b/go/ql/test/library-tests/semmle/go/Decl/TypeEntities.expected index 2de33d124076..d25336d987cf 100644 --- a/go/ql/test/library-tests/semmle/go/Decl/TypeEntities.expected +++ b/go/ql/test/library-tests/semmle/go/Decl/TypeEntities.expected @@ -1,2 +1,2 @@ | main.go:3:6:3:11 | status | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Decl | status | -| main.go:5:6:5:12 | intlist | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Decl | []int | +| main.go:5:6:5:12 | intlist | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Decl | intlist | diff --git a/go/ql/test/library-tests/semmle/go/Files/CONSISTENCY/UnexpectedFrontendErrors.expected b/go/ql/test/library-tests/semmle/go/Files/CONSISTENCY/UnexpectedFrontendErrors.expected index 6a47139fb8dd..e63bda23e944 100644 --- a/go/ql/test/library-tests/semmle/go/Files/CONSISTENCY/UnexpectedFrontendErrors.expected +++ b/go/ql/test/library-tests/semmle/go/Files/CONSISTENCY/UnexpectedFrontendErrors.expected @@ -1,4 +1,4 @@ -| -:0:0:0:0 | package ; expected nonexistent | +| -:0:0:0:0 | package ; expected package nonexistent | | vendor/github.com/github/nonexistent/bad.go:1:57:1:57 | expected ';', found 'EOF' | | vendor/github.com/github/nonexistent/bad.go:1:57:1:57 | expected 'IDENT', found 'EOF' | | vendor/github.com/github/nonexistent/bad.go:1:57:1:57 | expected 'package', found 'EOF' | diff --git a/go/ql/test/library-tests/semmle/go/Function/GenericFunctionInstantiationExpr.expected b/go/ql/test/library-tests/semmle/go/Function/GenericFunctionInstantiationExpr.expected index 6528a0ae7f3d..3b0ee59bde68 100644 --- a/go/ql/test/library-tests/semmle/go/Function/GenericFunctionInstantiationExpr.expected +++ b/go/ql/test/library-tests/semmle/go/Function/GenericFunctionInstantiationExpr.expected @@ -1,8 +1,8 @@ -| genericFunctions.go:25:2:25:33 | generic function instantiation expression | genericFunctions.go:25:2:25:28 | GenericFunctionOneTypeParam | 0 | genericFunctions.go:25:30:25:32 | int | -| genericFunctions.go:26:2:26:36 | generic function instantiation expression | genericFunctions.go:26:2:26:28 | GenericFunctionOneTypeParam | 0 | genericFunctions.go:26:30:26:35 | string | -| genericFunctions.go:44:6:44:48 | generic function instantiation expression | genericFunctions.go:44:6:44:33 | GenericFunctionTwoTypeParams | 0 | genericFunctions.go:44:35:44:40 | string | -| genericFunctions.go:44:6:44:48 | generic function instantiation expression | genericFunctions.go:44:6:44:33 | GenericFunctionTwoTypeParams | 1 | genericFunctions.go:44:43:44:47 | int64 | -| genericFunctions.go:45:6:45:50 | generic function instantiation expression | genericFunctions.go:45:6:45:33 | GenericFunctionTwoTypeParams | 0 | genericFunctions.go:45:35:45:40 | string | -| genericFunctions.go:45:6:45:50 | generic function instantiation expression | genericFunctions.go:45:6:45:33 | GenericFunctionTwoTypeParams | 1 | genericFunctions.go:45:43:45:49 | float64 | -| genericFunctions.go:141:6:141:41 | generic function instantiation expression | genericFunctions.go:141:6:141:33 | GenericFunctionInAnotherFile | 0 | genericFunctions.go:141:35:141:40 | string | -| genericFunctions.go:146:6:146:55 | generic function instantiation expression | genericFunctions.go:146:6:146:47 | selection of GenericFunctionInAnotherPackage | 0 | genericFunctions.go:146:49:146:54 | string | +| genericFunctions.go:27:2:27:33 | generic function instantiation expression | genericFunctions.go:27:2:27:28 | GenericFunctionOneTypeParam | 0 | genericFunctions.go:27:30:27:32 | int | +| genericFunctions.go:28:2:28:36 | generic function instantiation expression | genericFunctions.go:28:2:28:28 | GenericFunctionOneTypeParam | 0 | genericFunctions.go:28:30:28:35 | string | +| genericFunctions.go:46:6:46:48 | generic function instantiation expression | genericFunctions.go:46:6:46:33 | GenericFunctionTwoTypeParams | 0 | genericFunctions.go:46:35:46:40 | string | +| genericFunctions.go:46:6:46:48 | generic function instantiation expression | genericFunctions.go:46:6:46:33 | GenericFunctionTwoTypeParams | 1 | genericFunctions.go:46:43:46:47 | int64 | +| genericFunctions.go:47:6:47:50 | generic function instantiation expression | genericFunctions.go:47:6:47:33 | GenericFunctionTwoTypeParams | 0 | genericFunctions.go:47:35:47:40 | string | +| genericFunctions.go:47:6:47:50 | generic function instantiation expression | genericFunctions.go:47:6:47:33 | GenericFunctionTwoTypeParams | 1 | genericFunctions.go:47:43:47:49 | float64 | +| genericFunctions.go:149:6:149:41 | generic function instantiation expression | genericFunctions.go:149:6:149:33 | GenericFunctionInAnotherFile | 0 | genericFunctions.go:149:35:149:40 | string | +| genericFunctions.go:154:6:154:55 | generic function instantiation expression | genericFunctions.go:154:6:154:47 | selection of GenericFunctionInAnotherPackage | 0 | genericFunctions.go:154:49:154:54 | string | diff --git a/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected b/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected index bb614a4b41c5..6ab36eb877ed 100644 --- a/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected +++ b/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected @@ -1,30 +1,45 @@ | E | Ordered | +| E | any | | E | comparable | -| E | interface { } | -| E1 | interface { } | -| E2 | interface { } | -| Edge | EdgeConstraint | -| Edge | interface { } | +| E | interface { ~uint16 \| ~uint32 } | +| E1 | any | +| E2 | any | | F | floaty | -| K | comparable | -| Node | NodeConstraint | -| Node | interface { } | -| S | interface { } | +| K | any | +| N | interface { int64 \| uint64 } | | S | interface { ~[]E } | | S1 | interface { ~[]E1 } | | S2 | interface { ~[]E2 } | -| SF2 | interface { } | -| SG2 | interface { } | +| Slice | interface { ~[]E } | | T | Ordered | +| T | any | | T | comparable | | T | interface { string \| []uint8 } | -| T | interface { } | -| T1 | interface { } | -| T2 | interface { } | -| TF1 | interface { } | -| TF2 | interface { } | -| TG1 | interface { } | -| TG2 | interface { } | -| U | interface { } | -| V | interface { int64 \| float64 } | +| T1 | any | +| T2 | any | +| TP101 | any | +| TP102 | comparable | +| TP103 | interface { int64 \| float64 } | +| TP104 | interface { } | +| TP105 | any | +| TP106 | any | +| TP107 | interface { } | +| TP108 | interface { } | +| TP109 | any | +| TP110 | any | +| TP111 | any | +| TP112 | any | +| TP113 | any | +| TP114 | any | +| TP115 | any | +| TP116 | any | +| TP117 | any | +| TP118 | NodeConstraint | +| TP119 | EdgeConstraint | +| TP120 | NodeConstraint | +| TP121 | EdgeConstraint | +| TP122 | NodeConstraint | +| TP123 | EdgeConstraint | +| TP200 | any | +| V | any | | bytes | interface { []uint8 \| string } | diff --git a/go/ql/test/library-tests/semmle/go/Function/genericFunctions.go b/go/ql/test/library-tests/semmle/go/Function/genericFunctions.go index 43d0a11dd9f3..a4aa1bfd9ec3 100644 --- a/go/ql/test/library-tests/semmle/go/Function/genericFunctions.go +++ b/go/ql/test/library-tests/semmle/go/Function/genericFunctions.go @@ -2,18 +2,20 @@ package main import "github.com/anotherpkg" -type T1 map[string][]string -type T2 T1 +type DefinedType1 map[string][]string +type DefinedType2 DefinedType1 +type AliasType1 = DefinedType2 +type AliasType2 = AliasType1 // A generic function with one type parameter -func GenericFunctionOneTypeParam[T any](t T) T { - var r T +func GenericFunctionOneTypeParam[TP101 any](t TP101) TP101 { + var r TP101 return r } // A generic function with two type parameter -func GenericFunctionTwoTypeParams[K comparable, V int64 | float64](m map[K]V) V { - var s V +func GenericFunctionTwoTypeParams[TP102 comparable, TP103 int64 | float64](m map[TP102]TP103) TP103 { + var s TP103 for _, v := range m { s += v } @@ -70,32 +72,38 @@ func generic_functions() { // Slice write sliceVar[0] = -1 - // Access a map through two type aliases - aliasedMap := T2{"key": []string{"value"}} + // Access a map through two named types + mapThroughNamedTypes := DefinedType2{"key": []string{"value"}} // Map read - _ = aliasedMap["key"] + _ = mapThroughNamedTypes["key"] // Map write - aliasedMap["key"][0] = "new value" + mapThroughNamedTypes["key"][0] = "new value" + // Access a map through two type aliases and two named types + mapThroughAliasedTypes := AliasType2{"key": []string{"value"}} + // Map read + _ = mapThroughAliasedTypes["key"] + // Map write + mapThroughAliasedTypes["key"][0] = "new value" } -type GenericStruct1[T any] struct { +type GenericStruct1[TP104 interface{}] struct { } -type GenericStruct2[S, T any] struct { +type GenericStruct2[TP105, TP106 any] struct { } -func (x GenericStruct1[TF1]) f1() TF1 { - var r TF1 +func (x GenericStruct1[TP107]) f1() TP107 { + var r TP107 return r } -func (x *GenericStruct1[TG1]) g1() { +func (x *GenericStruct1[TP108]) g1() { } -func (x GenericStruct2[SF2, TF2]) f2() { +func (x GenericStruct2[TP109, TP110]) f2() { } -func (x *GenericStruct2[SG2, TG2]) g2() { +func (x *GenericStruct2[TP111, TP112]) g2() { } func call_methods_with_generic_receiver() { @@ -108,34 +116,34 @@ func call_methods_with_generic_receiver() { x2.g2() } -type Element[S any] struct { - list *List[S] +type Element[TP113 any] struct { + list *List[TP113] } -type List[T any] struct { - root Element[T] +type List[TP114 any] struct { + root Element[TP114] } // Len is the number of elements in the list. -func (l *List[U]) MyLen() int { +func (l *List[TP115]) MyLen() int { return 0 } -type NodeConstraint[Edge any] interface { - Edges() []Edge +type NodeConstraint[TP116 any] interface { + Edges() []TP116 } -type EdgeConstraint[Node any] interface { - Nodes() (from, to Node) +type EdgeConstraint[TP117 any] interface { + Nodes() (from, to TP117) } -type Graph[Node NodeConstraint[Edge], Edge EdgeConstraint[Node]] struct{} +type Graph[TP118 NodeConstraint[TP119], TP119 EdgeConstraint[TP118]] struct{} -func New[Node NodeConstraint[Edge], Edge EdgeConstraint[Node]](nodes []Node) *Graph[Node, Edge] { +func New[TP120 NodeConstraint[TP121], TP121 EdgeConstraint[TP120]](nodes []TP120) *Graph[TP120, TP121] { return nil } -func (g *Graph[Node, Edge]) ShortestPath(from, to Node) []Edge { return []Edge{} } +func (g *Graph[TP122, TP123]) ShortestPath(from, to TP122) []TP123 { return []TP123{} } func callFunctionsInAnotherFile() { _ = GenericFunctionInAnotherFile[string]("world") diff --git a/go/ql/test/library-tests/semmle/go/Function/genericFunctions2.go b/go/ql/test/library-tests/semmle/go/Function/genericFunctions2.go index 9394357dea01..a7c4f86786ee 100644 --- a/go/ql/test/library-tests/semmle/go/Function/genericFunctions2.go +++ b/go/ql/test/library-tests/semmle/go/Function/genericFunctions2.go @@ -1,6 +1,6 @@ package main -func GenericFunctionInAnotherFile[T any](t T) T { - var r T +func GenericFunctionInAnotherFile[TP200 any](t TP200) TP200 { + var r TP200 return r } diff --git a/go/ql/test/library-tests/semmle/go/Function/getParameter.expected b/go/ql/test/library-tests/semmle/go/Function/getParameter.expected index 538b6ff3567b..339ec2f0cf8d 100644 --- a/go/ql/test/library-tests/semmle/go/Function/getParameter.expected +++ b/go/ql/test/library-tests/semmle/go/Function/getParameter.expected @@ -1,15 +1,15 @@ -| genericFunctions2.go:3:6:3:33 | GenericFunctionInAnotherFile | 0 | genericFunctions2.go:3:42:3:42 | t | -| genericFunctions.go:9:6:9:32 | GenericFunctionOneTypeParam | 0 | genericFunctions.go:9:41:9:41 | t | -| genericFunctions.go:15:6:15:33 | GenericFunctionTwoTypeParams | 0 | genericFunctions.go:15:68:15:68 | m | -| genericFunctions.go:87:30:87:31 | f1 | -1 | genericFunctions.go:87:7:87:7 | x | -| genericFunctions.go:92:31:92:32 | g1 | -1 | genericFunctions.go:92:7:92:7 | x | -| genericFunctions.go:95:35:95:36 | f2 | -1 | genericFunctions.go:95:7:95:7 | x | -| genericFunctions.go:98:36:98:37 | g2 | -1 | genericFunctions.go:98:7:98:7 | x | -| genericFunctions.go:120:19:120:23 | MyLen | -1 | genericFunctions.go:120:7:120:7 | l | -| genericFunctions.go:134:6:134:8 | New | 0 | genericFunctions.go:134:64:134:68 | nodes | -| genericFunctions.go:138:29:138:40 | ShortestPath | 0 | genericFunctions.go:138:42:138:45 | from | -| genericFunctions.go:138:29:138:40 | ShortestPath | 1 | genericFunctions.go:138:48:138:49 | to | -| genericFunctions.go:138:29:138:40 | ShortestPath | -1 | genericFunctions.go:138:7:138:7 | g | +| genericFunctions2.go:3:6:3:33 | GenericFunctionInAnotherFile | 0 | genericFunctions2.go:3:46:3:46 | t | +| genericFunctions.go:11:6:11:32 | GenericFunctionOneTypeParam | 0 | genericFunctions.go:11:45:11:45 | t | +| genericFunctions.go:17:6:17:33 | GenericFunctionTwoTypeParams | 0 | genericFunctions.go:17:76:17:76 | m | +| genericFunctions.go:95:32:95:33 | f1 | -1 | genericFunctions.go:95:7:95:7 | x | +| genericFunctions.go:100:33:100:34 | g1 | -1 | genericFunctions.go:100:7:100:7 | x | +| genericFunctions.go:103:39:103:40 | f2 | -1 | genericFunctions.go:103:7:103:7 | x | +| genericFunctions.go:106:40:106:41 | g2 | -1 | genericFunctions.go:106:7:106:7 | x | +| genericFunctions.go:128:23:128:27 | MyLen | -1 | genericFunctions.go:128:7:128:7 | l | +| genericFunctions.go:142:6:142:8 | New | 0 | genericFunctions.go:142:68:142:72 | nodes | +| genericFunctions.go:146:31:146:42 | ShortestPath | 0 | genericFunctions.go:146:44:146:47 | from | +| genericFunctions.go:146:31:146:42 | ShortestPath | 1 | genericFunctions.go:146:50:146:51 | to | +| genericFunctions.go:146:31:146:42 | ShortestPath | -1 | genericFunctions.go:146:7:146:7 | g | | main.go:7:6:7:7 | f1 | 0 | main.go:7:9:7:9 | x | | main.go:9:12:9:13 | f2 | 0 | main.go:9:15:9:15 | x | | main.go:9:12:9:13 | f2 | 1 | main.go:9:18:9:18 | y | diff --git a/go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expected b/go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expected index ce72080bd6f3..0637da3898df 100644 --- a/go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expected +++ b/go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expected @@ -1,15 +1,15 @@ -| genericFunctions2.go:3:1:6:1 | function declaration | FuncDecl | 0 | genericFunctions2.go:3:35:3:39 | type parameter declaration | 0 | genericFunctions2.go:3:35:3:35 | T | genericFunctions2.go:3:37:3:39 | any | interface { } | -| genericFunctions.go:9:1:12:1 | function declaration | FuncDecl | 0 | genericFunctions.go:9:34:9:38 | type parameter declaration | 0 | genericFunctions.go:9:34:9:34 | T | genericFunctions.go:9:36:9:38 | any | interface { } | -| genericFunctions.go:15:1:21:1 | function declaration | FuncDecl | 0 | genericFunctions.go:15:35:15:46 | type parameter declaration | 0 | genericFunctions.go:15:35:15:35 | K | genericFunctions.go:15:37:15:46 | comparable | comparable | -| genericFunctions.go:15:1:21:1 | function declaration | FuncDecl | 1 | genericFunctions.go:15:49:15:65 | type parameter declaration | 0 | genericFunctions.go:15:49:15:49 | V | genericFunctions.go:15:51:15:65 | type set literal | interface { int64 \| float64 } | -| genericFunctions.go:81:6:82:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:81:21:81:25 | type parameter declaration | 0 | genericFunctions.go:81:21:81:21 | T | genericFunctions.go:81:23:81:25 | any | interface { } | -| genericFunctions.go:84:6:85:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:84:21:84:28 | type parameter declaration | 0 | genericFunctions.go:84:21:84:21 | S | genericFunctions.go:84:26:84:28 | any | interface { } | -| genericFunctions.go:84:6:85:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:84:21:84:28 | type parameter declaration | 1 | genericFunctions.go:84:24:84:24 | T | genericFunctions.go:84:26:84:28 | any | interface { } | -| genericFunctions.go:111:6:113:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:111:14:111:18 | type parameter declaration | 0 | genericFunctions.go:111:14:111:14 | S | genericFunctions.go:111:16:111:18 | any | interface { } | -| genericFunctions.go:115:6:117:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:115:11:115:15 | type parameter declaration | 0 | genericFunctions.go:115:11:115:11 | T | genericFunctions.go:115:13:115:15 | any | interface { } | -| genericFunctions.go:124:6:126:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:124:21:124:28 | type parameter declaration | 0 | genericFunctions.go:124:21:124:24 | Edge | genericFunctions.go:124:26:124:28 | any | interface { } | -| genericFunctions.go:128:6:130:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:128:21:128:28 | type parameter declaration | 0 | genericFunctions.go:128:21:128:24 | Node | genericFunctions.go:128:26:128:28 | any | interface { } | -| genericFunctions.go:132:6:132:73 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:132:12:132:36 | type parameter declaration | 0 | genericFunctions.go:132:12:132:15 | Node | genericFunctions.go:132:17:132:36 | generic type instantiation expression | NodeConstraint | -| genericFunctions.go:132:6:132:73 | type declaration specifier | TypeSpec | 1 | genericFunctions.go:132:39:132:63 | type parameter declaration | 0 | genericFunctions.go:132:39:132:42 | Edge | genericFunctions.go:132:44:132:63 | generic type instantiation expression | EdgeConstraint | -| genericFunctions.go:134:1:136:1 | function declaration | FuncDecl | 0 | genericFunctions.go:134:10:134:34 | type parameter declaration | 0 | genericFunctions.go:134:10:134:13 | Node | genericFunctions.go:134:15:134:34 | generic type instantiation expression | NodeConstraint | -| genericFunctions.go:134:1:136:1 | function declaration | FuncDecl | 1 | genericFunctions.go:134:37:134:61 | type parameter declaration | 0 | genericFunctions.go:134:37:134:40 | Edge | genericFunctions.go:134:42:134:61 | generic type instantiation expression | EdgeConstraint | +| genericFunctions2.go:3:1:6:1 | function declaration | FuncDecl | 0 | genericFunctions2.go:3:35:3:43 | type parameter declaration | 0 | genericFunctions2.go:3:35:3:39 | TP200 | genericFunctions2.go:3:41:3:43 | any | any | +| genericFunctions.go:11:1:14:1 | function declaration | FuncDecl | 0 | genericFunctions.go:11:34:11:42 | type parameter declaration | 0 | genericFunctions.go:11:34:11:38 | TP101 | genericFunctions.go:11:40:11:42 | any | any | +| genericFunctions.go:17:1:23:1 | function declaration | FuncDecl | 0 | genericFunctions.go:17:35:17:50 | type parameter declaration | 0 | genericFunctions.go:17:35:17:39 | TP102 | genericFunctions.go:17:41:17:50 | comparable | comparable | +| genericFunctions.go:17:1:23:1 | function declaration | FuncDecl | 1 | genericFunctions.go:17:53:17:73 | type parameter declaration | 0 | genericFunctions.go:17:53:17:57 | TP103 | genericFunctions.go:17:59:17:73 | type set literal | interface { int64 \| float64 } | +| genericFunctions.go:89:6:90:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:89:21:89:37 | type parameter declaration | 0 | genericFunctions.go:89:21:89:25 | TP104 | genericFunctions.go:89:27:89:37 | interface type | interface { } | +| genericFunctions.go:92:6:93:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:92:21:92:36 | type parameter declaration | 0 | genericFunctions.go:92:21:92:25 | TP105 | genericFunctions.go:92:34:92:36 | any | any | +| genericFunctions.go:92:6:93:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:92:21:92:36 | type parameter declaration | 1 | genericFunctions.go:92:28:92:32 | TP106 | genericFunctions.go:92:34:92:36 | any | any | +| genericFunctions.go:119:6:121:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:119:14:119:22 | type parameter declaration | 0 | genericFunctions.go:119:14:119:18 | TP113 | genericFunctions.go:119:20:119:22 | any | any | +| genericFunctions.go:123:6:125:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:123:11:123:19 | type parameter declaration | 0 | genericFunctions.go:123:11:123:15 | TP114 | genericFunctions.go:123:17:123:19 | any | any | +| genericFunctions.go:132:6:134:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:132:21:132:29 | type parameter declaration | 0 | genericFunctions.go:132:21:132:25 | TP116 | genericFunctions.go:132:27:132:29 | any | any | +| genericFunctions.go:136:6:138:1 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:136:21:136:29 | type parameter declaration | 0 | genericFunctions.go:136:21:136:25 | TP117 | genericFunctions.go:136:27:136:29 | any | any | +| genericFunctions.go:140:6:140:77 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:140:12:140:38 | type parameter declaration | 0 | genericFunctions.go:140:12:140:16 | TP118 | genericFunctions.go:140:18:140:38 | generic type instantiation expression | NodeConstraint | +| genericFunctions.go:140:6:140:77 | type declaration specifier | TypeSpec | 1 | genericFunctions.go:140:41:140:67 | type parameter declaration | 0 | genericFunctions.go:140:41:140:45 | TP119 | genericFunctions.go:140:47:140:67 | generic type instantiation expression | EdgeConstraint | +| genericFunctions.go:142:1:144:1 | function declaration | FuncDecl | 0 | genericFunctions.go:142:10:142:36 | type parameter declaration | 0 | genericFunctions.go:142:10:142:14 | TP120 | genericFunctions.go:142:16:142:36 | generic type instantiation expression | NodeConstraint | +| genericFunctions.go:142:1:144:1 | function declaration | FuncDecl | 1 | genericFunctions.go:142:39:142:65 | type parameter declaration | 0 | genericFunctions.go:142:39:142:43 | TP121 | genericFunctions.go:142:45:142:65 | generic type instantiation expression | EdgeConstraint | diff --git a/go/ql/test/library-tests/semmle/go/PrintAst/PrintAst.expected b/go/ql/test/library-tests/semmle/go/PrintAst/PrintAst.expected index e2424aa4575d..4c9b7da6fe55 100644 --- a/go/ql/test/library-tests/semmle/go/PrintAst/PrintAst.expected +++ b/go/ql/test/library-tests/semmle/go/PrintAst/PrintAst.expected @@ -53,10 +53,10 @@ input.go: # 20| 0: [CallExpr] call to Println # 20| Type = (int, error) # 20| 0: [FunctionName, SelectorExpr] selection of Println -# 20| Type = func([]interface { }) int, error +# 20| Type = func([]any) int, error # 20| 0: [Ident, PackageName] fmt # 20| 1: [FunctionName, Ident] Println -# 20| Type = func([]interface { }) int, error +# 20| Type = func([]any) int, error # 20| 1: [StringLit] "Hi" # 20| Type = string # 20| Value = [StringLit] Hi @@ -203,10 +203,10 @@ input.go: # 52| 0: [CallExpr] call to Println # 52| Type = (int, error) # 52| 0: [FunctionName, SelectorExpr] selection of Println -# 52| Type = func([]interface { }) int, error +# 52| Type = func([]any) int, error # 52| 0: [Ident, PackageName] fmt # 52| 1: [FunctionName, Ident] Println -# 52| Type = func([]interface { }) int, error +# 52| Type = func([]any) int, error # 52| 1: [StringLit] "Heard from ch1" # 52| Type = string # 52| Value = [StringLit] Heard from ch1 @@ -229,20 +229,20 @@ input.go: # 54| 0: [CallExpr] call to Println # 54| Type = (int, error) # 54| 0: [FunctionName, SelectorExpr] selection of Println -# 54| Type = func([]interface { }) int, error +# 54| Type = func([]any) int, error # 54| 0: [Ident, PackageName] fmt # 54| 1: [FunctionName, Ident] Println -# 54| Type = func([]interface { }) int, error +# 54| Type = func([]any) int, error # 54| 1: [Ident, VariableName] a # 54| Type = [1]float32 # 55| 2: [ExprStmt] expression statement # 55| 0: [CallExpr] call to Println # 55| Type = (int, error) # 55| 0: [FunctionName, SelectorExpr] selection of Println -# 55| Type = func([]interface { }) int, error +# 55| Type = func([]any) int, error # 55| 0: [Ident, PackageName] fmt # 55| 1: [FunctionName, Ident] Println -# 55| Type = func([]interface { }) int, error +# 55| Type = func([]any) int, error # 55| 1: [Ident, VariableName] w # 55| Type = bool # 56| 2: [CommClause] comm clause @@ -250,10 +250,10 @@ input.go: # 57| 0: [CallExpr] call to Println # 57| Type = (int, error) # 57| 0: [FunctionName, SelectorExpr] selection of Println -# 57| Type = func([]interface { }) int, error +# 57| Type = func([]any) int, error # 57| 0: [Ident, PackageName] fmt # 57| 1: [FunctionName, Ident] Println -# 57| Type = func([]interface { }) int, error +# 57| Type = func([]any) int, error # 58| 3: [CommClause] comm clause # 58| 0: [SendStmt] send statement # 58| 0: [Ident, VariableName] ch1 @@ -297,10 +297,10 @@ input.go: # 67| 0: [CallExpr] call to Println # 67| Type = (int, error) # 67| 0: [FunctionName, SelectorExpr] selection of Println -# 67| Type = func([]interface { }) int, error +# 67| Type = func([]any) int, error # 67| 0: [Ident, PackageName] fmt # 67| 1: [FunctionName, Ident] Println -# 67| Type = func([]interface { }) int, error +# 67| Type = func([]any) int, error # 67| 1: [Ident, VariableName] x # 67| Type = int # 68| 2: [BlockStmt] block statement @@ -316,10 +316,10 @@ input.go: # 69| 0: [CallExpr] call to Println # 69| Type = (int, error) # 69| 0: [FunctionName, SelectorExpr] selection of Println -# 69| Type = func([]interface { }) int, error +# 69| Type = func([]any) int, error # 69| 0: [Ident, PackageName] fmt # 69| 1: [FunctionName, Ident] Println -# 69| Type = func([]interface { }) int, error +# 69| Type = func([]any) int, error # 69| 1: [MinusExpr] -... # 69| Type = int # 69| 0: [Ident, VariableName] x @@ -474,10 +474,10 @@ input.go: # 115| 0: [CallExpr] call to Println # 115| Type = (int, error) # 115| 0: [FunctionName, SelectorExpr] selection of Println -# 115| Type = func([]interface { }) int, error +# 115| Type = func([]any) int, error # 115| 0: [Ident, PackageName] fmt # 115| 1: [FunctionName, Ident] Println -# 115| Type = func([]interface { }) int, error +# 115| Type = func([]any) int, error # 115| 1: [Ident, VariableName] y # 115| Type = interface { } # 116| 1: [CaseClause] case clause @@ -566,10 +566,10 @@ input.go: # 138| 0: [CallExpr] call to Print # 138| Type = (int, error) # 138| 0: [FunctionName, SelectorExpr] selection of Print -# 138| Type = func([]interface { }) int, error +# 138| Type = func([]any) int, error # 138| 0: [Ident, PackageName] fmt # 138| 1: [FunctionName, Ident] Print -# 138| Type = func([]interface { }) int, error +# 138| Type = func([]any) int, error # 138| 1: [Ident, VariableName] x # 138| Type = int # 141| 1: [RangeStmt] range statement @@ -584,10 +584,10 @@ input.go: # 142| 0: [CallExpr] call to Print # 142| Type = (int, error) # 142| 0: [FunctionName, SelectorExpr] selection of Print -# 142| Type = func([]interface { }) int, error +# 142| Type = func([]any) int, error # 142| 0: [Ident, PackageName] fmt # 142| 1: [FunctionName, Ident] Print -# 142| Type = func([]interface { }) int, error +# 142| Type = func([]any) int, error # 142| 1: [Ident, VariableName] i # 142| Type = int # 142| 2: [Ident, VariableName] v diff --git a/go/ql/test/library-tests/semmle/go/PrintAst/PrintAstExcludeComments.expected b/go/ql/test/library-tests/semmle/go/PrintAst/PrintAstExcludeComments.expected index 57fbeb881a52..0a9335b397bd 100644 --- a/go/ql/test/library-tests/semmle/go/PrintAst/PrintAstExcludeComments.expected +++ b/go/ql/test/library-tests/semmle/go/PrintAst/PrintAstExcludeComments.expected @@ -33,10 +33,10 @@ input.go: # 20| 0: [CallExpr] call to Println # 20| Type = (int, error) # 20| 0: [FunctionName, SelectorExpr] selection of Println -# 20| Type = func([]interface { }) int, error +# 20| Type = func([]any) int, error # 20| 0: [Ident, PackageName] fmt # 20| 1: [FunctionName, Ident] Println -# 20| Type = func([]interface { }) int, error +# 20| Type = func([]any) int, error # 20| 1: [StringLit] "Hi" # 20| Type = string # 20| Value = [StringLit] Hi @@ -183,10 +183,10 @@ input.go: # 52| 0: [CallExpr] call to Println # 52| Type = (int, error) # 52| 0: [FunctionName, SelectorExpr] selection of Println -# 52| Type = func([]interface { }) int, error +# 52| Type = func([]any) int, error # 52| 0: [Ident, PackageName] fmt # 52| 1: [FunctionName, Ident] Println -# 52| Type = func([]interface { }) int, error +# 52| Type = func([]any) int, error # 52| 1: [StringLit] "Heard from ch1" # 52| Type = string # 52| Value = [StringLit] Heard from ch1 @@ -209,20 +209,20 @@ input.go: # 54| 0: [CallExpr] call to Println # 54| Type = (int, error) # 54| 0: [FunctionName, SelectorExpr] selection of Println -# 54| Type = func([]interface { }) int, error +# 54| Type = func([]any) int, error # 54| 0: [Ident, PackageName] fmt # 54| 1: [FunctionName, Ident] Println -# 54| Type = func([]interface { }) int, error +# 54| Type = func([]any) int, error # 54| 1: [Ident, VariableName] a # 54| Type = [1]float32 # 55| 2: [ExprStmt] expression statement # 55| 0: [CallExpr] call to Println # 55| Type = (int, error) # 55| 0: [FunctionName, SelectorExpr] selection of Println -# 55| Type = func([]interface { }) int, error +# 55| Type = func([]any) int, error # 55| 0: [Ident, PackageName] fmt # 55| 1: [FunctionName, Ident] Println -# 55| Type = func([]interface { }) int, error +# 55| Type = func([]any) int, error # 55| 1: [Ident, VariableName] w # 55| Type = bool # 56| 2: [CommClause] comm clause @@ -230,10 +230,10 @@ input.go: # 57| 0: [CallExpr] call to Println # 57| Type = (int, error) # 57| 0: [FunctionName, SelectorExpr] selection of Println -# 57| Type = func([]interface { }) int, error +# 57| Type = func([]any) int, error # 57| 0: [Ident, PackageName] fmt # 57| 1: [FunctionName, Ident] Println -# 57| Type = func([]interface { }) int, error +# 57| Type = func([]any) int, error # 58| 3: [CommClause] comm clause # 58| 0: [SendStmt] send statement # 58| 0: [Ident, VariableName] ch1 @@ -277,10 +277,10 @@ input.go: # 67| 0: [CallExpr] call to Println # 67| Type = (int, error) # 67| 0: [FunctionName, SelectorExpr] selection of Println -# 67| Type = func([]interface { }) int, error +# 67| Type = func([]any) int, error # 67| 0: [Ident, PackageName] fmt # 67| 1: [FunctionName, Ident] Println -# 67| Type = func([]interface { }) int, error +# 67| Type = func([]any) int, error # 67| 1: [Ident, VariableName] x # 67| Type = int # 68| 2: [BlockStmt] block statement @@ -296,10 +296,10 @@ input.go: # 69| 0: [CallExpr] call to Println # 69| Type = (int, error) # 69| 0: [FunctionName, SelectorExpr] selection of Println -# 69| Type = func([]interface { }) int, error +# 69| Type = func([]any) int, error # 69| 0: [Ident, PackageName] fmt # 69| 1: [FunctionName, Ident] Println -# 69| Type = func([]interface { }) int, error +# 69| Type = func([]any) int, error # 69| 1: [MinusExpr] -... # 69| Type = int # 69| 0: [Ident, VariableName] x @@ -454,10 +454,10 @@ input.go: # 115| 0: [CallExpr] call to Println # 115| Type = (int, error) # 115| 0: [FunctionName, SelectorExpr] selection of Println -# 115| Type = func([]interface { }) int, error +# 115| Type = func([]any) int, error # 115| 0: [Ident, PackageName] fmt # 115| 1: [FunctionName, Ident] Println -# 115| Type = func([]interface { }) int, error +# 115| Type = func([]any) int, error # 115| 1: [Ident, VariableName] y # 115| Type = interface { } # 116| 1: [CaseClause] case clause @@ -546,10 +546,10 @@ input.go: # 138| 0: [CallExpr] call to Print # 138| Type = (int, error) # 138| 0: [FunctionName, SelectorExpr] selection of Print -# 138| Type = func([]interface { }) int, error +# 138| Type = func([]any) int, error # 138| 0: [Ident, PackageName] fmt # 138| 1: [FunctionName, Ident] Print -# 138| Type = func([]interface { }) int, error +# 138| Type = func([]any) int, error # 138| 1: [Ident, VariableName] x # 138| Type = int # 141| 1: [RangeStmt] range statement @@ -564,10 +564,10 @@ input.go: # 142| 0: [CallExpr] call to Print # 142| Type = (int, error) # 142| 0: [FunctionName, SelectorExpr] selection of Print -# 142| Type = func([]interface { }) int, error +# 142| Type = func([]any) int, error # 142| 0: [Ident, PackageName] fmt # 142| 1: [FunctionName, Ident] Print -# 142| Type = func([]interface { }) int, error +# 142| Type = func([]any) int, error # 142| 1: [Ident, VariableName] i # 142| Type = int # 142| 2: [Ident, VariableName] v diff --git a/go/ql/test/library-tests/semmle/go/Types/Aliases.expected b/go/ql/test/library-tests/semmle/go/Types/Aliases.expected new file mode 100644 index 000000000000..25edafbc70db --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/Types/Aliases.expected @@ -0,0 +1,4 @@ +| github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.FirstAlias | string | string | +| github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.GenericSignatureAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.GenericSignature | func(T) T | +| github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.SecondAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.FirstAlias | string | +| github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.TypeAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.GenericArray | [10]T | diff --git a/go/ql/test/library-tests/semmle/go/Types/Aliases.ql b/go/ql/test/library-tests/semmle/go/Types/Aliases.ql new file mode 100644 index 000000000000..a049ceb8356a --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/Types/Aliases.ql @@ -0,0 +1,10 @@ +import go + +string getQualifiedNameIfExists(Type t) { + if exists(t.getQualifiedName()) then result = t.getQualifiedName() else result = t.pp() +} + +from AliasType at, string filepath +where at.hasLocationInfo(filepath, _, _, _, _) and filepath != "" +select getQualifiedNameIfExists(at), getQualifiedNameIfExists(at.getRhs()), + getQualifiedNameIfExists(at.getUnderlyingType()) diff --git a/go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected b/go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected index 3f170370284c..d72190a0f540 100644 --- a/go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected +++ b/go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected @@ -1,3 +1,5 @@ +| aliases.go:3:6:3:15 | FirstAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.FirstAlias | +| aliases.go:4:6:4:16 | SecondAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.SecondAlias | | cyclic.go:3:6:3:6 | s | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.s | | cyclic.go:7:6:7:6 | t | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.t | | cyclic.go:12:6:12:6 | u | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.u | @@ -29,7 +31,9 @@ | generic.go:47:6:47:16 | MyInterface | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.MyInterface | | generic.go:67:6:67:22 | HasBlankTypeParam | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.HasBlankTypeParam | | generic.go:68:6:68:23 | HasBlankTypeParams | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.HasBlankTypeParams | +| generic.go:82:6:82:14 | TypeAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.TypeAlias | | generic.go:84:6:84:21 | GenericSignature | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.GenericSignature | +| generic.go:85:6:85:26 | GenericSignatureAlias | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.GenericSignatureAlias | | interface.go:3:6:3:7 | i0 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.i0 | | interface.go:5:6:5:7 | i1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.i1 | | interface.go:9:6:9:7 | i2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.i2 | diff --git a/go/ql/test/library-tests/semmle/go/Types/Types.expected b/go/ql/test/library-tests/semmle/go/Types/Types.expected index b4a05a8858d1..7d7158d87224 100644 --- a/go/ql/test/library-tests/semmle/go/Types/Types.expected +++ b/go/ql/test/library-tests/semmle/go/Types/Types.expected @@ -1,3 +1,5 @@ +| aliases.go:3:6:3:15 | FirstAlias | FirstAlias | +| aliases.go:4:6:4:16 | SecondAlias | SecondAlias | | cyclic.go:3:6:3:6 | s | s | | cyclic.go:7:6:7:6 | t | t | | cyclic.go:12:6:12:6 | u | u | @@ -29,7 +31,9 @@ | generic.go:47:6:47:16 | MyInterface | MyInterface | | generic.go:67:6:67:22 | HasBlankTypeParam | HasBlankTypeParam | | generic.go:68:6:68:23 | HasBlankTypeParams | HasBlankTypeParams | +| generic.go:82:6:82:14 | TypeAlias | TypeAlias | | generic.go:84:6:84:21 | GenericSignature | GenericSignature | +| generic.go:85:6:85:26 | GenericSignatureAlias | GenericSignatureAlias | | interface.go:3:6:3:7 | i0 | i0 | | interface.go:5:6:5:7 | i1 | i1 | | interface.go:9:6:9:7 | i2 | i2 | diff --git a/go/ql/test/library-tests/semmle/go/Types/aliases.go b/go/ql/test/library-tests/semmle/go/Types/aliases.go new file mode 100644 index 000000000000..f1e7fb3d73f4 --- /dev/null +++ b/go/ql/test/library-tests/semmle/go/Types/aliases.go @@ -0,0 +1,4 @@ +package main + +type FirstAlias = string +type SecondAlias = FirstAlias diff --git a/go/ql/test/query-tests/Diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected b/go/ql/test/query-tests/Diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected index 909c0a71eded..19c2ad21db8c 100644 --- a/go/ql/test/query-tests/Diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected +++ b/go/ql/test/query-tests/Diagnostics/CONSISTENCY/UnexpectedFrontendErrors.expected @@ -1,5 +1,5 @@ | -:0:0:0:0 | malformed import path "github.com/github/codeql-go/ql/test/query-tests/Diagnostics/invalid{": invalid char '{' | -| -:0:0:0:0 | package ; expected main | +| -:0:0:0:0 | package ; expected package main | | bad.go:3:1:3:1 | expected 'package', found avvu | | bad.go:3:1:3:1 | expected 'package', found avvu | | bad.go:3:5:3:5 | expected 'IDENT', found newline | diff --git a/go/ql/test/query-tests/Diagnostics/ExtractionErrors.expected b/go/ql/test/query-tests/Diagnostics/ExtractionErrors.expected index c7695f79dcab..b3a9e8631f08 100644 --- a/go/ql/test/query-tests/Diagnostics/ExtractionErrors.expected +++ b/go/ql/test/query-tests/Diagnostics/ExtractionErrors.expected @@ -4,4 +4,4 @@ | Extraction failed with error expected 'IDENT', found newline | 2 | | Extraction failed with error expected 'package', found avvu | 2 | | Extraction failed with error malformed import path "github.com/github/codeql-go/ql/test/query-tests/Diagnostics/invalid{": invalid char '{' | 2 | -| Extraction failed with error package ; expected main | 2 | +| Extraction failed with error package ; expected package main | 2 | diff --git a/go/ql/test/query-tests/Summary/CONSISTENCY/UnexpectedFrontendErrors.expected b/go/ql/test/query-tests/Summary/CONSISTENCY/UnexpectedFrontendErrors.expected index d4dff7b992f5..b0969d1a2244 100644 --- a/go/ql/test/query-tests/Summary/CONSISTENCY/UnexpectedFrontendErrors.expected +++ b/go/ql/test/query-tests/Summary/CONSISTENCY/UnexpectedFrontendErrors.expected @@ -1,4 +1,4 @@ -| -:0:0:0:0 | package ; expected main | +| -:0:0:0:0 | package ; expected package main | | empty-file.go:1:1:1:1 | expected ';', found 'EOF' | | empty-file.go:1:1:1:1 | expected 'IDENT', found 'EOF' | | empty-file.go:1:1:1:1 | expected 'package', found 'EOF' | diff --git a/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/MODULE.bazel b/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/MODULE.bazel new file mode 100644 index 000000000000..3e5873d31bbd --- /dev/null +++ b/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/MODULE.bazel @@ -0,0 +1,47 @@ +module( + name = "rules_go", + version = "0.49.0-codeql.1", + compatibility_level = 0, + repo_name = "io_bazel_rules_go", +) + +# The custom repo_name is used to prevent our bazel_features polyfill for WORKSPACE builds from +# conflicting with the real bazel_features repo. +bazel_dep(name = "bazel_features", version = "1.9.1", repo_name = "io_bazel_rules_go_bazel_features") +bazel_dep(name = "bazel_skylib", version = "1.2.0") +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "rules_proto", version = "6.0.0") +bazel_dep(name = "protobuf", version = "3.19.2", repo_name = "com_google_protobuf") + +go_sdk = use_extension("//go:extensions.bzl", "go_sdk") +go_sdk.download( + name = "go_default_sdk", + version = "1.21.8", +) +use_repo( + go_sdk, + "go_toolchains", + # This name is ugly on purpose to avoid a conflict with a user-named SDK. + "io_bazel_rules_nogo", +) + +register_toolchains("@go_toolchains//:all") + +bazel_dep(name = "gazelle", version = "0.36.0") + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") +use_repo( + go_deps, + "com_github_gogo_protobuf", + "com_github_golang_mock", + "com_github_golang_protobuf", + "org_golang_google_genproto", + "org_golang_google_grpc", + "org_golang_google_grpc_cmd_protoc_gen_go_grpc", + "org_golang_google_protobuf", + "org_golang_x_net", + "org_golang_x_tools", + # Exported by gazelle specifically for rules_go. + "bazel_gazelle_go_repository_config", +) diff --git a/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/patches/disable_winsymlink.patch b/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/patches/disable_winsymlink.patch new file mode 100644 index 000000000000..bc13343051a2 --- /dev/null +++ b/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/patches/disable_winsymlink.patch @@ -0,0 +1,20 @@ +Taken from https://github.com/bazelbuild/rules_go/pull/4050/commits/55b4c07d3244c829c11f297335550f19fcc718bd +diff --git a/go/private/context.bzl b/go/private/context.bzl +index ad0270fe..0243a231 100644 +--- a/go/private/context.bzl ++++ b/go/private/context.bzl +@@ -439,6 +439,14 @@ def go_context( + # + # See https://go.dev/doc/toolchain for more info. + "GOTOOLCHAIN": "local", ++ ++ # NOTE(#4049): Since Go 1.23.0, os.Readlink (and consequently ++ # filepath.EvalSymlinks) stopped treating Windows mount points and ++ # reparse points (junctions) as symbolic links. Bazel uses junctions ++ # when constructing exec roots, and we use filepath.EvalSymlinks in ++ # GoStdlib, so this broke us. Setting GODEBUG=winsymlink=0 restores ++ # the old behavior. ++ "GODEBUG": "winsymlink=0", + } + + # Path mapping can't map the values of environment variables, so we pass GOROOT to the action diff --git a/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/source.json b/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/source.json new file mode 100644 index 000000000000..c715b299f87b --- /dev/null +++ b/misc/bazel/registry/modules/rules_go/0.49.0-codeql.1/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-2T7wLx5yyC2Ls9UWlRmzYWezPPaMJSUl47nT1d0UPec=", + "strip_prefix": "", + "url": "https://github.com/bazelbuild/rules_go/releases/download/v0.49.0/rules_go-v0.49.0.zip", + "patches": { + "disable_winsymlink.patch": "sha256-o2DWpbkv9TK80evwEQCdDFSXGLlgoT5BZg7MnvE77Go=" + }, + "patch_strip": 1 +} diff --git a/misc/bazel/registry/modules/rules_go/metadata.json b/misc/bazel/registry/modules/rules_go/metadata.json new file mode 100644 index 000000000000..307a4d6771c9 --- /dev/null +++ b/misc/bazel/registry/modules/rules_go/metadata.json @@ -0,0 +1,33 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_go", + "maintainers": [ + { + "email": "fabian@meumertzhe.im", + "github": "fmeum", + "name": "Fabian Meumertzheim" + }, + { + "email": "zplin@uber.com", + "github": "linzhp", + "name": "Zhongpeng Lin" + }, + { + "email": "tfrench@uber.com", + "github": "tyler-french", + "name": "Tyler French" + } + ], + "repository": [ + "github:bazelbuild/rules_go" + ], + "versions": [ + "0.49.0-codeql.1" + ], + "yanked_versions": { + "0.33.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", + "0.34.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", + "0.35.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", + "0.36.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher", + "0.37.0": "Obsolete experimental version that emits debug prints. Update to 0.39.1 or higher" + } +}