From 1267d6acc85dbf84a2c50f516df3bb86604910f2 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 13 Dec 2024 17:10:40 +0000 Subject: [PATCH] Test changes to be investigated --- .../semmle/go/Decl/TypeEntities.expected | 2 +- .../semmle/go/Function/TypeParamType.expected | 188 +++++++++--------- .../go/Function/getTypeParameter.expected | 24 +-- .../semmle/go/Types/Aliases.expected | 28 +-- .../go/Types/Field_hasQualifiedName2.expected | 5 +- .../go/Types/Field_hasQualifiedName3.expected | 5 +- .../semmle/go/Types/QualifiedNames.expected | 7 + .../semmle/go/Types/StructFields.expected | 2 - .../semmle/go/Types/Types.expected | 7 + .../go/aliases/DataflowFields/test.expected | 2 + .../semmle/go/aliases/DataflowFields/test.ql | 39 +++- .../go/aliases/InterfaceImpls/test.expected | 17 +- .../go/aliases/MethodDefs/test.expected | 14 +- .../semmle/go/aliases/defsuses/test.expected | 18 +- 14 files changed, 208 insertions(+), 150 deletions(-) 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 2de33d1240766..d25336d987cfe 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/Function/TypeParamType.expected b/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected index 69485ebb2b08c..ceaf57ff6046a 100644 --- a/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected +++ b/go/ql/test/library-tests/semmle/go/Function/TypeParamType.expected @@ -24,192 +24,192 @@ numberOfTypeParameters | cmp.Less | 0 | T | Ordered | | cmp.Or | 0 | T | comparable | | cmp.isNaN | 0 | T | Ordered | -| codeql-go-tests/function.EdgeConstraint | 0 | TP117 | interface { } | -| codeql-go-tests/function.Element | 0 | TP113 | interface { } | -| codeql-go-tests/function.GenericFunctionInAnotherFile | 0 | TP200 | interface { } | -| codeql-go-tests/function.GenericFunctionOneTypeParam | 0 | TP101 | interface { } | +| codeql-go-tests/function.EdgeConstraint | 0 | TP117 | any | +| codeql-go-tests/function.Element | 0 | TP113 | any | +| codeql-go-tests/function.GenericFunctionInAnotherFile | 0 | TP200 | any | +| codeql-go-tests/function.GenericFunctionOneTypeParam | 0 | TP101 | any | | codeql-go-tests/function.GenericFunctionTwoTypeParams | 0 | TP102 | comparable | | codeql-go-tests/function.GenericFunctionTwoTypeParams | 1 | TP103 | interface { int64 \| float64 } | | codeql-go-tests/function.GenericStruct1 | 0 | TP104 | interface { } | | codeql-go-tests/function.GenericStruct1.f1 | 0 | TP107 | interface { } | | codeql-go-tests/function.GenericStruct1.g1 | 0 | TP108 | interface { } | -| codeql-go-tests/function.GenericStruct2 | 0 | TP105 | interface { } | -| codeql-go-tests/function.GenericStruct2 | 1 | TP106 | interface { } | -| codeql-go-tests/function.GenericStruct2.f2 | 0 | TP109 | interface { } | -| codeql-go-tests/function.GenericStruct2.f2 | 1 | TP110 | interface { } | -| codeql-go-tests/function.GenericStruct2.g2 | 0 | TP111 | interface { } | -| codeql-go-tests/function.GenericStruct2.g2 | 1 | TP112 | interface { } | +| codeql-go-tests/function.GenericStruct2 | 0 | TP105 | any | +| codeql-go-tests/function.GenericStruct2 | 1 | TP106 | any | +| codeql-go-tests/function.GenericStruct2.f2 | 0 | TP109 | any | +| codeql-go-tests/function.GenericStruct2.f2 | 1 | TP110 | any | +| codeql-go-tests/function.GenericStruct2.g2 | 0 | TP111 | any | +| codeql-go-tests/function.GenericStruct2.g2 | 1 | TP112 | any | | codeql-go-tests/function.Graph | 0 | TP118 | NodeConstraint | | codeql-go-tests/function.Graph | 1 | TP119 | EdgeConstraint | | codeql-go-tests/function.Graph.ShortestPath | 0 | TP122 | NodeConstraint | | codeql-go-tests/function.Graph.ShortestPath | 1 | TP123 | EdgeConstraint | -| codeql-go-tests/function.List | 0 | TP114 | interface { } | -| codeql-go-tests/function.List.MyLen | 0 | TP115 | interface { } | +| codeql-go-tests/function.List | 0 | TP114 | any | +| codeql-go-tests/function.List.MyLen | 0 | TP115 | any | | codeql-go-tests/function.New | 0 | TP120 | NodeConstraint | | codeql-go-tests/function.New | 1 | TP121 | EdgeConstraint | -| codeql-go-tests/function.NodeConstraint | 0 | TP116 | interface { } | -| codeql-go-tests/function.multipleAnonymousTypeParamsFunc | 0 | _ | interface { } | +| codeql-go-tests/function.NodeConstraint | 0 | TP116 | any | +| codeql-go-tests/function.multipleAnonymousTypeParamsFunc | 0 | _ | any | | codeql-go-tests/function.multipleAnonymousTypeParamsFunc | 1 | _ | interface { string } | -| codeql-go-tests/function.multipleAnonymousTypeParamsFunc | 2 | _ | interface { } | -| codeql-go-tests/function.multipleAnonymousTypeParamsType | 0 | _ | interface { } | +| codeql-go-tests/function.multipleAnonymousTypeParamsFunc | 2 | _ | any | +| codeql-go-tests/function.multipleAnonymousTypeParamsType | 0 | _ | any | | codeql-go-tests/function.multipleAnonymousTypeParamsType | 1 | _ | interface { string } | -| codeql-go-tests/function.multipleAnonymousTypeParamsType | 2 | _ | interface { } | -| codeql-go-tests/function.multipleAnonymousTypeParamsType.f | 0 | _ | interface { } | +| codeql-go-tests/function.multipleAnonymousTypeParamsType | 2 | _ | any | +| codeql-go-tests/function.multipleAnonymousTypeParamsType.f | 0 | _ | any | | codeql-go-tests/function.multipleAnonymousTypeParamsType.f | 1 | _ | interface { string } | -| codeql-go-tests/function.multipleAnonymousTypeParamsType.f | 2 | _ | interface { } | -| github.com/anotherpkg.GenericFunctionInAnotherPackage | 0 | T | interface { } | -| internal/abi.Escape | 0 | T | interface { } | +| codeql-go-tests/function.multipleAnonymousTypeParamsType.f | 2 | _ | any | +| github.com/anotherpkg.GenericFunctionInAnotherPackage | 0 | T | any | +| internal/abi.Escape | 0 | T | any | | internal/bytealg.HashStr | 0 | T | interface { string \| []uint8 } | | internal/bytealg.HashStrRev | 0 | T | interface { string \| []uint8 } | | internal/bytealg.IndexRabinKarp | 0 | T | interface { string \| []uint8 } | | internal/bytealg.LastIndexRabinKarp | 0 | T | interface { string \| []uint8 } | -| internal/runtime/atomic.Pointer.CompareAndSwap | 0 | T | interface { } | -| internal/runtime/atomic.Pointer.CompareAndSwapNoWB | 0 | T | interface { } | -| internal/runtime/atomic.Pointer.Load | 0 | T | interface { } | -| internal/runtime/atomic.Pointer.Store | 0 | T | interface { } | -| internal/runtime/atomic.Pointer.StoreNoWB | 0 | T | interface { } | -| iter.Pull | 0 | V | interface { } | -| iter.Pull2 | 0 | K | interface { } | -| iter.Pull2 | 1 | V | interface { } | -| iter.Seq | 0 | V | interface { } | -| iter.Seq2 | 0 | K | interface { } | -| iter.Seq2 | 1 | V | interface { } | +| internal/runtime/atomic.Pointer.CompareAndSwap | 0 | T | any | +| internal/runtime/atomic.Pointer.CompareAndSwapNoWB | 0 | T | any | +| internal/runtime/atomic.Pointer.Load | 0 | T | any | +| internal/runtime/atomic.Pointer.Store | 0 | T | any | +| internal/runtime/atomic.Pointer.StoreNoWB | 0 | T | any | +| iter.Pull | 0 | V | any | +| iter.Pull2 | 0 | K | any | +| iter.Pull2 | 1 | V | any | +| iter.Seq | 0 | V | any | +| iter.Seq2 | 0 | K | any | +| iter.Seq2 | 1 | V | any | | reflect.rangeNum | 1 | N | interface { int64 \| uint64 } | | runtime.fandbits | 0 | F | floaty | | runtime.fmax | 0 | F | floaty | | runtime.fmin | 0 | F | floaty | | runtime.forbits | 0 | F | floaty | -| runtime.noEscapePtr | 0 | T | interface { } | +| runtime.noEscapePtr | 0 | T | any | | slices.All | 0 | Slice | interface { ~[]E } | -| slices.All | 1 | E | interface { } | +| slices.All | 1 | E | any | | slices.AppendSeq | 0 | Slice | interface { ~[]E } | -| slices.AppendSeq | 1 | E | interface { } | +| slices.AppendSeq | 1 | E | any | | slices.Backward | 0 | Slice | interface { ~[]E } | -| slices.Backward | 1 | E | interface { } | +| slices.Backward | 1 | E | any | | slices.BinarySearch | 0 | S | interface { ~[]E } | | slices.BinarySearch | 1 | E | Ordered | | slices.BinarySearchFunc | 0 | S | interface { ~[]E } | -| slices.BinarySearchFunc | 1 | E | interface { } | -| slices.BinarySearchFunc | 2 | T | interface { } | +| slices.BinarySearchFunc | 1 | E | any | +| slices.BinarySearchFunc | 2 | T | any | | slices.Chunk | 0 | Slice | interface { ~[]E } | -| slices.Chunk | 1 | E | interface { } | +| slices.Chunk | 1 | E | any | | slices.Clip | 0 | S | interface { ~[]E } | -| slices.Clip | 1 | E | interface { } | +| slices.Clip | 1 | E | any | | slices.Clone | 0 | S | interface { ~[]E } | -| slices.Clone | 1 | E | interface { } | -| slices.Collect | 0 | E | interface { } | +| slices.Clone | 1 | E | any | +| slices.Collect | 0 | E | any | | slices.Compact | 0 | S | interface { ~[]E } | | slices.Compact | 1 | E | comparable | | slices.CompactFunc | 0 | S | interface { ~[]E } | -| slices.CompactFunc | 1 | E | interface { } | +| slices.CompactFunc | 1 | E | any | | slices.Compare | 0 | S | interface { ~[]E } | | slices.Compare | 1 | E | Ordered | | slices.CompareFunc | 0 | S1 | interface { ~[]E1 } | | slices.CompareFunc | 1 | S2 | interface { ~[]E2 } | -| slices.CompareFunc | 2 | E1 | interface { } | -| slices.CompareFunc | 3 | E2 | interface { } | +| slices.CompareFunc | 2 | E1 | any | +| slices.CompareFunc | 3 | E2 | any | | slices.Concat | 0 | S | interface { ~[]E } | -| slices.Concat | 1 | E | interface { } | +| slices.Concat | 1 | E | any | | slices.Contains | 0 | S | interface { ~[]E } | | slices.Contains | 1 | E | comparable | | slices.ContainsFunc | 0 | S | interface { ~[]E } | -| slices.ContainsFunc | 1 | E | interface { } | +| slices.ContainsFunc | 1 | E | any | | slices.Delete | 0 | S | interface { ~[]E } | -| slices.Delete | 1 | E | interface { } | +| slices.Delete | 1 | E | any | | slices.DeleteFunc | 0 | S | interface { ~[]E } | -| slices.DeleteFunc | 1 | E | interface { } | +| slices.DeleteFunc | 1 | E | any | | slices.Equal | 0 | S | interface { ~[]E } | | slices.Equal | 1 | E | comparable | | slices.EqualFunc | 0 | S1 | interface { ~[]E1 } | | slices.EqualFunc | 1 | S2 | interface { ~[]E2 } | -| slices.EqualFunc | 2 | E1 | interface { } | -| slices.EqualFunc | 3 | E2 | interface { } | +| slices.EqualFunc | 2 | E1 | any | +| slices.EqualFunc | 3 | E2 | any | | slices.Grow | 0 | S | interface { ~[]E } | -| slices.Grow | 1 | E | interface { } | +| slices.Grow | 1 | E | any | | slices.Index | 0 | S | interface { ~[]E } | | slices.Index | 1 | E | comparable | | slices.IndexFunc | 0 | S | interface { ~[]E } | -| slices.IndexFunc | 1 | E | interface { } | +| slices.IndexFunc | 1 | E | any | | slices.Insert | 0 | S | interface { ~[]E } | -| slices.Insert | 1 | E | interface { } | +| slices.Insert | 1 | E | any | | slices.IsSorted | 0 | S | interface { ~[]E } | | slices.IsSorted | 1 | E | Ordered | | slices.IsSortedFunc | 0 | S | interface { ~[]E } | -| slices.IsSortedFunc | 1 | E | interface { } | +| slices.IsSortedFunc | 1 | E | any | | slices.Max | 0 | S | interface { ~[]E } | | slices.Max | 1 | E | Ordered | | slices.MaxFunc | 0 | S | interface { ~[]E } | -| slices.MaxFunc | 1 | E | interface { } | +| slices.MaxFunc | 1 | E | any | | slices.Min | 0 | S | interface { ~[]E } | | slices.Min | 1 | E | Ordered | | slices.MinFunc | 0 | S | interface { ~[]E } | -| slices.MinFunc | 1 | E | interface { } | +| slices.MinFunc | 1 | E | any | | slices.Repeat | 0 | S | interface { ~[]E } | -| slices.Repeat | 1 | E | interface { } | +| slices.Repeat | 1 | E | any | | slices.Replace | 0 | S | interface { ~[]E } | -| slices.Replace | 1 | E | interface { } | +| slices.Replace | 1 | E | any | | slices.Reverse | 0 | S | interface { ~[]E } | -| slices.Reverse | 1 | E | interface { } | +| slices.Reverse | 1 | E | any | | slices.Sort | 0 | S | interface { ~[]E } | | slices.Sort | 1 | E | Ordered | | slices.SortFunc | 0 | S | interface { ~[]E } | -| slices.SortFunc | 1 | E | interface { } | +| slices.SortFunc | 1 | E | any | | slices.SortStableFunc | 0 | S | interface { ~[]E } | -| slices.SortStableFunc | 1 | E | interface { } | +| slices.SortStableFunc | 1 | E | any | | slices.Sorted | 0 | E | Ordered | -| slices.SortedFunc | 0 | E | interface { } | -| slices.SortedStableFunc | 0 | E | interface { } | +| slices.SortedFunc | 0 | E | any | +| slices.SortedStableFunc | 0 | E | any | | slices.Values | 0 | Slice | interface { ~[]E } | -| slices.Values | 1 | E | interface { } | -| slices.breakPatternsCmpFunc | 0 | E | interface { } | +| slices.Values | 1 | E | any | +| slices.breakPatternsCmpFunc | 0 | E | any | | slices.breakPatternsOrdered | 0 | E | Ordered | -| slices.choosePivotCmpFunc | 0 | E | interface { } | +| slices.choosePivotCmpFunc | 0 | E | any | | slices.choosePivotOrdered | 0 | E | Ordered | -| slices.heapSortCmpFunc | 0 | E | interface { } | +| slices.heapSortCmpFunc | 0 | E | any | | slices.heapSortOrdered | 0 | E | Ordered | -| slices.insertionSortCmpFunc | 0 | E | interface { } | +| slices.insertionSortCmpFunc | 0 | E | any | | slices.insertionSortOrdered | 0 | E | Ordered | | slices.isNaN | 0 | T | Ordered | -| slices.medianAdjacentCmpFunc | 0 | E | interface { } | +| slices.medianAdjacentCmpFunc | 0 | E | any | | slices.medianAdjacentOrdered | 0 | E | Ordered | -| slices.medianCmpFunc | 0 | E | interface { } | +| slices.medianCmpFunc | 0 | E | any | | slices.medianOrdered | 0 | E | Ordered | -| slices.order2CmpFunc | 0 | E | interface { } | +| slices.order2CmpFunc | 0 | E | any | | slices.order2Ordered | 0 | E | Ordered | -| slices.overlaps | 0 | E | interface { } | -| slices.partialInsertionSortCmpFunc | 0 | E | interface { } | +| slices.overlaps | 0 | E | any | +| slices.partialInsertionSortCmpFunc | 0 | E | any | | slices.partialInsertionSortOrdered | 0 | E | Ordered | -| slices.partitionCmpFunc | 0 | E | interface { } | -| slices.partitionEqualCmpFunc | 0 | E | interface { } | +| slices.partitionCmpFunc | 0 | E | any | +| slices.partitionEqualCmpFunc | 0 | E | any | | slices.partitionEqualOrdered | 0 | E | Ordered | | slices.partitionOrdered | 0 | E | Ordered | -| slices.pdqsortCmpFunc | 0 | E | interface { } | +| slices.pdqsortCmpFunc | 0 | E | any | | slices.pdqsortOrdered | 0 | E | Ordered | -| slices.reverseRangeCmpFunc | 0 | E | interface { } | +| slices.reverseRangeCmpFunc | 0 | E | any | | slices.reverseRangeOrdered | 0 | E | Ordered | -| slices.rotateCmpFunc | 0 | E | interface { } | -| slices.rotateLeft | 0 | E | interface { } | +| slices.rotateCmpFunc | 0 | E | any | +| slices.rotateLeft | 0 | E | any | | slices.rotateOrdered | 0 | E | Ordered | -| slices.rotateRight | 0 | E | interface { } | -| slices.siftDownCmpFunc | 0 | E | interface { } | +| slices.rotateRight | 0 | E | any | +| slices.siftDownCmpFunc | 0 | E | any | | slices.siftDownOrdered | 0 | E | Ordered | -| slices.stableCmpFunc | 0 | E | interface { } | +| slices.stableCmpFunc | 0 | E | any | | slices.stableOrdered | 0 | E | Ordered | -| slices.startIdx | 0 | E | interface { } | -| slices.swapRangeCmpFunc | 0 | E | interface { } | +| slices.startIdx | 0 | E | any | +| slices.swapRangeCmpFunc | 0 | E | any | | slices.swapRangeOrdered | 0 | E | Ordered | -| slices.symMergeCmpFunc | 0 | E | interface { } | +| slices.symMergeCmpFunc | 0 | E | any | | slices.symMergeOrdered | 0 | E | Ordered | | strconv.bsearch | 0 | S | interface { ~[]E } | | strconv.bsearch | 1 | E | interface { ~uint16 \| ~uint32 } | -| sync.OnceValue | 0 | T | interface { } | -| sync.OnceValues | 0 | T1 | interface { } | -| sync.OnceValues | 1 | T2 | interface { } | -| sync/atomic.Pointer | 0 | T | interface { } | -| sync/atomic.Pointer.CompareAndSwap | 0 | T | interface { } | -| sync/atomic.Pointer.Load | 0 | T | interface { } | -| sync/atomic.Pointer.Store | 0 | T | interface { } | -| sync/atomic.Pointer.Swap | 0 | T | interface { } | +| sync.OnceValue | 0 | T | any | +| sync.OnceValues | 0 | T1 | any | +| sync.OnceValues | 1 | T2 | any | +| sync/atomic.Pointer | 0 | T | any | +| sync/atomic.Pointer.CompareAndSwap | 0 | T | any | +| sync/atomic.Pointer.Load | 0 | T | any | +| sync/atomic.Pointer.Store | 0 | T | any | +| sync/atomic.Pointer.Swap | 0 | T | any | | time.atoi | 0 | bytes | interface { []uint8 \| string } | | time.isDigit | 0 | bytes | interface { []uint8 \| string } | | time.leadingInt | 0 | bytes | interface { []uint8 \| string } | 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 43fd11cbfaada..e4cfa8faa18ea 100644 --- a/go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expected +++ b/go/ql/test/library-tests/semmle/go/Function/getTypeParameter.expected @@ -1,21 +1,21 @@ -| 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 | interface { } | -| 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 | interface { } | +| 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 | interface { } | -| 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 | interface { } | -| 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 | interface { } | -| 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 | interface { } | -| 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 | interface { } | -| 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 | 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 | -| genericFunctions.go:158:1:158:65 | function declaration | FuncDecl | 0 | genericFunctions.go:158:38:158:42 | type parameter declaration | 0 | genericFunctions.go:158:38:158:38 | _ | genericFunctions.go:158:40:158:42 | any | interface { } | +| genericFunctions.go:158:1:158:65 | function declaration | FuncDecl | 0 | genericFunctions.go:158:38:158:42 | type parameter declaration | 0 | genericFunctions.go:158:38:158:38 | _ | genericFunctions.go:158:40:158:42 | any | any | | genericFunctions.go:158:1:158:65 | function declaration | FuncDecl | 1 | genericFunctions.go:158:45:158:52 | type parameter declaration | 0 | genericFunctions.go:158:45:158:45 | _ | genericFunctions.go:158:47:158:52 | string | interface { string } | -| genericFunctions.go:158:1:158:65 | function declaration | FuncDecl | 2 | genericFunctions.go:158:55:158:59 | type parameter declaration | 0 | genericFunctions.go:158:55:158:55 | _ | genericFunctions.go:158:57:158:59 | any | interface { } | -| genericFunctions.go:160:6:160:69 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:160:38:160:42 | type parameter declaration | 0 | genericFunctions.go:160:38:160:38 | _ | genericFunctions.go:160:40:160:42 | any | interface { } | +| genericFunctions.go:158:1:158:65 | function declaration | FuncDecl | 2 | genericFunctions.go:158:55:158:59 | type parameter declaration | 0 | genericFunctions.go:158:55:158:55 | _ | genericFunctions.go:158:57:158:59 | any | any | +| genericFunctions.go:160:6:160:69 | type declaration specifier | TypeSpec | 0 | genericFunctions.go:160:38:160:42 | type parameter declaration | 0 | genericFunctions.go:160:38:160:38 | _ | genericFunctions.go:160:40:160:42 | any | any | | genericFunctions.go:160:6:160:69 | type declaration specifier | TypeSpec | 1 | genericFunctions.go:160:45:160:52 | type parameter declaration | 0 | genericFunctions.go:160:45:160:45 | _ | genericFunctions.go:160:47:160:52 | string | interface { string } | -| genericFunctions.go:160:6:160:69 | type declaration specifier | TypeSpec | 2 | genericFunctions.go:160:55:160:59 | type parameter declaration | 0 | genericFunctions.go:160:55:160:55 | _ | genericFunctions.go:160:57:160:59 | any | interface { } | +| genericFunctions.go:160:6:160:69 | type declaration specifier | TypeSpec | 2 | genericFunctions.go:160:55:160:59 | type parameter declaration | 0 | genericFunctions.go:160:55:160:55 | _ | genericFunctions.go:160:57:160:59 | any | any | diff --git a/go/ql/test/library-tests/semmle/go/Types/Aliases.expected b/go/ql/test/library-tests/semmle/go/Types/Aliases.expected index 2c09dd790a565..0a97495cfa83b 100644 --- a/go/ql/test/library-tests/semmle/go/Types/Aliases.expected +++ b/go/ql/test/library-tests/semmle/go/Types/Aliases.expected @@ -1,20 +1,20 @@ entities -| aliases.go | aliases.go:3:6:3:13 | aliasesX | 1 | file://:0:0:0:0 | int | -| aliases.go | aliases.go:4:6:4:13 | aliasesY | 1 | file://:0:0:0:0 | int | -| aliases.go | aliases.go:6:6:6:14 | aliasesS1 | 1 | file://:0:0:0:0 | struct type | -| aliases.go | aliases.go:6:26:6:26 | x | 3 | file://:0:0:0:0 | int | -| aliases.go | aliases.go:8:6:8:14 | aliasesS2 | 1 | file://:0:0:0:0 | struct type | -| aliases.go | aliases.go:8:26:8:26 | x | 3 | file://:0:0:0:0 | int | +| aliases.go | aliases.go:3:6:3:13 | aliasesX | 1 | aliases.go:3:6:3:13 | aliasesX | +| aliases.go | aliases.go:4:6:4:13 | aliasesY | 1 | aliases.go:4:6:4:13 | aliasesY | +| aliases.go | aliases.go:6:6:6:14 | aliasesS1 | 1 | aliases.go:6:6:6:14 | aliasesS1 | +| aliases.go | aliases.go:6:26:6:26 | x | 1 | aliases.go:3:6:3:13 | aliasesX | +| aliases.go | aliases.go:8:6:8:14 | aliasesS2 | 1 | aliases.go:8:6:8:14 | aliasesS2 | +| aliases.go | aliases.go:8:26:8:26 | x | 1 | aliases.go:4:6:4:13 | aliasesY | | aliases.go | aliases.go:10:6:10:6 | F | 1 | file://:0:0:0:0 | signature type | -| aliases.go | aliases.go:10:8:10:11 | Afs1 | 1 | file://:0:0:0:0 | struct type | +| aliases.go | aliases.go:10:8:10:11 | Afs1 | 1 | aliases.go:6:6:6:14 | aliasesS1 | | aliases.go | aliases.go:14:6:14:6 | G | 1 | file://:0:0:0:0 | signature type | -| aliases.go | aliases.go:14:8:14:11 | Afs2 | 1 | file://:0:0:0:0 | struct type | +| aliases.go | aliases.go:14:8:14:11 | Afs2 | 1 | aliases.go:8:6:8:14 | aliasesS2 | | aliases.go | aliases.go:19:6:19:7 | S3 | 1 | aliases.go:19:6:19:7 | S3 | -| aliases.go | aliases.go:19:17:19:17 | x | 3 | file://:0:0:0:0 | int | -| aliases.go | aliases.go:22:6:22:6 | T | 1 | aliases.go:19:6:19:7 | S3 | +| aliases.go | aliases.go:19:17:19:17 | x | 1 | file://:0:0:0:0 | int | +| aliases.go | aliases.go:22:6:22:6 | T | 1 | aliases.go:22:6:22:6 | T | | aliases.go | aliases.go:25:6:25:6 | H | 1 | file://:0:0:0:0 | signature type | -| aliases.go | aliases.go:25:8:25:11 | Afs3 | 1 | aliases.go:19:6:19:7 | S3 | +| aliases.go | aliases.go:25:8:25:11 | Afs3 | 1 | aliases.go:22:6:22:6 | T | #select -| F | func(struct { x int }) int | -| G | func(struct { x int }) int | -| H | func(S3) int | +| F | func(aliasesS1) int | +| G | func(aliasesS2) int | +| H | func(T) int | diff --git a/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName2.expected b/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName2.expected index e7ffe6bc1ba64..c202f19c737f3 100644 --- a/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName2.expected +++ b/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName2.expected @@ -1,6 +1,7 @@ -| aliases.go:6:26:6:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.S3 | x | -| aliases.go:8:26:8:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.S3 | x | +| aliases.go:6:26:6:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.aliasesS1 | x | +| aliases.go:8:26:8:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.aliasesS2 | x | | aliases.go:19:17:19:17 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.S3 | x | +| aliases.go:19:17:19:17 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.T | x | | cyclic.go:4:3:4:3 | s | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.s | s | | cyclic.go:8:3:8:3 | u | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.t | u | | cyclic.go:8:3:8:3 | u | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.u | u | diff --git a/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName3.expected b/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName3.expected index 03b93b37c7475..4fdb1832707c9 100644 --- a/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName3.expected +++ b/go/ql/test/library-tests/semmle/go/Types/Field_hasQualifiedName3.expected @@ -1,6 +1,7 @@ -| aliases.go:6:26:6:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | S3 | x | -| aliases.go:8:26:8:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | S3 | x | +| aliases.go:6:26:6:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | aliasesS1 | x | +| aliases.go:8:26:8:26 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | aliasesS2 | x | | aliases.go:19:17:19:17 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | S3 | x | +| aliases.go:19:17:19:17 | x | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | T | x | | cyclic.go:4:3:4:3 | s | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | s | s | | cyclic.go:8:3:8:3 | u | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | t | u | | cyclic.go:8:3:8:3 | u | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types | u | u | 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 dd6e9021a4f35..78fbecb3389f0 100644 --- a/go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected +++ b/go/ql/test/library-tests/semmle/go/Types/QualifiedNames.expected @@ -1,4 +1,9 @@ +| aliases.go:3:6:3:13 | aliasesX | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.aliasesX | +| aliases.go:4:6:4:13 | aliasesY | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.aliasesY | +| aliases.go:6:6:6:14 | aliasesS1 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.aliasesS1 | +| aliases.go:8:6:8:14 | aliasesS2 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.aliasesS2 | | aliases.go:19:6:19:7 | S3 | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.S3 | +| aliases.go:22:6:22:6 | T | github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types.T | | 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 | @@ -30,7 +35,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/StructFields.expected b/go/ql/test/library-tests/semmle/go/Types/StructFields.expected index 1757e0cdaf95a..eebc14fba8043 100644 --- a/go/ql/test/library-tests/semmle/go/Types/StructFields.expected +++ b/go/ql/test/library-tests/semmle/go/Types/StructFields.expected @@ -1,5 +1,3 @@ -| aliases.go:19:6:19:7 | S3 | aliases.go:6:18:6:37 | struct type | x | int | -| aliases.go:19:6:19:7 | S3 | aliases.go:8:18:8:37 | struct type | x | int | | aliases.go:19:6:19:7 | S3 | aliases.go:19:9:19:23 | struct type | x | int | | cyclic.go:3:6:3:6 | s | cyclic.go:3:8:5:1 | struct type | s | * s | | cyclic.go:7:6:7:6 | t | cyclic.go:7:8:10:1 | struct type | f | int | 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 ab34dd4d8eef3..d64daf5ab9af4 100644 --- a/go/ql/test/library-tests/semmle/go/Types/Types.expected +++ b/go/ql/test/library-tests/semmle/go/Types/Types.expected @@ -1,4 +1,9 @@ +| aliases.go:3:6:3:13 | aliasesX | aliasesX | +| aliases.go:4:6:4:13 | aliasesY | aliasesY | +| aliases.go:6:6:6:14 | aliasesS1 | aliasesS1 | +| aliases.go:8:6:8:14 | aliasesS2 | aliasesS2 | | aliases.go:19:6:19:7 | S3 | S3 | +| aliases.go:22:6:22:6 | T | T | | cyclic.go:3:6:3:6 | s | s | | cyclic.go:7:6:7:6 | t | t | | cyclic.go:12:6:12:6 | u | u | @@ -30,7 +35,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/aliases/DataflowFields/test.expected b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.expected index e69de29bb2d1d..ecbb9b4156a61 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.expected +++ b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.expected @@ -0,0 +1,2 @@ +| embedding.go:30:25:30:62 | comment | Missing result: hasValueFlow="selection of Field" | +| simple.go:24:29:24:66 | comment | Missing result: hasValueFlow="selection of field" | diff --git a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.ql b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.ql index 1b27b27d6dc21..d7f5be78fa763 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.ql +++ b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/test.ql @@ -1,3 +1,38 @@ +/** + * @name LDAP query built from user-controlled sources + * @description Building an LDAP query from user-controlled sources is vulnerable to insertion of + * malicious LDAP code by the user. + * @kind path-problem + * @problem.severity error + * @id go/ldap-injection + * @tags security + * experimental + * external/cwe/cwe-90 + */ + import go -import TestUtilities.InlineFlowTest -import DefaultFlowTest +import MyPartialFlow::PartialPathGraph + +// import TestUtilities.InlineFlowTest +// import DefaultFlowTest +module MyConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node source) { + exists(Function fn | fn.hasQualifiedName(_, ["source", "taint"]) | + source = fn.getACall().getResult() + ) + } + + predicate isSink(DataFlow::Node sink) { + exists(Function fn | fn.hasQualifiedName(_, "sink") | sink = fn.getACall().getAnArgument()) + } +} + +module MyFlow = TaintTracking::Global; + +int explorationLimit() { result = 5 } + +module MyPartialFlow = MyFlow::FlowExplorationFwd; + +from MyPartialFlow::PartialPathNode source, MyPartialFlow::PartialPathNode sink +where MyPartialFlow::partialFlow(source, sink, _) +select sink.getNode(), source, sink, "Sink is reached from $@.", source.getNode(), "here" diff --git a/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.expected b/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.expected index 01635aaf19d43..9647c64d12ca3 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.expected +++ b/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.expected @@ -14,15 +14,28 @@ callTargets | test.go:57:2:57:29 | call to ImplementMe | test.go:53:1:53:85 | function declaration | ImplementMe | #select | file://:0:0:0:0 | basic interface type | * Impl1 | +| file://:0:0:0:0 | basic interface type | * Impl1 | +| file://:0:0:0:0 | basic interface type | * Impl2 | | file://:0:0:0:0 | basic interface type | * Impl2 | | file://:0:0:0:0 | basic interface type | * Impl3 | +| file://:0:0:0:0 | basic interface type | * Impl3 | | file://:0:0:0:0 | basic interface type | * Impl4 | +| file://:0:0:0:0 | basic interface type | * Impl4 | +| file://:0:0:0:0 | basic interface type | * Impl5 | | file://:0:0:0:0 | basic interface type | * Impl5 | -| file://:0:0:0:0 | basic interface type | * Impl6 | +| file://:0:0:0:0 | basic interface type | Impl1 | | file://:0:0:0:0 | basic interface type | Impl1 | | file://:0:0:0:0 | basic interface type | Impl2 | +| file://:0:0:0:0 | basic interface type | Impl2 | +| file://:0:0:0:0 | basic interface type | Impl3 | | file://:0:0:0:0 | basic interface type | Impl3 | | file://:0:0:0:0 | basic interface type | Impl4 | +| file://:0:0:0:0 | basic interface type | Impl4 | | file://:0:0:0:0 | basic interface type | Impl5 | -| file://:0:0:0:0 | basic interface type | Impl6 | +| file://:0:0:0:0 | basic interface type | Impl5 | +| file://:0:0:0:0 | basic interface type | Impl6Alias | +| file://:0:0:0:0 | basic interface type | Impl6Alias | +| file://:0:0:0:0 | basic interface type | interface { ImplementMe func(func(struct { x IntAlias }) ) } | +| file://:0:0:0:0 | basic interface type | interface { ImplementMe func(func(struct { x IntAlias }) ) } | +| file://:0:0:0:0 | basic interface type | interface { ImplementMe func(func(struct { x int }) ) } | | file://:0:0:0:0 | basic interface type | interface { ImplementMe func(func(struct { x int }) ) } | diff --git a/go/ql/test/library-tests/semmle/go/aliases/MethodDefs/test.expected b/go/ql/test/library-tests/semmle/go/aliases/MethodDefs/test.expected index 71cd13704370b..83e097fcf6de3 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/MethodDefs/test.expected +++ b/go/ql/test/library-tests/semmle/go/aliases/MethodDefs/test.expected @@ -1,19 +1,19 @@ distinctDefinedFs -| 2 | +| 4 | declaredEntities | methods.go:5:6:5:13 | IntAlias (1 declaration sites) | | methods.go:7:6:7:7 | S1 (1 declaration sites) | -| methods.go:7:19:7:19 | x (2 declaration sites) | +| methods.go:7:19:7:19 | x (1 declaration sites) | | methods.go:8:6:8:7 | S2 (1 declaration sites) | -| methods.go:8:19:8:19 | x (2 declaration sites) | +| methods.go:8:19:8:19 | x (1 declaration sites) | | methods.go:10:6:10:7 | I1 (1 declaration sites) | -| methods.go:10:22:10:22 | F (2 declaration sites) | +| methods.go:10:22:10:22 | F (1 declaration sites) | | methods.go:11:6:11:7 | I2 (1 declaration sites) | -| methods.go:11:22:11:22 | F (2 declaration sites) | +| methods.go:11:22:11:22 | F (1 declaration sites) | | methods.go:12:6:12:7 | I3 (1 declaration sites) | -| methods.go:12:22:12:22 | F (2 declaration sites) | +| methods.go:12:22:12:22 | F (1 declaration sites) | | methods.go:13:6:13:7 | I4 (1 declaration sites) | -| methods.go:13:22:13:22 | F (2 declaration sites) | +| methods.go:13:22:13:22 | F (1 declaration sites) | | methods.go:15:6:15:10 | Test1 (1 declaration sites) | | methods.go:15:12:15:17 | param1 (1 declaration sites) | | methods.go:15:23:15:28 | param2 (1 declaration sites) | diff --git a/go/ql/test/library-tests/semmle/go/aliases/defsuses/test.expected b/go/ql/test/library-tests/semmle/go/aliases/defsuses/test.expected index aa9c3ef213a8a..7fd98f92adc2e 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/defsuses/test.expected +++ b/go/ql/test/library-tests/semmle/go/aliases/defsuses/test.expected @@ -1,11 +1,9 @@ lowLevelDefs | defsuses.go:6:6:6:13 | IntAlias | defsuses.go:6:6:6:13 | IntAlias (1 declaration sites) | | defsuses.go:8:6:8:7 | S1 | defsuses.go:8:6:8:7 | S1 (1 declaration sites) | -| defsuses.go:8:19:8:19 | x | defsuses.go:8:19:8:19 | x (2 declaration sites) | -| defsuses.go:8:19:8:19 | x | defsuses.go:9:19:9:19 | x (2 declaration sites) | +| defsuses.go:8:19:8:19 | x | defsuses.go:8:19:8:19 | x (1 declaration sites) | | defsuses.go:9:6:9:7 | S2 | defsuses.go:9:6:9:7 | S2 (1 declaration sites) | -| defsuses.go:9:19:9:19 | x | defsuses.go:8:19:8:19 | x (2 declaration sites) | -| defsuses.go:9:19:9:19 | x | defsuses.go:9:19:9:19 | x (2 declaration sites) | +| defsuses.go:9:19:9:19 | x | defsuses.go:9:19:9:19 | x (1 declaration sites) | | defsuses.go:11:6:11:10 | Test1 | defsuses.go:11:6:11:10 | Test1 (1 declaration sites) | | defsuses.go:12:2:12:4 | obj | defsuses.go:12:2:12:4 | obj (1 declaration sites) | | defsuses.go:15:6:15:8 | ptr | defsuses.go:15:6:15:8 | ptr (1 declaration sites) | @@ -16,18 +14,14 @@ lowLevelUses | defsuses.go:11:14:11:16 | int | file://:0:0:0:0 | int (0 declaration sites) | | defsuses.go:12:9:12:10 | S1 | defsuses.go:8:6:8:7 | S1 (1 declaration sites) | | defsuses.go:13:2:13:4 | obj | defsuses.go:12:2:12:4 | obj (1 declaration sites) | -| defsuses.go:13:6:13:6 | x | defsuses.go:8:19:8:19 | x (2 declaration sites) | -| defsuses.go:13:6:13:6 | x | defsuses.go:9:19:9:19 | x (2 declaration sites) | +| defsuses.go:13:6:13:6 | x | defsuses.go:8:19:8:19 | x (1 declaration sites) | | defsuses.go:15:11:15:12 | S2 | defsuses.go:9:6:9:7 | S2 (1 declaration sites) | | defsuses.go:16:2:16:4 | ptr | defsuses.go:15:6:15:8 | ptr (1 declaration sites) | | defsuses.go:16:9:16:11 | obj | defsuses.go:12:2:12:4 | obj (1 declaration sites) | | defsuses.go:18:9:18:11 | ptr | defsuses.go:15:6:15:8 | ptr (1 declaration sites) | -| defsuses.go:18:13:18:13 | x | defsuses.go:8:19:8:19 | x (2 declaration sites) | -| defsuses.go:18:13:18:13 | x | defsuses.go:9:19:9:19 | x (2 declaration sites) | +| defsuses.go:18:13:18:13 | x | defsuses.go:9:19:9:19 | x (1 declaration sites) | distinctDefinedXs -| 1 | +| 2 | distinctUsedXs -| 1 | +| 2 | fieldUseUsePairs -| defsuses.go:13:6:13:6 | x | defsuses.go:18:13:18:13 | x | -| defsuses.go:18:13:18:13 | x | defsuses.go:13:6:13:6 | x |