From 81e85010f900a49f7fced559196166a2f982c335 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 20 Mar 2025 12:30:57 +0000 Subject: [PATCH 001/372] List subpackages in vendor/modules.txt These were all generated by running depstubber. --- go/ql/test/experimental/CWE-285/vendor/modules.txt | 2 +- go/ql/test/experimental/CWE-321-V2/vendor/modules.txt | 2 +- .../CWE-522-DecompressionBombs/vendor/modules.txt | 11 +++++++++-- .../semmle/go/concepts/LoggerCall/vendor/modules.txt | 5 ----- .../semmle/go/frameworks/Beego/vendor/modules.txt | 6 +++++- .../go/frameworks/ElazarlGoproxy/vendor/modules.txt | 1 + .../semmle/go/frameworks/Email/vendor/modules.txt | 2 +- .../semmle/go/frameworks/Gin/vendor/modules.txt | 1 + .../semmle/go/frameworks/GoMicro/vendor/modules.txt | 7 ++++++- .../semmle/go/frameworks/Iris/vendor/modules.txt | 2 +- .../go/frameworks/K8sIoApiCoreV1/vendor/modules.txt | 5 +++-- .../K8sIoApimachineryPkgRuntime/vendor/modules.txt | 4 +++- .../go/frameworks/K8sIoClientGo/vendor/modules.txt | 2 +- .../semmle/go/frameworks/NoSQL/vendor/modules.txt | 7 ++++--- .../semmle/go/frameworks/Revel/vendor/modules.txt | 4 +++- .../semmle/go/frameworks/SQL/gogf/vendor/modules.txt | 3 ++- .../semmle/go/frameworks/Spew/vendor/modules.txt | 2 +- .../SystemCommandExecutors/vendor/modules.txt | 2 +- .../semmle/go/frameworks/WebSocket/vendor/modules.txt | 2 +- .../semmle/go/frameworks/Zap/vendor/modules.txt | 1 + .../IncompleteHostnameRegexp/vendor/modules.txt | 2 -- .../query-tests/Security/CWE-079/vendor/modules.txt | 2 +- .../query-tests/Security/CWE-089/vendor/modules.txt | 4 +++- .../query-tests/Security/CWE-312/vendor/modules.txt | 5 +++-- .../query-tests/Security/CWE-347/vendor/modules.txt | 2 +- .../query-tests/Security/CWE-640/vendor/modules.txt | 2 +- .../query-tests/Security/CWE-643/vendor/modules.txt | 6 ++++-- .../query-tests/Security/CWE-798/vendor/modules.txt | 6 +++--- .../query-tests/Security/CWE-918/vendor/modules.txt | 2 +- 29 files changed, 63 insertions(+), 39 deletions(-) diff --git a/go/ql/test/experimental/CWE-285/vendor/modules.txt b/go/ql/test/experimental/CWE-285/vendor/modules.txt index 5ad327e8bb5..8de84fbd85d 100644 --- a/go/ql/test/experimental/CWE-285/vendor/modules.txt +++ b/go/ql/test/experimental/CWE-285/vendor/modules.txt @@ -1,3 +1,3 @@ # github.com/msteinert/pam v1.0.0 ## explicit -github.com/msteinert/pam \ No newline at end of file +github.com/msteinert/pam diff --git a/go/ql/test/experimental/CWE-321-V2/vendor/modules.txt b/go/ql/test/experimental/CWE-321-V2/vendor/modules.txt index eedc2bbfc92..015b30ce9a2 100644 --- a/go/ql/test/experimental/CWE-321-V2/vendor/modules.txt +++ b/go/ql/test/experimental/CWE-321-V2/vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/go-jose/go-jose/v3 v3.0.0 ## explicit -github.com/go-jose/go-jose/v3 +github.com/go-jose/go-jose/v3/jwt # github.com/golang-jwt/jwt/v5 v5.0.0 ## explicit github.com/golang-jwt/jwt/v5 diff --git a/go/ql/test/experimental/CWE-522-DecompressionBombs/vendor/modules.txt b/go/ql/test/experimental/CWE-522-DecompressionBombs/vendor/modules.txt index 92976a6e7e9..228cc0e318d 100644 --- a/go/ql/test/experimental/CWE-522-DecompressionBombs/vendor/modules.txt +++ b/go/ql/test/experimental/CWE-522-DecompressionBombs/vendor/modules.txt @@ -3,13 +3,20 @@ github.com/DataDog/zstd # github.com/dsnet/compress v0.0.1 ## explicit -github.com/dsnet/compress +github.com/dsnet/compress/bzip2 +github.com/dsnet/compress/flate # github.com/golang/snappy v0.0.4 ## explicit github.com/golang/snappy # github.com/klauspost/compress v1.16.6 ## explicit -github.com/klauspost/compress +github.com/klauspost/compress/zstd +github.com/klauspost/compress/snappy +github.com/klauspost/compress/s2 +github.com/klauspost/compress/zlib +github.com/klauspost/compress/zip +github.com/klauspost/compress/flate +github.com/klauspost/compress/gzip # github.com/klauspost/pgzip v1.2.6 ## explicit github.com/klauspost/pgzip diff --git a/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/modules.txt index c20671b4194..da35ae80c08 100644 --- a/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/modules.txt @@ -1,14 +1,9 @@ -# github.com/github/depstubber v0.0.0-20200916130315-f3217697abd4 -## explicit # github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b ## explicit github.com/golang/glog # github.com/sirupsen/logrus v1.7.0 ## explicit github.com/sirupsen/logrus -# golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 -golang.org/x/sys/unix -golang.org/x/sys/windows # k8s.io/klog v1.0.0 ## explicit k8s.io/klog diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt index bb2db0e47da..2ec05197130 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt @@ -1,6 +1,10 @@ # github.com/astaxie/beego v1.12.3 ## explicit +github.com/astaxie/beego/utils github.com/astaxie/beego +github.com/astaxie/beego/context +github.com/astaxie/beego/logs # github.com/beego/beego/v2 v2.1.2 ## explicit -github.com/beego/beego/v2 +github.com/beego/beego/v2/server/web +github.com/beego/beego/v2/server/web/context diff --git a/go/ql/test/library-tests/semmle/go/frameworks/ElazarlGoproxy/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/ElazarlGoproxy/vendor/modules.txt index bf027718a74..d560618b74d 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/ElazarlGoproxy/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/ElazarlGoproxy/vendor/modules.txt @@ -3,3 +3,4 @@ github.com/elazarl/goproxy # github.com/github/depstubber v0.0.0-20201214172518-12c3da4b7c9d ## explicit +github.com/github/depstubber diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt index 4b7525957df..c964e33b1f6 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/modules.txt @@ -1,3 +1,3 @@ # github.com/sendgrid/sendgrid-go v3.5.0+incompatible ## explicit -github.com/sendgrid/sendgrid-go +github.com/sendgrid/sendgrid-go/helpers/mail diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Gin/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Gin/vendor/modules.txt index 5f2816316f4..4d249b53d1a 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Gin/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Gin/vendor/modules.txt @@ -1,3 +1,4 @@ # github.com/gin-gonic/gin v1.6.2 ## explicit github.com/gin-gonic/gin +github.com/gin-gonic/gin/binding diff --git a/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt index 1884e9622af..4235d352598 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt @@ -1,6 +1,11 @@ # go-micro.dev/v4 v4.10.2 ## explicit +go-micro.dev/v4/api +go-micro.dev/v4/client +go-micro.dev/v4/server go-micro.dev/v4 # google.golang.org/protobuf v1.28.1 ## explicit -google.golang.org/protobuf +google.golang.org/protobuf/proto +google.golang.org/protobuf/reflect/protoreflect +google.golang.org/protobuf/runtime/protoimpl diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Iris/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Iris/vendor/modules.txt index e3c62be74a7..8fdf3c4082d 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Iris/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Iris/vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/kataras/iris/v12 v12.2.5 ## explicit -github.com/kataras/iris/v12 +github.com/kataras/iris/v12/context # github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 ## explicit github.com/Shopify/goreferrer diff --git a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/modules.txt index bd3ad03a88b..859956613d5 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/modules.txt @@ -1,6 +1,7 @@ # k8s.io/api v0.20.0 ## explicit -k8s.io/api +k8s.io/api/core/v1 +k8s.io/apimachinery/pkg/runtime # k8s.io/apimachinery v0.20.0 ## explicit -k8s.io/apimachinery +k8s.io/apimachinery/pkg/runtime diff --git a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/modules.txt index 007fe13b0de..59d5b5f7464 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/modules.txt @@ -1,3 +1,5 @@ # k8s.io/apimachinery v0.19.4 ## explicit -k8s.io/apimachinery +k8s.io/apimachinery/pkg/conversion +k8s.io/apimachinery/pkg/runtime +k8s.io/apimachinery/pkg/runtime/schema diff --git a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoClientGo/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoClientGo/vendor/modules.txt index 7c2af624559..3b8636e54ea 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoClientGo/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoClientGo/vendor/modules.txt @@ -18,7 +18,7 @@ golang.org/x/oauth2 golang.org/x/time # k8s.io/client-go v0.19.0 ## explicit -k8s.io/client-go +k8s.io/client-go/kubernetes/typed/core/v1 # k8s.io/utils v0.0.0-20201110183641-67b214c5f920 ## explicit k8s.io/utils diff --git a/go/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/modules.txt index efe6455326a..94d59ce4d62 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/NoSQL/vendor/modules.txt @@ -1,6 +1,3 @@ -# go.mongodb.org/mongo-driver v1.3.2 -## explicit -go.mongodb.org/mongo-driver # github.com/couchbase/gocb/v2 v2.2.0 ## explicit github.com/couchbase/gocb/v2 @@ -10,6 +7,10 @@ github.com/google/uuid # github.com/opentracing/opentracing-go v1.2.0 ## explicit github.com/opentracing/opentracing-go +# go.mongodb.org/mongo-driver v1.3.2 +## explicit +go.mongodb.org/mongo-driver/bson +go.mongodb.org/mongo-driver/mongo # gopkg.in/couchbase/gocb.v1 v1.6.7 ## explicit gopkg.in/couchbase/gocb.v1 diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Revel/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Revel/vendor/modules.txt index fe1af187494..b674df40109 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Revel/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Revel/vendor/modules.txt @@ -3,7 +3,9 @@ github.com/go-stack/stack # github.com/revel/modules v1.0.0 ## explicit -github.com/revel/modules +github.com/revel/modules/orm/gorp/app/controllers +github.com/revel/modules/static/app/controllers # github.com/revel/revel v1.0.0 ## explicit github.com/revel/revel +github.com/revel/revel/logger diff --git a/go/ql/test/library-tests/semmle/go/frameworks/SQL/gogf/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/SQL/gogf/vendor/modules.txt index 72560d0da5e..d3645e863f4 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/SQL/gogf/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/SQL/gogf/vendor/modules.txt @@ -1,6 +1,7 @@ # github.com/gogf/gf v1.16.9 ## explicit -github.com/gogf/gf +github.com/gogf/gf/database/gdb +github.com/gogf/gf/frame/g # github.com/BurntSushi/toml v0.3.1 ## explicit github.com/BurntSushi/toml diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Spew/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Spew/vendor/modules.txt index 9e9ed5edf64..5d0fa4c56ac 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Spew/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Spew/vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/davecgh/go-spew v1.1.1 ## explicit -github.com/davecgh/go-spew +github.com/davecgh/go-spew/spew # github.com/github/depstubber v0.0.0-20200916130315-f3217697abd4 ## explicit github.com/github/depstubber diff --git a/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt index 2fdb2ae4eae..d6e69c7b298 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/modules.txt @@ -3,4 +3,4 @@ github.com/codeskyblue/go-sh # golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 ## explicit -golang.org/x/crypto +golang.org/x/crypto/ssh diff --git a/go/ql/test/library-tests/semmle/go/frameworks/WebSocket/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/WebSocket/vendor/modules.txt index 43950046ca3..ea1d1721a31 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/WebSocket/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/WebSocket/vendor/modules.txt @@ -9,7 +9,7 @@ github.com/gorilla/websocket github.com/sacOO7/gowebsocket # golang.org/x/net v0.0.0-20200505041828-1ed23360d12c ## explicit -golang.org/x/net +golang.org/x/net/websocket # nhooyr.io/websocket v1.8.5 ## explicit nhooyr.io/websocket diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Zap/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Zap/vendor/modules.txt index 81aa5380f12..d6c25845fd4 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Zap/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Zap/vendor/modules.txt @@ -1,3 +1,4 @@ # go.uber.org/zap v1.16.0 ## explicit go.uber.org/zap +go.uber.org/zap/zapcore diff --git a/go/ql/test/query-tests/Security/CWE-020/IncompleteHostnameRegexp/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-020/IncompleteHostnameRegexp/vendor/modules.txt index bf027718a74..a81e0c273fa 100644 --- a/go/ql/test/query-tests/Security/CWE-020/IncompleteHostnameRegexp/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-020/IncompleteHostnameRegexp/vendor/modules.txt @@ -1,5 +1,3 @@ # github.com/elazarl/goproxy v0.0.0-20201021153353-00ad82a08272 ## explicit github.com/elazarl/goproxy -# github.com/github/depstubber v0.0.0-20201214172518-12c3da4b7c9d -## explicit diff --git a/go/ql/test/query-tests/Security/CWE-079/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-079/vendor/modules.txt index 5e59711dd7b..f61f191db59 100644 --- a/go/ql/test/query-tests/Security/CWE-079/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-079/vendor/modules.txt @@ -6,7 +6,7 @@ github.com/gobwas/ws github.com/gorilla/websocket # golang.org/x/net v0.0.0-20200505041828-1ed23360d12c ## explicit -golang.org/x/net +golang.org/x/net/websocket # nhooyr.io/websocket v1.8.5 ## explicit nhooyr.io/websocket diff --git a/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt index ddbc30953a2..b0de76d4f88 100644 --- a/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt @@ -3,4 +3,6 @@ github.com/Masterminds/squirrel # go.mongodb.org/mongo-driver v1.3.3 ## explicit -go.mongodb.org/mongo-driver +go.mongodb.org/mongo-driver/mongo +go.mongodb.org/mongo-driver/mongo/options +go.mongodb.org/mongo-driver/bson diff --git a/go/ql/test/query-tests/Security/CWE-312/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-312/vendor/modules.txt index 23942432702..aa0c56a1a6f 100644 --- a/go/ql/test/query-tests/Security/CWE-312/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-312/vendor/modules.txt @@ -9,7 +9,8 @@ github.com/sirupsen/logrus k8s.io/klog # github.com/golang/protobuf v1.4.2 ## explicit -github.com/golang/protobuf +github.com/golang/protobuf/proto # google.golang.org/protobuf v1.23.0 ## explicit -google.golang.org/protobuf +google.golang.org/protobuf/reflect/protoreflect +google.golang.org/protobuf/runtime/protoimpl diff --git a/go/ql/test/query-tests/Security/CWE-347/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-347/vendor/modules.txt index 01144bc9249..811980fafee 100644 --- a/go/ql/test/query-tests/Security/CWE-347/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-347/vendor/modules.txt @@ -3,7 +3,7 @@ github.com/gin-gonic/gin # github.com/go-jose/go-jose/v3 v3.0.0 ## explicit -github.com/go-jose/go-jose/v3 +github.com/go-jose/go-jose/v3/jwt # github.com/golang-jwt/jwt/v5 v5.0.0 ## explicit github.com/golang-jwt/jwt/v5 diff --git a/go/ql/test/query-tests/Security/CWE-640/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-640/vendor/modules.txt index 4b7525957df..c964e33b1f6 100644 --- a/go/ql/test/query-tests/Security/CWE-640/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-640/vendor/modules.txt @@ -1,3 +1,3 @@ # github.com/sendgrid/sendgrid-go v3.5.0+incompatible ## explicit -github.com/sendgrid/sendgrid-go +github.com/sendgrid/sendgrid-go/helpers/mail diff --git a/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt index 3f70fcb344d..a852f50be92 100644 --- a/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt @@ -1,5 +1,6 @@ # github.com/ChrisTrenkamp/goxpath v0.0.0-20190607011252-c5096ec8773d ## explicit +github.com/ChrisTrenkamp/goxpath/tree github.com/ChrisTrenkamp/goxpath # github.com/antchfx/htmlquery v1.2.2 ## explicit @@ -18,10 +19,11 @@ github.com/antchfx/xpath github.com/go-xmlpath/xmlpath # github.com/jbowtie/gokogiri v0.0.0-20190301021639-37f655d3078f ## explicit -github.com/jbowtie/gokogiri +github.com/jbowtie/gokogiri/xpath +github.com/jbowtie/gokogiri/xml # github.com/lestrrat-go/libxml2 v0.0.0-20231124114421-99c71026c2f5 ## explicit -github.com/lestrrat-go/libxml2 +github.com/lestrrat-go/libxml2/parser # github.com/santhosh-tekuri/xpathparser v1.0.0 ## explicit github.com/santhosh-tekuri/xpathparser diff --git a/go/ql/test/query-tests/Security/CWE-798/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-798/vendor/modules.txt index 61fe07b4540..caa73317d56 100644 --- a/go/ql/test/query-tests/Security/CWE-798/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-798/vendor/modules.txt @@ -6,7 +6,7 @@ github.com/appleboy/gin-jwt/v2 github.com/cristalhq/jwt/v3 # github.com/go-kit/kit v0.12.0 ## explicit -github.com/go-kit/kit +github.com/go-kit/kit/auth/jwt # github.com/gogf/gf-jwt/v2 v2.0.1 ## explicit github.com/gogf/gf-jwt/v2 @@ -18,13 +18,13 @@ github.com/golang-jwt/jwt/v4 github.com/iris-contrib/middleware/jwt # github.com/kataras/iris/v12 v12.2.0 ## explicit -github.com/kataras/iris/v12 +github.com/kataras/iris/v12/middleware/jwt # github.com/kataras/jwt v0.1.8 ## explicit github.com/kataras/jwt # github.com/lestrrat/go-jwx v0.9.1 ## explicit -github.com/lestrrat/go-jwx +github.com/lestrrat/go-jwx/jwk # github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693 ## explicit github.com/square/go-jose/v3 diff --git a/go/ql/test/query-tests/Security/CWE-918/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-918/vendor/modules.txt index 319b30b771b..a440f984681 100644 --- a/go/ql/test/query-tests/Security/CWE-918/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-918/vendor/modules.txt @@ -9,7 +9,7 @@ github.com/gorilla/websocket github.com/sacOO7/gowebsocket # golang.org/x/net v0.0.0-20200421231249-e086a090c8fd ## explicit -golang.org/x/net +golang.org/x/net/websocket # nhooyr.io/websocket v1.8.5 ## explicit nhooyr.io/websocket From 40768332d897d31ca57fddc4ffd53cb63350c7ec Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 20 Mar 2025 12:32:12 +0000 Subject: [PATCH 002/372] Remove empty imports from stubs --- .../concepts/LoggerCall/vendor/github.com/golang/glog/stub.go | 2 -- .../semmle/go/concepts/LoggerCall/vendor/k8s.io/klog/stub.go | 2 -- .../vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go | 2 -- .../frameworks/K8sIoApiCoreV1/vendor/k8s.io/api/core/v1/stub.go | 2 -- .../vendor/k8s.io/apimachinery/pkg/runtime/stub.go | 2 -- .../vendor/k8s.io/apimachinery/pkg/runtime/schema/stub.go | 2 -- .../vendor/go.mongodb.org/mongo-driver/bson/primitive/stub.go | 2 -- .../Security/CWE-312/vendor/github.com/golang/glog/stub.go | 2 -- .../query-tests/Security/CWE-312/vendor/k8s.io/klog/stub.go | 2 -- .../vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go | 2 -- .../CWE-643/vendor/github.com/antchfx/htmlquery/stub.go | 2 -- .../CWE-643/vendor/github.com/antchfx/jsonquery/stub.go | 2 -- .../filters/ClassifyFiles/vendor/github.com/onsi/ginkgo/stub.go | 2 -- .../filters/ClassifyFiles/vendor/github.com/onsi/gomega/stub.go | 2 -- 14 files changed, 28 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/github.com/golang/glog/stub.go b/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/github.com/golang/glog/stub.go index 7c4ffefc1e8..49f90bc21af 100644 --- a/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/github.com/golang/glog/stub.go +++ b/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/github.com/golang/glog/stub.go @@ -7,8 +7,6 @@ // Package glog is a stub of github.com/golang/glog, generated by depstubber. package glog -import () - func Error(_ ...interface{}) {} func ErrorDepth(_ int, _ ...interface{}) {} diff --git a/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/k8s.io/klog/stub.go b/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/k8s.io/klog/stub.go index d0357248812..0c29992abcf 100644 --- a/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/k8s.io/klog/stub.go +++ b/go/ql/test/library-tests/semmle/go/concepts/LoggerCall/vendor/k8s.io/klog/stub.go @@ -7,8 +7,6 @@ // Package klog is a stub of k8s.io/klog, generated by depstubber. package klog -import () - func Error(_ ...interface{}) {} func ErrorDepth(_ int, _ ...interface{}) {} diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go index cd1956cecc0..f5d9d9bbbef 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/Email/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go @@ -7,8 +7,6 @@ // Package mail is a stub of github.com/sendgrid/sendgrid-go/helpers/mail, generated by depstubber. package mail -import () - type Asm struct { GroupID int GroupsToDisplay []int diff --git a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/api/core/v1/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/api/core/v1/stub.go index 1c9a8e0dfdd..e5f5c4ffa01 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/api/core/v1/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/api/core/v1/stub.go @@ -7,8 +7,6 @@ // Package core is a stub of k8s.io/api/core/v1, generated by depstubber. package core -import () - type Secret struct { TypeMeta interface{} ObjectMeta interface{} diff --git a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/apimachinery/pkg/runtime/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/apimachinery/pkg/runtime/stub.go index bb7bf043197..2655b31d450 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/apimachinery/pkg/runtime/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApiCoreV1/vendor/k8s.io/apimachinery/pkg/runtime/stub.go @@ -7,8 +7,6 @@ // Package runtime is a stub of k8s.io/apimachinery/pkg/runtime, generated by depstubber. package runtime -import () - type ProtobufMarshaller interface { MarshalTo(_ []byte) (int, error) } diff --git a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/k8s.io/apimachinery/pkg/runtime/schema/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/k8s.io/apimachinery/pkg/runtime/schema/stub.go index 58c86777a1c..2d58b01f8ea 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/k8s.io/apimachinery/pkg/runtime/schema/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/K8sIoApimachineryPkgRuntime/vendor/k8s.io/apimachinery/pkg/runtime/schema/stub.go @@ -7,8 +7,6 @@ // Package schema is a stub of k8s.io/apimachinery/pkg/runtime/schema, generated by depstubber. package schema -import () - type GroupKind struct { Group string Kind string diff --git a/go/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/bson/primitive/stub.go b/go/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/bson/primitive/stub.go index 6f07aaff4ee..3349209245a 100644 --- a/go/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/bson/primitive/stub.go +++ b/go/ql/test/query-tests/Security/CWE-089/vendor/go.mongodb.org/mongo-driver/bson/primitive/stub.go @@ -7,8 +7,6 @@ // Package primitive is a stub of go.mongodb.org/mongo-driver/bson/primitive, generated by depstubber. package primitive -import () - type D []E func (_ D) Map() M { diff --git a/go/ql/test/query-tests/Security/CWE-312/vendor/github.com/golang/glog/stub.go b/go/ql/test/query-tests/Security/CWE-312/vendor/github.com/golang/glog/stub.go index cdd12b34901..932a5e6fc25 100644 --- a/go/ql/test/query-tests/Security/CWE-312/vendor/github.com/golang/glog/stub.go +++ b/go/ql/test/query-tests/Security/CWE-312/vendor/github.com/golang/glog/stub.go @@ -7,6 +7,4 @@ // Package glog is a stub of github.com/golang/glog, generated by depstubber. package glog -import () - func Info(_ ...interface{}) {} diff --git a/go/ql/test/query-tests/Security/CWE-312/vendor/k8s.io/klog/stub.go b/go/ql/test/query-tests/Security/CWE-312/vendor/k8s.io/klog/stub.go index 7dbaa5001fc..db9ede2303e 100644 --- a/go/ql/test/query-tests/Security/CWE-312/vendor/k8s.io/klog/stub.go +++ b/go/ql/test/query-tests/Security/CWE-312/vendor/k8s.io/klog/stub.go @@ -7,6 +7,4 @@ // Package klog is a stub of k8s.io/klog, generated by depstubber. package klog -import () - func Info(_ ...interface{}) {} diff --git a/go/ql/test/query-tests/Security/CWE-640/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go b/go/ql/test/query-tests/Security/CWE-640/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go index cd1956cecc0..f5d9d9bbbef 100644 --- a/go/ql/test/query-tests/Security/CWE-640/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go +++ b/go/ql/test/query-tests/Security/CWE-640/vendor/github.com/sendgrid/sendgrid-go/helpers/mail/stub.go @@ -7,8 +7,6 @@ // Package mail is a stub of github.com/sendgrid/sendgrid-go/helpers/mail, generated by depstubber. package mail -import () - type Asm struct { GroupID int GroupsToDisplay []int diff --git a/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go b/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go index 0bac0acfe55..7a41d8f9883 100644 --- a/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go +++ b/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/htmlquery/stub.go @@ -7,8 +7,6 @@ // Package htmlquery is a stub of github.com/antchfx/htmlquery, generated by depstubber. package htmlquery -import () - func Find(_ interface{}, _ string) []interface{} { return nil } diff --git a/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go b/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go index 2948daae031..4abcf002faa 100644 --- a/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go +++ b/go/ql/test/query-tests/Security/CWE-643/vendor/github.com/antchfx/jsonquery/stub.go @@ -7,8 +7,6 @@ // Package jsonquery is a stub of github.com/antchfx/jsonquery, generated by depstubber. package jsonquery -import () - func Find(_ *Node, _ string) []*Node { return nil } diff --git a/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/ginkgo/stub.go b/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/ginkgo/stub.go index fcf8b8b5683..20f179c9002 100644 --- a/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/ginkgo/stub.go +++ b/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/ginkgo/stub.go @@ -7,8 +7,6 @@ // Package ginkgo is a stub of github.com/onsi/ginkgo, generated by depstubber. package ginkgo -import () - func Fail(_ string, _ ...int) {} type GinkgoTestingT interface { diff --git a/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/gomega/stub.go b/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/gomega/stub.go index 27fa1387b46..61c9db70ad6 100644 --- a/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/gomega/stub.go +++ b/go/ql/test/query-tests/filters/ClassifyFiles/vendor/github.com/onsi/gomega/stub.go @@ -7,6 +7,4 @@ // Package gomega is a stub of github.com/onsi/gomega, generated by depstubber. package gomega -import () - func RegisterFailHandler(_ interface{}) {} From 6147f0a8734c26ac0912f3404301e0da0c730564 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 20 Mar 2025 12:32:56 +0000 Subject: [PATCH 003/372] Fix outdated depstubber command --- .../semmle/go/frameworks/SQL/pg.go | 2 +- .../vendor/github.com/go-pg/pg/orm/stub.go | 45 ++++++++++++------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/frameworks/SQL/pg.go b/go/ql/test/library-tests/semmle/go/frameworks/SQL/pg.go index 09ffa084fe0..7cd76f715c9 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/SQL/pg.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/SQL/pg.go @@ -1,7 +1,7 @@ package main //go:generate depstubber -vendor github.com/go-pg/pg Conn,DB,Tx Q -//go:generate depstubber -vendor github.com/go-pg/pg/orm Query Q +//go:generate depstubber -vendor github.com/go-pg/pg/orm Query,Formatter Q //go:generate depstubber -vendor github.com/go-pg/pg/v9 Conn,DB,Tx Q import ( diff --git a/go/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go index 1d049c8a9a3..1214ad0492d 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/SQL/vendor/github.com/go-pg/pg/orm/stub.go @@ -2,7 +2,7 @@ // This is a simple stub for github.com/go-pg/pg/orm, strictly for use in testing. // See the LICENSE file for information about the licensing of the original library. -// Source: github.com/go-pg/pg/orm (exports: Query, Formatter; functions: Q) +// Source: github.com/go-pg/pg/orm (exports: Query,Formatter; functions: Q) // Package orm is a stub of github.com/go-pg/pg/orm, generated by depstubber. package orm @@ -94,6 +94,34 @@ func (_ *Field) Value(_ reflect.Value) reflect.Value { return reflect.Value{} } +type Formatter struct{} + +func (_ Formatter) Append(_ []byte, _ string, _ ...interface{}) []byte { + return nil +} + +func (_ Formatter) AppendBytes(_ []byte, _ []byte, _ ...interface{}) []byte { + return nil +} + +func (_ Formatter) FormatQuery(_ []byte, _ string, _ ...interface{}) []byte { + return nil +} + +func (_ Formatter) Param(_ string) interface{} { + return nil +} + +func (_ Formatter) String() string { + return "" +} + +func (_ Formatter) WithParam(_ string, _ interface{}) Formatter { + return Formatter{} +} + +func (_ *Formatter) SetParam(_ string, _ interface{}) {} + type Method struct { Index int } @@ -491,18 +519,3 @@ type TableModel interface { Table() *Table Value() reflect.Value } - -type Formatter struct { -} - -func (f Formatter) Append(dst []byte, src string, params ...interface{}) []byte { - return nil -} - -func (f Formatter) AppendBytes(dst, src []byte, params ...interface{}) []byte { - return nil -} - -func (f Formatter) FormatQuery(dst []byte, query string, params ...interface{}) []byte { - return nil -} From 7e04a9f6c0e33e06e21d178a224201dd5b3085b8 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 20 Mar 2025 12:33:39 +0000 Subject: [PATCH 004/372] Improve stubs (made by old version of depstubber?) --- .../github.com/codeskyblue/go-sh/stub.go | 45 ++++--------- .../vendor/golang.org/x/crypto/ssh/stub.go | 67 +++++-------------- 2 files changed, 31 insertions(+), 81 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/github.com/codeskyblue/go-sh/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/github.com/codeskyblue/go-sh/stub.go index 229a2114569..ae0660e5633 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/github.com/codeskyblue/go-sh/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/github.com/codeskyblue/go-sh/stub.go @@ -1,10 +1,11 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for github.com/codeskyblue/go-sh, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: github.com/codeskyblue/go-sh (exports: ; functions: Command,InteractiveSession) -// Package go_sh is a stub of github.com/codeskyblue/go-sh, generated by depstubber. -package go_sh +// Package go_pkg is a stub of github.com/codeskyblue/go-sh, generated by depstubber. +package go_pkg import ( io "io" @@ -32,15 +33,11 @@ type Session struct { func (_ *Session) Alias(_ string, _ string, _ ...string) {} -func (_ *Session) Call(_ string, _ ...interface{}) interface { - Error() string -} { +func (_ *Session) Call(_ string, _ ...interface{}) error { return nil } -func (_ *Session) CombinedOutput() ([]uint8, interface { - Error() string -}) { +func (_ *Session) CombinedOutput() ([]byte, error) { return nil, nil } @@ -50,15 +47,11 @@ func (_ *Session) Command(_ string, _ ...interface{}) *Session { func (_ *Session) Kill(_ os.Signal) {} -func (_ *Session) Output() ([]uint8, interface { - Error() string -}) { +func (_ *Session) Output() ([]byte, error) { return nil, nil } -func (_ *Session) Run() interface { - Error() string -} { +func (_ *Session) Run() error { return nil } @@ -82,9 +75,7 @@ func (_ *Session) SetTimeout(_ time.Duration) *Session { return nil } -func (_ *Session) Start() interface { - Error() string -} { +func (_ *Session) Start() error { return nil } @@ -92,32 +83,22 @@ func (_ *Session) Test(_ string, _ string) bool { return false } -func (_ *Session) UnmarshalJSON(_ interface{}) interface { - Error() string -} { +func (_ *Session) UnmarshalJSON(_ interface{}) error { return nil } -func (_ *Session) UnmarshalXML(_ interface{}) interface { - Error() string -} { +func (_ *Session) UnmarshalXML(_ interface{}) error { return nil } -func (_ *Session) Wait() interface { - Error() string -} { +func (_ *Session) Wait() error { return nil } -func (_ *Session) WaitTimeout(_ time.Duration) interface { - Error() string -} { +func (_ *Session) WaitTimeout(_ time.Duration) error { return nil } -func (_ *Session) WriteStdout(_ string) interface { - Error() string -} { +func (_ *Session) WriteStdout(_ string) error { return nil } diff --git a/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/golang.org/x/crypto/ssh/stub.go b/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/golang.org/x/crypto/ssh/stub.go index 9d1aab65e3c..0c0c3d879bb 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/golang.org/x/crypto/ssh/stub.go +++ b/go/ql/test/library-tests/semmle/go/frameworks/SystemCommandExecutors/vendor/golang.org/x/crypto/ssh/stub.go @@ -1,6 +1,7 @@ // Code generated by depstubber. DO NOT EDIT. // This is a simple stub for golang.org/x/crypto/ssh, strictly for use in testing. +// See the LICENSE file for information about the licensing of the original library. // Source: golang.org/x/crypto/ssh (exports: Session; functions: ) // Package ssh is a stub of golang.org/x/crypto/ssh, generated by depstubber. @@ -16,102 +17,70 @@ type Session struct { Stderr io.Writer } -func (_ *Session) Close() interface { - Error() string -} { +func (_ *Session) Close() error { return nil } -func (_ *Session) CombinedOutput(_ string) ([]uint8, interface { - Error() string -}) { +func (_ *Session) CombinedOutput(_ string) ([]byte, error) { return nil, nil } -func (_ *Session) Output(_ string) ([]uint8, interface { - Error() string -}) { +func (_ *Session) Output(_ string) ([]byte, error) { return nil, nil } -func (_ *Session) RequestPty(_ string, _ int, _ int, _ TerminalModes) interface { - Error() string -} { +func (_ *Session) RequestPty(_ string, _ int, _ int, _ TerminalModes) error { return nil } -func (_ *Session) RequestSubsystem(_ string) interface { - Error() string -} { +func (_ *Session) RequestSubsystem(_ string) error { return nil } -func (_ *Session) Run(_ string) interface { - Error() string -} { +func (_ *Session) Run(_ string) error { return nil } -func (_ *Session) SendRequest(_ string, _ bool, _ []uint8) (bool, interface { - Error() string -}) { +func (_ *Session) SendRequest(_ string, _ bool, _ []byte) (bool, error) { return false, nil } -func (_ *Session) Setenv(_ string, _ string) interface { - Error() string -} { +func (_ *Session) Setenv(_ string, _ string) error { return nil } -func (_ *Session) Shell() interface { - Error() string -} { +func (_ *Session) Shell() error { return nil } -func (_ *Session) Signal(_ Signal) interface { - Error() string -} { +func (_ *Session) Signal(_ Signal) error { return nil } -func (_ *Session) Start(_ string) interface { - Error() string -} { +func (_ *Session) Start(_ string) error { return nil } -func (_ *Session) StderrPipe() (io.Reader, interface { - Error() string -}) { +func (_ *Session) StderrPipe() (io.Reader, error) { return nil, nil } -func (_ *Session) StdinPipe() (io.WriteCloser, interface { - Error() string -}) { +func (_ *Session) StdinPipe() (io.WriteCloser, error) { return nil, nil } -func (_ *Session) StdoutPipe() (io.Reader, interface { - Error() string -}) { +func (_ *Session) StdoutPipe() (io.Reader, error) { return nil, nil } -func (_ *Session) Wait() interface { - Error() string -} { +func (_ *Session) Wait() error { return nil } -func (_ *Session) WindowChange(_ int, _ int) interface { - Error() string -} { +func (_ *Session) WindowChange(_ int, _ int) error { return nil } type Signal string -type TerminalModes map[uint8]uint32 +type TerminalModes map[byte]uint32 From e44f7f946fa1f4514074de01a5023f3852e0191b Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 21 Mar 2025 09:45:50 +0000 Subject: [PATCH 005/372] Sort package paths in vendor/modules.txt --- .../semmle/go/frameworks/Beego/vendor/modules.txt | 2 +- .../semmle/go/frameworks/GoMicro/vendor/modules.txt | 2 +- go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt | 2 +- go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt index 2ec05197130..d1bcf3037c5 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/Beego/vendor/modules.txt @@ -1,9 +1,9 @@ # github.com/astaxie/beego v1.12.3 ## explicit -github.com/astaxie/beego/utils github.com/astaxie/beego github.com/astaxie/beego/context github.com/astaxie/beego/logs +github.com/astaxie/beego/utils # github.com/beego/beego/v2 v2.1.2 ## explicit github.com/beego/beego/v2/server/web diff --git a/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt b/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt index 4235d352598..a0326204190 100644 --- a/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt +++ b/go/ql/test/library-tests/semmle/go/frameworks/GoMicro/vendor/modules.txt @@ -1,9 +1,9 @@ # go-micro.dev/v4 v4.10.2 ## explicit +go-micro.dev/v4 go-micro.dev/v4/api go-micro.dev/v4/client go-micro.dev/v4/server -go-micro.dev/v4 # google.golang.org/protobuf v1.28.1 ## explicit google.golang.org/protobuf/proto diff --git a/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt index b0de76d4f88..020db5bbe9c 100644 --- a/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-089/vendor/modules.txt @@ -3,6 +3,6 @@ github.com/Masterminds/squirrel # go.mongodb.org/mongo-driver v1.3.3 ## explicit +go.mongodb.org/mongo-driver/bson go.mongodb.org/mongo-driver/mongo go.mongodb.org/mongo-driver/mongo/options -go.mongodb.org/mongo-driver/bson diff --git a/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt b/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt index a852f50be92..36b5fdf2ae0 100644 --- a/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt +++ b/go/ql/test/query-tests/Security/CWE-643/vendor/modules.txt @@ -1,7 +1,7 @@ # github.com/ChrisTrenkamp/goxpath v0.0.0-20190607011252-c5096ec8773d ## explicit -github.com/ChrisTrenkamp/goxpath/tree github.com/ChrisTrenkamp/goxpath +github.com/ChrisTrenkamp/goxpath/tree # github.com/antchfx/htmlquery v1.2.2 ## explicit github.com/antchfx/htmlquery @@ -19,8 +19,8 @@ github.com/antchfx/xpath github.com/go-xmlpath/xmlpath # github.com/jbowtie/gokogiri v0.0.0-20190301021639-37f655d3078f ## explicit -github.com/jbowtie/gokogiri/xpath github.com/jbowtie/gokogiri/xml +github.com/jbowtie/gokogiri/xpath # github.com/lestrrat-go/libxml2 v0.0.0-20231124114421-99c71026c2f5 ## explicit github.com/lestrrat-go/libxml2/parser From ccbe77eb099b9200ae8100f2bc89c6020cb6214f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 11:08:10 -0400 Subject: [PATCH 006/372] Java: move original files --- ...StaticInnerClassMissingNestedAnnotation.md | 64 +++++++++++++++++++ ...StaticInnerClassMissingNestedAnnotation.ql | 30 +++++++++ .../Frameworks/JUnit/AnnotationTest.java | 44 +++++++++++++ ...InnerClassMissingNestedAnnotation.expected | 1 + ...ticInnerClassMissingNestedAnnotation.qlref | 1 + .../Likely Bugs/Frameworks/JUnit/options | 1 + .../org/junit/jupiter/api/Nested.java | 4 ++ 7 files changed, 145 insertions(+) create mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md create mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md new file mode 100644 index 00000000000..78719b29556 --- /dev/null +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md @@ -0,0 +1,64 @@ +# J-T-004: Non-static inner class defined in a JUnit 5 is missing a `@Nested` annotation + +A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation will be excluded from execution and it may indicate a misunderstanding from the programmer. + +## Overview + +JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if the inner class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. + +Note that static classes, whether static or not, behave as independent sets of unit tests. Thus, inner static classes do not share the information provided by the outer class with other inner classes. Thus, this rule only applies to non-static JUnit 5 inner classes. + +## Recommendation + +If you want the tests defined in an inner class to be recognized by the build plugin and be executed, annotate with `@Nested`, imported from `org.junit.jupiter.api`. + +## Example + +```java +import org.junit.jupiter.api.Nested; +import static org.junit.Assert.assertEquals; + +public class IntegerOperationTest { + private int i; // Shared variable among the inner classes. + + @BeforeEach + public void initTest() { i = 0; } + + @Nested + public class AdditionTest { // COMPLIANT: Inner test class annotated with `@Nested`. + @Test + public void addTest1() { // Test of an inner class, implying `AdditionTest` is a test class. + assertEquals(1, i+1); + } + } + + public class SubtractionTest { // NON_COMPLIANT: Inner test class missing `@Nested`. + @Test + public void addTest1() { // Test of an inner class, implying `SubtractionTest` is a test class. + assertEquals(-1, i-1); + } + } + + static public class MultiplicationTest { // COMPLIANT: static test class should not be annotated as `@Nested`. + ... + } +} +``` + +## Implementation Notes + +The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". Therefore, this rule does not aim to target static inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles below is not non-compliant to this rule. + +``` java +@Nested +public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope + @Test + public void test() { + } +} +``` + +## References + +- JUnit: [Documentation on `@Nested`](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html). +- Baeldung: [JUnit 5 @Nested Test Classes](https://www.baeldung.com/junit-5-nested-test-classes). diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql new file mode 100644 index 00000000000..cb1988dca05 --- /dev/null +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql @@ -0,0 +1,30 @@ +/** + * @id java/junit5-non-static-inner-class-missing-nested-annotation + * @name J-T-004: Non-static inner class defined in a JUnit5 test is missing a `@Nested` annotation + * @description A non-static inner class defined in a JUnit5 test missing a `@Nested` annotation + * will be excluded from execution and it may indicate a misunderstanding from the + * programmer. + * @kind problem + * @precision very-high + * @problem.severity warning + * @tags maintainability + * correctness + */ + +import java + +class JUnit5TestClass extends Class { + JUnit5TestClass() { + this.getAMethod().getAnAnnotation().getType().hasQualifiedName("org.junit.jupiter.api", "Test") + } +} + +from JUnit5TestClass testClass // `TestClass` by definition should have at least one @Test method. +where + not testClass.isStatic() and + testClass instanceof InnerClass and // `InnerClass` is by definition a non-static nested class. + not exists(Annotation annotation | + annotation.getType().hasQualifiedName("org.junit.jupiter.api", "Nested") and + annotation.getAnnotatedElement() = testClass + ) +select testClass, "This JUnit5 inner test class lacks a @Nested annotation." diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java new file mode 100644 index 00000000000..91dd1f5b597 --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -0,0 +1,44 @@ +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Nested; + +public class AnnotationTest { + @Nested + public class Test1 { // COMPLIANT: Inner test class has `@Nested` + @Test + public void test() { + } + } + + public class Test2 { // NON_COMPLIANT: Inner test class is missing a `@Nested` + @Test + public void test() { + } + } + + public class Test3 { // COMPLIANT: Since it is empty, it is not a test class + } + + public class Test4 { // COMPLIANT: Since no methods have `@Test`, it is not a test class + public void f() { + } + + public void g() { + } + + public void h() { + } + } + + public static class Test5 { // COMPLIANT: Static inner test classes don't need `@Nested` + @Test + public void test() { + } + } + + @Nested + public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope (see Implementation Details) + @Test + public void test() { + } + } +} diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected new file mode 100644 index 00000000000..0964e894cbd --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected @@ -0,0 +1 @@ +| AnnotationTest.java:12:16:12:20 | Test2 | This JUnit5 inner test class lacks a @Nested annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref new file mode 100644 index 00000000000..4b0732a04c5 --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref @@ -0,0 +1 @@ +Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options new file mode 100644 index 00000000000..8ad0239c5f0 --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/options @@ -0,0 +1 @@ +//semmle-extractor-options: --javac-args -cp ${testdir}/../../../../stubs/junit-jupiter-api-5.2.0 diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java new file mode 100644 index 00000000000..c1ca1fe9163 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/Nested.java @@ -0,0 +1,4 @@ +package org.junit.jupiter.api; + +public @interface Nested { +} From f17e7266cfeb2bb0fe89ed96de5b5353dbab1922 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 15:22:59 -0400 Subject: [PATCH 007/372] Java: refactor QL --- java/ql/lib/semmle/code/java/UnitTests.qll | 8 ++++++ ...StaticInnerClassMissingNestedAnnotation.ql | 26 +++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index 38f37fa4ff0..af1cd88f4f1 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -112,6 +112,14 @@ class JUnitJupiterTestMethod extends Method { } } +/** + * A JUnit test class that contains at least one method annotated with + * `org.junit.jupiter.api.Test`. + */ +class JUnit5TestClass extends Class { + JUnit5TestClass() { this.getAMethod() instanceof JUnitJupiterTestMethod } +} + /** * A JUnit `@Ignore` annotation. */ diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql index cb1988dca05..4b521567784 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql @@ -1,30 +1,22 @@ /** * @id java/junit5-non-static-inner-class-missing-nested-annotation - * @name J-T-004: Non-static inner class defined in a JUnit5 test is missing a `@Nested` annotation - * @description A non-static inner class defined in a JUnit5 test missing a `@Nested` annotation + * @name Non-static inner class defined in a JUnit 5 test is missing a `@Nested` annotation + * @description A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation * will be excluded from execution and it may indicate a misunderstanding from the * programmer. * @kind problem * @precision very-high * @problem.severity warning - * @tags maintainability + * @tags quality + * maintainability * correctness */ import java -class JUnit5TestClass extends Class { - JUnit5TestClass() { - this.getAMethod().getAnAnnotation().getType().hasQualifiedName("org.junit.jupiter.api", "Test") - } -} - -from JUnit5TestClass testClass // `TestClass` by definition should have at least one @Test method. +from JUnit5TestClass testClass where - not testClass.isStatic() and - testClass instanceof InnerClass and // `InnerClass` is by definition a non-static nested class. - not exists(Annotation annotation | - annotation.getType().hasQualifiedName("org.junit.jupiter.api", "Nested") and - annotation.getAnnotatedElement() = testClass - ) -select testClass, "This JUnit5 inner test class lacks a @Nested annotation." + // `InnerClass` is a non-static, nested class. + testClass instanceof InnerClass and + not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") +select testClass, "This JUnit5 inner test class lacks a '@Nested' annotation." From b08c8d020de9429c94b21f98ca4fda55b4614526 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 15:33:15 -0400 Subject: [PATCH 008/372] Java: tests to inline expectations --- .../Likely Bugs/Frameworks/JUnit/AnnotationTest.java | 7 +++++-- ...nit5NonStaticInnerClassMissingNestedAnnotation.expected | 2 +- .../JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 91dd1f5b597..4aeceb51f9e 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -9,7 +9,8 @@ public class AnnotationTest { } } - public class Test2 { // NON_COMPLIANT: Inner test class is missing a `@Nested` + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2 { // $ Alert @Test public void test() { } @@ -35,8 +36,10 @@ public class AnnotationTest { } } + // COMPLIANT: Invalid to use `@Nested` on a static class, but + // this matter is out of scope (see QHelp Implementation Notes) @Nested - public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope (see Implementation Details) + public static class Test6 { @Test public void test() { } diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected index 0964e894cbd..5133a322331 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected @@ -1 +1 @@ -| AnnotationTest.java:12:16:12:20 | Test2 | This JUnit5 inner test class lacks a @Nested annotation. | +| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref index 4b0732a04c5..3a819b36f79 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref @@ -1 +1,2 @@ -Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +query: Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql From ed57bc7858ab7436145c504e78b1dfa3bc98ddce Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 16:11:11 -0400 Subject: [PATCH 009/372] Java: exclude abstract classes --- ...5NonStaticInnerClassMissingNestedAnnotation.md | 11 +++++++++-- ...5NonStaticInnerClassMissingNestedAnnotation.ql | 4 +++- .../Frameworks/JUnit/AnnotationTest.java | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md index 78719b29556..7f336fd7c10 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md @@ -47,11 +47,18 @@ public class IntegerOperationTest { ## Implementation Notes -The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". Therefore, this rule does not aim to target static inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles below is not non-compliant to this rule. +The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". It also does not apply to inner abstract classes since there is no use case for an `@Nested` annotation on an abstract class. Therefore, this rule does not aim to target static or abstract inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles the below is not non-compliant to this rule. ``` java @Nested -public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope +public static class TestStatic { // COMPLIANT: Although invalid, this matter is out of the scope + @Test + public void test() { + } +} + +@Nested +public abstract class TestAbstract { // COMPLIANT: Although invalid, this matter is out of the scope @Test public void test() { } diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql index 4b521567784..1c5b4234e75 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql @@ -18,5 +18,7 @@ from JUnit5TestClass testClass where // `InnerClass` is a non-static, nested class. testClass instanceof InnerClass and - not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") + not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and + // An abstract class should not have a `@Nested` annotation + not testClass.isAbstract() select testClass, "This JUnit5 inner test class lacks a '@Nested' annotation." diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 4aeceb51f9e..6c095e9e4ec 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -44,4 +44,19 @@ public class AnnotationTest { public void test() { } } + + public abstract class Test7 { // COMPLIANT: Abstract inner test classes don't need `@Nested` + @Test + public void test() { + } + } + + // COMPLIANT: Invalid to use `@Nested` on an abstract class, but + // this matter is out of scope (see QHelp Implementation Notes) + @Nested + public abstract class Test8 { + @Test + public void test() { + } + } } From 640096c822cae7994dd53eaf509d540fbee7ffad Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 16:15:56 -0400 Subject: [PATCH 010/372] Java: change note --- .../2025-03-21-junit-missing-nested-annotation.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md diff --git a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md new file mode 100644 index 00000000000..b014655b42c --- /dev/null +++ b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new quality query, `java/junit5-non-static-inner-class-missing-nested-annotation`, to detect missing `@Nested` annotations on non-static, inner JUnit 5 test classes. From 3e13f0ed41ec85e20d96e86e7fd7f1ff7c71b1c3 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 21 Mar 2025 22:43:35 -0400 Subject: [PATCH 011/372] Java: remove redundant 'non-static' wording and update qhelp --- .../JUnit/JUnit5MissingNestedAnnotation.md | 45 ++++++++++++ ...on.ql => JUnit5MissingNestedAnnotation.ql} | 11 +-- ...StaticInnerClassMissingNestedAnnotation.md | 71 ------------------- ...5-03-21-junit-missing-nested-annotation.md | 2 +- .../Frameworks/JUnit/AnnotationTest.java | 4 +- .../JUnit5MissingNestedAnnotation.expected | 1 + .../JUnit/JUnit5MissingNestedAnnotation.qlref | 2 + ...InnerClassMissingNestedAnnotation.expected | 1 - ...ticInnerClassMissingNestedAnnotation.qlref | 2 - 9 files changed, 57 insertions(+), 82 deletions(-) create mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md rename java/ql/src/Likely Bugs/Frameworks/JUnit/{JUnit5NonStaticInnerClassMissingNestedAnnotation.ql => JUnit5MissingNestedAnnotation.ql} (50%) delete mode 100644 java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected create mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref delete mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected delete mode 100644 java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md new file mode 100644 index 00000000000..2c4fbd7d61e --- /dev/null +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md @@ -0,0 +1,45 @@ +## Overview + +JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if an inner test class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. + +## Recommendation + +If you want the tests defined in an inner class to be recognized by the build plugin and be executed, annotate the class with `@Nested`, imported from `org.junit.jupiter.api`. + +## Example + +```java +import org.junit.jupiter.api.Nested; +import static org.junit.Assert.assertEquals; + +public class IntegerOperationTest { + private int i; // Shared variable among the inner classes. + + @BeforeEach + public void initTest() { i = 0; } + + @Nested + public class AdditionTest { // COMPLIANT: Inner test class annotated with `@Nested`. + @Test + public void addTest1() { + assertEquals(1, i + 1); + } + } + + public class SubtractionTest { // NON_COMPLIANT: Inner test class missing `@Nested`. + @Test + public void addTest1() { + assertEquals(-1, i - 1); + } + } +} +``` + +## Implementation Notes + +This rule is focused on missing `@Nested` annotations on non-static nested (inner) test classes. Static nested test classes and abstract nested test classes should not be annotated with `@Nested`. As a result, the absence of a `@Nested` annotation on such classes is compliant. Identifying incorrect application of a `@Nested` annotation to static and abstract classes is out of scope for this rule. + +## References + +- JUnit 5 API Documentation: [Annotation Interface Nested](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html). +- JUnit 5 User Guide: [Nested Tests](https://junit.org/junit5/docs/current/user-guide/#writing-tests-nested). diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql similarity index 50% rename from java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql rename to java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 1c5b4234e75..a8cf5d14e3c 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -1,8 +1,8 @@ /** - * @id java/junit5-non-static-inner-class-missing-nested-annotation - * @name Non-static inner class defined in a JUnit 5 test is missing a `@Nested` annotation - * @description A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation - * will be excluded from execution and it may indicate a misunderstanding from the + * @id java/junit5-missing-nested-annotation + * @name Missing `@Nested` annotation on JUnit 5 inner test class + * @description A JUnit 5 inner test class that is missing a `@Nested` annotation will be + * excluded from execution and it may indicate a misunderstanding from the * programmer. * @kind problem * @precision very-high @@ -10,6 +10,7 @@ * @tags quality * maintainability * correctness + * previous-id:java/junit5-non-static-inner-class-missing-nested-annotation */ import java @@ -21,4 +22,4 @@ where not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and // An abstract class should not have a `@Nested` annotation not testClass.isAbstract() -select testClass, "This JUnit5 inner test class lacks a '@Nested' annotation." +select testClass, "This JUnit 5 inner test class lacks a '@Nested' annotation." diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md deleted file mode 100644 index 7f336fd7c10..00000000000 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.md +++ /dev/null @@ -1,71 +0,0 @@ -# J-T-004: Non-static inner class defined in a JUnit 5 is missing a `@Nested` annotation - -A non-static inner class defined in a JUnit 5 test missing a `@Nested` annotation will be excluded from execution and it may indicate a misunderstanding from the programmer. - -## Overview - -JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if the inner class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. - -Note that static classes, whether static or not, behave as independent sets of unit tests. Thus, inner static classes do not share the information provided by the outer class with other inner classes. Thus, this rule only applies to non-static JUnit 5 inner classes. - -## Recommendation - -If you want the tests defined in an inner class to be recognized by the build plugin and be executed, annotate with `@Nested`, imported from `org.junit.jupiter.api`. - -## Example - -```java -import org.junit.jupiter.api.Nested; -import static org.junit.Assert.assertEquals; - -public class IntegerOperationTest { - private int i; // Shared variable among the inner classes. - - @BeforeEach - public void initTest() { i = 0; } - - @Nested - public class AdditionTest { // COMPLIANT: Inner test class annotated with `@Nested`. - @Test - public void addTest1() { // Test of an inner class, implying `AdditionTest` is a test class. - assertEquals(1, i+1); - } - } - - public class SubtractionTest { // NON_COMPLIANT: Inner test class missing `@Nested`. - @Test - public void addTest1() { // Test of an inner class, implying `SubtractionTest` is a test class. - assertEquals(-1, i-1); - } - } - - static public class MultiplicationTest { // COMPLIANT: static test class should not be annotated as `@Nested`. - ... - } -} -``` - -## Implementation Notes - -The `@Nested` annotation does not apply to inner static classes, since the meaning of the annotation is to mark a class as "a *non-static* inner class containing `@Test` methods to be picked up by a build system". It also does not apply to inner abstract classes since there is no use case for an `@Nested` annotation on an abstract class. Therefore, this rule does not aim to target static or abstract inner test classes with a `@Nested` annotation, nor does it try to enforce such correct usage of `@Nested`. Therefore, any code that resembles the below is not non-compliant to this rule. - -``` java -@Nested -public static class TestStatic { // COMPLIANT: Although invalid, this matter is out of the scope - @Test - public void test() { - } -} - -@Nested -public abstract class TestAbstract { // COMPLIANT: Although invalid, this matter is out of the scope - @Test - public void test() { - } -} -``` - -## References - -- JUnit: [Documentation on `@Nested`](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/Nested.html). -- Baeldung: [JUnit 5 @Nested Test Classes](https://www.baeldung.com/junit-5-nested-test-classes). diff --git a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md index b014655b42c..c663ddc04f6 100644 --- a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md +++ b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md @@ -1,4 +1,4 @@ --- category: newQuery --- -* Added a new quality query, `java/junit5-non-static-inner-class-missing-nested-annotation`, to detect missing `@Nested` annotations on non-static, inner JUnit 5 test classes. +* Added a new quality query, `java/junit5-missing-nested-annotation`, to detect missing `@Nested` annotations on JUnit 5 inner test classes. diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 6c095e9e4ec..12b65294045 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -30,7 +30,7 @@ public class AnnotationTest { } } - public static class Test5 { // COMPLIANT: Static inner test classes don't need `@Nested` + public static class Test5 { // COMPLIANT: Static nested test classes don't need `@Nested` @Test public void test() { } @@ -45,7 +45,7 @@ public class AnnotationTest { } } - public abstract class Test7 { // COMPLIANT: Abstract inner test classes don't need `@Nested` + public abstract class Test7 { // COMPLIANT: Abstract nested test classes don't need `@Nested` @Test public void test() { } diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected new file mode 100644 index 00000000000..bb7f1b036f3 --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected @@ -0,0 +1 @@ +| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit 5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref new file mode 100644 index 00000000000..1d4c5febd14 --- /dev/null +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.qlref @@ -0,0 +1,2 @@ +query: Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected deleted file mode 100644 index 5133a322331..00000000000 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.expected +++ /dev/null @@ -1 +0,0 @@ -| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref deleted file mode 100644 index 3a819b36f79..00000000000 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.qlref +++ /dev/null @@ -1,2 +0,0 @@ -query: Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql -postprocess: utils/test/InlineExpectationsTestQuery.ql From 4d7bed6181e5e35ed27bfa280bafaf657c18f673 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 14:31:11 -0400 Subject: [PATCH 012/372] Java: exclude anonymous, local, and private classes --- java/ql/lib/semmle/code/java/UnitTests.qll | 14 ++++++++++ .../JUnit/JUnit5MissingNestedAnnotation.ql | 4 +-- .../Frameworks/JUnit/AnnotationTest.java | 28 +++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index af1cd88f4f1..810732356af 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -120,6 +120,20 @@ class JUnit5TestClass extends Class { JUnit5TestClass() { this.getAMethod() instanceof JUnitJupiterTestMethod } } +/** + * A JUnit inner test class that is non-anonymous, non-local, + * and non-private. + */ +class JUnit5InnerTestClass extends JUnit5TestClass { + JUnit5InnerTestClass() { + // `InnerClass` is a non-static nested class. + this instanceof InnerClass and + not this.isAnonymous() and + not this.isLocal() and + not this.isPrivate() + } +} + /** * A JUnit `@Ignore` annotation. */ diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index a8cf5d14e3c..2f69cea0c7a 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -15,10 +15,8 @@ import java -from JUnit5TestClass testClass +from JUnit5InnerTestClass testClass where - // `InnerClass` is a non-static, nested class. - testClass instanceof InnerClass and not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and // An abstract class should not have a `@Nested` annotation not testClass.isAbstract() diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 12b65294045..ad229192fd4 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -59,4 +59,32 @@ public class AnnotationTest { public void test() { } } + + interface Test9 { + } + + public void f() { + // COMPLIANT: anonymous classes are not considered as inner test + // classes by JUnit and therefore don't need `@Nested` + new Test9() { + @Test + public void test() { + } + }; + // COMPLIANT: local classes are not considered as inner test + // classes by JUnit and therefore don't need `@Nested` + class Test10 { + @Test + void test() { + } + } + } + + // COMPLIANT: private classes are not considered as inner test + // classes by JUnit and therefore don't need `@Nested` + private class Test11 { + @Test + public void test() { + } + } } From 35b647839c45f2b81cfa787243272d070d5682c0 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 16:36:08 -0400 Subject: [PATCH 013/372] Java: include RepeatedTest, ParameterizedTest, TestFactory, and TestTemplate when identifying JUnit 5 test methods --- java/ql/lib/semmle/code/java/UnitTests.qll | 31 +++++++++++++-- .../JUnit/JUnit5MissingNestedAnnotation.ql | 5 +-- .../Frameworks/JUnit/AnnotationTest.java | 38 ++++++++++++++++++- .../JUnit5MissingNestedAnnotation.expected | 6 ++- .../org/junit/jupiter/api/RepeatedTest.java | 25 ++++++++++++ .../org/junit/jupiter/api/TestFactory.java | 23 +++++++++++ .../org/junit/jupiter/api/TestTemplate.java | 23 +++++++++++ .../jupiter/params/ParameterizedTest.java | 26 +++++++++++++ .../jupiter/params/provider/ValueSource.java | 24 ++++++++++++ 9 files changed, 192 insertions(+), 9 deletions(-) create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java create mode 100644 java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index 810732356af..84a2ce4d02b 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -113,11 +113,36 @@ class JUnitJupiterTestMethod extends Method { } /** - * A JUnit test class that contains at least one method annotated with - * `org.junit.jupiter.api.Test`. + * A JUnit 5 test method. + * A test method is defined by JUnit as "any instance method + * that is directly annotated or meta-annotated with `@Test`, + * `@RepeatedTest`, `@ParameterizedTest`, `@TestFactory`, or + * `@TestTemplate`." + * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions + */ +class JUnit5TestMethod extends Method { + JUnit5TestMethod() { + this instanceof JUnitJupiterTestMethod or + this.getAnAnnotation() + .getType() + .hasQualifiedName("org.junit.jupiter.api", ["RepeatedTest", "TestFactory", "TestTemplate"]) or + this.getAnAnnotation() + .getType() + .hasQualifiedName("org.junit.jupiter.params", "ParameterizedTest") + } +} + +/** + * A JUnit 5 test class. + * A test class must contain at least one test method, and + * cannot be abstract. + * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions */ class JUnit5TestClass extends Class { - JUnit5TestClass() { this.getAMethod() instanceof JUnitJupiterTestMethod } + JUnit5TestClass() { + this.getAMethod() instanceof JUnit5TestMethod and + not this.isAbstract() + } } /** diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 2f69cea0c7a..f60ed0d4e04 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -16,8 +16,5 @@ import java from JUnit5InnerTestClass testClass -where - not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") and - // An abstract class should not have a `@Nested` annotation - not testClass.isAbstract() +where not testClass.hasAnnotation("org.junit.jupiter.api", "Nested") select testClass, "This JUnit 5 inner test class lacks a '@Nested' annotation." diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index ad229192fd4..4ea60f4404c 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -1,5 +1,11 @@ +import java.util.Collection; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.RepeatedTest; +import org.junit.jupiter.api.TestFactory; +import org.junit.jupiter.api.TestTemplate; import org.junit.jupiter.api.Nested; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; public class AnnotationTest { @Nested @@ -10,12 +16,42 @@ public class AnnotationTest { } // NON_COMPLIANT: Inner test class is missing `@Nested` - public class Test2 { // $ Alert + public class Test2_Test { // $ Alert @Test public void test() { } } + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_RepeatedTest { // $ Alert + @RepeatedTest(2) + public void test() { + } + } + + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_ParameterizedTest { // $ Alert + @ParameterizedTest + @ValueSource(strings = { "" }) + public void test(String s) { + } + } + + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_TestFactory { // $ Alert + @TestFactory + Collection test() { + return null; + } + } + + // NON_COMPLIANT: Inner test class is missing `@Nested` + public class Test2_TestTemplate { // $ Alert + @TestTemplate + public void test() { + } + } + public class Test3 { // COMPLIANT: Since it is empty, it is not a test class } diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected index bb7f1b036f3..866afc0926a 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.expected @@ -1 +1,5 @@ -| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:19:16:19:25 | Test2_Test | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:26:16:26:33 | Test2_RepeatedTest | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:33:16:33:38 | Test2_ParameterizedTest | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:41:16:41:32 | Test2_TestFactory | This JUnit 5 inner test class lacks a '@Nested' annotation. | +| AnnotationTest.java:49:16:49:33 | Test2_TestTemplate | This JUnit 5 inner test class lacks a '@Nested' annotation. | diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java new file mode 100644 index 00000000000..1ea7e576ab2 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/RepeatedTest.java @@ -0,0 +1,25 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@TestTemplate +public @interface RepeatedTest { + int value(); +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java new file mode 100644 index 00000000000..4da3585c822 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestFactory.java @@ -0,0 +1,23 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TestFactory { +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java new file mode 100644 index 00000000000..5ff7ca49131 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/api/TestTemplate.java @@ -0,0 +1,23 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TestTemplate { +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java new file mode 100644 index 00000000000..3f8d0c4ba32 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/ParameterizedTest.java @@ -0,0 +1,26 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.params; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.TestTemplate; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@TestTemplate +public @interface ParameterizedTest { +} diff --git a/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java new file mode 100644 index 00000000000..fd698ac98a0 --- /dev/null +++ b/java/ql/test/stubs/junit-jupiter-api-5.2.0/org/junit/jupiter/params/provider/ValueSource.java @@ -0,0 +1,24 @@ +/* + * Copyright 2015-2025 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.params.provider; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.TYPE }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ValueSource { + String[] strings() default {}; +} From 37092f4411cc6161c0a2e38ee34fbcdc35229493 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 16:39:22 -0400 Subject: [PATCH 014/372] Java: add 'testability' and 'frameworks/junit' tags --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index f60ed0d4e04..7b7786309cf 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -10,6 +10,8 @@ * @tags quality * maintainability * correctness + * testability + * frameworks/junit * previous-id:java/junit5-non-static-inner-class-missing-nested-annotation */ From dca4c58b29639f75519c971aa3eae8a08c30d0df Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 16:43:44 -0400 Subject: [PATCH 015/372] Java: add to ccr/quality suite --- java/ql/src/codeql-suites/java-ccr.qls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/codeql-suites/java-ccr.qls b/java/ql/src/codeql-suites/java-ccr.qls index ac1f52624c4..0ee1e8516e6 100644 --- a/java/ql/src/codeql-suites/java-ccr.qls +++ b/java/ql/src/codeql-suites/java-ccr.qls @@ -11,4 +11,5 @@ - java/unused-container - java/input-resource-leak - java/output-resource-leak - - java/type-variable-hides-type \ No newline at end of file + - java/type-variable-hides-type + - java/junit5-missing-nested-annotation From 0f002624d60495fc4317258b650e05a6c9bab284 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Sun, 23 Mar 2025 18:30:39 -0400 Subject: [PATCH 016/372] Java: remove mention of abstract classes from qhelp --- .../JUnit/JUnit5MissingNestedAnnotation.md | 2 +- .../Frameworks/JUnit/AnnotationTest.java | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md index 2c4fbd7d61e..652f35e85cf 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md @@ -37,7 +37,7 @@ public class IntegerOperationTest { ## Implementation Notes -This rule is focused on missing `@Nested` annotations on non-static nested (inner) test classes. Static nested test classes and abstract nested test classes should not be annotated with `@Nested`. As a result, the absence of a `@Nested` annotation on such classes is compliant. Identifying incorrect application of a `@Nested` annotation to static and abstract classes is out of scope for this rule. +This rule is focused on missing `@Nested` annotations on non-static nested (inner) test classes. Static nested test classes should not be annotated with `@Nested`. As a result, the absence of a `@Nested` annotation on such classes is compliant. Identifying incorrect application of a `@Nested` annotation to static nested classes is out of scope for this rule. ## References diff --git a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java index 4ea60f4404c..0050d56dade 100644 --- a/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java +++ b/java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java @@ -87,29 +87,20 @@ public class AnnotationTest { } } - // COMPLIANT: Invalid to use `@Nested` on an abstract class, but - // this matter is out of scope (see QHelp Implementation Notes) - @Nested - public abstract class Test8 { - @Test - public void test() { - } - } - - interface Test9 { + interface Test8 { } public void f() { // COMPLIANT: anonymous classes are not considered as inner test // classes by JUnit and therefore don't need `@Nested` - new Test9() { + new Test8() { @Test public void test() { } }; // COMPLIANT: local classes are not considered as inner test // classes by JUnit and therefore don't need `@Nested` - class Test10 { + class Test9 { @Test void test() { } @@ -118,7 +109,7 @@ public class AnnotationTest { // COMPLIANT: private classes are not considered as inner test // classes by JUnit and therefore don't need `@Nested` - private class Test11 { + private class Test10 { @Test public void test() { } From b9bf192c09c71664b35751a31d65ec44b87aeae8 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 24 Mar 2025 14:37:05 -0400 Subject: [PATCH 017/372] Java: previous-id property instead of tag, see #19097 --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 7b7786309cf..db67a2c4843 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -1,5 +1,6 @@ /** * @id java/junit5-missing-nested-annotation + * @previous-id java/junit5-non-static-inner-class-missing-nested-annotation * @name Missing `@Nested` annotation on JUnit 5 inner test class * @description A JUnit 5 inner test class that is missing a `@Nested` annotation will be * excluded from execution and it may indicate a misunderstanding from the @@ -12,7 +13,6 @@ * correctness * testability * frameworks/junit - * previous-id:java/junit5-non-static-inner-class-missing-nested-annotation */ import java From e169c21f8bef540103c1140f24c72e7d9e45a8ff Mon Sep 17 00:00:00 2001 From: Jami <57204504+jcogs33@users.noreply.github.com> Date: Tue, 25 Mar 2025 07:19:39 -0400 Subject: [PATCH 018/372] Apply suggestions from docs review Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.md | 2 +- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md index 652f35e85cf..f8c604a7026 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.md @@ -1,6 +1,6 @@ ## Overview -JUnit tests are grouped in a class, and starting from JUnit 5 users can group the test classes in a bigger class so they can share the local environment of the enclosing class. While this helps to organize the unit tests and foster code reuse, if an inner test class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. +JUnit tests are grouped in a class, and starting from JUnit 5, users can group the test classes in a larger class so they can share the local environment of the enclosing class. While this helps organize the unit tests and foster code reuse, if an inner test class is not annotated with `@Nested`, the unit tests in it will fail to execute during builds. ## Recommendation diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index db67a2c4843..3540ad8d942 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -3,7 +3,7 @@ * @previous-id java/junit5-non-static-inner-class-missing-nested-annotation * @name Missing `@Nested` annotation on JUnit 5 inner test class * @description A JUnit 5 inner test class that is missing a `@Nested` annotation will be - * excluded from execution and it may indicate a misunderstanding from the + * excluded from execution and may indicate a mistake from the * programmer. * @kind problem * @precision very-high From 56ea9b65234d68f3c74dc4611967b1695d6020a8 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 08:21:15 -0400 Subject: [PATCH 019/372] Java: move original files --- .../Undesirable Calls/DoNotUseFinalizers.md | 34 +++++++++++++++++++ .../Undesirable Calls/DoNotUseFinalizers.ql | 25 ++++++++++++++ .../DoNotUseFinalizers.expected | 3 ++ .../DoNotUseFinalizers.qlref | 1 + .../query-tests/DoNotUseFinalizers/Test.java | 13 +++++++ 5 files changed, 76 insertions(+) create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql create mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected create mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref create mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/Test.java diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md new file mode 100644 index 00000000000..70a1236e3a7 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md @@ -0,0 +1,34 @@ +# J-FIN-002: Calling garbage collection methods in application code may cause inconsistent program state + +Calling garbage collection or finalizer methods in application code may cause inconsistent program state or unpredicatable behavior. + +## Overview + +Triggering garbage collection explicitly may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior or deadlock. + +## Recommendation + +Avoid calling finalizers and garbage collection methods in application code. Allow the JVM to determine a garbage collection schedule instead. + +## Example + +```java +public class Test { + void f() throws Throwable { + System.gc(); // NON_COMPLIANT + Runtime.getRuntime().gc(); // NON_COMPLIANT + System.runFinalizersOnExit(true); //NON_COMPLIANT + this.finalize(); // NON_COMPLIANT + } +} + +``` + +# Implementation Notes + +This rule covers a concept related to J-FIN-001; this rule is focused on the use of existing finalizer invocations rather than attempts to write a custom implementation (J-FIN-001). + +## References + +- [Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers) +- [CWE-586](https://cwe.mitre.org/data/definitions/586) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql new file mode 100644 index 00000000000..b2e55302430 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql @@ -0,0 +1,25 @@ +/** + * @id java/do-not-use-finalizers + * @name J-D-004: Calling garbage collection methods in application code may cause inconsistent program state + * @description Calling garbage collection or finalizer methods in application code may cause + * inconsistent program state or unpredicatable behavior. + * @kind problem + * @precision high + * @problem.severity error + * @tags correctness + * external/cwe/cwe-586 + */ + +import java + +from MethodCall c, Method m +where + c.getMethod() = m and + ( + m.hasQualifiedName("java.lang", "System", ["gc", "runFinalizersOnExit"]) + or + m.hasQualifiedName("java.lang", "Runtime", "gc") + or + m.hasQualifiedName(_, _, "finalize") + ) +select c, "Call to prohibited method that may modify the JVM's garbage collection process." diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected new file mode 100644 index 00000000000..3a96af624f6 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected @@ -0,0 +1,3 @@ +| Test.java:3:9:3:19 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | +| Test.java:4:9:4:33 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | +| Test.java:5:9:5:23 | finalize(...) | Call to prohibited method that may modify the JVM's garbage collection process. | diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref new file mode 100644 index 00000000000..e429708f146 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref @@ -0,0 +1 @@ +rules/J-FIN-002/DoNotUseFinalizers.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/Test.java b/java/ql/test/query-tests/DoNotUseFinalizers/Test.java new file mode 100644 index 00000000000..cca4a6b8f21 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalizers/Test.java @@ -0,0 +1,13 @@ +public class Test { + void f() throws Throwable { + System.gc(); // NON_COMPLIANT + Runtime.getRuntime().gc(); // NON_COMPLIANT + this.finalize(); // NON_COMPLIANT + // this is removed in Java 11 + //System.runFinalizersOnExit(true); // NON_COMPLIANT + } + + void f1() throws Throwable { + f(); // COMPLIANT + } +} From 9a6e241f540021744dca8154c0939a7a4b5a6f4f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 08:58:48 -0400 Subject: [PATCH 020/372] Java: update to only find 'finalize' calls and add 'super.finalize' exclusion --- .../Undesirable Calls/DoNotUseFinalize.md | 27 +++++++++++++++ .../Undesirable Calls/DoNotUseFinalize.ql | 27 +++++++++++++++ .../Undesirable Calls/DoNotUseFinalizers.md | 34 ------------------- .../Undesirable Calls/DoNotUseFinalizers.ql | 25 -------------- .../DoNotUseFinalize.expected | 1 + .../DoNotUseFinalize/DoNotUseFinalize.qlref | 1 + .../query-tests/DoNotUseFinalize/Test.java | 9 +++++ .../DoNotUseFinalizers.expected | 3 -- .../DoNotUseFinalizers.qlref | 1 - .../query-tests/DoNotUseFinalizers/Test.java | 13 ------- 10 files changed, 65 insertions(+), 76 deletions(-) create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md create mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql delete mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md delete mode 100644 java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql create mode 100644 java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected create mode 100644 java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref create mode 100644 java/ql/test/query-tests/DoNotUseFinalize/Test.java delete mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected delete mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref delete mode 100644 java/ql/test/query-tests/DoNotUseFinalizers/Test.java diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md new file mode 100644 index 00000000000..7acb4186fe6 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md @@ -0,0 +1,27 @@ +## Overview + +Calling `finalize` in application code may cause inconsistent program state or unpredicatable behavior. + +## Recommendation + +Avoid calling `finalize` in application code. Allow the JVM to determine a garbage collection schedule instead. + +## Example + +```java +public class Test { + void f() throws Throwable { + this.finalize(); // NON_COMPLIANT + } +} + +``` + +# Implementation Notes + +This rule is focused on the use of existing `finalize` invocations rather than attempts to write a custom implementation. + +## References + +- Carnegie Mellon University, SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). +- Common Weakness Enumeration: [CWE-586](https://cwe.mitre.org/data/definitions/586). diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql new file mode 100644 index 00000000000..fe420322635 --- /dev/null +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql @@ -0,0 +1,27 @@ +/** + * @id java/do-not-use-finalize + * @name Do not use `finalize` + * @description Calling `finalize` in application code may cause + * inconsistent program state or unpredicatable behavior. + * @kind problem + * @precision high + * @problem.severity error + * @tags correctness + * external/cwe/cwe-586 + */ + +import java + +from MethodCall mc, Method m +where + mc.getMethod() = m and + m.hasName("finalize") and + // The Java documentation for `finalize` states: "If a subclass overrides + // `finalize` it must invoke the superclass finalizer explicitly". Therefore, + // we do not alert on `super.finalize` calls that occur within a callable + // that overrides `finalize`. + not exists(Callable caller, FinalizeMethod fm | caller = mc.getCaller() | + caller.(Method).overrides(fm) and + mc.getQualifier() instanceof SuperAccess + ) +select mc, "Call to 'finalize'." diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md deleted file mode 100644 index 70a1236e3a7..00000000000 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.md +++ /dev/null @@ -1,34 +0,0 @@ -# J-FIN-002: Calling garbage collection methods in application code may cause inconsistent program state - -Calling garbage collection or finalizer methods in application code may cause inconsistent program state or unpredicatable behavior. - -## Overview - -Triggering garbage collection explicitly may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior or deadlock. - -## Recommendation - -Avoid calling finalizers and garbage collection methods in application code. Allow the JVM to determine a garbage collection schedule instead. - -## Example - -```java -public class Test { - void f() throws Throwable { - System.gc(); // NON_COMPLIANT - Runtime.getRuntime().gc(); // NON_COMPLIANT - System.runFinalizersOnExit(true); //NON_COMPLIANT - this.finalize(); // NON_COMPLIANT - } -} - -``` - -# Implementation Notes - -This rule covers a concept related to J-FIN-001; this rule is focused on the use of existing finalizer invocations rather than attempts to write a custom implementation (J-FIN-001). - -## References - -- [Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers) -- [CWE-586](https://cwe.mitre.org/data/definitions/586) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql deleted file mode 100644 index b2e55302430..00000000000 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalizers.ql +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @id java/do-not-use-finalizers - * @name J-D-004: Calling garbage collection methods in application code may cause inconsistent program state - * @description Calling garbage collection or finalizer methods in application code may cause - * inconsistent program state or unpredicatable behavior. - * @kind problem - * @precision high - * @problem.severity error - * @tags correctness - * external/cwe/cwe-586 - */ - -import java - -from MethodCall c, Method m -where - c.getMethod() = m and - ( - m.hasQualifiedName("java.lang", "System", ["gc", "runFinalizersOnExit"]) - or - m.hasQualifiedName("java.lang", "Runtime", "gc") - or - m.hasQualifiedName(_, _, "finalize") - ) -select c, "Call to prohibited method that may modify the JVM's garbage collection process." diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected new file mode 100644 index 00000000000..5dd0c3cbdf5 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected @@ -0,0 +1 @@ +| Test.java:3:9:3:23 | finalize(...) | Call to 'finalize'. | diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref new file mode 100644 index 00000000000..7b36e5a63d4 --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref @@ -0,0 +1 @@ +Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotUseFinalize/Test.java new file mode 100644 index 00000000000..6e039dffe8e --- /dev/null +++ b/java/ql/test/query-tests/DoNotUseFinalize/Test.java @@ -0,0 +1,9 @@ +public class Test { + void f() throws Throwable { + this.finalize(); // NON_COMPLIANT + } + + void f1() throws Throwable { + f(); // COMPLIANT + } +} diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected deleted file mode 100644 index 3a96af624f6..00000000000 --- a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.expected +++ /dev/null @@ -1,3 +0,0 @@ -| Test.java:3:9:3:19 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | -| Test.java:4:9:4:33 | gc(...) | Call to prohibited method that may modify the JVM's garbage collection process. | -| Test.java:5:9:5:23 | finalize(...) | Call to prohibited method that may modify the JVM's garbage collection process. | diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref b/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref deleted file mode 100644 index e429708f146..00000000000 --- a/java/ql/test/query-tests/DoNotUseFinalizers/DoNotUseFinalizers.qlref +++ /dev/null @@ -1 +0,0 @@ -rules/J-FIN-002/DoNotUseFinalizers.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalizers/Test.java b/java/ql/test/query-tests/DoNotUseFinalizers/Test.java deleted file mode 100644 index cca4a6b8f21..00000000000 --- a/java/ql/test/query-tests/DoNotUseFinalizers/Test.java +++ /dev/null @@ -1,13 +0,0 @@ -public class Test { - void f() throws Throwable { - System.gc(); // NON_COMPLIANT - Runtime.getRuntime().gc(); // NON_COMPLIANT - this.finalize(); // NON_COMPLIANT - // this is removed in Java 11 - //System.runFinalizersOnExit(true); // NON_COMPLIANT - } - - void f1() throws Throwable { - f(); // COMPLIANT - } -} From d9482ae334f2ed817507f310a5aa637f72f0f389 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 13:38:08 -0400 Subject: [PATCH 021/372] Java: update tests to use inline expectations --- .../test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref | 3 ++- java/ql/test/query-tests/DoNotUseFinalize/Test.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref index 7b36e5a63d4..c47232fa119 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref @@ -1 +1,2 @@ -Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +query: Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotUseFinalize/Test.java index 6e039dffe8e..ecb30cb1b37 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotUseFinalize/Test.java @@ -1,6 +1,7 @@ public class Test { void f() throws Throwable { - this.finalize(); // NON_COMPLIANT + // NON_COMPLIANT + this.finalize(); // $ Alert } void f1() throws Throwable { From c689a0e9b718ff14fd5923e25c0b57224badf64b Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 20:36:21 -0400 Subject: [PATCH 022/372] Java: add more test cases --- .../DoNotUseFinalize/DoNotUseFinalize.expected | 3 ++- .../query-tests/DoNotUseFinalize/Test.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected index 5dd0c3cbdf5..2445343c293 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected +++ b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected @@ -1 +1,2 @@ -| Test.java:3:9:3:23 | finalize(...) | Call to 'finalize'. | +| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize'. | +| Test.java:25:9:25:33 | finalize(...) | Call to 'finalize'. | diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotUseFinalize/Test.java index ecb30cb1b37..3ef4e74e4dc 100644 --- a/java/ql/test/query-tests/DoNotUseFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotUseFinalize/Test.java @@ -7,4 +7,22 @@ public class Test { void f1() throws Throwable { f(); // COMPLIANT } + + @Override + protected void finalize() throws Throwable { + // COMPLIANT: If a subclass overrides `finalize` + // it must invoke the superclass finalizer explicitly. + super.finalize(); + } + + // Overload of `finalize` + protected void finalize(String s) throws Throwable { + System.out.println(s); + } + + // NON_COMPLIANT: call to overload of `finalize` + void f2() throws Throwable { + this.finalize("overload"); // $ Alert + } + } From dd57d1aec6c2a8de30d6b70e790cb5e93208f6ec Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 20:51:03 -0400 Subject: [PATCH 023/372] Java: add quality tag --- .../Undesirable Calls/DoNotUseFinalize.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql index fe420322635..36ca6697fd6 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql @@ -6,7 +6,8 @@ * @kind problem * @precision high * @problem.severity error - * @tags correctness + * @tags quality + * correctness * external/cwe/cwe-586 */ From 44445dbeb8230e7a93c531e249e9dd95846e76d0 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 20:52:06 -0400 Subject: [PATCH 024/372] Java: minor refactor --- .../Undesirable Calls/DoNotUseFinalize.ql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql index 36ca6697fd6..720d72b6c20 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql @@ -13,10 +13,9 @@ import java -from MethodCall mc, Method m +from MethodCall mc where - mc.getMethod() = m and - m.hasName("finalize") and + mc.getMethod().hasName("finalize") and // The Java documentation for `finalize` states: "If a subclass overrides // `finalize` it must invoke the superclass finalizer explicitly". Therefore, // we do not alert on `super.finalize` calls that occur within a callable From 2e254981437cb42799c46611ef72f1a1e918e41f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 20 Mar 2025 21:23:23 -0400 Subject: [PATCH 025/372] Java: add change note --- java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md diff --git a/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md new file mode 100644 index 00000000000..27e4c530cbd --- /dev/null +++ b/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new quality query, `java/do-not-use-finalize`, to detect calls to `finalize`. From f73eda0c38ab9c02407d9d2f1ce380d42a653401 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 18:17:26 -0400 Subject: [PATCH 026/372] Java: add previous-id and change 'use' to 'call' --- .../{DoNotUseFinalize.md => DoNotCallFinalize.md} | 0 .../{DoNotUseFinalize.ql => DoNotCallFinalize.ql} | 5 +++-- java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md | 4 ++++ java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md | 4 ---- .../DoNotCallFinalize.expected} | 0 .../query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref | 2 ++ .../{DoNotUseFinalize => DoNotCallFinalize}/Test.java | 0 .../test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref | 2 -- 8 files changed, 9 insertions(+), 8 deletions(-) rename java/ql/src/Violations of Best Practice/Undesirable Calls/{DoNotUseFinalize.md => DoNotCallFinalize.md} (100%) rename java/ql/src/Violations of Best Practice/Undesirable Calls/{DoNotUseFinalize.ql => DoNotCallFinalize.ql} (88%) create mode 100644 java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md delete mode 100644 java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md rename java/ql/test/query-tests/{DoNotUseFinalize/DoNotUseFinalize.expected => DoNotCallFinalize/DoNotCallFinalize.expected} (100%) create mode 100644 java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref rename java/ql/test/query-tests/{DoNotUseFinalize => DoNotCallFinalize}/Test.java (100%) delete mode 100644 java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md similarity index 100% rename from java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.md rename to java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql similarity index 88% rename from java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql rename to java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 720d72b6c20..592a27ef661 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -1,6 +1,7 @@ /** - * @id java/do-not-use-finalize - * @name Do not use `finalize` + * @id java/do-not-call-finalize + * @previous-id java/do-not-use-finalizers + * @name Do not call `finalize` * @description Calling `finalize` in application code may cause * inconsistent program state or unpredicatable behavior. * @kind problem diff --git a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md new file mode 100644 index 00000000000..101b94136a1 --- /dev/null +++ b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md @@ -0,0 +1,4 @@ +--- +category: newQuery +--- +* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize`. diff --git a/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md deleted file mode 100644 index 27e4c530cbd..00000000000 --- a/java/ql/src/change-notes/2025-03-20-do-not-use-finalize.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* Added a new quality query, `java/do-not-use-finalize`, to detect calls to `finalize`. diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected similarity index 100% rename from java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.expected rename to java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected diff --git a/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref new file mode 100644 index 00000000000..b301797d529 --- /dev/null +++ b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.qlref @@ -0,0 +1,2 @@ +query: Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/DoNotUseFinalize/Test.java b/java/ql/test/query-tests/DoNotCallFinalize/Test.java similarity index 100% rename from java/ql/test/query-tests/DoNotUseFinalize/Test.java rename to java/ql/test/query-tests/DoNotCallFinalize/Test.java diff --git a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref b/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref deleted file mode 100644 index c47232fa119..00000000000 --- a/java/ql/test/query-tests/DoNotUseFinalize/DoNotUseFinalize.qlref +++ /dev/null @@ -1,2 +0,0 @@ -query: Violations of Best Practice/Undesirable Calls/DoNotUseFinalize.ql -postprocess: utils/test/InlineExpectationsTestQuery.ql From ed22a16f32dfb1ba5c940dece2a1dfb105dd88cb Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 19:33:38 -0400 Subject: [PATCH 027/372] Java: exclude overloads of finalize --- .../Undesirable Calls/DoNotCallFinalize.md | 6 +++--- .../Undesirable Calls/DoNotCallFinalize.ql | 12 ++++++------ .../change-notes/2025-03-20-do-not-call-finalize.md | 2 +- .../DoNotCallFinalize/DoNotCallFinalize.expected | 3 +-- java/ql/test/query-tests/DoNotCallFinalize/Test.java | 6 +++--- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 7acb4186fe6..9c3e3ebd4a0 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -1,10 +1,10 @@ ## Overview -Calling `finalize` in application code may cause inconsistent program state or unpredicatable behavior. +Calling `finalize()` in application code may cause inconsistent program state or unpredicatable behavior. ## Recommendation -Avoid calling `finalize` in application code. Allow the JVM to determine a garbage collection schedule instead. +Avoid calling `finalize()` in application code. Allow the JVM to determine a garbage collection schedule instead. ## Example @@ -19,7 +19,7 @@ public class Test { # Implementation Notes -This rule is focused on the use of existing `finalize` invocations rather than attempts to write a custom implementation. +This rule is focused on the use of existing `finalize()` invocations rather than attempts to write a custom implementation. ## References diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 592a27ef661..3b6be7b652d 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -1,8 +1,8 @@ /** * @id java/do-not-call-finalize * @previous-id java/do-not-use-finalizers - * @name Do not call `finalize` - * @description Calling `finalize` in application code may cause + * @name Do not call `finalize()` + * @description Calling `finalize()` in application code may cause * inconsistent program state or unpredicatable behavior. * @kind problem * @precision high @@ -16,13 +16,13 @@ import java from MethodCall mc where - mc.getMethod().hasName("finalize") and - // The Java documentation for `finalize` states: "If a subclass overrides + mc.getMethod() instanceof FinalizeMethod and + // The Java documentation for `finalize()` states: "If a subclass overrides // `finalize` it must invoke the superclass finalizer explicitly". Therefore, - // we do not alert on `super.finalize` calls that occur within a callable + // we do not alert on `super.finalize()` calls that occur within a callable // that overrides `finalize`. not exists(Callable caller, FinalizeMethod fm | caller = mc.getCaller() | caller.(Method).overrides(fm) and mc.getQualifier() instanceof SuperAccess ) -select mc, "Call to 'finalize'." +select mc, "Call to 'finalize()'." diff --git a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md index 101b94136a1..8317dce595c 100644 --- a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md +++ b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md @@ -1,4 +1,4 @@ --- category: newQuery --- -* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize`. +* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize()`. diff --git a/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected index 2445343c293..ac3c4fa59c0 100644 --- a/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected +++ b/java/ql/test/query-tests/DoNotCallFinalize/DoNotCallFinalize.expected @@ -1,2 +1 @@ -| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize'. | -| Test.java:25:9:25:33 | finalize(...) | Call to 'finalize'. | +| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize()'. | diff --git a/java/ql/test/query-tests/DoNotCallFinalize/Test.java b/java/ql/test/query-tests/DoNotCallFinalize/Test.java index 3ef4e74e4dc..eb7ac19da59 100644 --- a/java/ql/test/query-tests/DoNotCallFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotCallFinalize/Test.java @@ -10,7 +10,7 @@ public class Test { @Override protected void finalize() throws Throwable { - // COMPLIANT: If a subclass overrides `finalize` + // COMPLIANT: If a subclass overrides `finalize()` // it must invoke the superclass finalizer explicitly. super.finalize(); } @@ -20,9 +20,9 @@ public class Test { System.out.println(s); } - // NON_COMPLIANT: call to overload of `finalize` + // COMPLIANT: call to overload of `finalize` void f2() throws Throwable { - this.finalize("overload"); // $ Alert + this.finalize("overload"); } } From 3631df03c7faec4d2d4371f73217a783164cfb3f Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 19:38:10 -0400 Subject: [PATCH 028/372] Java: add to code-quality suite --- java/ql/src/codeql-suites/java-code-quality.qls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/codeql-suites/java-code-quality.qls b/java/ql/src/codeql-suites/java-code-quality.qls index ac1f52624c4..552d803eec1 100644 --- a/java/ql/src/codeql-suites/java-code-quality.qls +++ b/java/ql/src/codeql-suites/java-code-quality.qls @@ -11,4 +11,5 @@ - java/unused-container - java/input-resource-leak - java/output-resource-leak - - java/type-variable-hides-type \ No newline at end of file + - java/type-variable-hides-type + - java/do-not-call-finalize From caf21a8202c3055273d5955e2fc273c58881fe82 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 20:20:48 -0400 Subject: [PATCH 029/372] Java: update qhelp and add 'performace' tag --- .../Undesirable Calls/DoNotCallFinalize.md | 5 +++-- .../Undesirable Calls/DoNotCallFinalize.ql | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 9c3e3ebd4a0..46dd0802b96 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -1,6 +1,6 @@ ## Overview -Calling `finalize()` in application code may cause inconsistent program state or unpredicatable behavior. +Triggering garbage collection by directly calling `finalize()` may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior, performance issues, or deadlock. ## Recommendation @@ -23,5 +23,6 @@ This rule is focused on the use of existing `finalize()` invocations rather than ## References -- Carnegie Mellon University, SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). +- SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). +- Java API Specification: [Object.finalize()](https://docs.oracle.com/javase/10/docs/api/java/lang/Object.html#finalize()). - Common Weakness Enumeration: [CWE-586](https://cwe.mitre.org/data/definitions/586). diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 3b6be7b652d..8ee12909a6d 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -9,6 +9,7 @@ * @problem.severity error * @tags quality * correctness + * performance * external/cwe/cwe-586 */ From 92cdddf6047c12d773845a2db35186bbce87937e Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 27 Mar 2025 21:29:20 -0400 Subject: [PATCH 030/372] Java: resolve filename conflict --- java/ql/src/codeql-suites/{java-ccr.qls => java-code-quality.qls} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename java/ql/src/codeql-suites/{java-ccr.qls => java-code-quality.qls} (100%) diff --git a/java/ql/src/codeql-suites/java-ccr.qls b/java/ql/src/codeql-suites/java-code-quality.qls similarity index 100% rename from java/ql/src/codeql-suites/java-ccr.qls rename to java/ql/src/codeql-suites/java-code-quality.qls From ae555f2f2e3ac85dc7f2c2bff1330a8b016789ae Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:23:49 +0000 Subject: [PATCH 031/372] Rust: Add a test for uncontrolled allocation size. --- .../UncontrolledAllocationSize.expected | 0 .../CWE-770/UncontrolledAllocationSize.qlref | 4 + .../test/query-tests/security/CWE-770/main.rs | 223 ++++++++++++++++++ .../query-tests/security/CWE-770/options.yml | 3 + .../security/CWE-770/rust-toolchain.toml | 2 + 5 files changed, 232 insertions(+) create mode 100644 rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected create mode 100644 rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.qlref create mode 100644 rust/ql/test/query-tests/security/CWE-770/main.rs create mode 100644 rust/ql/test/query-tests/security/CWE-770/options.yml create mode 100644 rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.qlref b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.qlref new file mode 100644 index 00000000000..2e30becb92c --- /dev/null +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.qlref @@ -0,0 +1,4 @@ +query: queries/security/CWE-770/UncontrolledAllocationSize.ql +postprocess: + - utils/test/InlineExpectationsTestQuery.ql + - utils/test/PrettyPrintModels.ql diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs new file mode 100644 index 00000000000..c2a1eb111c3 --- /dev/null +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -0,0 +1,223 @@ +#![feature(alloc_layout_extra)] +#![feature(allocator_api)] +#![feature(try_with_capacity)] +#![feature(box_vec_non_null)] +#![feature(non_null_from_ref)] + +struct MyStruct { + _a: usize, + _b: i64, +} + +unsafe fn test_std_alloc_from_size(v: usize) { + let l1 = std::alloc::Layout::from_size_align(16, 1).unwrap(); + let m1 = std::alloc::alloc(l1); + let _ = std::alloc::alloc(l1.align_to(8).unwrap()); + let _ = std::alloc::alloc(l1.align_to(8).unwrap().pad_to_align()); + let _ = std::alloc::alloc_zeroed(l1); + let _ = std::alloc::realloc(m1, l1, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l2 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.align_to(8).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.align_to(8).unwrap().pad_to_align()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc_zeroed(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l3 = std::alloc::Layout::from_size_align(1, v).unwrap(); // not obviously dangerous? + let _ = std::alloc::alloc(l3); + + let l4 = std::alloc::Layout::from_size_align_unchecked(v, 1); + let _ = std::alloc::alloc(l4); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l5 = std::alloc::Layout::from_size_align_unchecked(v * std::mem::size_of::(), std::mem::size_of::()); + let _ = std::alloc::alloc(l5); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let s6 = (std::mem::size_of::() * v) + 1; + let l6 = std::alloc::Layout::from_size_align_unchecked(s6, 4); + let _ = std::alloc::alloc(l6); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l7 = std::alloc::Layout::from_size_align_unchecked(l6.size(), 8); + let _ = std::alloc::alloc(l7); // $ MISSING: Alert[rust/uncontrolled-allocation-size] +} + +unsafe fn test_std_alloc_new_repeat_extend(v: usize) { + let l1 = std::alloc::Layout::new::<[u8; 10]>(); + let _ = std::alloc::alloc(l1); + + let l2 = std::alloc::Layout::new::(); + let _ = std::alloc::alloc(l2); + let _ = std::alloc::alloc(l2.repeat(10).unwrap().0); + let _ = std::alloc::alloc(l2.repeat(v).unwrap().0); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.repeat(v + 1).unwrap().0); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.repeat_packed(10).unwrap()); + let _ = std::alloc::alloc(l2.repeat_packed(v).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.repeat_packed(v * 10).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l3 = std::alloc::Layout::array::(10).unwrap(); + let _ = std::alloc::alloc(l3); + let (k1, _offs1) = l3.repeat(v).expect("arithmetic overflow?"); + let _ = std::alloc::alloc(k1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let (k2, _offs2) = l3.extend(k1).unwrap(); + let _ = std::alloc::alloc(k2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let (k3, _offs3) = k1.extend(l3).unwrap(); + let _ = std::alloc::alloc(k3); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l3.extend_packed(k1).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(k1.extend_packed(l3).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l4 = std::alloc::Layout::array::(v).unwrap(); + let _ = std::alloc::alloc(l4); // $ MISSING: Alert[rust/uncontrolled-allocation-size] +} + +fn clamp(v: T, min: T, max: T) -> T { + if v < min { + return min; + } else if v > max { + return max; + } else { + return v; + } +} + +unsafe fn test_std_alloc_with_bounds(v: usize) { + let l1 = std::alloc::Layout::array::(v).unwrap(); + + if v < 100 { + let _ = std::alloc::alloc(l1); + } else { + let _ = std::alloc::alloc(l1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + } + + if v == 100 { + let _ = std::alloc::alloc(l1); + } else { + let _ = std::alloc::alloc(l1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + } + + { + let mut v_mut = v; + + if v_mut > 100 { + v_mut = 100; + } + + let l2 = std::alloc::Layout::array::(v_mut).unwrap(); + let _ = std::alloc::alloc(l2); + + let l3 = std::alloc::Layout::array::(v).unwrap(); + let _ = std::alloc::alloc(l3); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + } + + let l4 = std::alloc::Layout::array::(std::cmp::min(v, 100)).unwrap(); + let _ = std::alloc::alloc(l4); + + let l5 = std::alloc::Layout::array::(std::cmp::max(v, 100)).unwrap(); + let _ = std::alloc::alloc(l5); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l6 = std::alloc::Layout::array::(clamp(v, 1, 100)).unwrap(); + let _ = std::alloc::alloc(l6); + + let _ = std::alloc::alloc(l1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + if v > 100 { + return; + } + let _ = std::alloc::alloc(l1); +} + +use std::alloc::{GlobalAlloc, Allocator}; + +unsafe fn test_system_alloc(v: usize) { + let l1 = std::alloc::Layout::array::(10).unwrap(); + let _ = std::alloc::System.alloc(l1); + let _ = std::alloc::System.alloc_zeroed(l1); + let _ = std::alloc::System.allocate(l1).unwrap(); + let _ = std::alloc::System.allocate_zeroed(l1).unwrap(); + let _ = std::alloc::Global.allocate(l1).unwrap(); + let _ = std::alloc::Global.allocate_zeroed(l1).unwrap(); + + let l2 = std::alloc::Layout::array::(v).unwrap(); + let _ = std::alloc::System.alloc(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::System.alloc_zeroed(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::System.allocate(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::System.allocate_zeroed(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::Global.allocate(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::Global.allocate_zeroed(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l3 = std::alloc::Layout::array::(10).unwrap(); + let m3 = std::alloc::System.alloc(l3); + let _ = std::alloc::System.realloc(m3, l3, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l4 = std::alloc::Layout::array::(10).unwrap(); + let m4 = std::ptr::NonNull::::new(std::alloc::alloc(l4)).unwrap(); + if v > 10 { + if v % 2 == 0 { + let _ = std::alloc::System.grow(m4, l4, l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + } else { + let _ = std::alloc::System.grow_zeroed(m4, l4, l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + } + } else { + let _ = std::alloc::System.shrink(m4, l4, l2).unwrap(); + } +} + +unsafe fn test_libc_alloc(v: usize) { + let m1 = libc::malloc(256); + let _ = libc::malloc(v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = libc::aligned_alloc(8, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = libc::aligned_alloc(v, 8); + let _ = libc::calloc(64, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = libc::calloc(v, std::mem::size_of::()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = libc::realloc(m1, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] +} + +unsafe fn test_vectors(v: usize) { + let _ = Vec::::try_with_capacity(v).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = Vec::::with_capacity(v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = Vec::::try_with_capacity_in(v, std::alloc::Global).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = Vec::::with_capacity_in(v, std::alloc::Global); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let mut v1 = Vec::::with_capacity(100); + v1.reserve(v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + v1.reserve_exact(v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = v1.try_reserve(v).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = v1.try_reserve_exact(v).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + v1.resize(v, 1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + v1.set_len(v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let l2 = std::alloc::Layout::new::<[u64; 200]>(); + let m2 = std::ptr::NonNull::::new(std::alloc::alloc(l2).cast::()).unwrap(); + let _ = Vec::::from_parts(m2, v, 200); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let m3 = std::ptr::NonNull::::new(std::alloc::alloc(l2).cast::()).unwrap(); + let _ = Vec::::from_parts(m3, 100, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let m4 = std::ptr::NonNull::::new(std::alloc::alloc(l2).cast::()).unwrap(); + let _ = Vec::::from_parts_in(m4, 100, v, std::alloc::Global); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let m5 = std::alloc::alloc(l2).cast::(); + let _ = Vec::::from_raw_parts(m5, v, 200); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let m6 = std::alloc::alloc(l2).cast::(); + let _ = Vec::::from_raw_parts(m6, 100, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + + let m7 = std::alloc::alloc(l2).cast::(); + let _ = Vec::::from_raw_parts_in(m7, 100, v, std::alloc::Global); // $ MISSING: Alert[rust/uncontrolled-allocation-size] +} + +// --- main --- + +fn main() { + println!("--- begin ---"); + + let v = std::env::args().nth(1).unwrap_or("1024".to_string()).parse::().unwrap(); // $ Source=arg1 + + unsafe { + test_std_alloc_from_size(v); + test_std_alloc_new_repeat_extend(v); + test_std_alloc_with_bounds(v); + test_system_alloc(v); + test_libc_alloc(v); + test_vectors(v); + } + + println!("--- end ---"); +} diff --git a/rust/ql/test/query-tests/security/CWE-770/options.yml b/rust/ql/test/query-tests/security/CWE-770/options.yml new file mode 100644 index 00000000000..95a17a53b43 --- /dev/null +++ b/rust/ql/test/query-tests/security/CWE-770/options.yml @@ -0,0 +1,3 @@ +qltest_cargo_check: true +qltest_dependencies: + - libc = { version = "0.2.11" } diff --git a/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml b/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml new file mode 100644 index 00000000000..afeb5929325 --- /dev/null +++ b/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly-2025-03-17" From 9409cd6ed7d0f9ee2fb3d863dda9df48831837f0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:32:43 +0000 Subject: [PATCH 032/372] Rust: Prototype query. --- .../UncontrolledAllocationSizeExtensions.qll | 34 ++++++++++++++ .../CWE-770/UncontrolledAllocationSize.ql | 44 +++++++++++++++++++ .../UncontrolledAllocationSize.expected | 4 ++ 3 files changed, 82 insertions(+) create mode 100644 rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll create mode 100644 rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql diff --git a/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll b/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll new file mode 100644 index 00000000000..bb0ffbb4e3c --- /dev/null +++ b/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll @@ -0,0 +1,34 @@ +/** + * Provides classes and predicates for reasoning about uncontrolled allocation + * size vulnerabilities. + */ + +import rust +private import codeql.rust.Concepts +private import codeql.rust.dataflow.DataFlow +private import codeql.rust.dataflow.FlowSink + +/** + * Provides default sources, sinks and barriers for detecting uncontrolled + * allocation size vulnerabilities, as well as extension points for adding your own. + */ +module UncontrolledAllocationSize { + /** + * A data flow sink for uncontrolled allocation size vulnerabilities. + */ + abstract class Sink extends QuerySink::Range { + override string getSinkType() { result = "UncontrolledAllocationSize" } + } + + /** + * A barrier for uncontrolled allocation size vulnerabilities. + */ + abstract class Barrier extends DataFlow::Node { } + + /** + * sink for uncontrolled allocation size from model data. + */ + private class ModelsAsDataSink extends Sink { + ModelsAsDataSink() { sinkNode(this, ["alloc-size", "alloc-layout"]) } + } +} diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql new file mode 100644 index 00000000000..bbaaaf06a02 --- /dev/null +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql @@ -0,0 +1,44 @@ +/** + * @name Uncontrolled allocation size + * @description Allocating memory with a size controlled by an external user can result in + * arbitrary amounts of memory being allocated. + * @kind path-problem + * @problem.severity recommendation + * @security-severity 7.5 + * @precision high + * @id rust/uncontrolled-allocation-size + * @tags reliability + * security + * external/cwe/cwe-770 + * external/cwe/cwe-789 + */ + +import rust +import codeql.rust.Concepts +import codeql.rust.dataflow.DataFlow +import codeql.rust.dataflow.TaintTracking +import codeql.rust.dataflow.internal.DataFlowImpl +import codeql.rust.security.UncontrolledAllocationSizeExtensions + +/** + * A taint-tracking configuration for uncontrolled allocation size vulnerabilities. + */ +module UncontrolledAllocationConfig implements DataFlow::ConfigSig { + import UncontrolledAllocationSize + + predicate isSource(DataFlow::Node source) { source instanceof ActiveThreatModelSource } + + predicate isSink(DataFlow::Node sink) { sink instanceof Sink } + + predicate isBarrier(DataFlow::Node barrier) { barrier instanceof Barrier } +} + +module UncontrolledAllocationFlow = TaintTracking::Global; + +import UncontrolledAllocationFlow::PathGraph + +from UncontrolledAllocationFlow::PathNode source, UncontrolledAllocationFlow::PathNode sink +where UncontrolledAllocationFlow::flowPath(source, sink) +select sink.getNode(), source, sink, + "This allocation size is derived from a $@ and could allocate arbitrary amounts of memory.", + source.getNode(), "user-provided value" diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index e69de29bb2d..58f42bec0c8 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -0,0 +1,4 @@ +#select +edges +nodes +subpaths From 03f94de3cb70178c7c5da4c1ba9b2d300a316390 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:49:03 +0000 Subject: [PATCH 033/372] Rust: Add models. --- .../lib/codeql/rust/frameworks/libc.model.yml | 9 + .../frameworks/stdlib/lang-alloc.model.yml | 25 + .../frameworks/stdlib/lang-core.model.yml | 14 +- .../diagnostics/SummaryStats.expected | 2 +- .../UncontrolledAllocationSize.expected | 443 ++++++++++++++++++ .../test/query-tests/security/CWE-770/main.rs | 80 ++-- 6 files changed, 531 insertions(+), 42 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/frameworks/libc.model.yml create mode 100644 rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml diff --git a/rust/ql/lib/codeql/rust/frameworks/libc.model.yml b/rust/ql/lib/codeql/rust/frameworks/libc.model.yml new file mode 100644 index 00000000000..f952656a21e --- /dev/null +++ b/rust/ql/lib/codeql/rust/frameworks/libc.model.yml @@ -0,0 +1,9 @@ +extensions: + - addsTo: + pack: codeql/rust-all + extensible: sinkModel + data: + - ["repo:https://github.com/rust-lang/libc:libc", "::malloc", "Argument[0]", "alloc-size", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::aligned_alloc", "Argument[1]", "alloc-size", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::calloc", "Argument[0,1]", "alloc-size", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::realloc", "Argument[1]", "alloc-size", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml new file mode 100644 index 00000000000..85cd97fb462 --- /dev/null +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -0,0 +1,25 @@ +extensions: + - addsTo: + pack: codeql/rust-all + extensible: sinkModel + data: + # Alloc + - ["lang:alloc", "crate::alloc::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["lang:alloc", "crate::alloc::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["lang:alloc", "crate::alloc::realloc", "Argument[2]", "alloc-size", "manual"] + - ["lang:std", "::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["lang:std", "::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["lang:std", "::allocate", "Argument[0]", "alloc-layout", "manual"] + - ["lang:std", "::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["lang:std", "::grow", "Argument[2]", "alloc-layout", "manual"] + - ["lang:std", "::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] + - ["lang:alloc", "::alloc", "Argument[0]", "alloc-layout", "manual"] + - ["lang:alloc", "::alloc_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["lang:alloc", "::allocate", "Argument[0]", "alloc-layout", "manual"] + - ["lang:alloc", "::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] + - ["lang:alloc", "::grow", "Argument[2]", "alloc-layout", "manual"] + - ["lang:alloc", "::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::malloc", "Argument[0]", "alloc-size", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::aligned_alloc", "Argument[1]", "alloc-size", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::calloc", "Argument[0,1]", "alloc-size", "manual"] + - ["repo:https://github.com/rust-lang/libc:libc", "::realloc", "Argument[1]", "alloc-size", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index a2f6b15ab2c..710949b07e0 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -19,7 +19,19 @@ extensions: - ["lang:core", "::collect", "Argument[self].Element", "ReturnValue.Element", "value", "manual"] - ["lang:core", "::map", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] - ["lang:core", "::for_each", "Argument[self].Element", "Argument[0].Parameter[0]", "value", "manual"] - # ptr + # Layout + - ["lang:core", "::from_size_align", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::from_size_align_unchecked", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::array", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::repeat", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["lang:core", "::repeat", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["lang:core", "::repeat_packed", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::repeat_packed", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::extend", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["lang:core", "::extend", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]", "taint", "manual"] + - ["lang:core", "::extend_packed", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::extend_packed", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + # Ptr - ["lang:core", "crate::ptr::read", "Argument[0].Reference", "ReturnValue", "value", "manual"] - ["lang:core", "crate::ptr::read_unaligned", "Argument[0].Reference", "ReturnValue", "value", "manual"] - ["lang:core", "crate::ptr::read_volatile", "Argument[0].Reference", "ReturnValue", "value", "manual"] diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index d34cd849069..a8833f62680 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -15,7 +15,7 @@ | Macro calls - resolved | 8 | | Macro calls - total | 9 | | Macro calls - unresolved | 1 | -| Taint edges - number of edges | 1674 | +| Taint edges - number of edges | 1675 | | Taint reach - nodes tainted | 0 | | Taint reach - per million nodes | 0 | | Taint sinks - cryptographic operations | 0 | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 58f42bec0c8..4dcc0f1b558 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -1,4 +1,447 @@ #select +| main.rs:18:13:18:31 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:18:13:18:31 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:21:13:21:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:21:13:21:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:24:13:24:36 | ...::alloc_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:24:13:24:36 | ...::alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:30:13:30:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:30:13:30:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:33:13:33:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:33:13:33:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:37:13:37:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:37:13:37:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:50:13:50:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:50:13:50:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:51:13:51:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:51:13:51:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:53:13:53:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:53:13:53:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:54:13:54:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:54:13:54:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:59:13:59:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:59:13:59:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:61:13:61:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:61:13:61:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:63:13:63:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:63:13:63:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:64:13:64:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:65:13:65:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:68:13:68:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:85:17:85:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:85:17:85:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:87:17:87:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:87:17:87:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:91:17:91:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:91:17:91:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:93:17:93:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:93:17:93:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:104:17:104:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:104:17:104:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:107:17:107:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:107:17:107:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:111:13:111:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:111:13:111:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:114:13:114:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:114:13:114:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:117:13:117:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:117:13:117:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:119:13:119:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:119:13:119:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:123:13:123:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:123:13:123:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:138:32:138:36 | alloc | main.rs:211:13:211:26 | ...::args | main.rs:138:32:138:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:139:32:139:43 | alloc_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:139:32:139:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:140:32:140:39 | allocate | main.rs:211:13:211:26 | ...::args | main.rs:140:32:140:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:141:32:141:46 | allocate_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:141:32:141:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:142:32:142:39 | allocate | main.rs:211:13:211:26 | ...::args | main.rs:142:32:142:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:143:32:143:46 | allocate_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:143:32:143:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:153:40:153:43 | grow | main.rs:211:13:211:26 | ...::args | main.rs:153:40:153:43 | grow | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:155:40:155:50 | grow_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:155:40:155:50 | grow_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:164:13:164:24 | ...::malloc | main.rs:211:13:211:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:164:13:164:24 | ...::malloc | main.rs:211:13:211:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:211:13:211:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:211:13:211:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:167:13:167:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:167:13:167:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:168:13:168:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:168:13:168:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:169:13:169:25 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:169:13:169:25 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | edges +| main.rs:12:36:12:43 | ...: usize | main.rs:18:41:18:41 | v | provenance | | +| main.rs:18:41:18:41 | v | main.rs:18:13:18:31 | ...::realloc | provenance | MaD:5 Sink:MaD:5 | +| main.rs:18:41:18:41 | v | main.rs:20:50:20:50 | v | provenance | | +| main.rs:18:41:18:41 | v | main.rs:29:60:29:60 | v | provenance | | +| main.rs:18:41:18:41 | v | main.rs:32:60:32:89 | ... * ... | provenance | | +| main.rs:18:41:18:41 | v | main.rs:35:9:35:10 | s6 | provenance | | +| main.rs:20:9:20:10 | l2 | main.rs:21:31:21:32 | l2 | provenance | | +| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:20:14:20:63 | ... .unwrap(...) | main.rs:20:9:20:10 | l2 | provenance | | +| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:22 | +| main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:21:31:21:32 | l2 | main.rs:24:38:24:39 | l2 | provenance | | +| main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:4 Sink:MaD:4 | +| main.rs:29:9:29:10 | l4 | main.rs:30:31:30:32 | l4 | provenance | | +| main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | main.rs:29:9:29:10 | l4 | provenance | | +| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:23 | +| main.rs:30:31:30:32 | l4 | main.rs:30:13:30:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:32:9:32:10 | l5 | main.rs:33:31:33:32 | l5 | provenance | | +| main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | main.rs:32:9:32:10 | l5 | provenance | | +| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:23 | +| main.rs:33:31:33:32 | l5 | main.rs:33:13:33:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:35:9:35:10 | s6 | main.rs:36:60:36:61 | s6 | provenance | | +| main.rs:36:9:36:10 | l6 | main.rs:37:31:37:32 | l6 | provenance | | +| main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | main.rs:36:9:36:10 | l6 | provenance | | +| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:23 | +| main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:43:44:43:51 | ...: usize | main.rs:50:41:50:41 | v | provenance | | +| main.rs:43:44:43:51 | ...: usize | main.rs:51:41:51:45 | ... + ... | provenance | | +| main.rs:43:44:43:51 | ...: usize | main.rs:53:48:53:48 | v | provenance | | +| main.rs:43:44:43:51 | ...: usize | main.rs:54:48:54:53 | ... * ... | provenance | | +| main.rs:43:44:43:51 | ...: usize | main.rs:58:34:58:34 | v | provenance | | +| main.rs:43:44:43:51 | ...: usize | main.rs:67:46:67:46 | v | provenance | | +| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | +| main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:24 | +| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | +| main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:24 | +| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:53:31:53:58 | ... .unwrap(...) | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:25 | +| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:54:31:54:63 | ... .unwrap(...) | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:25 | +| main.rs:58:9:58:20 | TuplePat [tuple.0] | main.rs:58:10:58:11 | k1 | provenance | | +| main.rs:58:10:58:11 | k1 | main.rs:59:31:59:32 | k1 | provenance | | +| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:27 | +| main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | main.rs:58:9:58:20 | TuplePat [tuple.0] | provenance | | +| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:24 | +| main.rs:59:31:59:32 | k1 | main.rs:59:13:59:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:59:31:59:32 | k1 | main.rs:60:34:60:35 | k1 | provenance | | +| main.rs:59:31:59:32 | k1 | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | provenance | MaD:19 | +| main.rs:59:31:59:32 | k1 | main.rs:64:48:64:49 | k1 | provenance | | +| main.rs:59:31:59:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:21 | +| main.rs:60:9:60:20 | TuplePat [tuple.0] | main.rs:60:10:60:11 | k2 | provenance | | +| main.rs:60:10:60:11 | k2 | main.rs:61:31:61:32 | k2 | provenance | | +| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | +| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:18 | +| main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:62:9:62:20 | TuplePat [tuple.0] | main.rs:62:10:62:11 | k3 | provenance | | +| main.rs:62:10:62:11 | k3 | main.rs:63:31:63:32 | k3 | provenance | | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | main.rs:62:9:62:20 | TuplePat [tuple.0] | provenance | | +| main.rs:63:31:63:32 | k3 | main.rs:63:13:63:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:64:31:64:59 | ... .unwrap(...) | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:20 | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:65:31:65:59 | ... .unwrap(...) | main.rs:65:13:65:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:67:9:67:10 | l4 | main.rs:68:31:68:32 | l4 | provenance | | +| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:67:14:67:56 | ... .unwrap(...) | main.rs:67:9:67:10 | l4 | provenance | | +| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | provenance | | +| main.rs:81:38:81:45 | ...: usize | main.rs:82:47:82:47 | v | provenance | | +| main.rs:81:38:81:45 | ...: usize | main.rs:97:13:97:21 | mut v_mut | provenance | | +| main.rs:81:38:81:45 | ...: usize | main.rs:106:51:106:51 | v | provenance | | +| main.rs:81:38:81:45 | ...: usize | main.rs:110:61:110:61 | v | provenance | | +| main.rs:81:38:81:45 | ...: usize | main.rs:113:61:113:61 | v | provenance | | +| main.rs:81:38:81:45 | ...: usize | main.rs:116:53:116:53 | v | provenance | | +| main.rs:82:9:82:10 | l1 | main.rs:85:35:85:36 | l1 | provenance | | +| main.rs:82:9:82:10 | l1 | main.rs:87:35:87:36 | l1 | provenance | | +| main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | main.rs:82:14:82:57 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:82:14:82:57 | ... .unwrap(...) | main.rs:82:9:82:10 | l1 | provenance | | +| main.rs:82:47:82:47 | v | main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:85:35:85:36 | l1 | main.rs:85:17:85:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:85:35:85:36 | l1 | main.rs:91:35:91:36 | l1 | provenance | | +| main.rs:85:35:85:36 | l1 | main.rs:93:35:93:36 | l1 | provenance | | +| main.rs:87:35:87:36 | l1 | main.rs:87:17:87:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:87:35:87:36 | l1 | main.rs:91:35:91:36 | l1 | provenance | | +| main.rs:87:35:87:36 | l1 | main.rs:93:35:93:36 | l1 | provenance | | +| main.rs:91:35:91:36 | l1 | main.rs:91:17:91:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:91:35:91:36 | l1 | main.rs:119:31:119:32 | l1 | provenance | | +| main.rs:93:35:93:36 | l1 | main.rs:93:17:93:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:93:35:93:36 | l1 | main.rs:119:31:119:32 | l1 | provenance | | +| main.rs:97:13:97:21 | mut v_mut | main.rs:103:51:103:55 | v_mut | provenance | | +| main.rs:103:13:103:14 | l2 | main.rs:104:35:104:36 | l2 | provenance | | +| main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | main.rs:103:18:103:65 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:103:18:103:65 | ... .unwrap(...) | main.rs:103:13:103:14 | l2 | provenance | | +| main.rs:103:51:103:55 | v_mut | main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:104:35:104:36 | l2 | main.rs:104:17:104:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:106:13:106:14 | l3 | main.rs:107:35:107:36 | l3 | provenance | | +| main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | main.rs:106:18:106:61 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:106:18:106:61 | ... .unwrap(...) | main.rs:106:13:106:14 | l3 | provenance | | +| main.rs:106:51:106:51 | v | main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:107:35:107:36 | l3 | main.rs:107:17:107:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:110:9:110:10 | l4 | main.rs:111:31:111:32 | l4 | provenance | | +| main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | main.rs:110:14:110:77 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:110:14:110:77 | ... .unwrap(...) | main.rs:110:9:110:10 | l4 | provenance | | +| main.rs:110:47:110:67 | ...::min(...) | main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:110:61:110:61 | v | main.rs:110:47:110:67 | ...::min(...) | provenance | MaD:31 | +| main.rs:111:31:111:32 | l4 | main.rs:111:13:111:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:113:9:113:10 | l5 | main.rs:114:31:114:32 | l5 | provenance | | +| main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | main.rs:113:14:113:77 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:113:14:113:77 | ... .unwrap(...) | main.rs:113:9:113:10 | l5 | provenance | | +| main.rs:113:47:113:67 | ...::max(...) | main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:113:61:113:61 | v | main.rs:113:47:113:67 | ...::max(...) | provenance | MaD:30 | +| main.rs:114:31:114:32 | l5 | main.rs:114:13:114:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:116:9:116:10 | l6 | main.rs:117:31:117:32 | l6 | provenance | | +| main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | main.rs:116:14:116:72 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:116:14:116:72 | ... .unwrap(...) | main.rs:116:9:116:10 | l6 | provenance | | +| main.rs:116:47:116:62 | clamp(...) | main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:116:53:116:53 | v | main.rs:71:35:71:38 | ...: T | provenance | | +| main.rs:116:53:116:53 | v | main.rs:116:47:116:62 | clamp(...) | provenance | | +| main.rs:117:31:117:32 | l6 | main.rs:117:13:117:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:119:31:119:32 | l1 | main.rs:119:13:119:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:119:31:119:32 | l1 | main.rs:123:31:123:32 | l1 | provenance | | +| main.rs:123:31:123:32 | l1 | main.rs:123:13:123:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:128:29:128:36 | ...: usize | main.rs:137:46:137:46 | v | provenance | | +| main.rs:137:9:137:10 | l2 | main.rs:138:38:138:39 | l2 | provenance | | +| main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | main.rs:137:14:137:56 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:137:14:137:56 | ... .unwrap(...) | main.rs:137:9:137:10 | l2 | provenance | | +| main.rs:137:46:137:46 | v | main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:138:38:138:39 | l2 | main.rs:138:32:138:36 | alloc | provenance | MaD:10 Sink:MaD:10 | +| main.rs:138:38:138:39 | l2 | main.rs:139:45:139:46 | l2 | provenance | | +| main.rs:139:45:139:46 | l2 | main.rs:139:32:139:43 | alloc_zeroed | provenance | MaD:11 Sink:MaD:11 | +| main.rs:139:45:139:46 | l2 | main.rs:140:41:140:42 | l2 | provenance | | +| main.rs:140:41:140:42 | l2 | main.rs:140:32:140:39 | allocate | provenance | MaD:6 Sink:MaD:6 | +| main.rs:140:41:140:42 | l2 | main.rs:141:48:141:49 | l2 | provenance | | +| main.rs:141:48:141:49 | l2 | main.rs:141:32:141:46 | allocate_zeroed | provenance | MaD:7 Sink:MaD:7 | +| main.rs:141:48:141:49 | l2 | main.rs:142:41:142:42 | l2 | provenance | | +| main.rs:142:41:142:42 | l2 | main.rs:142:32:142:39 | allocate | provenance | MaD:1 Sink:MaD:1 | +| main.rs:142:41:142:42 | l2 | main.rs:143:48:143:49 | l2 | provenance | | +| main.rs:143:48:143:49 | l2 | main.rs:143:32:143:46 | allocate_zeroed | provenance | MaD:2 Sink:MaD:2 | +| main.rs:143:48:143:49 | l2 | main.rs:153:53:153:54 | l2 | provenance | | +| main.rs:143:48:143:49 | l2 | main.rs:155:60:155:61 | l2 | provenance | | +| main.rs:153:53:153:54 | l2 | main.rs:153:40:153:43 | grow | provenance | MaD:8 Sink:MaD:8 | +| main.rs:155:60:155:61 | l2 | main.rs:155:40:155:50 | grow_zeroed | provenance | MaD:9 Sink:MaD:9 | +| main.rs:162:27:162:34 | ...: usize | main.rs:164:26:164:26 | v | provenance | | +| main.rs:164:26:164:26 | v | main.rs:164:13:164:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | +| main.rs:164:26:164:26 | v | main.rs:164:13:164:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | +| main.rs:164:26:164:26 | v | main.rs:165:36:165:36 | v | provenance | | +| main.rs:165:36:165:36 | v | main.rs:165:13:165:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | +| main.rs:165:36:165:36 | v | main.rs:165:13:165:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | +| main.rs:165:36:165:36 | v | main.rs:167:30:167:30 | v | provenance | | +| main.rs:167:30:167:30 | v | main.rs:167:13:167:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:167:30:167:30 | v | main.rs:167:13:167:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:167:30:167:30 | v | main.rs:168:26:168:26 | v | provenance | | +| main.rs:168:26:168:26 | v | main.rs:168:13:168:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:168:26:168:26 | v | main.rs:168:13:168:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:168:26:168:26 | v | main.rs:169:31:169:31 | v | provenance | | +| main.rs:169:31:169:31 | v | main.rs:169:13:169:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | +| main.rs:169:31:169:31 | v | main.rs:169:13:169:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | +| main.rs:211:9:211:9 | v | main.rs:214:34:214:34 | v | provenance | | +| main.rs:211:9:211:9 | v | main.rs:215:42:215:42 | v | provenance | | +| main.rs:211:9:211:9 | v | main.rs:216:36:216:36 | v | provenance | | +| main.rs:211:9:211:9 | v | main.rs:217:27:217:27 | v | provenance | | +| main.rs:211:9:211:9 | v | main.rs:218:25:218:25 | v | provenance | | +| main.rs:211:13:211:26 | ...::args | main.rs:211:13:211:28 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:211:13:211:28 | ...::args(...) [element] | main.rs:211:13:211:35 | ... .nth(...) [Some] | provenance | MaD:32 | +| main.rs:211:13:211:35 | ... .nth(...) [Some] | main.rs:211:13:211:65 | ... .unwrap_or(...) | provenance | MaD:26 | +| main.rs:211:13:211:65 | ... .unwrap_or(...) | main.rs:211:13:211:82 | ... .parse(...) [Ok] | provenance | MaD:29 | +| main.rs:211:13:211:82 | ... .parse(...) [Ok] | main.rs:211:13:211:91 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:211:13:211:91 | ... .unwrap(...) | main.rs:211:9:211:9 | v | provenance | | +| main.rs:214:34:214:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | +| main.rs:215:42:215:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | +| main.rs:216:36:216:36 | v | main.rs:81:38:81:45 | ...: usize | provenance | | +| main.rs:217:27:217:27 | v | main.rs:128:29:128:36 | ...: usize | provenance | | +| main.rs:218:25:218:25 | v | main.rs:162:27:162:34 | ...: usize | provenance | | +models +| 1 | Sink: lang:alloc; ::allocate; alloc-layout; Argument[0] | +| 2 | Sink: lang:alloc; ::allocate_zeroed; alloc-layout; Argument[0] | +| 3 | Sink: lang:alloc; crate::alloc::alloc; alloc-layout; Argument[0] | +| 4 | Sink: lang:alloc; crate::alloc::alloc_zeroed; alloc-layout; Argument[0] | +| 5 | Sink: lang:alloc; crate::alloc::realloc; alloc-size; Argument[2] | +| 6 | Sink: lang:std; ::allocate; alloc-layout; Argument[0] | +| 7 | Sink: lang:std; ::allocate_zeroed; alloc-layout; Argument[0] | +| 8 | Sink: lang:std; ::grow; alloc-layout; Argument[2] | +| 9 | Sink: lang:std; ::grow_zeroed; alloc-layout; Argument[2] | +| 10 | Sink: lang:std; ::alloc; alloc-layout; Argument[0] | +| 11 | Sink: lang:std; ::alloc_zeroed; alloc-layout; Argument[0] | +| 12 | Sink: repo:https://github.com/rust-lang/libc:libc; ::aligned_alloc; alloc-size; Argument[1] | +| 13 | Sink: repo:https://github.com/rust-lang/libc:libc; ::calloc; alloc-size; Argument[0,1] | +| 14 | Sink: repo:https://github.com/rust-lang/libc:libc; ::malloc; alloc-size; Argument[0] | +| 15 | Sink: repo:https://github.com/rust-lang/libc:libc; ::realloc; alloc-size; Argument[1] | +| 16 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | +| 17 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 18 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | +| 19 | Summary: lang:core; ::extend; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | +| 20 | Summary: lang:core; ::extend_packed; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 21 | Summary: lang:core; ::extend_packed; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 22 | Summary: lang:core; ::from_size_align; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 23 | Summary: lang:core; ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | +| 24 | Summary: lang:core; ::repeat; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | +| 25 | Summary: lang:core; ::repeat_packed; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 26 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 27 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 28 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 29 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 30 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | +| 31 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | +| 32 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | nodes +| main.rs:12:36:12:43 | ...: usize | semmle.label | ...: usize | +| main.rs:18:13:18:31 | ...::realloc | semmle.label | ...::realloc | +| main.rs:18:41:18:41 | v | semmle.label | v | +| main.rs:20:9:20:10 | l2 | semmle.label | l2 | +| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:20:14:20:63 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:20:50:20:50 | v | semmle.label | v | +| main.rs:21:13:21:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:21:31:21:32 | l2 | semmle.label | l2 | +| main.rs:24:13:24:36 | ...::alloc_zeroed | semmle.label | ...::alloc_zeroed | +| main.rs:24:38:24:39 | l2 | semmle.label | l2 | +| main.rs:29:9:29:10 | l4 | semmle.label | l4 | +| main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | semmle.label | ...::from_size_align_unchecked(...) | +| main.rs:29:60:29:60 | v | semmle.label | v | +| main.rs:30:13:30:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:30:31:30:32 | l4 | semmle.label | l4 | +| main.rs:32:9:32:10 | l5 | semmle.label | l5 | +| main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | semmle.label | ...::from_size_align_unchecked(...) | +| main.rs:32:60:32:89 | ... * ... | semmle.label | ... * ... | +| main.rs:33:13:33:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:33:31:33:32 | l5 | semmle.label | l5 | +| main.rs:35:9:35:10 | s6 | semmle.label | s6 | +| main.rs:36:9:36:10 | l6 | semmle.label | l6 | +| main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | semmle.label | ...::from_size_align_unchecked(...) | +| main.rs:36:60:36:61 | s6 | semmle.label | s6 | +| main.rs:37:13:37:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:37:31:37:32 | l6 | semmle.label | l6 | +| main.rs:43:44:43:51 | ...: usize | semmle.label | ...: usize | +| main.rs:50:13:50:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | semmle.label | l2.repeat(...) [Ok, tuple.0] | +| main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:50:31:50:53 | ... .0 | semmle.label | ... .0 | +| main.rs:50:41:50:41 | v | semmle.label | v | +| main.rs:51:13:51:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | semmle.label | l2.repeat(...) [Ok, tuple.0] | +| main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:51:31:51:57 | ... .0 | semmle.label | ... .0 | +| main.rs:51:41:51:45 | ... + ... | semmle.label | ... + ... | +| main.rs:53:13:53:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | semmle.label | l2.repeat_packed(...) [Ok] | +| main.rs:53:31:53:58 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:53:48:53:48 | v | semmle.label | v | +| main.rs:54:13:54:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | semmle.label | l2.repeat_packed(...) [Ok] | +| main.rs:54:31:54:63 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:54:48:54:53 | ... * ... | semmle.label | ... * ... | +| main.rs:58:9:58:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | +| main.rs:58:10:58:11 | k1 | semmle.label | k1 | +| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | semmle.label | l3.repeat(...) [Ok, tuple.0] | +| main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | semmle.label | ... .expect(...) [tuple.0] | +| main.rs:58:34:58:34 | v | semmle.label | v | +| main.rs:59:13:59:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:59:31:59:32 | k1 | semmle.label | k1 | +| main.rs:60:9:60:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | +| main.rs:60:10:60:11 | k2 | semmle.label | k2 | +| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | semmle.label | l3.extend(...) [Ok, tuple.0] | +| main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:60:34:60:35 | k1 | semmle.label | k1 | +| main.rs:61:13:61:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:61:31:61:32 | k2 | semmle.label | k2 | +| main.rs:62:9:62:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | +| main.rs:62:10:62:11 | k3 | semmle.label | k3 | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | semmle.label | k1.extend(...) [Ok, tuple.0] | +| main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:63:13:63:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:63:31:63:32 | k3 | semmle.label | k3 | +| main.rs:64:13:64:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | semmle.label | l3.extend_packed(...) [Ok] | +| main.rs:64:31:64:59 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:64:48:64:49 | k1 | semmle.label | k1 | +| main.rs:65:13:65:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | semmle.label | k1.extend_packed(...) [Ok] | +| main.rs:65:31:65:59 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:67:9:67:10 | l4 | semmle.label | l4 | +| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:67:14:67:56 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:67:46:67:46 | v | semmle.label | v | +| main.rs:68:13:68:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:68:31:68:32 | l4 | semmle.label | l4 | +| main.rs:71:35:71:38 | ...: T | semmle.label | ...: T | +| main.rs:77:9:77:16 | return v | semmle.label | return v | +| main.rs:81:38:81:45 | ...: usize | semmle.label | ...: usize | +| main.rs:82:9:82:10 | l1 | semmle.label | l1 | +| main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:82:14:82:57 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:82:47:82:47 | v | semmle.label | v | +| main.rs:85:17:85:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:85:35:85:36 | l1 | semmle.label | l1 | +| main.rs:87:17:87:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:87:35:87:36 | l1 | semmle.label | l1 | +| main.rs:91:17:91:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:91:35:91:36 | l1 | semmle.label | l1 | +| main.rs:93:17:93:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:93:35:93:36 | l1 | semmle.label | l1 | +| main.rs:97:13:97:21 | mut v_mut | semmle.label | mut v_mut | +| main.rs:103:13:103:14 | l2 | semmle.label | l2 | +| main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:103:18:103:65 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:103:51:103:55 | v_mut | semmle.label | v_mut | +| main.rs:104:17:104:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:104:35:104:36 | l2 | semmle.label | l2 | +| main.rs:106:13:106:14 | l3 | semmle.label | l3 | +| main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:106:18:106:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:106:51:106:51 | v | semmle.label | v | +| main.rs:107:17:107:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:107:35:107:36 | l3 | semmle.label | l3 | +| main.rs:110:9:110:10 | l4 | semmle.label | l4 | +| main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:110:14:110:77 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:110:47:110:67 | ...::min(...) | semmle.label | ...::min(...) | +| main.rs:110:61:110:61 | v | semmle.label | v | +| main.rs:111:13:111:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:111:31:111:32 | l4 | semmle.label | l4 | +| main.rs:113:9:113:10 | l5 | semmle.label | l5 | +| main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:113:14:113:77 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:113:47:113:67 | ...::max(...) | semmle.label | ...::max(...) | +| main.rs:113:61:113:61 | v | semmle.label | v | +| main.rs:114:13:114:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:114:31:114:32 | l5 | semmle.label | l5 | +| main.rs:116:9:116:10 | l6 | semmle.label | l6 | +| main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:116:14:116:72 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:116:47:116:62 | clamp(...) | semmle.label | clamp(...) | +| main.rs:116:53:116:53 | v | semmle.label | v | +| main.rs:117:13:117:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:117:31:117:32 | l6 | semmle.label | l6 | +| main.rs:119:13:119:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:119:31:119:32 | l1 | semmle.label | l1 | +| main.rs:123:13:123:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:123:31:123:32 | l1 | semmle.label | l1 | +| main.rs:128:29:128:36 | ...: usize | semmle.label | ...: usize | +| main.rs:137:9:137:10 | l2 | semmle.label | l2 | +| main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:137:14:137:56 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:137:46:137:46 | v | semmle.label | v | +| main.rs:138:32:138:36 | alloc | semmle.label | alloc | +| main.rs:138:38:138:39 | l2 | semmle.label | l2 | +| main.rs:139:32:139:43 | alloc_zeroed | semmle.label | alloc_zeroed | +| main.rs:139:45:139:46 | l2 | semmle.label | l2 | +| main.rs:140:32:140:39 | allocate | semmle.label | allocate | +| main.rs:140:41:140:42 | l2 | semmle.label | l2 | +| main.rs:141:32:141:46 | allocate_zeroed | semmle.label | allocate_zeroed | +| main.rs:141:48:141:49 | l2 | semmle.label | l2 | +| main.rs:142:32:142:39 | allocate | semmle.label | allocate | +| main.rs:142:41:142:42 | l2 | semmle.label | l2 | +| main.rs:143:32:143:46 | allocate_zeroed | semmle.label | allocate_zeroed | +| main.rs:143:48:143:49 | l2 | semmle.label | l2 | +| main.rs:153:40:153:43 | grow | semmle.label | grow | +| main.rs:153:53:153:54 | l2 | semmle.label | l2 | +| main.rs:155:40:155:50 | grow_zeroed | semmle.label | grow_zeroed | +| main.rs:155:60:155:61 | l2 | semmle.label | l2 | +| main.rs:162:27:162:34 | ...: usize | semmle.label | ...: usize | +| main.rs:164:13:164:24 | ...::malloc | semmle.label | ...::malloc | +| main.rs:164:13:164:24 | ...::malloc | semmle.label | ...::malloc | +| main.rs:164:26:164:26 | v | semmle.label | v | +| main.rs:165:13:165:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | +| main.rs:165:13:165:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | +| main.rs:165:36:165:36 | v | semmle.label | v | +| main.rs:167:13:167:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:167:13:167:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:167:30:167:30 | v | semmle.label | v | +| main.rs:168:13:168:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:168:13:168:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:168:26:168:26 | v | semmle.label | v | +| main.rs:169:13:169:25 | ...::realloc | semmle.label | ...::realloc | +| main.rs:169:13:169:25 | ...::realloc | semmle.label | ...::realloc | +| main.rs:169:31:169:31 | v | semmle.label | v | +| main.rs:211:9:211:9 | v | semmle.label | v | +| main.rs:211:13:211:26 | ...::args | semmle.label | ...::args | +| main.rs:211:13:211:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:211:13:211:35 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:211:13:211:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:211:13:211:82 | ... .parse(...) [Ok] | semmle.label | ... .parse(...) [Ok] | +| main.rs:211:13:211:91 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:214:34:214:34 | v | semmle.label | v | +| main.rs:215:42:215:42 | v | semmle.label | v | +| main.rs:216:36:216:36 | v | semmle.label | v | +| main.rs:217:27:217:27 | v | semmle.label | v | +| main.rs:218:25:218:25 | v | semmle.label | v | subpaths +| main.rs:116:53:116:53 | v | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | main.rs:116:47:116:62 | clamp(...) | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index c2a1eb111c3..0af7d0eb536 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -15,26 +15,26 @@ unsafe fn test_std_alloc_from_size(v: usize) { let _ = std::alloc::alloc(l1.align_to(8).unwrap()); let _ = std::alloc::alloc(l1.align_to(8).unwrap().pad_to_align()); let _ = std::alloc::alloc_zeroed(l1); - let _ = std::alloc::realloc(m1, l1, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::realloc(m1, l1, v); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l2 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let _ = std::alloc::alloc(l2.align_to(8).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] let _ = std::alloc::alloc(l2.align_to(8).unwrap().pad_to_align()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::alloc_zeroed(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc_zeroed(l2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l3 = std::alloc::Layout::from_size_align(1, v).unwrap(); // not obviously dangerous? let _ = std::alloc::alloc(l3); let l4 = std::alloc::Layout::from_size_align_unchecked(v, 1); - let _ = std::alloc::alloc(l4); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l4); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l5 = std::alloc::Layout::from_size_align_unchecked(v * std::mem::size_of::(), std::mem::size_of::()); - let _ = std::alloc::alloc(l5); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l5); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let s6 = (std::mem::size_of::() * v) + 1; let l6 = std::alloc::Layout::from_size_align_unchecked(s6, 4); - let _ = std::alloc::alloc(l6); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l6); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l7 = std::alloc::Layout::from_size_align_unchecked(l6.size(), 8); let _ = std::alloc::alloc(l7); // $ MISSING: Alert[rust/uncontrolled-allocation-size] @@ -47,25 +47,25 @@ unsafe fn test_std_alloc_new_repeat_extend(v: usize) { let l2 = std::alloc::Layout::new::(); let _ = std::alloc::alloc(l2); let _ = std::alloc::alloc(l2.repeat(10).unwrap().0); - let _ = std::alloc::alloc(l2.repeat(v).unwrap().0); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::alloc(l2.repeat(v + 1).unwrap().0); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.repeat(v).unwrap().0); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l2.repeat(v + 1).unwrap().0); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let _ = std::alloc::alloc(l2.repeat_packed(10).unwrap()); - let _ = std::alloc::alloc(l2.repeat_packed(v).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::alloc(l2.repeat_packed(v * 10).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.repeat_packed(v).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l2.repeat_packed(v * 10).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l3 = std::alloc::Layout::array::(10).unwrap(); let _ = std::alloc::alloc(l3); let (k1, _offs1) = l3.repeat(v).expect("arithmetic overflow?"); - let _ = std::alloc::alloc(k1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(k1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let (k2, _offs2) = l3.extend(k1).unwrap(); - let _ = std::alloc::alloc(k2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(k2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let (k3, _offs3) = k1.extend(l3).unwrap(); - let _ = std::alloc::alloc(k3); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::alloc(l3.extend_packed(k1).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::alloc(k1.extend_packed(l3).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(k3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l3.extend_packed(k1).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(k1.extend_packed(l3).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l4 = std::alloc::Layout::array::(v).unwrap(); - let _ = std::alloc::alloc(l4); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l4); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } fn clamp(v: T, min: T, max: T) -> T { @@ -82,15 +82,15 @@ unsafe fn test_std_alloc_with_bounds(v: usize) { let l1 = std::alloc::Layout::array::(v).unwrap(); if v < 100 { - let _ = std::alloc::alloc(l1); + let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 } else { - let _ = std::alloc::alloc(l1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } if v == 100 { - let _ = std::alloc::alloc(l1); + let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 } else { - let _ = std::alloc::alloc(l1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } { @@ -101,26 +101,26 @@ unsafe fn test_std_alloc_with_bounds(v: usize) { } let l2 = std::alloc::Layout::array::(v_mut).unwrap(); - let _ = std::alloc::alloc(l2); + let _ = std::alloc::alloc(l2); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 let l3 = std::alloc::Layout::array::(v).unwrap(); - let _ = std::alloc::alloc(l3); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } let l4 = std::alloc::Layout::array::(std::cmp::min(v, 100)).unwrap(); - let _ = std::alloc::alloc(l4); + let _ = std::alloc::alloc(l4); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 let l5 = std::alloc::Layout::array::(std::cmp::max(v, 100)).unwrap(); - let _ = std::alloc::alloc(l5); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l5); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l6 = std::alloc::Layout::array::(clamp(v, 1, 100)).unwrap(); - let _ = std::alloc::alloc(l6); + let _ = std::alloc::alloc(l6); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l1); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 if v > 100 { return; } - let _ = std::alloc::alloc(l1); + let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 } use std::alloc::{GlobalAlloc, Allocator}; @@ -135,12 +135,12 @@ unsafe fn test_system_alloc(v: usize) { let _ = std::alloc::Global.allocate_zeroed(l1).unwrap(); let l2 = std::alloc::Layout::array::(v).unwrap(); - let _ = std::alloc::System.alloc(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::System.alloc_zeroed(l2); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::System.allocate(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::System.allocate_zeroed(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::Global.allocate(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::Global.allocate_zeroed(l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::System.alloc(l2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::System.alloc_zeroed(l2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::System.allocate(l2).unwrap(); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::System.allocate_zeroed(l2).unwrap(); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::Global.allocate(l2).unwrap(); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::Global.allocate_zeroed(l2).unwrap(); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l3 = std::alloc::Layout::array::(10).unwrap(); let m3 = std::alloc::System.alloc(l3); @@ -150,9 +150,9 @@ unsafe fn test_system_alloc(v: usize) { let m4 = std::ptr::NonNull::::new(std::alloc::alloc(l4)).unwrap(); if v > 10 { if v % 2 == 0 { - let _ = std::alloc::System.grow(m4, l4, l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::System.grow(m4, l4, l2).unwrap(); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } else { - let _ = std::alloc::System.grow_zeroed(m4, l4, l2).unwrap(); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::System.grow_zeroed(m4, l4, l2).unwrap(); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } } else { let _ = std::alloc::System.shrink(m4, l4, l2).unwrap(); @@ -161,12 +161,12 @@ unsafe fn test_system_alloc(v: usize) { unsafe fn test_libc_alloc(v: usize) { let m1 = libc::malloc(256); - let _ = libc::malloc(v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = libc::aligned_alloc(8, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = libc::malloc(v); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = libc::aligned_alloc(8, v); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let _ = libc::aligned_alloc(v, 8); - let _ = libc::calloc(64, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = libc::calloc(v, std::mem::size_of::()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = libc::realloc(m1, v); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = libc::calloc(64, v); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = libc::calloc(v, std::mem::size_of::()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = libc::realloc(m1, v); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } unsafe fn test_vectors(v: usize) { From e49c1afe72c249e32abd4740fcc0bb43c37648c0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 31 Mar 2025 10:08:32 +0100 Subject: [PATCH 034/372] Rust: Add a few missing models. --- .../frameworks/stdlib/lang-core.model.yml | 3 + .../diagnostics/SummaryStats.expected | 2 +- .../UncontrolledAllocationSize.expected | 152 +++++++++++------- .../test/query-tests/security/CWE-770/main.rs | 6 +- 4 files changed, 98 insertions(+), 65 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index 710949b07e0..1f840626b3f 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -31,6 +31,9 @@ extensions: - ["lang:core", "::extend", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]", "taint", "manual"] - ["lang:core", "::extend_packed", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:core", "::extend_packed", "Argument[0]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::align_to", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::pad_to_align", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::size", "Argument[self]", "ReturnValue", "taint", "manual"] # Ptr - ["lang:core", "crate::ptr::read", "Argument[0].Reference", "ReturnValue", "value", "manual"] - ["lang:core", "crate::ptr::read_unaligned", "Argument[0].Reference", "ReturnValue", "value", "manual"] diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index a8833f62680..787fc3ddbbe 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -15,7 +15,7 @@ | Macro calls - resolved | 8 | | Macro calls - total | 9 | | Macro calls - unresolved | 1 | -| Taint edges - number of edges | 1675 | +| Taint edges - number of edges | 1677 | | Taint reach - nodes tainted | 0 | | Taint reach - per million nodes | 0 | | Taint sinks - cryptographic operations | 0 | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 4dcc0f1b558..0d8c10db39f 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -1,10 +1,13 @@ #select | main.rs:18:13:18:31 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:18:13:18:31 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:21:13:21:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:21:13:21:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:22:13:22:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:22:13:22:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:23:13:23:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:23:13:23:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:24:13:24:36 | ...::alloc_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:24:13:24:36 | ...::alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:30:13:30:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:30:13:30:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:33:13:33:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:33:13:33:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:37:13:37:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:37:13:37:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:40:13:40:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:40:13:40:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:50:13:50:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:50:13:50:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:51:13:51:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:51:13:51:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | | main.rs:53:13:53:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:53:13:53:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | @@ -52,75 +55,87 @@ edges | main.rs:18:41:18:41 | v | main.rs:32:60:32:89 | ... * ... | provenance | | | main.rs:18:41:18:41 | v | main.rs:35:9:35:10 | s6 | provenance | | | main.rs:20:9:20:10 | l2 | main.rs:21:31:21:32 | l2 | provenance | | -| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:20:14:20:63 | ... .unwrap(...) | main.rs:20:9:20:10 | l2 | provenance | | -| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:22 | +| main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:21:31:21:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:17 | +| main.rs:21:31:21:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:17 | | main.rs:21:31:21:32 | l2 | main.rs:24:38:24:39 | l2 | provenance | | +| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:22:31:22:53 | ... .unwrap(...) | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:23:31:23:53 | ... .unwrap(...) | main.rs:23:31:23:68 | ... .pad_to_align(...) | provenance | MaD:25 | +| main.rs:23:31:23:68 | ... .pad_to_align(...) | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:4 Sink:MaD:4 | | main.rs:29:9:29:10 | l4 | main.rs:30:31:30:32 | l4 | provenance | | | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | main.rs:29:9:29:10 | l4 | provenance | | -| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:23 | +| main.rs:29:60:29:60 | v | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | | main.rs:30:31:30:32 | l4 | main.rs:30:13:30:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:32:9:32:10 | l5 | main.rs:33:31:33:32 | l5 | provenance | | | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | main.rs:32:9:32:10 | l5 | provenance | | -| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:23 | +| main.rs:32:60:32:89 | ... * ... | main.rs:32:14:32:118 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | | main.rs:33:31:33:32 | l5 | main.rs:33:13:33:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:35:9:35:10 | s6 | main.rs:36:60:36:61 | s6 | provenance | | | main.rs:36:9:36:10 | l6 | main.rs:37:31:37:32 | l6 | provenance | | | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | main.rs:36:9:36:10 | l6 | provenance | | -| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:23 | +| main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | | main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size(...) | provenance | MaD:28 | +| main.rs:39:9:39:10 | l7 | main.rs:40:31:40:32 | l7 | provenance | | +| main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | main.rs:39:9:39:10 | l7 | provenance | | +| main.rs:39:60:39:68 | l6.size(...) | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | +| main.rs:40:31:40:32 | l7 | main.rs:40:13:40:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:43:44:43:51 | ...: usize | main.rs:50:41:50:41 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:51:41:51:45 | ... + ... | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:53:48:53:48 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:54:48:54:53 | ... * ... | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:58:34:58:34 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:67:46:67:46 | v | provenance | | -| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | | main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | | main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:24 | -| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:26 | +| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | | main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | | main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:24 | -| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:26 | +| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:53:31:53:58 | ... .unwrap(...) | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:25 | -| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:27 | +| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:54:31:54:63 | ... .unwrap(...) | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:25 | +| main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:27 | | main.rs:58:9:58:20 | TuplePat [tuple.0] | main.rs:58:10:58:11 | k1 | provenance | | | main.rs:58:10:58:11 | k1 | main.rs:59:31:59:32 | k1 | provenance | | -| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:27 | +| main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | provenance | MaD:30 | | main.rs:58:24:58:66 | ... .expect(...) [tuple.0] | main.rs:58:9:58:20 | TuplePat [tuple.0] | provenance | | -| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:24 | +| main.rs:58:34:58:34 | v | main.rs:58:24:58:35 | l3.repeat(...) [Ok, tuple.0] | provenance | MaD:26 | | main.rs:59:31:59:32 | k1 | main.rs:59:13:59:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:59:31:59:32 | k1 | main.rs:60:34:60:35 | k1 | provenance | | -| main.rs:59:31:59:32 | k1 | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | provenance | MaD:19 | +| main.rs:59:31:59:32 | k1 | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | provenance | MaD:20 | | main.rs:59:31:59:32 | k1 | main.rs:64:48:64:49 | k1 | provenance | | -| main.rs:59:31:59:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:21 | +| main.rs:59:31:59:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:22 | | main.rs:60:9:60:20 | TuplePat [tuple.0] | main.rs:60:10:60:11 | k2 | provenance | | | main.rs:60:10:60:11 | k2 | main.rs:61:31:61:32 | k2 | provenance | | -| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | | main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | -| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:18 | +| main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:19 | | main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:62:9:62:20 | TuplePat [tuple.0] | main.rs:62:10:62:11 | k3 | provenance | | | main.rs:62:10:62:11 | k3 | main.rs:63:31:63:32 | k3 | provenance | | -| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:28 | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | | main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | main.rs:62:9:62:20 | TuplePat [tuple.0] | provenance | | | main.rs:63:31:63:32 | k3 | main.rs:63:13:63:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:64:31:64:59 | ... .unwrap(...) | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:20 | -| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:21 | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:65:31:65:59 | ... .unwrap(...) | main.rs:65:13:65:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:67:9:67:10 | l4 | main.rs:68:31:68:32 | l4 | provenance | | -| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:67:14:67:56 | ... .unwrap(...) | main.rs:67:9:67:10 | l4 | provenance | | -| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | provenance | | | main.rs:81:38:81:45 | ...: usize | main.rs:82:47:82:47 | v | provenance | | @@ -131,9 +146,9 @@ edges | main.rs:81:38:81:45 | ...: usize | main.rs:116:53:116:53 | v | provenance | | | main.rs:82:9:82:10 | l1 | main.rs:85:35:85:36 | l1 | provenance | | | main.rs:82:9:82:10 | l1 | main.rs:87:35:87:36 | l1 | provenance | | -| main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | main.rs:82:14:82:57 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | main.rs:82:14:82:57 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:82:14:82:57 | ... .unwrap(...) | main.rs:82:9:82:10 | l1 | provenance | | -| main.rs:82:47:82:47 | v | main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:82:47:82:47 | v | main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:85:35:85:36 | l1 | main.rs:85:17:85:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:85:35:85:36 | l1 | main.rs:91:35:91:36 | l1 | provenance | | | main.rs:85:35:85:36 | l1 | main.rs:93:35:93:36 | l1 | provenance | | @@ -146,31 +161,31 @@ edges | main.rs:93:35:93:36 | l1 | main.rs:119:31:119:32 | l1 | provenance | | | main.rs:97:13:97:21 | mut v_mut | main.rs:103:51:103:55 | v_mut | provenance | | | main.rs:103:13:103:14 | l2 | main.rs:104:35:104:36 | l2 | provenance | | -| main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | main.rs:103:18:103:65 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | main.rs:103:18:103:65 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:103:18:103:65 | ... .unwrap(...) | main.rs:103:13:103:14 | l2 | provenance | | -| main.rs:103:51:103:55 | v_mut | main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:103:51:103:55 | v_mut | main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:104:35:104:36 | l2 | main.rs:104:17:104:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:106:13:106:14 | l3 | main.rs:107:35:107:36 | l3 | provenance | | -| main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | main.rs:106:18:106:61 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | main.rs:106:18:106:61 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:106:18:106:61 | ... .unwrap(...) | main.rs:106:13:106:14 | l3 | provenance | | -| main.rs:106:51:106:51 | v | main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:106:51:106:51 | v | main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:107:35:107:36 | l3 | main.rs:107:17:107:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:110:9:110:10 | l4 | main.rs:111:31:111:32 | l4 | provenance | | -| main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | main.rs:110:14:110:77 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | main.rs:110:14:110:77 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:110:14:110:77 | ... .unwrap(...) | main.rs:110:9:110:10 | l4 | provenance | | -| main.rs:110:47:110:67 | ...::min(...) | main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | -| main.rs:110:61:110:61 | v | main.rs:110:47:110:67 | ...::min(...) | provenance | MaD:31 | +| main.rs:110:47:110:67 | ...::min(...) | main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:110:61:110:61 | v | main.rs:110:47:110:67 | ...::min(...) | provenance | MaD:34 | | main.rs:111:31:111:32 | l4 | main.rs:111:13:111:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:113:9:113:10 | l5 | main.rs:114:31:114:32 | l5 | provenance | | -| main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | main.rs:113:14:113:77 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | main.rs:113:14:113:77 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:113:14:113:77 | ... .unwrap(...) | main.rs:113:9:113:10 | l5 | provenance | | -| main.rs:113:47:113:67 | ...::max(...) | main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | -| main.rs:113:61:113:61 | v | main.rs:113:47:113:67 | ...::max(...) | provenance | MaD:30 | +| main.rs:113:47:113:67 | ...::max(...) | main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:113:61:113:61 | v | main.rs:113:47:113:67 | ...::max(...) | provenance | MaD:33 | | main.rs:114:31:114:32 | l5 | main.rs:114:13:114:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:116:9:116:10 | l6 | main.rs:117:31:117:32 | l6 | provenance | | -| main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | main.rs:116:14:116:72 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | main.rs:116:14:116:72 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:116:14:116:72 | ... .unwrap(...) | main.rs:116:9:116:10 | l6 | provenance | | -| main.rs:116:47:116:62 | clamp(...) | main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:116:47:116:62 | clamp(...) | main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:116:53:116:53 | v | main.rs:71:35:71:38 | ...: T | provenance | | | main.rs:116:53:116:53 | v | main.rs:116:47:116:62 | clamp(...) | provenance | | | main.rs:117:31:117:32 | l6 | main.rs:117:13:117:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | @@ -179,9 +194,9 @@ edges | main.rs:123:31:123:32 | l1 | main.rs:123:13:123:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:128:29:128:36 | ...: usize | main.rs:137:46:137:46 | v | provenance | | | main.rs:137:9:137:10 | l2 | main.rs:138:38:138:39 | l2 | provenance | | -| main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | main.rs:137:14:137:56 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | main.rs:137:14:137:56 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:137:14:137:56 | ... .unwrap(...) | main.rs:137:9:137:10 | l2 | provenance | | -| main.rs:137:46:137:46 | v | main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | provenance | MaD:17 | +| main.rs:137:46:137:46 | v | main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:138:38:138:39 | l2 | main.rs:138:32:138:36 | alloc | provenance | MaD:10 Sink:MaD:10 | | main.rs:138:38:138:39 | l2 | main.rs:139:45:139:46 | l2 | provenance | | | main.rs:139:45:139:46 | l2 | main.rs:139:32:139:43 | alloc_zeroed | provenance | MaD:11 Sink:MaD:11 | @@ -218,10 +233,10 @@ edges | main.rs:211:9:211:9 | v | main.rs:217:27:217:27 | v | provenance | | | main.rs:211:9:211:9 | v | main.rs:218:25:218:25 | v | provenance | | | main.rs:211:13:211:26 | ...::args | main.rs:211:13:211:28 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:211:13:211:28 | ...::args(...) [element] | main.rs:211:13:211:35 | ... .nth(...) [Some] | provenance | MaD:32 | -| main.rs:211:13:211:35 | ... .nth(...) [Some] | main.rs:211:13:211:65 | ... .unwrap_or(...) | provenance | MaD:26 | -| main.rs:211:13:211:65 | ... .unwrap_or(...) | main.rs:211:13:211:82 | ... .parse(...) [Ok] | provenance | MaD:29 | -| main.rs:211:13:211:82 | ... .parse(...) [Ok] | main.rs:211:13:211:91 | ... .unwrap(...) | provenance | MaD:28 | +| main.rs:211:13:211:28 | ...::args(...) [element] | main.rs:211:13:211:35 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:211:13:211:35 | ... .nth(...) [Some] | main.rs:211:13:211:65 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:211:13:211:65 | ... .unwrap_or(...) | main.rs:211:13:211:82 | ... .parse(...) [Ok] | provenance | MaD:32 | +| main.rs:211:13:211:82 | ... .parse(...) [Ok] | main.rs:211:13:211:91 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:211:13:211:91 | ... .unwrap(...) | main.rs:211:9:211:9 | v | provenance | | | main.rs:214:34:214:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | | main.rs:215:42:215:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | @@ -245,22 +260,25 @@ models | 14 | Sink: repo:https://github.com/rust-lang/libc:libc; ::malloc; alloc-size; Argument[0] | | 15 | Sink: repo:https://github.com/rust-lang/libc:libc; ::realloc; alloc-size; Argument[1] | | 16 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | -| 17 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 18 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | -| 19 | Summary: lang:core; ::extend; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | -| 20 | Summary: lang:core; ::extend_packed; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 21 | Summary: lang:core; ::extend_packed; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 22 | Summary: lang:core; ::from_size_align; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 23 | Summary: lang:core; ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | -| 24 | Summary: lang:core; ::repeat; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | -| 25 | Summary: lang:core; ::repeat_packed; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 26 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 27 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 28 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 29 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 30 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | -| 31 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | -| 32 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 17 | Summary: lang:core; ::align_to; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 18 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 19 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | +| 20 | Summary: lang:core; ::extend; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | +| 21 | Summary: lang:core; ::extend_packed; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 22 | Summary: lang:core; ::extend_packed; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 23 | Summary: lang:core; ::from_size_align; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 24 | Summary: lang:core; ::from_size_align_unchecked; Argument[0]; ReturnValue; taint | +| 25 | Summary: lang:core; ::pad_to_align; Argument[self]; ReturnValue; taint | +| 26 | Summary: lang:core; ::repeat; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | +| 27 | Summary: lang:core; ::repeat_packed; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 28 | Summary: lang:core; ::size; Argument[self]; ReturnValue; taint | +| 29 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 30 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 31 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 32 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | +| 33 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | +| 34 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | +| 35 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | nodes | main.rs:12:36:12:43 | ...: usize | semmle.label | ...: usize | | main.rs:18:13:18:31 | ...::realloc | semmle.label | ...::realloc | @@ -271,6 +289,13 @@ nodes | main.rs:20:50:20:50 | v | semmle.label | v | | main.rs:21:13:21:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:21:31:21:32 | l2 | semmle.label | l2 | +| main.rs:22:13:22:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | semmle.label | l2.align_to(...) [Ok] | +| main.rs:22:31:22:53 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:23:13:23:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | semmle.label | l2.align_to(...) [Ok] | +| main.rs:23:31:23:53 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:23:31:23:68 | ... .pad_to_align(...) | semmle.label | ... .pad_to_align(...) | | main.rs:24:13:24:36 | ...::alloc_zeroed | semmle.label | ...::alloc_zeroed | | main.rs:24:38:24:39 | l2 | semmle.label | l2 | | main.rs:29:9:29:10 | l4 | semmle.label | l4 | @@ -289,6 +314,11 @@ nodes | main.rs:36:60:36:61 | s6 | semmle.label | s6 | | main.rs:37:13:37:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:37:31:37:32 | l6 | semmle.label | l6 | +| main.rs:39:9:39:10 | l7 | semmle.label | l7 | +| main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | semmle.label | ...::from_size_align_unchecked(...) | +| main.rs:39:60:39:68 | l6.size(...) | semmle.label | l6.size(...) | +| main.rs:40:13:40:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:40:31:40:32 | l7 | semmle.label | l7 | | main.rs:43:44:43:51 | ...: usize | semmle.label | ...: usize | | main.rs:50:13:50:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | semmle.label | l2.repeat(...) [Ok, tuple.0] | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index 0af7d0eb536..d2b5c109fa7 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -19,8 +19,8 @@ unsafe fn test_std_alloc_from_size(v: usize) { let l2 = std::alloc::Layout::from_size_align(v, 1).unwrap(); let _ = std::alloc::alloc(l2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l2.align_to(8).unwrap()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] - let _ = std::alloc::alloc(l2.align_to(8).unwrap().pad_to_align()); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l2.align_to(8).unwrap()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l2.align_to(8).unwrap().pad_to_align()); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let _ = std::alloc::alloc_zeroed(l2); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l3 = std::alloc::Layout::from_size_align(1, v).unwrap(); // not obviously dangerous? @@ -37,7 +37,7 @@ unsafe fn test_std_alloc_from_size(v: usize) { let _ = std::alloc::alloc(l6); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l7 = std::alloc::Layout::from_size_align_unchecked(l6.size(), 8); - let _ = std::alloc::alloc(l7); // $ MISSING: Alert[rust/uncontrolled-allocation-size] + let _ = std::alloc::alloc(l7); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } unsafe fn test_std_alloc_new_repeat_extend(v: usize) { From 64aa4e8bae685efee1f4751c6bea20173dadb756 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:38:16 +0000 Subject: [PATCH 035/372] Rust: Ensure that the sinks for this query appear in metrics. --- rust/ql/src/queries/summary/Stats.qll | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/ql/src/queries/summary/Stats.qll b/rust/ql/src/queries/summary/Stats.qll index a2220398b41..119a53d7d72 100644 --- a/rust/ql/src/queries/summary/Stats.qll +++ b/rust/ql/src/queries/summary/Stats.qll @@ -15,6 +15,7 @@ private import codeql.rust.Concepts private import codeql.rust.security.CleartextLoggingExtensions private import codeql.rust.security.SqlInjectionExtensions private import codeql.rust.security.WeakSensitiveDataHashingExtensions +private import codeql.rust.security.UncontrolledAllocationSizeExtensions private import codeql.rust.security.regex.RegexInjectionExtensions /** From addc1d34d86860b220e674557ead9135dd60403c Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 25 Mar 2025 16:05:35 +0000 Subject: [PATCH 036/372] Rust: Add qhelp, examples, and tests of examples. --- .../CWE-770/UncontrolledAllocationSize.qhelp | 41 ++++ .../CWE-770/UncontrolledAllocationSizeBad.rs | 11 + .../CWE-770/UncontrolledAllocationSizeGood.rs | 17 ++ .../UncontrolledAllocationSize.expected | 210 +++++++++++------- .../test/query-tests/security/CWE-770/main.rs | 52 +++++ 5 files changed, 255 insertions(+), 76 deletions(-) create mode 100644 rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp create mode 100644 rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeBad.rs create mode 100644 rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp new file mode 100644 index 00000000000..936c2761976 --- /dev/null +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp @@ -0,0 +1,41 @@ + + + + +

Allocating memory with a size based on user input may allow arbitrary amounts of memory to be +allocated, leading to a crash or denial of service incident.

+ +

If the user input is multiplied by a constant, such as the size of a type, the result may +overflow. In a build with the --release flag Rust performs two's complement wrapping, +with the result that less memory may be allocated than expected. This can lead to buffer overflow +incidents.

+ +
+ + +

Implement a guard to limit the amount of memory that is allocated, and reject the request if +the guard is not met. Ensure that any multiplications in the calculation cannot overflow, either +by guarding their inputs, or using a multiplication routine such as checked_mul that +does not wrap around.

+ +
+ + +

In the following example, an arbitrary amount of memory is allocated based on user input. In +addition, due to the multiplication operation the result may overflow if a very large value is +provided, leading to less memory being allocated than other parts of the program expect.

+ + +

In the fixed example, the user input is checked against a maximum value. If the check fails an +error is returned, and both the multiplication and alloaction do not take place.

+ + +
+ + +
  • The Rust Programming Language: Data Types - Integer Overflow.
  • + +
    +
    diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeBad.rs b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeBad.rs new file mode 100644 index 00000000000..40794494f3b --- /dev/null +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeBad.rs @@ -0,0 +1,11 @@ + +fn allocate_buffer(user_input: String) -> Result<*mut u8, Error> { + let num_bytes = user_input.parse::()? * std::mem::size_of::(); + + let layout = std::alloc::Layout::from_size_align(num_bytes, 1).unwrap(); + unsafe { + let buffer = std::alloc::alloc(layout); // BAD: uncontrolled allocation size + + Ok(buffer) + } +} diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs new file mode 100644 index 00000000000..c0758431289 --- /dev/null +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs @@ -0,0 +1,17 @@ + +const BUFFER_LIMIT: usize = 10 * 1024; + +fn allocate_buffer(user_input: String) -> Result<*mut u8, Error> { + let size = user_input.parse::()?; + if (size > BUFFER_LIMIT) { + return Err("Size exceeds limit".into()); + } + let num_bytes = size * std::mem::size_of::(); + + let layout = std::alloc::Layout::from_size_align(num_bytes, 1).unwrap(); + unsafe { + let buffer = std::alloc::alloc(layout); // GOOD + + Ok(buffer) + } +} diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 0d8c10db39f..7ef8327b64e 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -1,52 +1,54 @@ #select -| main.rs:18:13:18:31 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:18:13:18:31 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:21:13:21:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:21:13:21:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:22:13:22:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:22:13:22:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:23:13:23:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:23:13:23:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:24:13:24:36 | ...::alloc_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:24:13:24:36 | ...::alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:30:13:30:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:30:13:30:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:33:13:33:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:33:13:33:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:37:13:37:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:37:13:37:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:40:13:40:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:40:13:40:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:50:13:50:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:50:13:50:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:51:13:51:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:51:13:51:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:53:13:53:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:53:13:53:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:54:13:54:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:54:13:54:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:59:13:59:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:59:13:59:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:61:13:61:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:61:13:61:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:63:13:63:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:63:13:63:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:64:13:64:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:65:13:65:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:68:13:68:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:85:17:85:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:85:17:85:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:87:17:87:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:87:17:87:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:91:17:91:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:91:17:91:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:93:17:93:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:93:17:93:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:104:17:104:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:104:17:104:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:107:17:107:33 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:107:17:107:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:111:13:111:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:111:13:111:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:114:13:114:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:114:13:114:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:117:13:117:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:117:13:117:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:119:13:119:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:119:13:119:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:123:13:123:29 | ...::alloc | main.rs:211:13:211:26 | ...::args | main.rs:123:13:123:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:138:32:138:36 | alloc | main.rs:211:13:211:26 | ...::args | main.rs:138:32:138:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:139:32:139:43 | alloc_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:139:32:139:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:140:32:140:39 | allocate | main.rs:211:13:211:26 | ...::args | main.rs:140:32:140:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:141:32:141:46 | allocate_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:141:32:141:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:142:32:142:39 | allocate | main.rs:211:13:211:26 | ...::args | main.rs:142:32:142:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:143:32:143:46 | allocate_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:143:32:143:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:153:40:153:43 | grow | main.rs:211:13:211:26 | ...::args | main.rs:153:40:153:43 | grow | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:155:40:155:50 | grow_zeroed | main.rs:211:13:211:26 | ...::args | main.rs:155:40:155:50 | grow_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:164:13:164:24 | ...::malloc | main.rs:211:13:211:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:164:13:164:24 | ...::malloc | main.rs:211:13:211:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:211:13:211:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:211:13:211:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:167:13:167:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:167:13:167:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:168:13:168:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:168:13:168:24 | ...::calloc | main.rs:211:13:211:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:169:13:169:25 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | -| main.rs:169:13:169:25 | ...::realloc | main.rs:211:13:211:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:211:13:211:26 | ...::args | user-provided value | +| main.rs:18:13:18:31 | ...::realloc | main.rs:262:13:262:26 | ...::args | main.rs:18:13:18:31 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:21:13:21:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:21:13:21:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:22:13:22:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:22:13:22:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:23:13:23:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:23:13:23:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:24:13:24:36 | ...::alloc_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:24:13:24:36 | ...::alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:30:13:30:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:30:13:30:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:33:13:33:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:33:13:33:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:37:13:37:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:37:13:37:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:40:13:40:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:40:13:40:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:50:13:50:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:50:13:50:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:51:13:51:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:51:13:51:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:53:13:53:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:53:13:53:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:54:13:54:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:54:13:54:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:59:13:59:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:59:13:59:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:61:13:61:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:61:13:61:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:63:13:63:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:63:13:63:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:64:13:64:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:65:13:65:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:68:13:68:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:85:17:85:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:85:17:85:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:87:17:87:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:87:17:87:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:91:17:91:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:91:17:91:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:93:17:93:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:93:17:93:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:104:17:104:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:104:17:104:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:107:17:107:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:107:17:107:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:111:13:111:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:111:13:111:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:114:13:114:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:114:13:114:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:117:13:117:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:117:13:117:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:119:13:119:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:119:13:119:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:123:13:123:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:123:13:123:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:138:32:138:36 | alloc | main.rs:262:13:262:26 | ...::args | main.rs:138:32:138:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:139:32:139:43 | alloc_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:139:32:139:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:140:32:140:39 | allocate | main.rs:262:13:262:26 | ...::args | main.rs:140:32:140:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:141:32:141:46 | allocate_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:141:32:141:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:142:32:142:39 | allocate | main.rs:262:13:262:26 | ...::args | main.rs:142:32:142:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:143:32:143:46 | allocate_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:143:32:143:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:153:40:153:43 | grow | main.rs:262:13:262:26 | ...::args | main.rs:153:40:153:43 | grow | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:155:40:155:50 | grow_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:155:40:155:50 | grow_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:164:13:164:24 | ...::malloc | main.rs:262:13:262:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:164:13:164:24 | ...::malloc | main.rs:262:13:262:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:262:13:262:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:262:13:262:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:167:13:167:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:167:13:167:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:168:13:168:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:168:13:168:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:169:13:169:25 | ...::realloc | main.rs:262:13:262:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:169:13:169:25 | ...::realloc | main.rs:262:13:262:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | +| main.rs:229:22:229:38 | ...::alloc | main.rs:253:25:253:38 | ...::args | main.rs:229:22:229:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:253:25:253:38 | ...::args | user-provided value | +| main.rs:246:22:246:38 | ...::alloc | main.rs:254:26:254:39 | ...::args | main.rs:246:22:246:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:254:26:254:39 | ...::args | user-provided value | edges | main.rs:12:36:12:43 | ...: usize | main.rs:18:41:18:41 | v | provenance | | | main.rs:18:41:18:41 | v | main.rs:18:13:18:31 | ...::realloc | provenance | MaD:5 Sink:MaD:5 | @@ -227,22 +229,49 @@ edges | main.rs:168:26:168:26 | v | main.rs:169:31:169:31 | v | provenance | | | main.rs:169:31:169:31 | v | main.rs:169:13:169:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:169:31:169:31 | v | main.rs:169:13:169:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:211:9:211:9 | v | main.rs:214:34:214:34 | v | provenance | | -| main.rs:211:9:211:9 | v | main.rs:215:42:215:42 | v | provenance | | -| main.rs:211:9:211:9 | v | main.rs:216:36:216:36 | v | provenance | | -| main.rs:211:9:211:9 | v | main.rs:217:27:217:27 | v | provenance | | -| main.rs:211:9:211:9 | v | main.rs:218:25:218:25 | v | provenance | | -| main.rs:211:13:211:26 | ...::args | main.rs:211:13:211:28 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:211:13:211:28 | ...::args(...) [element] | main.rs:211:13:211:35 | ... .nth(...) [Some] | provenance | MaD:35 | -| main.rs:211:13:211:35 | ... .nth(...) [Some] | main.rs:211:13:211:65 | ... .unwrap_or(...) | provenance | MaD:29 | -| main.rs:211:13:211:65 | ... .unwrap_or(...) | main.rs:211:13:211:82 | ... .parse(...) [Ok] | provenance | MaD:32 | -| main.rs:211:13:211:82 | ... .parse(...) [Ok] | main.rs:211:13:211:91 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:211:13:211:91 | ... .unwrap(...) | main.rs:211:9:211:9 | v | provenance | | -| main.rs:214:34:214:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | -| main.rs:215:42:215:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | -| main.rs:216:36:216:36 | v | main.rs:81:38:81:45 | ...: usize | provenance | | -| main.rs:217:27:217:27 | v | main.rs:128:29:128:36 | ...: usize | provenance | | -| main.rs:218:25:218:25 | v | main.rs:162:27:162:34 | ...: usize | provenance | | +| main.rs:224:24:224:41 | ...: String | main.rs:225:21:225:47 | user_input.parse(...) [Ok] | provenance | MaD:32 | +| main.rs:225:9:225:17 | num_bytes | main.rs:227:54:227:62 | num_bytes | provenance | | +| main.rs:225:21:225:47 | user_input.parse(...) [Ok] | main.rs:225:21:225:48 | TryExpr | provenance | | +| main.rs:225:21:225:48 | TryExpr | main.rs:225:9:225:17 | num_bytes | provenance | | +| main.rs:227:9:227:14 | layout | main.rs:229:40:229:45 | layout | provenance | | +| main.rs:227:18:227:66 | ...::from_size_align(...) [Ok] | main.rs:227:18:227:75 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:227:18:227:75 | ... .unwrap(...) | main.rs:227:9:227:14 | layout | provenance | | +| main.rs:227:54:227:62 | num_bytes | main.rs:227:18:227:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:229:40:229:45 | layout | main.rs:229:22:229:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:237:25:237:42 | ...: String | main.rs:238:16:238:42 | user_input.parse(...) [Ok] | provenance | MaD:32 | +| main.rs:238:9:238:12 | size | main.rs:242:9:242:17 | num_bytes | provenance | | +| main.rs:238:16:238:42 | user_input.parse(...) [Ok] | main.rs:238:16:238:43 | TryExpr | provenance | | +| main.rs:238:16:238:43 | TryExpr | main.rs:238:9:238:12 | size | provenance | | +| main.rs:242:9:242:17 | num_bytes | main.rs:244:54:244:62 | num_bytes | provenance | | +| main.rs:244:9:244:14 | layout | main.rs:246:40:246:45 | layout | provenance | | +| main.rs:244:18:244:66 | ...::from_size_align(...) [Ok] | main.rs:244:18:244:75 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:244:18:244:75 | ... .unwrap(...) | main.rs:244:9:244:14 | layout | provenance | | +| main.rs:244:54:244:62 | num_bytes | main.rs:244:18:244:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:246:40:246:45 | layout | main.rs:246:22:246:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:253:25:253:38 | ...::args | main.rs:253:25:253:40 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:253:25:253:40 | ...::args(...) [element] | main.rs:253:25:253:47 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:253:25:253:47 | ... .nth(...) [Some] | main.rs:253:25:253:74 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:253:25:253:74 | ... .unwrap_or(...) | main.rs:224:24:224:41 | ...: String | provenance | | +| main.rs:254:26:254:39 | ...::args | main.rs:254:26:254:41 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:254:26:254:41 | ...::args(...) [element] | main.rs:254:26:254:48 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:254:26:254:48 | ... .nth(...) [Some] | main.rs:254:26:254:75 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:254:26:254:75 | ... .unwrap_or(...) | main.rs:237:25:237:42 | ...: String | provenance | | +| main.rs:262:9:262:9 | v | main.rs:265:34:265:34 | v | provenance | | +| main.rs:262:9:262:9 | v | main.rs:266:42:266:42 | v | provenance | | +| main.rs:262:9:262:9 | v | main.rs:267:36:267:36 | v | provenance | | +| main.rs:262:9:262:9 | v | main.rs:268:27:268:27 | v | provenance | | +| main.rs:262:9:262:9 | v | main.rs:269:25:269:25 | v | provenance | | +| main.rs:262:13:262:26 | ...::args | main.rs:262:13:262:28 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:262:13:262:28 | ...::args(...) [element] | main.rs:262:13:262:35 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:262:13:262:35 | ... .nth(...) [Some] | main.rs:262:13:262:65 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:262:13:262:65 | ... .unwrap_or(...) | main.rs:262:13:262:82 | ... .parse(...) [Ok] | provenance | MaD:32 | +| main.rs:262:13:262:82 | ... .parse(...) [Ok] | main.rs:262:13:262:91 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:262:13:262:91 | ... .unwrap(...) | main.rs:262:9:262:9 | v | provenance | | +| main.rs:265:34:265:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | +| main.rs:266:42:266:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | +| main.rs:267:36:267:36 | v | main.rs:81:38:81:45 | ...: usize | provenance | | +| main.rs:268:27:268:27 | v | main.rs:128:29:128:36 | ...: usize | provenance | | +| main.rs:269:25:269:25 | v | main.rs:162:27:162:34 | ...: usize | provenance | | models | 1 | Sink: lang:alloc; ::allocate; alloc-layout; Argument[0] | | 2 | Sink: lang:alloc; ::allocate_zeroed; alloc-layout; Argument[0] | @@ -461,17 +490,46 @@ nodes | main.rs:169:13:169:25 | ...::realloc | semmle.label | ...::realloc | | main.rs:169:13:169:25 | ...::realloc | semmle.label | ...::realloc | | main.rs:169:31:169:31 | v | semmle.label | v | -| main.rs:211:9:211:9 | v | semmle.label | v | -| main.rs:211:13:211:26 | ...::args | semmle.label | ...::args | -| main.rs:211:13:211:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | -| main.rs:211:13:211:35 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | -| main.rs:211:13:211:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | -| main.rs:211:13:211:82 | ... .parse(...) [Ok] | semmle.label | ... .parse(...) [Ok] | -| main.rs:211:13:211:91 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:214:34:214:34 | v | semmle.label | v | -| main.rs:215:42:215:42 | v | semmle.label | v | -| main.rs:216:36:216:36 | v | semmle.label | v | -| main.rs:217:27:217:27 | v | semmle.label | v | -| main.rs:218:25:218:25 | v | semmle.label | v | +| main.rs:224:24:224:41 | ...: String | semmle.label | ...: String | +| main.rs:225:9:225:17 | num_bytes | semmle.label | num_bytes | +| main.rs:225:21:225:47 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | +| main.rs:225:21:225:48 | TryExpr | semmle.label | TryExpr | +| main.rs:227:9:227:14 | layout | semmle.label | layout | +| main.rs:227:18:227:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:227:18:227:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:227:54:227:62 | num_bytes | semmle.label | num_bytes | +| main.rs:229:22:229:38 | ...::alloc | semmle.label | ...::alloc | +| main.rs:229:40:229:45 | layout | semmle.label | layout | +| main.rs:237:25:237:42 | ...: String | semmle.label | ...: String | +| main.rs:238:9:238:12 | size | semmle.label | size | +| main.rs:238:16:238:42 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | +| main.rs:238:16:238:43 | TryExpr | semmle.label | TryExpr | +| main.rs:242:9:242:17 | num_bytes | semmle.label | num_bytes | +| main.rs:244:9:244:14 | layout | semmle.label | layout | +| main.rs:244:18:244:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:244:18:244:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:244:54:244:62 | num_bytes | semmle.label | num_bytes | +| main.rs:246:22:246:38 | ...::alloc | semmle.label | ...::alloc | +| main.rs:246:40:246:45 | layout | semmle.label | layout | +| main.rs:253:25:253:38 | ...::args | semmle.label | ...::args | +| main.rs:253:25:253:40 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:253:25:253:47 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:253:25:253:74 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:254:26:254:39 | ...::args | semmle.label | ...::args | +| main.rs:254:26:254:41 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:254:26:254:48 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:254:26:254:75 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:262:9:262:9 | v | semmle.label | v | +| main.rs:262:13:262:26 | ...::args | semmle.label | ...::args | +| main.rs:262:13:262:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:262:13:262:35 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:262:13:262:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:262:13:262:82 | ... .parse(...) [Ok] | semmle.label | ... .parse(...) [Ok] | +| main.rs:262:13:262:91 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:265:34:265:34 | v | semmle.label | v | +| main.rs:266:42:266:42 | v | semmle.label | v | +| main.rs:267:36:267:36 | v | semmle.label | v | +| main.rs:268:27:268:27 | v | semmle.label | v | +| main.rs:269:25:269:25 | v | semmle.label | v | subpaths | main.rs:116:53:116:53 | v | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | main.rs:116:47:116:62 | clamp(...) | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index d2b5c109fa7..a699767dc1a 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -203,6 +203,57 @@ unsafe fn test_vectors(v: usize) { let _ = Vec::::from_raw_parts_in(m7, 100, v, std::alloc::Global); // $ MISSING: Alert[rust/uncontrolled-allocation-size] } +// --- examples from the qhelp --- + +struct Error { + msg: String, +} + +impl From for Error { + fn from(err: std::num::ParseIntError) -> Self { + Error { msg: "ParseIntError".to_string() } + } +} + +impl From<&str> for Error { + fn from(msg: &str) -> Self { + Error { msg: msg.to_string() } + } +} + +fn allocate_buffer_bad(user_input: String) -> Result<*mut u8, Error> { + let num_bytes = user_input.parse::()? * std::mem::size_of::(); + + let layout = std::alloc::Layout::from_size_align(num_bytes, 1).unwrap(); + unsafe { + let buffer = std::alloc::alloc(layout); // $ Alert[rust/uncontrolled-allocation-size]=example1 + + Ok(buffer) + } +} + +const BUFFER_LIMIT: usize = 10 * 1024; + +fn allocate_buffer_good(user_input: String) -> Result<*mut u8, Error> { + let size = user_input.parse::()?; + if (size > BUFFER_LIMIT) { + return Err("Size exceeds limit".into()); + } + let num_bytes = size * std::mem::size_of::(); + + let layout = std::alloc::Layout::from_size_align(num_bytes, 1).unwrap(); + unsafe { + let buffer = std::alloc::alloc(layout); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=example2 + + Ok(buffer) + } +} + +fn test_examples() { + allocate_buffer_bad(std::env::args().nth(1).unwrap_or("0".to_string())); // $ Source=example1 + allocate_buffer_good(std::env::args().nth(1).unwrap_or("0".to_string())); // $ Source=example2 +} + // --- main --- fn main() { @@ -217,6 +268,7 @@ fn main() { test_system_alloc(v); test_libc_alloc(v); test_vectors(v); + test_examples(); } println!("--- end ---"); From cdd5cb05237dd1300945f4888af1a1236fe53063 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 31 Mar 2025 09:28:10 +0100 Subject: [PATCH 037/372] Rust: More test cases for bounds / guards. --- .../UncontrolledAllocationSize.expected | 780 +++++++++++------- .../test/query-tests/security/CWE-770/main.rs | 83 +- 2 files changed, 537 insertions(+), 326 deletions(-) diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 7ef8327b64e..cca67133563 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -1,54 +1,66 @@ #select -| main.rs:18:13:18:31 | ...::realloc | main.rs:262:13:262:26 | ...::args | main.rs:18:13:18:31 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:21:13:21:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:21:13:21:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:22:13:22:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:22:13:22:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:23:13:23:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:23:13:23:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:24:13:24:36 | ...::alloc_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:24:13:24:36 | ...::alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:30:13:30:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:30:13:30:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:33:13:33:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:33:13:33:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:37:13:37:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:37:13:37:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:40:13:40:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:40:13:40:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:50:13:50:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:50:13:50:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:51:13:51:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:51:13:51:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:53:13:53:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:53:13:53:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:54:13:54:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:54:13:54:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:59:13:59:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:59:13:59:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:61:13:61:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:61:13:61:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:63:13:63:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:63:13:63:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:64:13:64:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:65:13:65:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:68:13:68:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:85:17:85:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:85:17:85:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:87:17:87:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:87:17:87:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:91:17:91:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:91:17:91:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:93:17:93:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:93:17:93:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:104:17:104:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:104:17:104:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:107:17:107:33 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:107:17:107:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:111:13:111:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:111:13:111:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:114:13:114:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:114:13:114:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:117:13:117:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:117:13:117:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:119:13:119:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:119:13:119:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:123:13:123:29 | ...::alloc | main.rs:262:13:262:26 | ...::args | main.rs:123:13:123:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:138:32:138:36 | alloc | main.rs:262:13:262:26 | ...::args | main.rs:138:32:138:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:139:32:139:43 | alloc_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:139:32:139:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:140:32:140:39 | allocate | main.rs:262:13:262:26 | ...::args | main.rs:140:32:140:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:141:32:141:46 | allocate_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:141:32:141:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:142:32:142:39 | allocate | main.rs:262:13:262:26 | ...::args | main.rs:142:32:142:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:143:32:143:46 | allocate_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:143:32:143:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:153:40:153:43 | grow | main.rs:262:13:262:26 | ...::args | main.rs:153:40:153:43 | grow | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:155:40:155:50 | grow_zeroed | main.rs:262:13:262:26 | ...::args | main.rs:155:40:155:50 | grow_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:164:13:164:24 | ...::malloc | main.rs:262:13:262:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:164:13:164:24 | ...::malloc | main.rs:262:13:262:26 | ...::args | main.rs:164:13:164:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:262:13:262:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:165:13:165:31 | ...::aligned_alloc | main.rs:262:13:262:26 | ...::args | main.rs:165:13:165:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:167:13:167:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:167:13:167:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:167:13:167:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:168:13:168:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:168:13:168:24 | ...::calloc | main.rs:262:13:262:26 | ...::args | main.rs:168:13:168:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:169:13:169:25 | ...::realloc | main.rs:262:13:262:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:169:13:169:25 | ...::realloc | main.rs:262:13:262:26 | ...::args | main.rs:169:13:169:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:262:13:262:26 | ...::args | user-provided value | -| main.rs:229:22:229:38 | ...::alloc | main.rs:253:25:253:38 | ...::args | main.rs:229:22:229:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:253:25:253:38 | ...::args | user-provided value | -| main.rs:246:22:246:38 | ...::alloc | main.rs:254:26:254:39 | ...::args | main.rs:246:22:246:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:254:26:254:39 | ...::args | user-provided value | +| main.rs:18:13:18:31 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:18:13:18:31 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:21:13:21:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:21:13:21:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:22:13:22:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:22:13:22:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:23:13:23:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:23:13:23:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:24:13:24:36 | ...::alloc_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:24:13:24:36 | ...::alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:30:13:30:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:30:13:30:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:33:13:33:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:33:13:33:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:37:13:37:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:37:13:37:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:40:13:40:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:40:13:40:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:50:13:50:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:50:13:50:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:51:13:51:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:51:13:51:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:53:13:53:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:53:13:53:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:54:13:54:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:54:13:54:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:59:13:59:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:59:13:59:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:61:13:61:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:61:13:61:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:63:13:63:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:63:13:63:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:64:13:64:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:65:13:65:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:68:13:68:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:83:13:83:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:83:13:83:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:88:13:88:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:88:13:88:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:96:17:96:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:96:17:96:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:97:17:97:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:97:17:97:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:102:17:102:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:102:17:102:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:103:17:103:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:103:17:103:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:109:17:109:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:109:17:109:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:111:17:111:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:111:17:111:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:116:17:116:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:116:17:116:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:121:17:121:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:121:17:121:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:126:17:126:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:126:17:126:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:135:13:135:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:135:13:135:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:146:17:146:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:146:17:146:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:147:17:147:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:147:17:147:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:148:17:148:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:148:17:148:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:152:13:152:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:152:13:152:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:155:13:155:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:155:13:155:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:158:13:158:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:158:13:158:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:162:17:162:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:162:17:162:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:169:17:169:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:169:17:169:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:170:17:170:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:170:17:170:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:177:13:177:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:177:13:177:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:178:13:178:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:178:13:178:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:193:32:193:36 | alloc | main.rs:317:13:317:26 | ...::args | main.rs:193:32:193:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:194:32:194:43 | alloc_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:194:32:194:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:195:32:195:39 | allocate | main.rs:317:13:317:26 | ...::args | main.rs:195:32:195:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:196:32:196:46 | allocate_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:196:32:196:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:197:32:197:39 | allocate | main.rs:317:13:317:26 | ...::args | main.rs:197:32:197:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:198:32:198:46 | allocate_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:198:32:198:46 | allocate_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:208:40:208:43 | grow | main.rs:317:13:317:26 | ...::args | main.rs:208:40:208:43 | grow | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:210:40:210:50 | grow_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:210:40:210:50 | grow_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:219:13:219:24 | ...::malloc | main.rs:317:13:317:26 | ...::args | main.rs:219:13:219:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:219:13:219:24 | ...::malloc | main.rs:317:13:317:26 | ...::args | main.rs:219:13:219:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:220:13:220:31 | ...::aligned_alloc | main.rs:317:13:317:26 | ...::args | main.rs:220:13:220:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:220:13:220:31 | ...::aligned_alloc | main.rs:317:13:317:26 | ...::args | main.rs:220:13:220:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:222:13:222:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:222:13:222:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:222:13:222:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:222:13:222:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:223:13:223:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:223:13:223:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:223:13:223:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:223:13:223:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:224:13:224:25 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:224:13:224:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:224:13:224:25 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:224:13:224:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:284:22:284:38 | ...::alloc | main.rs:308:25:308:38 | ...::args | main.rs:284:22:284:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:308:25:308:38 | ...::args | user-provided value | +| main.rs:301:22:301:38 | ...::alloc | main.rs:309:26:309:39 | ...::args | main.rs:301:22:301:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:309:26:309:39 | ...::args | user-provided value | edges | main.rs:12:36:12:43 | ...: usize | main.rs:18:41:18:41 | v | provenance | | | main.rs:18:41:18:41 | v | main.rs:18:13:18:31 | ...::realloc | provenance | MaD:5 Sink:MaD:5 | @@ -140,138 +152,210 @@ edges | main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | provenance | | -| main.rs:81:38:81:45 | ...: usize | main.rs:82:47:82:47 | v | provenance | | -| main.rs:81:38:81:45 | ...: usize | main.rs:97:13:97:21 | mut v_mut | provenance | | -| main.rs:81:38:81:45 | ...: usize | main.rs:106:51:106:51 | v | provenance | | -| main.rs:81:38:81:45 | ...: usize | main.rs:110:61:110:61 | v | provenance | | -| main.rs:81:38:81:45 | ...: usize | main.rs:113:61:113:61 | v | provenance | | -| main.rs:81:38:81:45 | ...: usize | main.rs:116:53:116:53 | v | provenance | | -| main.rs:82:9:82:10 | l1 | main.rs:85:35:85:36 | l1 | provenance | | -| main.rs:82:9:82:10 | l1 | main.rs:87:35:87:36 | l1 | provenance | | -| main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | main.rs:82:14:82:57 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:82:14:82:57 | ... .unwrap(...) | main.rs:82:9:82:10 | l1 | provenance | | -| main.rs:82:47:82:47 | v | main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:85:35:85:36 | l1 | main.rs:85:17:85:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:85:35:85:36 | l1 | main.rs:91:35:91:36 | l1 | provenance | | -| main.rs:85:35:85:36 | l1 | main.rs:93:35:93:36 | l1 | provenance | | -| main.rs:87:35:87:36 | l1 | main.rs:87:17:87:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:87:35:87:36 | l1 | main.rs:91:35:91:36 | l1 | provenance | | -| main.rs:87:35:87:36 | l1 | main.rs:93:35:93:36 | l1 | provenance | | -| main.rs:91:35:91:36 | l1 | main.rs:91:17:91:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:91:35:91:36 | l1 | main.rs:119:31:119:32 | l1 | provenance | | -| main.rs:93:35:93:36 | l1 | main.rs:93:17:93:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:93:35:93:36 | l1 | main.rs:119:31:119:32 | l1 | provenance | | -| main.rs:97:13:97:21 | mut v_mut | main.rs:103:51:103:55 | v_mut | provenance | | -| main.rs:103:13:103:14 | l2 | main.rs:104:35:104:36 | l2 | provenance | | -| main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | main.rs:103:18:103:65 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:103:18:103:65 | ... .unwrap(...) | main.rs:103:13:103:14 | l2 | provenance | | -| main.rs:103:51:103:55 | v_mut | main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:104:35:104:36 | l2 | main.rs:104:17:104:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:106:13:106:14 | l3 | main.rs:107:35:107:36 | l3 | provenance | | -| main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | main.rs:106:18:106:61 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:106:18:106:61 | ... .unwrap(...) | main.rs:106:13:106:14 | l3 | provenance | | -| main.rs:106:51:106:51 | v | main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:107:35:107:36 | l3 | main.rs:107:17:107:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:110:9:110:10 | l4 | main.rs:111:31:111:32 | l4 | provenance | | -| main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | main.rs:110:14:110:77 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:110:14:110:77 | ... .unwrap(...) | main.rs:110:9:110:10 | l4 | provenance | | -| main.rs:110:47:110:67 | ...::min(...) | main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:110:61:110:61 | v | main.rs:110:47:110:67 | ...::min(...) | provenance | MaD:34 | -| main.rs:111:31:111:32 | l4 | main.rs:111:13:111:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:113:9:113:10 | l5 | main.rs:114:31:114:32 | l5 | provenance | | -| main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | main.rs:113:14:113:77 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:113:14:113:77 | ... .unwrap(...) | main.rs:113:9:113:10 | l5 | provenance | | -| main.rs:113:47:113:67 | ...::max(...) | main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:113:61:113:61 | v | main.rs:113:47:113:67 | ...::max(...) | provenance | MaD:33 | -| main.rs:114:31:114:32 | l5 | main.rs:114:13:114:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:116:9:116:10 | l6 | main.rs:117:31:117:32 | l6 | provenance | | -| main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | main.rs:116:14:116:72 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:116:14:116:72 | ... .unwrap(...) | main.rs:116:9:116:10 | l6 | provenance | | -| main.rs:116:47:116:62 | clamp(...) | main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:116:53:116:53 | v | main.rs:71:35:71:38 | ...: T | provenance | | -| main.rs:116:53:116:53 | v | main.rs:116:47:116:62 | clamp(...) | provenance | | -| main.rs:117:31:117:32 | l6 | main.rs:117:13:117:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:119:31:119:32 | l1 | main.rs:119:13:119:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:119:31:119:32 | l1 | main.rs:123:31:123:32 | l1 | provenance | | -| main.rs:123:31:123:32 | l1 | main.rs:123:13:123:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:128:29:128:36 | ...: usize | main.rs:137:46:137:46 | v | provenance | | -| main.rs:137:9:137:10 | l2 | main.rs:138:38:138:39 | l2 | provenance | | -| main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | main.rs:137:14:137:56 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:137:14:137:56 | ... .unwrap(...) | main.rs:137:9:137:10 | l2 | provenance | | -| main.rs:137:46:137:46 | v | main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:138:38:138:39 | l2 | main.rs:138:32:138:36 | alloc | provenance | MaD:10 Sink:MaD:10 | -| main.rs:138:38:138:39 | l2 | main.rs:139:45:139:46 | l2 | provenance | | -| main.rs:139:45:139:46 | l2 | main.rs:139:32:139:43 | alloc_zeroed | provenance | MaD:11 Sink:MaD:11 | -| main.rs:139:45:139:46 | l2 | main.rs:140:41:140:42 | l2 | provenance | | -| main.rs:140:41:140:42 | l2 | main.rs:140:32:140:39 | allocate | provenance | MaD:6 Sink:MaD:6 | -| main.rs:140:41:140:42 | l2 | main.rs:141:48:141:49 | l2 | provenance | | -| main.rs:141:48:141:49 | l2 | main.rs:141:32:141:46 | allocate_zeroed | provenance | MaD:7 Sink:MaD:7 | -| main.rs:141:48:141:49 | l2 | main.rs:142:41:142:42 | l2 | provenance | | -| main.rs:142:41:142:42 | l2 | main.rs:142:32:142:39 | allocate | provenance | MaD:1 Sink:MaD:1 | -| main.rs:142:41:142:42 | l2 | main.rs:143:48:143:49 | l2 | provenance | | -| main.rs:143:48:143:49 | l2 | main.rs:143:32:143:46 | allocate_zeroed | provenance | MaD:2 Sink:MaD:2 | -| main.rs:143:48:143:49 | l2 | main.rs:153:53:153:54 | l2 | provenance | | -| main.rs:143:48:143:49 | l2 | main.rs:155:60:155:61 | l2 | provenance | | -| main.rs:153:53:153:54 | l2 | main.rs:153:40:153:43 | grow | provenance | MaD:8 Sink:MaD:8 | -| main.rs:155:60:155:61 | l2 | main.rs:155:40:155:50 | grow_zeroed | provenance | MaD:9 Sink:MaD:9 | -| main.rs:162:27:162:34 | ...: usize | main.rs:164:26:164:26 | v | provenance | | -| main.rs:164:26:164:26 | v | main.rs:164:13:164:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | -| main.rs:164:26:164:26 | v | main.rs:164:13:164:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | -| main.rs:164:26:164:26 | v | main.rs:165:36:165:36 | v | provenance | | -| main.rs:165:36:165:36 | v | main.rs:165:13:165:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | -| main.rs:165:36:165:36 | v | main.rs:165:13:165:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | -| main.rs:165:36:165:36 | v | main.rs:167:30:167:30 | v | provenance | | -| main.rs:167:30:167:30 | v | main.rs:167:13:167:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | -| main.rs:167:30:167:30 | v | main.rs:167:13:167:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | -| main.rs:167:30:167:30 | v | main.rs:168:26:168:26 | v | provenance | | -| main.rs:168:26:168:26 | v | main.rs:168:13:168:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | -| main.rs:168:26:168:26 | v | main.rs:168:13:168:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | -| main.rs:168:26:168:26 | v | main.rs:169:31:169:31 | v | provenance | | -| main.rs:169:31:169:31 | v | main.rs:169:13:169:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:169:31:169:31 | v | main.rs:169:13:169:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:224:24:224:41 | ...: String | main.rs:225:21:225:47 | user_input.parse(...) [Ok] | provenance | MaD:32 | -| main.rs:225:9:225:17 | num_bytes | main.rs:227:54:227:62 | num_bytes | provenance | | -| main.rs:225:21:225:47 | user_input.parse(...) [Ok] | main.rs:225:21:225:48 | TryExpr | provenance | | -| main.rs:225:21:225:48 | TryExpr | main.rs:225:9:225:17 | num_bytes | provenance | | -| main.rs:227:9:227:14 | layout | main.rs:229:40:229:45 | layout | provenance | | -| main.rs:227:18:227:66 | ...::from_size_align(...) [Ok] | main.rs:227:18:227:75 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:227:18:227:75 | ... .unwrap(...) | main.rs:227:9:227:14 | layout | provenance | | -| main.rs:227:54:227:62 | num_bytes | main.rs:227:18:227:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:229:40:229:45 | layout | main.rs:229:22:229:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:237:25:237:42 | ...: String | main.rs:238:16:238:42 | user_input.parse(...) [Ok] | provenance | MaD:32 | -| main.rs:238:9:238:12 | size | main.rs:242:9:242:17 | num_bytes | provenance | | -| main.rs:238:16:238:42 | user_input.parse(...) [Ok] | main.rs:238:16:238:43 | TryExpr | provenance | | -| main.rs:238:16:238:43 | TryExpr | main.rs:238:9:238:12 | size | provenance | | -| main.rs:242:9:242:17 | num_bytes | main.rs:244:54:244:62 | num_bytes | provenance | | -| main.rs:244:9:244:14 | layout | main.rs:246:40:246:45 | layout | provenance | | -| main.rs:244:18:244:66 | ...::from_size_align(...) [Ok] | main.rs:244:18:244:75 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:244:18:244:75 | ... .unwrap(...) | main.rs:244:9:244:14 | layout | provenance | | -| main.rs:244:54:244:62 | num_bytes | main.rs:244:18:244:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:246:40:246:45 | layout | main.rs:246:22:246:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:253:25:253:38 | ...::args | main.rs:253:25:253:40 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:253:25:253:40 | ...::args(...) [element] | main.rs:253:25:253:47 | ... .nth(...) [Some] | provenance | MaD:35 | -| main.rs:253:25:253:47 | ... .nth(...) [Some] | main.rs:253:25:253:74 | ... .unwrap_or(...) | provenance | MaD:29 | -| main.rs:253:25:253:74 | ... .unwrap_or(...) | main.rs:224:24:224:41 | ...: String | provenance | | -| main.rs:254:26:254:39 | ...::args | main.rs:254:26:254:41 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:254:26:254:41 | ...::args(...) [element] | main.rs:254:26:254:48 | ... .nth(...) [Some] | provenance | MaD:35 | -| main.rs:254:26:254:48 | ... .nth(...) [Some] | main.rs:254:26:254:75 | ... .unwrap_or(...) | provenance | MaD:29 | -| main.rs:254:26:254:75 | ... .unwrap_or(...) | main.rs:237:25:237:42 | ...: String | provenance | | -| main.rs:262:9:262:9 | v | main.rs:265:34:265:34 | v | provenance | | -| main.rs:262:9:262:9 | v | main.rs:266:42:266:42 | v | provenance | | -| main.rs:262:9:262:9 | v | main.rs:267:36:267:36 | v | provenance | | -| main.rs:262:9:262:9 | v | main.rs:268:27:268:27 | v | provenance | | -| main.rs:262:9:262:9 | v | main.rs:269:25:269:25 | v | provenance | | -| main.rs:262:13:262:26 | ...::args | main.rs:262:13:262:28 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:262:13:262:28 | ...::args(...) [element] | main.rs:262:13:262:35 | ... .nth(...) [Some] | provenance | MaD:35 | -| main.rs:262:13:262:35 | ... .nth(...) [Some] | main.rs:262:13:262:65 | ... .unwrap_or(...) | provenance | MaD:29 | -| main.rs:262:13:262:65 | ... .unwrap_or(...) | main.rs:262:13:262:82 | ... .parse(...) [Ok] | provenance | MaD:32 | -| main.rs:262:13:262:82 | ... .parse(...) [Ok] | main.rs:262:13:262:91 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:262:13:262:91 | ... .unwrap(...) | main.rs:262:9:262:9 | v | provenance | | -| main.rs:265:34:265:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | -| main.rs:266:42:266:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | -| main.rs:267:36:267:36 | v | main.rs:81:38:81:45 | ...: usize | provenance | | -| main.rs:268:27:268:27 | v | main.rs:128:29:128:36 | ...: usize | provenance | | -| main.rs:269:25:269:25 | v | main.rs:162:27:162:34 | ...: usize | provenance | | +| main.rs:81:33:81:40 | ...: usize | main.rs:82:54:82:54 | v | provenance | | +| main.rs:82:9:82:14 | layout | main.rs:83:31:83:36 | layout | provenance | | +| main.rs:82:18:82:58 | ...::from_size_align(...) [Ok] | main.rs:82:18:82:67 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:82:18:82:67 | ... .unwrap(...) | main.rs:82:9:82:14 | layout | provenance | | +| main.rs:82:54:82:54 | v | main.rs:82:18:82:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:83:31:83:36 | layout | main.rs:83:13:83:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:86:35:86:42 | ...: usize | main.rs:87:54:87:54 | v | provenance | | +| main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:87:18:87:67 | ... .unwrap(...) | main.rs:87:9:87:14 | layout | provenance | | +| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:95:51:95:51 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:99:31:99:31 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:101:51:101:51 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:105:33:105:33 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:115:54:115:54 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:120:54:120:54 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:125:54:125:54 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:131:50:131:50 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:138:13:138:21 | mut v_mut | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:145:51:145:51 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:151:62:151:62 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:154:62:154:62 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:157:54:157:54 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:161:55:161:55 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:168:55:168:55 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:176:51:176:51 | v | provenance | | +| main.rs:92:9:92:10 | l1 | main.rs:96:35:96:36 | l1 | provenance | | +| main.rs:92:9:92:10 | l1 | main.rs:102:35:102:36 | l1 | provenance | | +| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:92:14:92:57 | ... .unwrap(...) | main.rs:92:9:92:10 | l1 | provenance | | +| main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:95:13:95:14 | l2 | main.rs:97:35:97:36 | l2 | provenance | | +| main.rs:95:18:95:52 | ...::array::<...>(...) [Ok] | main.rs:95:18:95:61 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:95:18:95:61 | ... .unwrap(...) | main.rs:95:13:95:14 | l2 | provenance | | +| main.rs:95:51:95:51 | v | main.rs:95:18:95:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:96:35:96:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | +| main.rs:96:35:96:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | +| main.rs:97:35:97:36 | l2 | main.rs:97:17:97:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:99:31:99:31 | v | main.rs:81:33:81:40 | ...: usize | provenance | | +| main.rs:101:13:101:14 | l3 | main.rs:103:35:103:36 | l3 | provenance | | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:101:18:101:61 | ... .unwrap(...) | main.rs:101:13:101:14 | l3 | provenance | | +| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:102:35:102:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | +| main.rs:102:35:102:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | +| main.rs:103:35:103:36 | l3 | main.rs:103:17:103:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:105:33:105:33 | v | main.rs:86:35:86:42 | ...: usize | provenance | | +| main.rs:109:35:109:36 | l1 | main.rs:109:17:109:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:109:35:109:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | +| main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:111:35:111:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | +| main.rs:115:13:115:14 | l4 | main.rs:116:35:116:36 | l4 | provenance | | +| main.rs:115:18:115:58 | ...::from_size_align(...) [Ok] | main.rs:115:18:115:67 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:115:18:115:67 | ... .unwrap(...) | main.rs:115:13:115:14 | l4 | provenance | | +| main.rs:115:54:115:54 | v | main.rs:115:18:115:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:116:35:116:36 | l4 | main.rs:116:17:116:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:120:13:120:14 | l5 | main.rs:121:35:121:36 | l5 | provenance | | +| main.rs:120:18:120:58 | ...::from_size_align(...) [Ok] | main.rs:120:18:120:67 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:120:18:120:67 | ... .unwrap(...) | main.rs:120:13:120:14 | l5 | provenance | | +| main.rs:120:54:120:54 | v | main.rs:120:18:120:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:121:35:121:36 | l5 | main.rs:121:17:121:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:125:13:125:14 | l6 | main.rs:126:35:126:36 | l6 | provenance | | +| main.rs:125:18:125:58 | ...::from_size_align(...) [Ok] | main.rs:125:18:125:67 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:125:18:125:67 | ... .unwrap(...) | main.rs:125:13:125:14 | l6 | provenance | | +| main.rs:125:54:125:54 | v | main.rs:125:18:125:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:126:35:126:36 | l6 | main.rs:126:17:126:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:131:9:131:10 | l7 | main.rs:135:31:135:32 | l7 | provenance | | +| main.rs:131:14:131:54 | ...::from_size_align(...) [Ok] | main.rs:131:14:131:63 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:131:14:131:63 | ... .unwrap(...) | main.rs:131:9:131:10 | l7 | provenance | | +| main.rs:131:50:131:50 | v | main.rs:131:14:131:54 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:135:31:135:32 | l7 | main.rs:135:13:135:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:138:13:138:21 | mut v_mut | main.rs:144:51:144:55 | v_mut | provenance | | +| main.rs:144:13:144:14 | l8 | main.rs:147:35:147:36 | l8 | provenance | | +| main.rs:144:18:144:56 | ...::array::<...>(...) [Ok] | main.rs:144:18:144:65 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:144:18:144:65 | ... .unwrap(...) | main.rs:144:13:144:14 | l8 | provenance | | +| main.rs:144:51:144:55 | v_mut | main.rs:144:18:144:56 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:145:13:145:14 | l9 | main.rs:148:35:148:36 | l9 | provenance | | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:145:18:145:61 | ... .unwrap(...) | main.rs:145:13:145:14 | l9 | provenance | | +| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:146:35:146:36 | l1 | main.rs:177:31:177:32 | l1 | provenance | | +| main.rs:147:35:147:36 | l8 | main.rs:147:17:147:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:151:9:151:11 | l10 | main.rs:152:31:152:33 | l10 | provenance | | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:151:15:151:78 | ... .unwrap(...) | main.rs:151:9:151:11 | l10 | provenance | | +| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:34 | +| main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:154:9:154:11 | l11 | main.rs:155:31:155:33 | l11 | provenance | | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:154:15:154:78 | ... .unwrap(...) | main.rs:154:9:154:11 | l11 | provenance | | +| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:33 | +| main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:157:9:157:11 | l12 | main.rs:158:31:158:33 | l12 | provenance | | +| main.rs:157:15:157:64 | ...::array::<...>(...) [Ok] | main.rs:157:15:157:73 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:157:15:157:73 | ... .unwrap(...) | main.rs:157:9:157:11 | l12 | provenance | | +| main.rs:157:48:157:63 | clamp(...) | main.rs:157:15:157:64 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:157:54:157:54 | v | main.rs:71:35:71:38 | ...: T | provenance | | +| main.rs:157:54:157:54 | v | main.rs:157:48:157:63 | clamp(...) | provenance | | +| main.rs:158:31:158:33 | l12 | main.rs:158:13:158:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:161:19:161:68 | ... .unwrap(...) | main.rs:161:13:161:15 | l13 | provenance | | +| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | +| main.rs:168:13:168:15 | l14 | main.rs:170:35:170:37 | l14 | provenance | | +| main.rs:168:19:168:59 | ...::from_size_align(...) [Ok] | main.rs:168:19:168:68 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:168:19:168:68 | ... .unwrap(...) | main.rs:168:13:168:15 | l14 | provenance | | +| main.rs:168:55:168:55 | v | main.rs:168:19:168:59 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:170:35:170:37 | l14 | main.rs:170:17:170:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:176:9:176:11 | l15 | main.rs:178:31:178:33 | l15 | provenance | | +| main.rs:176:15:176:55 | ...::from_size_align(...) [Ok] | main.rs:176:15:176:64 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:176:15:176:64 | ... .unwrap(...) | main.rs:176:9:176:11 | l15 | provenance | | +| main.rs:176:51:176:51 | v | main.rs:176:15:176:55 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:177:31:177:32 | l1 | main.rs:177:13:177:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:178:31:178:33 | l15 | main.rs:178:13:178:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:183:29:183:36 | ...: usize | main.rs:192:46:192:46 | v | provenance | | +| main.rs:192:9:192:10 | l2 | main.rs:193:38:193:39 | l2 | provenance | | +| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:192:14:192:56 | ... .unwrap(...) | main.rs:192:9:192:10 | l2 | provenance | | +| main.rs:192:46:192:46 | v | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:193:38:193:39 | l2 | main.rs:193:32:193:36 | alloc | provenance | MaD:10 Sink:MaD:10 | +| main.rs:193:38:193:39 | l2 | main.rs:194:45:194:46 | l2 | provenance | | +| main.rs:194:45:194:46 | l2 | main.rs:194:32:194:43 | alloc_zeroed | provenance | MaD:11 Sink:MaD:11 | +| main.rs:194:45:194:46 | l2 | main.rs:195:41:195:42 | l2 | provenance | | +| main.rs:195:41:195:42 | l2 | main.rs:195:32:195:39 | allocate | provenance | MaD:6 Sink:MaD:6 | +| main.rs:195:41:195:42 | l2 | main.rs:196:48:196:49 | l2 | provenance | | +| main.rs:196:48:196:49 | l2 | main.rs:196:32:196:46 | allocate_zeroed | provenance | MaD:7 Sink:MaD:7 | +| main.rs:196:48:196:49 | l2 | main.rs:197:41:197:42 | l2 | provenance | | +| main.rs:197:41:197:42 | l2 | main.rs:197:32:197:39 | allocate | provenance | MaD:1 Sink:MaD:1 | +| main.rs:197:41:197:42 | l2 | main.rs:198:48:198:49 | l2 | provenance | | +| main.rs:198:48:198:49 | l2 | main.rs:198:32:198:46 | allocate_zeroed | provenance | MaD:2 Sink:MaD:2 | +| main.rs:198:48:198:49 | l2 | main.rs:208:53:208:54 | l2 | provenance | | +| main.rs:198:48:198:49 | l2 | main.rs:210:60:210:61 | l2 | provenance | | +| main.rs:208:53:208:54 | l2 | main.rs:208:40:208:43 | grow | provenance | MaD:8 Sink:MaD:8 | +| main.rs:210:60:210:61 | l2 | main.rs:210:40:210:50 | grow_zeroed | provenance | MaD:9 Sink:MaD:9 | +| main.rs:217:27:217:34 | ...: usize | main.rs:219:26:219:26 | v | provenance | | +| main.rs:219:26:219:26 | v | main.rs:219:13:219:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | +| main.rs:219:26:219:26 | v | main.rs:219:13:219:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | +| main.rs:219:26:219:26 | v | main.rs:220:36:220:36 | v | provenance | | +| main.rs:220:36:220:36 | v | main.rs:220:13:220:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | +| main.rs:220:36:220:36 | v | main.rs:220:13:220:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | +| main.rs:220:36:220:36 | v | main.rs:222:30:222:30 | v | provenance | | +| main.rs:222:30:222:30 | v | main.rs:222:13:222:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:222:30:222:30 | v | main.rs:222:13:222:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:222:30:222:30 | v | main.rs:223:26:223:26 | v | provenance | | +| main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | +| main.rs:223:26:223:26 | v | main.rs:224:31:224:31 | v | provenance | | +| main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | +| main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | +| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse(...) [Ok] | provenance | MaD:32 | +| main.rs:280:9:280:17 | num_bytes | main.rs:282:54:282:62 | num_bytes | provenance | | +| main.rs:280:21:280:47 | user_input.parse(...) [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | +| main.rs:280:21:280:48 | TryExpr | main.rs:280:9:280:17 | num_bytes | provenance | | +| main.rs:282:9:282:14 | layout | main.rs:284:40:284:45 | layout | provenance | | +| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:282:18:282:75 | ... .unwrap(...) | main.rs:282:9:282:14 | layout | provenance | | +| main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:292:25:292:42 | ...: String | main.rs:293:16:293:42 | user_input.parse(...) [Ok] | provenance | MaD:32 | +| main.rs:293:9:293:12 | size | main.rs:297:9:297:17 | num_bytes | provenance | | +| main.rs:293:16:293:42 | user_input.parse(...) [Ok] | main.rs:293:16:293:43 | TryExpr | provenance | | +| main.rs:293:16:293:43 | TryExpr | main.rs:293:9:293:12 | size | provenance | | +| main.rs:297:9:297:17 | num_bytes | main.rs:299:54:299:62 | num_bytes | provenance | | +| main.rs:299:9:299:14 | layout | main.rs:301:40:301:45 | layout | provenance | | +| main.rs:299:18:299:66 | ...::from_size_align(...) [Ok] | main.rs:299:18:299:75 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:299:18:299:75 | ... .unwrap(...) | main.rs:299:9:299:14 | layout | provenance | | +| main.rs:299:54:299:62 | num_bytes | main.rs:299:18:299:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:301:40:301:45 | layout | main.rs:301:22:301:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:308:25:308:74 | ... .unwrap_or(...) | main.rs:279:24:279:41 | ...: String | provenance | | +| main.rs:309:26:309:39 | ...::args | main.rs:309:26:309:41 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:309:26:309:41 | ...::args(...) [element] | main.rs:309:26:309:48 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:309:26:309:48 | ... .nth(...) [Some] | main.rs:309:26:309:75 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:309:26:309:75 | ... .unwrap_or(...) | main.rs:292:25:292:42 | ...: String | provenance | | +| main.rs:317:9:317:9 | v | main.rs:320:34:320:34 | v | provenance | | +| main.rs:317:9:317:9 | v | main.rs:321:42:321:42 | v | provenance | | +| main.rs:317:9:317:9 | v | main.rs:322:36:322:36 | v | provenance | | +| main.rs:317:9:317:9 | v | main.rs:323:27:323:27 | v | provenance | | +| main.rs:317:9:317:9 | v | main.rs:324:25:324:25 | v | provenance | | +| main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:16 | +| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:29 | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse(...) [Ok] | provenance | MaD:32 | +| main.rs:317:13:317:82 | ... .parse(...) [Ok] | main.rs:317:13:317:91 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:317:13:317:91 | ... .unwrap(...) | main.rs:317:9:317:9 | v | provenance | | +| main.rs:320:34:320:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | +| main.rs:321:42:321:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | +| main.rs:322:36:322:36 | v | main.rs:91:38:91:45 | ...: usize | provenance | | +| main.rs:323:27:323:27 | v | main.rs:183:29:183:36 | ...: usize | provenance | | +| main.rs:324:25:324:25 | v | main.rs:217:27:217:34 | ...: usize | provenance | | models | 1 | Sink: lang:alloc; ::allocate; alloc-layout; Argument[0] | | 2 | Sink: lang:alloc; ::allocate_zeroed; alloc-layout; Argument[0] | @@ -402,134 +486,206 @@ nodes | main.rs:68:31:68:32 | l4 | semmle.label | l4 | | main.rs:71:35:71:38 | ...: T | semmle.label | ...: T | | main.rs:77:9:77:16 | return v | semmle.label | return v | -| main.rs:81:38:81:45 | ...: usize | semmle.label | ...: usize | -| main.rs:82:9:82:10 | l1 | semmle.label | l1 | -| main.rs:82:14:82:48 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:82:14:82:57 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:82:47:82:47 | v | semmle.label | v | -| main.rs:85:17:85:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:85:35:85:36 | l1 | semmle.label | l1 | -| main.rs:87:17:87:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:87:35:87:36 | l1 | semmle.label | l1 | -| main.rs:91:17:91:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:91:35:91:36 | l1 | semmle.label | l1 | -| main.rs:93:17:93:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:93:35:93:36 | l1 | semmle.label | l1 | -| main.rs:97:13:97:21 | mut v_mut | semmle.label | mut v_mut | -| main.rs:103:13:103:14 | l2 | semmle.label | l2 | -| main.rs:103:18:103:56 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:103:18:103:65 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:103:51:103:55 | v_mut | semmle.label | v_mut | -| main.rs:104:17:104:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:104:35:104:36 | l2 | semmle.label | l2 | -| main.rs:106:13:106:14 | l3 | semmle.label | l3 | -| main.rs:106:18:106:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:106:18:106:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:106:51:106:51 | v | semmle.label | v | -| main.rs:107:17:107:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:107:35:107:36 | l3 | semmle.label | l3 | -| main.rs:110:9:110:10 | l4 | semmle.label | l4 | -| main.rs:110:14:110:68 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:110:14:110:77 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:110:47:110:67 | ...::min(...) | semmle.label | ...::min(...) | -| main.rs:110:61:110:61 | v | semmle.label | v | -| main.rs:111:13:111:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:111:31:111:32 | l4 | semmle.label | l4 | -| main.rs:113:9:113:10 | l5 | semmle.label | l5 | -| main.rs:113:14:113:68 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:113:14:113:77 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:113:47:113:67 | ...::max(...) | semmle.label | ...::max(...) | -| main.rs:113:61:113:61 | v | semmle.label | v | -| main.rs:114:13:114:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:114:31:114:32 | l5 | semmle.label | l5 | -| main.rs:116:9:116:10 | l6 | semmle.label | l6 | -| main.rs:116:14:116:63 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:116:14:116:72 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:116:47:116:62 | clamp(...) | semmle.label | clamp(...) | -| main.rs:116:53:116:53 | v | semmle.label | v | -| main.rs:117:13:117:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:117:31:117:32 | l6 | semmle.label | l6 | -| main.rs:119:13:119:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:119:31:119:32 | l1 | semmle.label | l1 | -| main.rs:123:13:123:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:123:31:123:32 | l1 | semmle.label | l1 | -| main.rs:128:29:128:36 | ...: usize | semmle.label | ...: usize | -| main.rs:137:9:137:10 | l2 | semmle.label | l2 | -| main.rs:137:14:137:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:137:14:137:56 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:137:46:137:46 | v | semmle.label | v | -| main.rs:138:32:138:36 | alloc | semmle.label | alloc | -| main.rs:138:38:138:39 | l2 | semmle.label | l2 | -| main.rs:139:32:139:43 | alloc_zeroed | semmle.label | alloc_zeroed | -| main.rs:139:45:139:46 | l2 | semmle.label | l2 | -| main.rs:140:32:140:39 | allocate | semmle.label | allocate | -| main.rs:140:41:140:42 | l2 | semmle.label | l2 | -| main.rs:141:32:141:46 | allocate_zeroed | semmle.label | allocate_zeroed | -| main.rs:141:48:141:49 | l2 | semmle.label | l2 | -| main.rs:142:32:142:39 | allocate | semmle.label | allocate | -| main.rs:142:41:142:42 | l2 | semmle.label | l2 | -| main.rs:143:32:143:46 | allocate_zeroed | semmle.label | allocate_zeroed | -| main.rs:143:48:143:49 | l2 | semmle.label | l2 | -| main.rs:153:40:153:43 | grow | semmle.label | grow | -| main.rs:153:53:153:54 | l2 | semmle.label | l2 | -| main.rs:155:40:155:50 | grow_zeroed | semmle.label | grow_zeroed | -| main.rs:155:60:155:61 | l2 | semmle.label | l2 | -| main.rs:162:27:162:34 | ...: usize | semmle.label | ...: usize | -| main.rs:164:13:164:24 | ...::malloc | semmle.label | ...::malloc | -| main.rs:164:13:164:24 | ...::malloc | semmle.label | ...::malloc | -| main.rs:164:26:164:26 | v | semmle.label | v | -| main.rs:165:13:165:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | -| main.rs:165:13:165:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | -| main.rs:165:36:165:36 | v | semmle.label | v | -| main.rs:167:13:167:24 | ...::calloc | semmle.label | ...::calloc | -| main.rs:167:13:167:24 | ...::calloc | semmle.label | ...::calloc | -| main.rs:167:30:167:30 | v | semmle.label | v | -| main.rs:168:13:168:24 | ...::calloc | semmle.label | ...::calloc | -| main.rs:168:13:168:24 | ...::calloc | semmle.label | ...::calloc | -| main.rs:168:26:168:26 | v | semmle.label | v | -| main.rs:169:13:169:25 | ...::realloc | semmle.label | ...::realloc | -| main.rs:169:13:169:25 | ...::realloc | semmle.label | ...::realloc | -| main.rs:169:31:169:31 | v | semmle.label | v | -| main.rs:224:24:224:41 | ...: String | semmle.label | ...: String | -| main.rs:225:9:225:17 | num_bytes | semmle.label | num_bytes | -| main.rs:225:21:225:47 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | -| main.rs:225:21:225:48 | TryExpr | semmle.label | TryExpr | -| main.rs:227:9:227:14 | layout | semmle.label | layout | -| main.rs:227:18:227:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:227:18:227:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:227:54:227:62 | num_bytes | semmle.label | num_bytes | -| main.rs:229:22:229:38 | ...::alloc | semmle.label | ...::alloc | -| main.rs:229:40:229:45 | layout | semmle.label | layout | -| main.rs:237:25:237:42 | ...: String | semmle.label | ...: String | -| main.rs:238:9:238:12 | size | semmle.label | size | -| main.rs:238:16:238:42 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | -| main.rs:238:16:238:43 | TryExpr | semmle.label | TryExpr | -| main.rs:242:9:242:17 | num_bytes | semmle.label | num_bytes | -| main.rs:244:9:244:14 | layout | semmle.label | layout | -| main.rs:244:18:244:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:244:18:244:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:244:54:244:62 | num_bytes | semmle.label | num_bytes | -| main.rs:246:22:246:38 | ...::alloc | semmle.label | ...::alloc | -| main.rs:246:40:246:45 | layout | semmle.label | layout | -| main.rs:253:25:253:38 | ...::args | semmle.label | ...::args | -| main.rs:253:25:253:40 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | -| main.rs:253:25:253:47 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | -| main.rs:253:25:253:74 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | -| main.rs:254:26:254:39 | ...::args | semmle.label | ...::args | -| main.rs:254:26:254:41 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | -| main.rs:254:26:254:48 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | -| main.rs:254:26:254:75 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | -| main.rs:262:9:262:9 | v | semmle.label | v | -| main.rs:262:13:262:26 | ...::args | semmle.label | ...::args | -| main.rs:262:13:262:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | -| main.rs:262:13:262:35 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | -| main.rs:262:13:262:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | -| main.rs:262:13:262:82 | ... .parse(...) [Ok] | semmle.label | ... .parse(...) [Ok] | -| main.rs:262:13:262:91 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:265:34:265:34 | v | semmle.label | v | -| main.rs:266:42:266:42 | v | semmle.label | v | -| main.rs:267:36:267:36 | v | semmle.label | v | -| main.rs:268:27:268:27 | v | semmle.label | v | -| main.rs:269:25:269:25 | v | semmle.label | v | +| main.rs:81:33:81:40 | ...: usize | semmle.label | ...: usize | +| main.rs:82:9:82:14 | layout | semmle.label | layout | +| main.rs:82:18:82:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:82:18:82:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:82:54:82:54 | v | semmle.label | v | +| main.rs:83:13:83:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:83:31:83:36 | layout | semmle.label | layout | +| main.rs:86:35:86:42 | ...: usize | semmle.label | ...: usize | +| main.rs:87:9:87:14 | layout | semmle.label | layout | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:87:18:87:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:87:54:87:54 | v | semmle.label | v | +| main.rs:88:13:88:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:88:31:88:36 | layout | semmle.label | layout | +| main.rs:91:38:91:45 | ...: usize | semmle.label | ...: usize | +| main.rs:92:9:92:10 | l1 | semmle.label | l1 | +| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:92:14:92:57 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:92:47:92:47 | v | semmle.label | v | +| main.rs:95:13:95:14 | l2 | semmle.label | l2 | +| main.rs:95:18:95:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:95:18:95:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:95:51:95:51 | v | semmle.label | v | +| main.rs:96:17:96:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:96:35:96:36 | l1 | semmle.label | l1 | +| main.rs:97:17:97:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:97:35:97:36 | l2 | semmle.label | l2 | +| main.rs:99:31:99:31 | v | semmle.label | v | +| main.rs:101:13:101:14 | l3 | semmle.label | l3 | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:101:18:101:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:101:51:101:51 | v | semmle.label | v | +| main.rs:102:17:102:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:102:35:102:36 | l1 | semmle.label | l1 | +| main.rs:103:17:103:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:103:35:103:36 | l3 | semmle.label | l3 | +| main.rs:105:33:105:33 | v | semmle.label | v | +| main.rs:109:17:109:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:109:35:109:36 | l1 | semmle.label | l1 | +| main.rs:111:17:111:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:111:35:111:36 | l1 | semmle.label | l1 | +| main.rs:115:13:115:14 | l4 | semmle.label | l4 | +| main.rs:115:18:115:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:115:18:115:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:115:54:115:54 | v | semmle.label | v | +| main.rs:116:17:116:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:116:35:116:36 | l4 | semmle.label | l4 | +| main.rs:120:13:120:14 | l5 | semmle.label | l5 | +| main.rs:120:18:120:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:120:18:120:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:120:54:120:54 | v | semmle.label | v | +| main.rs:121:17:121:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:121:35:121:36 | l5 | semmle.label | l5 | +| main.rs:125:13:125:14 | l6 | semmle.label | l6 | +| main.rs:125:18:125:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:125:18:125:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:125:54:125:54 | v | semmle.label | v | +| main.rs:126:17:126:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:126:35:126:36 | l6 | semmle.label | l6 | +| main.rs:131:9:131:10 | l7 | semmle.label | l7 | +| main.rs:131:14:131:54 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:131:14:131:63 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:131:50:131:50 | v | semmle.label | v | +| main.rs:135:13:135:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:135:31:135:32 | l7 | semmle.label | l7 | +| main.rs:138:13:138:21 | mut v_mut | semmle.label | mut v_mut | +| main.rs:144:13:144:14 | l8 | semmle.label | l8 | +| main.rs:144:18:144:56 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:144:18:144:65 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:144:51:144:55 | v_mut | semmle.label | v_mut | +| main.rs:145:13:145:14 | l9 | semmle.label | l9 | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:145:18:145:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:145:51:145:51 | v | semmle.label | v | +| main.rs:146:17:146:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:146:35:146:36 | l1 | semmle.label | l1 | +| main.rs:147:17:147:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:147:35:147:36 | l8 | semmle.label | l8 | +| main.rs:148:17:148:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:148:35:148:36 | l9 | semmle.label | l9 | +| main.rs:151:9:151:11 | l10 | semmle.label | l10 | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:151:15:151:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:151:48:151:68 | ...::min(...) | semmle.label | ...::min(...) | +| main.rs:151:62:151:62 | v | semmle.label | v | +| main.rs:152:13:152:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:152:31:152:33 | l10 | semmle.label | l10 | +| main.rs:154:9:154:11 | l11 | semmle.label | l11 | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:154:15:154:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:154:48:154:68 | ...::max(...) | semmle.label | ...::max(...) | +| main.rs:154:62:154:62 | v | semmle.label | v | +| main.rs:155:13:155:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:155:31:155:33 | l11 | semmle.label | l11 | +| main.rs:157:9:157:11 | l12 | semmle.label | l12 | +| main.rs:157:15:157:64 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:157:15:157:73 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:157:48:157:63 | clamp(...) | semmle.label | clamp(...) | +| main.rs:157:54:157:54 | v | semmle.label | v | +| main.rs:158:13:158:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:158:31:158:33 | l12 | semmle.label | l12 | +| main.rs:161:13:161:15 | l13 | semmle.label | l13 | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:161:19:161:68 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:161:55:161:55 | v | semmle.label | v | +| main.rs:162:17:162:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:162:35:162:37 | l13 | semmle.label | l13 | +| main.rs:168:13:168:15 | l14 | semmle.label | l14 | +| main.rs:168:19:168:59 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:168:19:168:68 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:168:55:168:55 | v | semmle.label | v | +| main.rs:169:17:169:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:169:35:169:37 | l13 | semmle.label | l13 | +| main.rs:170:17:170:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:170:35:170:37 | l14 | semmle.label | l14 | +| main.rs:176:9:176:11 | l15 | semmle.label | l15 | +| main.rs:176:15:176:55 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:176:15:176:64 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:176:51:176:51 | v | semmle.label | v | +| main.rs:177:13:177:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:177:31:177:32 | l1 | semmle.label | l1 | +| main.rs:178:13:178:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:178:31:178:33 | l15 | semmle.label | l15 | +| main.rs:183:29:183:36 | ...: usize | semmle.label | ...: usize | +| main.rs:192:9:192:10 | l2 | semmle.label | l2 | +| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:192:14:192:56 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:192:46:192:46 | v | semmle.label | v | +| main.rs:193:32:193:36 | alloc | semmle.label | alloc | +| main.rs:193:38:193:39 | l2 | semmle.label | l2 | +| main.rs:194:32:194:43 | alloc_zeroed | semmle.label | alloc_zeroed | +| main.rs:194:45:194:46 | l2 | semmle.label | l2 | +| main.rs:195:32:195:39 | allocate | semmle.label | allocate | +| main.rs:195:41:195:42 | l2 | semmle.label | l2 | +| main.rs:196:32:196:46 | allocate_zeroed | semmle.label | allocate_zeroed | +| main.rs:196:48:196:49 | l2 | semmle.label | l2 | +| main.rs:197:32:197:39 | allocate | semmle.label | allocate | +| main.rs:197:41:197:42 | l2 | semmle.label | l2 | +| main.rs:198:32:198:46 | allocate_zeroed | semmle.label | allocate_zeroed | +| main.rs:198:48:198:49 | l2 | semmle.label | l2 | +| main.rs:208:40:208:43 | grow | semmle.label | grow | +| main.rs:208:53:208:54 | l2 | semmle.label | l2 | +| main.rs:210:40:210:50 | grow_zeroed | semmle.label | grow_zeroed | +| main.rs:210:60:210:61 | l2 | semmle.label | l2 | +| main.rs:217:27:217:34 | ...: usize | semmle.label | ...: usize | +| main.rs:219:13:219:24 | ...::malloc | semmle.label | ...::malloc | +| main.rs:219:13:219:24 | ...::malloc | semmle.label | ...::malloc | +| main.rs:219:26:219:26 | v | semmle.label | v | +| main.rs:220:13:220:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | +| main.rs:220:13:220:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | +| main.rs:220:36:220:36 | v | semmle.label | v | +| main.rs:222:13:222:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:222:13:222:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:222:30:222:30 | v | semmle.label | v | +| main.rs:223:13:223:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:223:13:223:24 | ...::calloc | semmle.label | ...::calloc | +| main.rs:223:26:223:26 | v | semmle.label | v | +| main.rs:224:13:224:25 | ...::realloc | semmle.label | ...::realloc | +| main.rs:224:13:224:25 | ...::realloc | semmle.label | ...::realloc | +| main.rs:224:31:224:31 | v | semmle.label | v | +| main.rs:279:24:279:41 | ...: String | semmle.label | ...: String | +| main.rs:280:9:280:17 | num_bytes | semmle.label | num_bytes | +| main.rs:280:21:280:47 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | +| main.rs:280:21:280:48 | TryExpr | semmle.label | TryExpr | +| main.rs:282:9:282:14 | layout | semmle.label | layout | +| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:282:18:282:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:282:54:282:62 | num_bytes | semmle.label | num_bytes | +| main.rs:284:22:284:38 | ...::alloc | semmle.label | ...::alloc | +| main.rs:284:40:284:45 | layout | semmle.label | layout | +| main.rs:292:25:292:42 | ...: String | semmle.label | ...: String | +| main.rs:293:9:293:12 | size | semmle.label | size | +| main.rs:293:16:293:42 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | +| main.rs:293:16:293:43 | TryExpr | semmle.label | TryExpr | +| main.rs:297:9:297:17 | num_bytes | semmle.label | num_bytes | +| main.rs:299:9:299:14 | layout | semmle.label | layout | +| main.rs:299:18:299:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:299:18:299:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:299:54:299:62 | num_bytes | semmle.label | num_bytes | +| main.rs:301:22:301:38 | ...::alloc | semmle.label | ...::alloc | +| main.rs:301:40:301:45 | layout | semmle.label | layout | +| main.rs:308:25:308:38 | ...::args | semmle.label | ...::args | +| main.rs:308:25:308:40 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:308:25:308:47 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:308:25:308:74 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:309:26:309:39 | ...::args | semmle.label | ...::args | +| main.rs:309:26:309:41 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:309:26:309:48 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:309:26:309:75 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:317:9:317:9 | v | semmle.label | v | +| main.rs:317:13:317:26 | ...::args | semmle.label | ...::args | +| main.rs:317:13:317:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | +| main.rs:317:13:317:35 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | +| main.rs:317:13:317:82 | ... .parse(...) [Ok] | semmle.label | ... .parse(...) [Ok] | +| main.rs:317:13:317:91 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:320:34:320:34 | v | semmle.label | v | +| main.rs:321:42:321:42 | v | semmle.label | v | +| main.rs:322:36:322:36 | v | semmle.label | v | +| main.rs:323:27:323:27 | v | semmle.label | v | +| main.rs:324:25:324:25 | v | semmle.label | v | subpaths -| main.rs:116:53:116:53 | v | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | main.rs:116:47:116:62 | clamp(...) | +| main.rs:157:54:157:54 | v | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | main.rs:157:48:157:63 | clamp(...) | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index a699767dc1a..558979ebfc2 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -78,13 +78,31 @@ fn clamp(v: T, min: T, max: T) -> T { } } -unsafe fn test_std_alloc_with_bounds(v: usize) { +unsafe fn test_fn_alloc_bounded(v: usize) { + let layout = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(layout); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 +} + +unsafe fn test_fn_alloc_unbounded(v: usize) { + let layout = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(layout); // $ Alert[rust/uncontrolled-allocation-size]=arg1 +} + +unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { let l1 = std::alloc::Layout::array::(v).unwrap(); if v < 100 { + let l2 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l2); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + + test_fn_alloc_bounded(v); } else { + let l3 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + + test_fn_alloc_unbounded(v); } if v == 100 { @@ -93,6 +111,29 @@ unsafe fn test_std_alloc_with_bounds(v: usize) { let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } + if (v < limit) { + let l4 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(l4); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + } + + if (v < 2 * v) { // not a good bound + let l5 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(l5); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + } + + if (true && v < limit && true) { + let l6 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(l6); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + } + + let mut l7; + if (v < 100) { + l7 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + } else { + l7 = std::alloc::Layout::from_size_align(100, 1).unwrap(); + } + let _ = std::alloc::alloc(l7); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + { let mut v_mut = v; @@ -100,27 +141,41 @@ unsafe fn test_std_alloc_with_bounds(v: usize) { v_mut = 100; } - let l2 = std::alloc::Layout::array::(v_mut).unwrap(); - let _ = std::alloc::alloc(l2); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - - let l3 = std::alloc::Layout::array::(v).unwrap(); - let _ = std::alloc::alloc(l3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let l8 = std::alloc::Layout::array::(v_mut).unwrap(); + let l9 = std::alloc::Layout::array::(v).unwrap(); + let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l8); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l9); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } - let l4 = std::alloc::Layout::array::(std::cmp::min(v, 100)).unwrap(); - let _ = std::alloc::alloc(l4); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let l10 = std::alloc::Layout::array::(std::cmp::min(v, 100)).unwrap(); + let _ = std::alloc::alloc(l10); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - let l5 = std::alloc::Layout::array::(std::cmp::max(v, 100)).unwrap(); - let _ = std::alloc::alloc(l5); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let l11 = std::alloc::Layout::array::(std::cmp::max(v, 100)).unwrap(); + let _ = std::alloc::alloc(l11); // $ Alert[rust/uncontrolled-allocation-size]=arg1 - let l6 = std::alloc::Layout::array::(clamp(v, 1, 100)).unwrap(); - let _ = std::alloc::alloc(l6); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let l12 = std::alloc::Layout::array::(clamp(v, 1, 100)).unwrap(); + let _ = std::alloc::alloc(l12); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + + for i in 0..10 { + let l13 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(l13); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + + if (v > 1000) { + continue; + } + + let l14 = std::alloc::Layout::from_size_align(v, 1).unwrap(); + let _ = std::alloc::alloc(l13); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l14); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + } - let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 if v > 100 { return; } + let l15 = std::alloc::Layout::from_size_align(v, 1).unwrap(); let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l15); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 } use std::alloc::{GlobalAlloc, Allocator}; @@ -264,7 +319,7 @@ fn main() { unsafe { test_std_alloc_from_size(v); test_std_alloc_new_repeat_extend(v); - test_std_alloc_with_bounds(v); + test_std_alloc_with_bounds(v, 1000); test_system_alloc(v); test_libc_alloc(v); test_vectors(v); From f7d3a51f2728d3bb4769c1813b3ff455fd190e0c Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:37:05 +0000 Subject: [PATCH 038/372] Rust: Implement barrier guard. --- .../UncontrolledAllocationSizeExtensions.qll | 20 +- .../UncontrolledAllocationSize.expected | 272 +----------------- .../test/query-tests/security/CWE-770/main.rs | 38 +-- 3 files changed, 41 insertions(+), 289 deletions(-) diff --git a/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll b/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll index bb0ffbb4e3c..9efffeee9ae 100644 --- a/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll +++ b/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll @@ -7,6 +7,8 @@ import rust private import codeql.rust.Concepts private import codeql.rust.dataflow.DataFlow private import codeql.rust.dataflow.FlowSink +private import codeql.rust.controlflow.ControlFlowGraph as Cfg +private import codeql.rust.controlflow.CfgNodes as CfgNodes /** * Provides default sources, sinks and barriers for detecting uncontrolled @@ -26,9 +28,25 @@ module UncontrolledAllocationSize { abstract class Barrier extends DataFlow::Node { } /** - * sink for uncontrolled allocation size from model data. + * A sink for uncontrolled allocation size from model data. */ private class ModelsAsDataSink extends Sink { ModelsAsDataSink() { sinkNode(this, ["alloc-size", "alloc-layout"]) } } + + /** + * A barrier for uncontrolled allocation size that is an guard / bound check. + */ + private class BoundCheckBarrier extends Barrier { + BoundCheckBarrier() { this = DataFlow::BarrierGuard::getABarrierNode() } + } + + private predicate isBoundCheck(CfgNodes::AstCfgNode g, Cfg::CfgNode node, boolean branch) { + // any comparison (`g` / `cmp`) guards the expression on either side (`node`) + exists(BinaryExpr cmp | + g = cmp.getACfgNode() and + [cmp.getLhs(), cmp.getRhs()].getACfgNode() = node and + branch = [true, false] + ) + } } diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index cca67133563..e10c26338dc 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -18,29 +18,12 @@ | main.rs:64:13:64:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:65:13:65:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:68:13:68:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:83:13:83:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:83:13:83:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:88:13:88:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:88:13:88:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:96:17:96:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:96:17:96:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:97:17:97:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:97:17:97:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:102:17:102:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:102:17:102:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:103:17:103:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:103:17:103:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:109:17:109:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:109:17:109:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:111:17:111:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:111:17:111:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:116:17:116:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:116:17:116:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:121:17:121:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:121:17:121:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:126:17:126:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:126:17:126:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:135:13:135:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:135:13:135:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:146:17:146:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:146:17:146:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:147:17:147:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:147:17:147:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:148:17:148:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:148:17:148:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:152:13:152:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:152:13:152:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:155:13:155:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:155:13:155:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:158:13:158:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:158:13:158:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:162:17:162:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:162:17:162:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:169:17:169:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:169:17:169:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:170:17:170:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:170:17:170:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:177:13:177:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:177:13:177:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:178:13:178:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:178:13:178:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:193:32:193:36 | alloc | main.rs:317:13:317:26 | ...::args | main.rs:193:32:193:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:194:32:194:43 | alloc_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:194:32:194:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:195:32:195:39 | allocate | main.rs:317:13:317:26 | ...::args | main.rs:195:32:195:39 | allocate | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | @@ -60,7 +43,6 @@ | main.rs:224:13:224:25 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:224:13:224:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:224:13:224:25 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:224:13:224:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:284:22:284:38 | ...::alloc | main.rs:308:25:308:38 | ...::args | main.rs:284:22:284:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:308:25:308:38 | ...::args | user-provided value | -| main.rs:301:22:301:38 | ...::alloc | main.rs:309:26:309:39 | ...::args | main.rs:301:22:301:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:309:26:309:39 | ...::args | user-provided value | edges | main.rs:12:36:12:43 | ...: usize | main.rs:18:41:18:41 | v | provenance | | | main.rs:18:41:18:41 | v | main.rs:18:13:18:31 | ...::realloc | provenance | MaD:5 Sink:MaD:5 | @@ -151,133 +133,25 @@ edges | main.rs:67:14:67:56 | ... .unwrap(...) | main.rs:67:9:67:10 | l4 | provenance | | | main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | provenance | | -| main.rs:81:33:81:40 | ...: usize | main.rs:82:54:82:54 | v | provenance | | -| main.rs:82:9:82:14 | layout | main.rs:83:31:83:36 | layout | provenance | | -| main.rs:82:18:82:58 | ...::from_size_align(...) [Ok] | main.rs:82:18:82:67 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:82:18:82:67 | ... .unwrap(...) | main.rs:82:9:82:14 | layout | provenance | | -| main.rs:82:54:82:54 | v | main.rs:82:18:82:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:83:31:83:36 | layout | main.rs:83:13:83:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:86:35:86:42 | ...: usize | main.rs:87:54:87:54 | v | provenance | | -| main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | -| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:87:18:87:67 | ... .unwrap(...) | main.rs:87:9:87:14 | layout | provenance | | -| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:95:51:95:51 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:99:31:99:31 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:101:51:101:51 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:105:33:105:33 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:115:54:115:54 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:120:54:120:54 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:125:54:125:54 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:131:50:131:50 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:138:13:138:21 | mut v_mut | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:145:51:145:51 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:151:62:151:62 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:154:62:154:62 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:157:54:157:54 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:161:55:161:55 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:168:55:168:55 | v | provenance | | -| main.rs:91:38:91:45 | ...: usize | main.rs:176:51:176:51 | v | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:96:35:96:36 | l1 | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:102:35:102:36 | l1 | provenance | | | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap(...) | provenance | MaD:31 | | main.rs:92:14:92:57 | ... .unwrap(...) | main.rs:92:9:92:10 | l1 | provenance | | | main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:95:13:95:14 | l2 | main.rs:97:35:97:36 | l2 | provenance | | -| main.rs:95:18:95:52 | ...::array::<...>(...) [Ok] | main.rs:95:18:95:61 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:95:18:95:61 | ... .unwrap(...) | main.rs:95:13:95:14 | l2 | provenance | | -| main.rs:95:51:95:51 | v | main.rs:95:18:95:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:96:35:96:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:96:35:96:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | -| main.rs:97:35:97:36 | l2 | main.rs:97:17:97:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:99:31:99:31 | v | main.rs:81:33:81:40 | ...: usize | provenance | | -| main.rs:101:13:101:14 | l3 | main.rs:103:35:103:36 | l3 | provenance | | -| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:101:18:101:61 | ... .unwrap(...) | main.rs:101:13:101:14 | l3 | provenance | | -| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:102:35:102:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:102:35:102:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | -| main.rs:103:35:103:36 | l3 | main.rs:103:17:103:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:105:33:105:33 | v | main.rs:86:35:86:42 | ...: usize | provenance | | | main.rs:109:35:109:36 | l1 | main.rs:109:17:109:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:109:35:109:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | | main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:111:35:111:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | -| main.rs:115:13:115:14 | l4 | main.rs:116:35:116:36 | l4 | provenance | | -| main.rs:115:18:115:58 | ...::from_size_align(...) [Ok] | main.rs:115:18:115:67 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:115:18:115:67 | ... .unwrap(...) | main.rs:115:13:115:14 | l4 | provenance | | -| main.rs:115:54:115:54 | v | main.rs:115:18:115:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:116:35:116:36 | l4 | main.rs:116:17:116:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:120:13:120:14 | l5 | main.rs:121:35:121:36 | l5 | provenance | | -| main.rs:120:18:120:58 | ...::from_size_align(...) [Ok] | main.rs:120:18:120:67 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:120:18:120:67 | ... .unwrap(...) | main.rs:120:13:120:14 | l5 | provenance | | -| main.rs:120:54:120:54 | v | main.rs:120:18:120:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:121:35:121:36 | l5 | main.rs:121:17:121:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:125:13:125:14 | l6 | main.rs:126:35:126:36 | l6 | provenance | | -| main.rs:125:18:125:58 | ...::from_size_align(...) [Ok] | main.rs:125:18:125:67 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:125:18:125:67 | ... .unwrap(...) | main.rs:125:13:125:14 | l6 | provenance | | -| main.rs:125:54:125:54 | v | main.rs:125:18:125:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:126:35:126:36 | l6 | main.rs:126:17:126:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:131:9:131:10 | l7 | main.rs:135:31:135:32 | l7 | provenance | | -| main.rs:131:14:131:54 | ...::from_size_align(...) [Ok] | main.rs:131:14:131:63 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:131:14:131:63 | ... .unwrap(...) | main.rs:131:9:131:10 | l7 | provenance | | -| main.rs:131:50:131:50 | v | main.rs:131:14:131:54 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:135:31:135:32 | l7 | main.rs:135:13:135:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:138:13:138:21 | mut v_mut | main.rs:144:51:144:55 | v_mut | provenance | | -| main.rs:144:13:144:14 | l8 | main.rs:147:35:147:36 | l8 | provenance | | -| main.rs:144:18:144:56 | ...::array::<...>(...) [Ok] | main.rs:144:18:144:65 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:144:18:144:65 | ... .unwrap(...) | main.rs:144:13:144:14 | l8 | provenance | | -| main.rs:144:51:144:55 | v_mut | main.rs:144:18:144:56 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:145:13:145:14 | l9 | main.rs:148:35:148:36 | l9 | provenance | | -| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:145:18:145:61 | ... .unwrap(...) | main.rs:145:13:145:14 | l9 | provenance | | -| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:146:35:146:36 | l1 | main.rs:177:31:177:32 | l1 | provenance | | -| main.rs:147:35:147:36 | l8 | main.rs:147:17:147:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:151:9:151:11 | l10 | main.rs:152:31:152:33 | l10 | provenance | | -| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:151:15:151:78 | ... .unwrap(...) | main.rs:151:9:151:11 | l10 | provenance | | -| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:34 | -| main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:154:9:154:11 | l11 | main.rs:155:31:155:33 | l11 | provenance | | -| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:154:15:154:78 | ... .unwrap(...) | main.rs:154:9:154:11 | l11 | provenance | | -| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:33 | -| main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:157:9:157:11 | l12 | main.rs:158:31:158:33 | l12 | provenance | | -| main.rs:157:15:157:64 | ...::array::<...>(...) [Ok] | main.rs:157:15:157:73 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:157:15:157:73 | ... .unwrap(...) | main.rs:157:9:157:11 | l12 | provenance | | -| main.rs:157:48:157:63 | clamp(...) | main.rs:157:15:157:64 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | -| main.rs:157:54:157:54 | v | main.rs:71:35:71:38 | ...: T | provenance | | -| main.rs:157:54:157:54 | v | main.rs:157:48:157:63 | clamp(...) | provenance | | -| main.rs:158:31:158:33 | l12 | main.rs:158:13:158:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | -| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:161:19:161:68 | ... .unwrap(...) | main.rs:161:13:161:15 | l13 | provenance | | -| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | -| main.rs:168:13:168:15 | l14 | main.rs:170:35:170:37 | l14 | provenance | | -| main.rs:168:19:168:59 | ...::from_size_align(...) [Ok] | main.rs:168:19:168:68 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:168:19:168:68 | ... .unwrap(...) | main.rs:168:13:168:15 | l14 | provenance | | -| main.rs:168:55:168:55 | v | main.rs:168:19:168:59 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:170:35:170:37 | l14 | main.rs:170:17:170:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:176:9:176:11 | l15 | main.rs:178:31:178:33 | l15 | provenance | | -| main.rs:176:15:176:55 | ...::from_size_align(...) [Ok] | main.rs:176:15:176:64 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:176:15:176:64 | ... .unwrap(...) | main.rs:176:9:176:11 | l15 | provenance | | -| main.rs:176:51:176:51 | v | main.rs:176:15:176:55 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:177:31:177:32 | l1 | main.rs:177:13:177:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:178:31:178:33 | l15 | main.rs:178:13:178:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:183:29:183:36 | ...: usize | main.rs:192:46:192:46 | v | provenance | | | main.rs:192:9:192:10 | l2 | main.rs:193:38:193:39 | l2 | provenance | | | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap(...) | provenance | MaD:31 | @@ -322,31 +196,17 @@ edges | main.rs:282:18:282:75 | ... .unwrap(...) | main.rs:282:9:282:14 | layout | provenance | | | main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:292:25:292:42 | ...: String | main.rs:293:16:293:42 | user_input.parse(...) [Ok] | provenance | MaD:32 | -| main.rs:293:9:293:12 | size | main.rs:297:9:297:17 | num_bytes | provenance | | -| main.rs:293:16:293:42 | user_input.parse(...) [Ok] | main.rs:293:16:293:43 | TryExpr | provenance | | -| main.rs:293:16:293:43 | TryExpr | main.rs:293:9:293:12 | size | provenance | | -| main.rs:297:9:297:17 | num_bytes | main.rs:299:54:299:62 | num_bytes | provenance | | -| main.rs:299:9:299:14 | layout | main.rs:301:40:301:45 | layout | provenance | | -| main.rs:299:18:299:66 | ...::from_size_align(...) [Ok] | main.rs:299:18:299:75 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:299:18:299:75 | ... .unwrap(...) | main.rs:299:9:299:14 | layout | provenance | | -| main.rs:299:54:299:62 | num_bytes | main.rs:299:18:299:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | -| main.rs:301:40:301:45 | layout | main.rs:301:22:301:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:33 | | main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:29 | | main.rs:308:25:308:74 | ... .unwrap_or(...) | main.rs:279:24:279:41 | ...: String | provenance | | -| main.rs:309:26:309:39 | ...::args | main.rs:309:26:309:41 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:309:26:309:41 | ...::args(...) [element] | main.rs:309:26:309:48 | ... .nth(...) [Some] | provenance | MaD:35 | -| main.rs:309:26:309:48 | ... .nth(...) [Some] | main.rs:309:26:309:75 | ... .unwrap_or(...) | provenance | MaD:29 | -| main.rs:309:26:309:75 | ... .unwrap_or(...) | main.rs:292:25:292:42 | ...: String | provenance | | | main.rs:317:9:317:9 | v | main.rs:320:34:320:34 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:321:42:321:42 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:322:36:322:36 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:323:27:323:27 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:324:25:324:25 | v | provenance | | | main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:35 | +| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:33 | | main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:29 | | main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse(...) [Ok] | provenance | MaD:32 | | main.rs:317:13:317:82 | ... .parse(...) [Ok] | main.rs:317:13:317:91 | ... .unwrap(...) | provenance | MaD:31 | @@ -389,9 +249,7 @@ models | 30 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | | 31 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | | 32 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 33 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | -| 34 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | -| 35 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 33 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | nodes | main.rs:12:36:12:43 | ...: usize | semmle.label | ...: usize | | main.rs:18:13:18:31 | ...::realloc | semmle.label | ...::realloc | @@ -484,131 +342,23 @@ nodes | main.rs:67:46:67:46 | v | semmle.label | v | | main.rs:68:13:68:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:68:31:68:32 | l4 | semmle.label | l4 | -| main.rs:71:35:71:38 | ...: T | semmle.label | ...: T | -| main.rs:77:9:77:16 | return v | semmle.label | return v | -| main.rs:81:33:81:40 | ...: usize | semmle.label | ...: usize | -| main.rs:82:9:82:14 | layout | semmle.label | layout | -| main.rs:82:18:82:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:82:18:82:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:82:54:82:54 | v | semmle.label | v | -| main.rs:83:13:83:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:83:31:83:36 | layout | semmle.label | layout | -| main.rs:86:35:86:42 | ...: usize | semmle.label | ...: usize | -| main.rs:87:9:87:14 | layout | semmle.label | layout | -| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:87:18:87:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:87:54:87:54 | v | semmle.label | v | -| main.rs:88:13:88:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:88:31:88:36 | layout | semmle.label | layout | | main.rs:91:38:91:45 | ...: usize | semmle.label | ...: usize | | main.rs:92:9:92:10 | l1 | semmle.label | l1 | | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | | main.rs:92:14:92:57 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | | main.rs:92:47:92:47 | v | semmle.label | v | -| main.rs:95:13:95:14 | l2 | semmle.label | l2 | -| main.rs:95:18:95:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:95:18:95:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:95:51:95:51 | v | semmle.label | v | | main.rs:96:17:96:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:96:35:96:36 | l1 | semmle.label | l1 | -| main.rs:97:17:97:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:97:35:97:36 | l2 | semmle.label | l2 | -| main.rs:99:31:99:31 | v | semmle.label | v | -| main.rs:101:13:101:14 | l3 | semmle.label | l3 | -| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:101:18:101:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:101:51:101:51 | v | semmle.label | v | | main.rs:102:17:102:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:102:35:102:36 | l1 | semmle.label | l1 | -| main.rs:103:17:103:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:103:35:103:36 | l3 | semmle.label | l3 | -| main.rs:105:33:105:33 | v | semmle.label | v | | main.rs:109:17:109:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:109:35:109:36 | l1 | semmle.label | l1 | | main.rs:111:17:111:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:111:35:111:36 | l1 | semmle.label | l1 | -| main.rs:115:13:115:14 | l4 | semmle.label | l4 | -| main.rs:115:18:115:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:115:18:115:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:115:54:115:54 | v | semmle.label | v | -| main.rs:116:17:116:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:116:35:116:36 | l4 | semmle.label | l4 | -| main.rs:120:13:120:14 | l5 | semmle.label | l5 | -| main.rs:120:18:120:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:120:18:120:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:120:54:120:54 | v | semmle.label | v | -| main.rs:121:17:121:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:121:35:121:36 | l5 | semmle.label | l5 | -| main.rs:125:13:125:14 | l6 | semmle.label | l6 | -| main.rs:125:18:125:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:125:18:125:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:125:54:125:54 | v | semmle.label | v | -| main.rs:126:17:126:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:126:35:126:36 | l6 | semmle.label | l6 | -| main.rs:131:9:131:10 | l7 | semmle.label | l7 | -| main.rs:131:14:131:54 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:131:14:131:63 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:131:50:131:50 | v | semmle.label | v | -| main.rs:135:13:135:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:135:31:135:32 | l7 | semmle.label | l7 | -| main.rs:138:13:138:21 | mut v_mut | semmle.label | mut v_mut | -| main.rs:144:13:144:14 | l8 | semmle.label | l8 | -| main.rs:144:18:144:56 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:144:18:144:65 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:144:51:144:55 | v_mut | semmle.label | v_mut | -| main.rs:145:13:145:14 | l9 | semmle.label | l9 | -| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:145:18:145:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:145:51:145:51 | v | semmle.label | v | | main.rs:146:17:146:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:146:35:146:36 | l1 | semmle.label | l1 | -| main.rs:147:17:147:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:147:35:147:36 | l8 | semmle.label | l8 | -| main.rs:148:17:148:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:148:35:148:36 | l9 | semmle.label | l9 | -| main.rs:151:9:151:11 | l10 | semmle.label | l10 | -| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:151:15:151:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:151:48:151:68 | ...::min(...) | semmle.label | ...::min(...) | -| main.rs:151:62:151:62 | v | semmle.label | v | -| main.rs:152:13:152:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:152:31:152:33 | l10 | semmle.label | l10 | -| main.rs:154:9:154:11 | l11 | semmle.label | l11 | -| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:154:15:154:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:154:48:154:68 | ...::max(...) | semmle.label | ...::max(...) | -| main.rs:154:62:154:62 | v | semmle.label | v | -| main.rs:155:13:155:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:155:31:155:33 | l11 | semmle.label | l11 | -| main.rs:157:9:157:11 | l12 | semmle.label | l12 | -| main.rs:157:15:157:64 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:157:15:157:73 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:157:48:157:63 | clamp(...) | semmle.label | clamp(...) | -| main.rs:157:54:157:54 | v | semmle.label | v | -| main.rs:158:13:158:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:158:31:158:33 | l12 | semmle.label | l12 | -| main.rs:161:13:161:15 | l13 | semmle.label | l13 | -| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:161:19:161:68 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:161:55:161:55 | v | semmle.label | v | -| main.rs:162:17:162:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:162:35:162:37 | l13 | semmle.label | l13 | -| main.rs:168:13:168:15 | l14 | semmle.label | l14 | -| main.rs:168:19:168:59 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:168:19:168:68 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:168:55:168:55 | v | semmle.label | v | -| main.rs:169:17:169:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:169:35:169:37 | l13 | semmle.label | l13 | -| main.rs:170:17:170:33 | ...::alloc | semmle.label | ...::alloc | -| main.rs:170:35:170:37 | l14 | semmle.label | l14 | -| main.rs:176:9:176:11 | l15 | semmle.label | l15 | -| main.rs:176:15:176:55 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:176:15:176:64 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:176:51:176:51 | v | semmle.label | v | | main.rs:177:13:177:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:177:31:177:32 | l1 | semmle.label | l1 | -| main.rs:178:13:178:29 | ...::alloc | semmle.label | ...::alloc | -| main.rs:178:31:178:33 | l15 | semmle.label | l15 | | main.rs:183:29:183:36 | ...: usize | semmle.label | ...: usize | | main.rs:192:9:192:10 | l2 | semmle.label | l2 | | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | @@ -656,25 +406,10 @@ nodes | main.rs:282:54:282:62 | num_bytes | semmle.label | num_bytes | | main.rs:284:22:284:38 | ...::alloc | semmle.label | ...::alloc | | main.rs:284:40:284:45 | layout | semmle.label | layout | -| main.rs:292:25:292:42 | ...: String | semmle.label | ...: String | -| main.rs:293:9:293:12 | size | semmle.label | size | -| main.rs:293:16:293:42 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | -| main.rs:293:16:293:43 | TryExpr | semmle.label | TryExpr | -| main.rs:297:9:297:17 | num_bytes | semmle.label | num_bytes | -| main.rs:299:9:299:14 | layout | semmle.label | layout | -| main.rs:299:18:299:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:299:18:299:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:299:54:299:62 | num_bytes | semmle.label | num_bytes | -| main.rs:301:22:301:38 | ...::alloc | semmle.label | ...::alloc | -| main.rs:301:40:301:45 | layout | semmle.label | layout | | main.rs:308:25:308:38 | ...::args | semmle.label | ...::args | | main.rs:308:25:308:40 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | | main.rs:308:25:308:47 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | | main.rs:308:25:308:74 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | -| main.rs:309:26:309:39 | ...::args | semmle.label | ...::args | -| main.rs:309:26:309:41 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | -| main.rs:309:26:309:48 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | -| main.rs:309:26:309:75 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | | main.rs:317:9:317:9 | v | semmle.label | v | | main.rs:317:13:317:26 | ...::args | semmle.label | ...::args | | main.rs:317:13:317:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | @@ -688,4 +423,3 @@ nodes | main.rs:323:27:323:27 | v | semmle.label | v | | main.rs:324:25:324:25 | v | semmle.label | v | subpaths -| main.rs:157:54:157:54 | v | main.rs:71:35:71:38 | ...: T | main.rs:77:9:77:16 | return v | main.rs:157:48:157:63 | clamp(...) | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index 558979ebfc2..e9cea0f604a 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -80,12 +80,12 @@ fn clamp(v: T, min: T, max: T) -> T { unsafe fn test_fn_alloc_bounded(v: usize) { let layout = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(layout); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(layout); // $ GOOD (bounded) } unsafe fn test_fn_alloc_unbounded(v: usize) { let layout = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(layout); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(layout); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 } unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { @@ -94,13 +94,13 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { if v < 100 { let l2 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l2); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l2); // $ GOOD (bounded) test_fn_alloc_bounded(v); } else { let l3 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l3); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 test_fn_alloc_unbounded(v); } @@ -113,17 +113,17 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { if (v < limit) { let l4 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l4); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l4); // $ GOOD (bounded) } if (v < 2 * v) { // not a good bound let l5 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l5); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l5); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 } if (true && v < limit && true) { let l6 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l6); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l6); // $ GOOD (bounded) } let mut l7; @@ -132,7 +132,7 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { } else { l7 = std::alloc::Layout::from_size_align(100, 1).unwrap(); } - let _ = std::alloc::alloc(l7); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l7); // $ GOOD (bounded) { let mut v_mut = v; @@ -144,30 +144,30 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { let l8 = std::alloc::Layout::array::(v_mut).unwrap(); let l9 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l8); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l9); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l8); // $ GOOD (bounded) + let _ = std::alloc::alloc(l9); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 } let l10 = std::alloc::Layout::array::(std::cmp::min(v, 100)).unwrap(); - let _ = std::alloc::alloc(l10); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l10); // $ GOOD (bounded) let l11 = std::alloc::Layout::array::(std::cmp::max(v, 100)).unwrap(); - let _ = std::alloc::alloc(l11); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l11); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 let l12 = std::alloc::Layout::array::(clamp(v, 1, 100)).unwrap(); - let _ = std::alloc::alloc(l12); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l12); // $ GOOD (bounded) for i in 0..10 { let l13 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l13); // $ Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l13); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 if (v > 1000) { continue; } let l14 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l13); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l14); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l13); // $ GOOD (bounded) + let _ = std::alloc::alloc(l14); // $ GOOD (bounded) } if v > 100 { @@ -175,7 +175,7 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { } let l15 = std::alloc::Layout::from_size_align(v, 1).unwrap(); let _ = std::alloc::alloc(l1); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l15); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l15); // $ GOOD (bounded) } use std::alloc::{GlobalAlloc, Allocator}; @@ -298,7 +298,7 @@ fn allocate_buffer_good(user_input: String) -> Result<*mut u8, Error> { let layout = std::alloc::Layout::from_size_align(num_bytes, 1).unwrap(); unsafe { - let buffer = std::alloc::alloc(layout); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=example2 + let buffer = std::alloc::alloc(layout); // $ GOOD (bounded) Ok(buffer) } @@ -306,7 +306,7 @@ fn allocate_buffer_good(user_input: String) -> Result<*mut u8, Error> { fn test_examples() { allocate_buffer_bad(std::env::args().nth(1).unwrap_or("0".to_string())); // $ Source=example1 - allocate_buffer_good(std::env::args().nth(1).unwrap_or("0".to_string())); // $ Source=example2 + allocate_buffer_good(std::env::args().nth(1).unwrap_or("0".to_string())); } // --- main --- From 6a5a1001bbd1d4e72e4f3c14b5d6e2e181a2e59b Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 31 Mar 2025 17:27:36 +0100 Subject: [PATCH 039/372] Rust: Refine the barrier guard. --- .../UncontrolledAllocationSizeExtensions.qll | 59 +++++++++-- .../UncontrolledAllocationSize.expected | 99 ++++++++++++++++++- .../test/query-tests/security/CWE-770/main.rs | 14 +-- 3 files changed, 154 insertions(+), 18 deletions(-) diff --git a/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll b/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll index 9efffeee9ae..b8ab16090d1 100644 --- a/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll +++ b/rust/ql/lib/codeql/rust/security/UncontrolledAllocationSizeExtensions.qll @@ -35,18 +35,61 @@ module UncontrolledAllocationSize { } /** - * A barrier for uncontrolled allocation size that is an guard / bound check. + * A barrier for uncontrolled allocation size that is an upper bound check / guard. */ - private class BoundCheckBarrier extends Barrier { - BoundCheckBarrier() { this = DataFlow::BarrierGuard::getABarrierNode() } + private class UpperBoundCheckBarrier extends Barrier { + UpperBoundCheckBarrier() { + this = DataFlow::BarrierGuard::getABarrierNode() + } } - private predicate isBoundCheck(CfgNodes::AstCfgNode g, Cfg::CfgNode node, boolean branch) { - // any comparison (`g` / `cmp`) guards the expression on either side (`node`) - exists(BinaryExpr cmp | - g = cmp.getACfgNode() and + /** + * Gets the operand on the "greater" (or "greater-or-equal") side + * of this relational expression, that is, the side that is larger + * if the overall expression evaluates to `true`; for example on + * `x <= 20` this is the `20`, and on `y > 0` it is `y`. + */ + private Expr getGreaterOperand(BinaryExpr op) { + op.getOperatorName() = ["<", "<="] and + result = op.getRhs() + or + op.getOperatorName() = [">", ">="] and + result = op.getLhs() + } + + /** + * Gets the operand on the "lesser" (or "lesser-or-equal") side + * of this relational expression, that is, the side that is smaller + * if the overall expression evaluates to `true`; for example on + * `x <= 20` this is `x`, and on `y > 0` it is the `0`. + */ + private Expr getLesserOperand(BinaryExpr op) { + op.getOperatorName() = ["<", "<="] and + result = op.getLhs() + or + op.getOperatorName() = [">", ">="] and + result = op.getRhs() + } + + /** + * Holds if comparison `g` having result `branch` indicates an upper bound for the sub-expression + * `node`. For example when the comparison `x < 10` is true, we have an upper bound for `x`. + */ + private predicate isUpperBoundCheck(CfgNodes::AstCfgNode g, Cfg::CfgNode node, boolean branch) { + exists(BinaryExpr cmp | g = cmp.getACfgNode() | + node = getLesserOperand(cmp).getACfgNode() and + branch = true + or + node = getGreaterOperand(cmp).getACfgNode() and + branch = false + or + cmp.getOperatorName() = "==" and [cmp.getLhs(), cmp.getRhs()].getACfgNode() = node and - branch = [true, false] + branch = true + or + cmp.getOperatorName() = "!=" and + [cmp.getLhs(), cmp.getRhs()].getACfgNode() = node and + branch = false ) } } diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index e10c26338dc..fa30dde511b 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -18,11 +18,18 @@ | main.rs:64:13:64:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:64:13:64:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:65:13:65:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:65:13:65:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:68:13:68:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:68:13:68:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:88:13:88:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:88:13:88:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:96:17:96:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:96:17:96:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:102:17:102:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:102:17:102:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:103:17:103:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:103:17:103:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:109:17:109:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:109:17:109:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:111:17:111:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:111:17:111:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:146:17:146:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:146:17:146:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:148:17:148:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:148:17:148:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:152:13:152:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:152:13:152:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:155:13:155:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:155:13:155:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:162:17:162:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:162:17:162:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | +| main.rs:169:17:169:33 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:169:17:169:33 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:177:13:177:29 | ...::alloc | main.rs:317:13:317:26 | ...::args | main.rs:177:13:177:29 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:193:32:193:36 | alloc | main.rs:317:13:317:26 | ...::args | main.rs:193:32:193:36 | alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:194:32:194:43 | alloc_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:194:32:194:43 | alloc_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | @@ -133,7 +140,19 @@ edges | main.rs:67:14:67:56 | ... .unwrap(...) | main.rs:67:9:67:10 | l4 | provenance | | | main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:86:35:86:42 | ...: usize | main.rs:87:54:87:54 | v | provenance | | +| main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:87:18:87:67 | ... .unwrap(...) | main.rs:87:9:87:14 | layout | provenance | | +| main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:101:51:101:51 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:105:33:105:33 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:145:51:145:51 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:151:62:151:62 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:154:62:154:62 | v | provenance | | +| main.rs:91:38:91:45 | ...: usize | main.rs:161:55:161:55 | v | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:96:35:96:36 | l1 | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:102:35:102:36 | l1 | provenance | | | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap(...) | provenance | MaD:31 | @@ -142,15 +161,45 @@ edges | main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:96:35:96:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:96:35:96:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | +| main.rs:101:13:101:14 | l3 | main.rs:103:35:103:36 | l3 | provenance | | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:101:18:101:61 | ... .unwrap(...) | main.rs:101:13:101:14 | l3 | provenance | | +| main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:102:35:102:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:102:35:102:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | +| main.rs:103:35:103:36 | l3 | main.rs:103:17:103:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:105:33:105:33 | v | main.rs:86:35:86:42 | ...: usize | provenance | | | main.rs:109:35:109:36 | l1 | main.rs:109:17:109:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:109:35:109:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | | main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:111:35:111:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | +| main.rs:145:13:145:14 | l9 | main.rs:148:35:148:36 | l9 | provenance | | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:145:18:145:61 | ... .unwrap(...) | main.rs:145:13:145:14 | l9 | provenance | | +| main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:146:35:146:36 | l1 | main.rs:177:31:177:32 | l1 | provenance | | +| main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:151:9:151:11 | l10 | main.rs:152:31:152:33 | l10 | provenance | | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:151:15:151:78 | ... .unwrap(...) | main.rs:151:9:151:11 | l10 | provenance | | +| main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:34 | +| main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:154:9:154:11 | l11 | main.rs:155:31:155:33 | l11 | provenance | | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:154:15:154:78 | ... .unwrap(...) | main.rs:154:9:154:11 | l11 | provenance | | +| main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | +| main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:33 | +| main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap(...) | provenance | MaD:31 | +| main.rs:161:19:161:68 | ... .unwrap(...) | main.rs:161:13:161:15 | l13 | provenance | | +| main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | +| main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | +| main.rs:169:35:169:37 | l13 | main.rs:169:17:169:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:177:31:177:32 | l1 | main.rs:177:13:177:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:183:29:183:36 | ...: usize | main.rs:192:46:192:46 | v | provenance | | | main.rs:192:9:192:10 | l2 | main.rs:193:38:193:39 | l2 | provenance | | @@ -197,7 +246,7 @@ edges | main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:33 | +| main.rs:308:25:308:40 | ...::args(...) [element] | main.rs:308:25:308:47 | ... .nth(...) [Some] | provenance | MaD:35 | | main.rs:308:25:308:47 | ... .nth(...) [Some] | main.rs:308:25:308:74 | ... .unwrap_or(...) | provenance | MaD:29 | | main.rs:308:25:308:74 | ... .unwrap_or(...) | main.rs:279:24:279:41 | ...: String | provenance | | | main.rs:317:9:317:9 | v | main.rs:320:34:320:34 | v | provenance | | @@ -206,7 +255,7 @@ edges | main.rs:317:9:317:9 | v | main.rs:323:27:323:27 | v | provenance | | | main.rs:317:9:317:9 | v | main.rs:324:25:324:25 | v | provenance | | | main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:16 | -| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:33 | +| main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:35 | | main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:29 | | main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse(...) [Ok] | provenance | MaD:32 | | main.rs:317:13:317:82 | ... .parse(...) [Ok] | main.rs:317:13:317:91 | ... .unwrap(...) | provenance | MaD:31 | @@ -249,7 +298,9 @@ models | 30 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | | 31 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | | 32 | Summary: lang:core; ::parse; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | -| 33 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 33 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | +| 34 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | +| 35 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | nodes | main.rs:12:36:12:43 | ...: usize | semmle.label | ...: usize | | main.rs:18:13:18:31 | ...::realloc | semmle.label | ...::realloc | @@ -342,6 +393,13 @@ nodes | main.rs:67:46:67:46 | v | semmle.label | v | | main.rs:68:13:68:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:68:31:68:32 | l4 | semmle.label | l4 | +| main.rs:86:35:86:42 | ...: usize | semmle.label | ...: usize | +| main.rs:87:9:87:14 | layout | semmle.label | layout | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:87:18:87:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:87:54:87:54 | v | semmle.label | v | +| main.rs:88:13:88:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:88:31:88:36 | layout | semmle.label | layout | | main.rs:91:38:91:45 | ...: usize | semmle.label | ...: usize | | main.rs:92:9:92:10 | l1 | semmle.label | l1 | | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | @@ -349,14 +407,49 @@ nodes | main.rs:92:47:92:47 | v | semmle.label | v | | main.rs:96:17:96:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:96:35:96:36 | l1 | semmle.label | l1 | +| main.rs:101:13:101:14 | l3 | semmle.label | l3 | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:101:18:101:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:101:51:101:51 | v | semmle.label | v | | main.rs:102:17:102:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:102:35:102:36 | l1 | semmle.label | l1 | +| main.rs:103:17:103:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:103:35:103:36 | l3 | semmle.label | l3 | +| main.rs:105:33:105:33 | v | semmle.label | v | | main.rs:109:17:109:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:109:35:109:36 | l1 | semmle.label | l1 | | main.rs:111:17:111:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:111:35:111:36 | l1 | semmle.label | l1 | +| main.rs:145:13:145:14 | l9 | semmle.label | l9 | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:145:18:145:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:145:51:145:51 | v | semmle.label | v | | main.rs:146:17:146:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:146:35:146:36 | l1 | semmle.label | l1 | +| main.rs:148:17:148:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:148:35:148:36 | l9 | semmle.label | l9 | +| main.rs:151:9:151:11 | l10 | semmle.label | l10 | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:151:15:151:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:151:48:151:68 | ...::min(...) | semmle.label | ...::min(...) | +| main.rs:151:62:151:62 | v | semmle.label | v | +| main.rs:152:13:152:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:152:31:152:33 | l10 | semmle.label | l10 | +| main.rs:154:9:154:11 | l11 | semmle.label | l11 | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | +| main.rs:154:15:154:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:154:48:154:68 | ...::max(...) | semmle.label | ...::max(...) | +| main.rs:154:62:154:62 | v | semmle.label | v | +| main.rs:155:13:155:29 | ...::alloc | semmle.label | ...::alloc | +| main.rs:155:31:155:33 | l11 | semmle.label | l11 | +| main.rs:161:13:161:15 | l13 | semmle.label | l13 | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | +| main.rs:161:19:161:68 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:161:55:161:55 | v | semmle.label | v | +| main.rs:162:17:162:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:162:35:162:37 | l13 | semmle.label | l13 | +| main.rs:169:17:169:33 | ...::alloc | semmle.label | ...::alloc | +| main.rs:169:35:169:37 | l13 | semmle.label | l13 | | main.rs:177:13:177:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:177:31:177:32 | l1 | semmle.label | l1 | | main.rs:183:29:183:36 | ...: usize | semmle.label | ...: usize | diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index e9cea0f604a..37533e746ed 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -85,7 +85,7 @@ unsafe fn test_fn_alloc_bounded(v: usize) { unsafe fn test_fn_alloc_unbounded(v: usize) { let layout = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(layout); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(layout); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { @@ -100,7 +100,7 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { } else { let l3 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 - let _ = std::alloc::alloc(l3); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l3); // $ Alert[rust/uncontrolled-allocation-size]=arg1 test_fn_alloc_unbounded(v); } @@ -145,28 +145,28 @@ unsafe fn test_std_alloc_with_bounds(v: usize, limit: usize) { let l9 = std::alloc::Layout::array::(v).unwrap(); let _ = std::alloc::alloc(l1); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let _ = std::alloc::alloc(l8); // $ GOOD (bounded) - let _ = std::alloc::alloc(l9); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l9); // $ Alert[rust/uncontrolled-allocation-size]=arg1 } let l10 = std::alloc::Layout::array::(std::cmp::min(v, 100)).unwrap(); - let _ = std::alloc::alloc(l10); // $ GOOD (bounded) + let _ = std::alloc::alloc(l10); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 let l11 = std::alloc::Layout::array::(std::cmp::max(v, 100)).unwrap(); - let _ = std::alloc::alloc(l11); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l11); // $ Alert[rust/uncontrolled-allocation-size]=arg1 let l12 = std::alloc::Layout::array::(clamp(v, 1, 100)).unwrap(); let _ = std::alloc::alloc(l12); // $ GOOD (bounded) for i in 0..10 { let l13 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l13); // $ MISSING: Alert[rust/uncontrolled-allocation-size]=arg1 + let _ = std::alloc::alloc(l13); // $ Alert[rust/uncontrolled-allocation-size]=arg1 if (v > 1000) { continue; } let l14 = std::alloc::Layout::from_size_align(v, 1).unwrap(); - let _ = std::alloc::alloc(l13); // $ GOOD (bounded) + let _ = std::alloc::alloc(l13); // $ SPURIOUS: Alert[rust/uncontrolled-allocation-size]=arg1 let _ = std::alloc::alloc(l14); // $ GOOD (bounded) } From fb22d5587855a3183602a3b3c3e5c3410268bd2f Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 31 Mar 2025 18:12:30 +0100 Subject: [PATCH 040/372] Rust: Remove duplicate models. --- .../rust/frameworks/stdlib/lang-alloc.model.yml | 4 ---- .../CWE-770/UncontrolledAllocationSize.expected | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml index 85cd97fb462..999f711ba37 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -19,7 +19,3 @@ extensions: - ["lang:alloc", "::allocate_zeroed", "Argument[0]", "alloc-layout", "manual"] - ["lang:alloc", "::grow", "Argument[2]", "alloc-layout", "manual"] - ["lang:alloc", "::grow_zeroed", "Argument[2]", "alloc-layout", "manual"] - - ["repo:https://github.com/rust-lang/libc:libc", "::malloc", "Argument[0]", "alloc-size", "manual"] - - ["repo:https://github.com/rust-lang/libc:libc", "::aligned_alloc", "Argument[1]", "alloc-size", "manual"] - - ["repo:https://github.com/rust-lang/libc:libc", "::calloc", "Argument[0,1]", "alloc-size", "manual"] - - ["repo:https://github.com/rust-lang/libc:libc", "::realloc", "Argument[1]", "alloc-size", "manual"] diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index fa30dde511b..9cc7f803aac 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -40,14 +40,9 @@ | main.rs:208:40:208:43 | grow | main.rs:317:13:317:26 | ...::args | main.rs:208:40:208:43 | grow | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:210:40:210:50 | grow_zeroed | main.rs:317:13:317:26 | ...::args | main.rs:210:40:210:50 | grow_zeroed | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:219:13:219:24 | ...::malloc | main.rs:317:13:317:26 | ...::args | main.rs:219:13:219:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:219:13:219:24 | ...::malloc | main.rs:317:13:317:26 | ...::args | main.rs:219:13:219:24 | ...::malloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:220:13:220:31 | ...::aligned_alloc | main.rs:317:13:317:26 | ...::args | main.rs:220:13:220:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:220:13:220:31 | ...::aligned_alloc | main.rs:317:13:317:26 | ...::args | main.rs:220:13:220:31 | ...::aligned_alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:222:13:222:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:222:13:222:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:222:13:222:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:222:13:222:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:223:13:223:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:223:13:223:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:223:13:223:24 | ...::calloc | main.rs:317:13:317:26 | ...::args | main.rs:223:13:223:24 | ...::calloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | -| main.rs:224:13:224:25 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:224:13:224:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:224:13:224:25 | ...::realloc | main.rs:317:13:317:26 | ...::args | main.rs:224:13:224:25 | ...::realloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:317:13:317:26 | ...::args | user-provided value | | main.rs:284:22:284:38 | ...::alloc | main.rs:308:25:308:38 | ...::args | main.rs:284:22:284:38 | ...::alloc | This allocation size is derived from a $@ and could allocate arbitrary amounts of memory. | main.rs:308:25:308:38 | ...::args | user-provided value | edges @@ -223,19 +218,14 @@ edges | main.rs:210:60:210:61 | l2 | main.rs:210:40:210:50 | grow_zeroed | provenance | MaD:9 Sink:MaD:9 | | main.rs:217:27:217:34 | ...: usize | main.rs:219:26:219:26 | v | provenance | | | main.rs:219:26:219:26 | v | main.rs:219:13:219:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | -| main.rs:219:26:219:26 | v | main.rs:219:13:219:24 | ...::malloc | provenance | MaD:14 Sink:MaD:14 | | main.rs:219:26:219:26 | v | main.rs:220:36:220:36 | v | provenance | | | main.rs:220:36:220:36 | v | main.rs:220:13:220:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | -| main.rs:220:36:220:36 | v | main.rs:220:13:220:31 | ...::aligned_alloc | provenance | MaD:12 Sink:MaD:12 | | main.rs:220:36:220:36 | v | main.rs:222:30:222:30 | v | provenance | | | main.rs:222:30:222:30 | v | main.rs:222:13:222:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | -| main.rs:222:30:222:30 | v | main.rs:222:13:222:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | | main.rs:222:30:222:30 | v | main.rs:223:26:223:26 | v | provenance | | | main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | -| main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | | main.rs:223:26:223:26 | v | main.rs:224:31:224:31 | v | provenance | | | main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | | main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse(...) [Ok] | provenance | MaD:32 | | main.rs:280:9:280:17 | num_bytes | main.rs:282:54:282:62 | num_bytes | provenance | | | main.rs:280:21:280:47 | user_input.parse(...) [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | @@ -475,19 +465,14 @@ nodes | main.rs:210:60:210:61 | l2 | semmle.label | l2 | | main.rs:217:27:217:34 | ...: usize | semmle.label | ...: usize | | main.rs:219:13:219:24 | ...::malloc | semmle.label | ...::malloc | -| main.rs:219:13:219:24 | ...::malloc | semmle.label | ...::malloc | | main.rs:219:26:219:26 | v | semmle.label | v | | main.rs:220:13:220:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | -| main.rs:220:13:220:31 | ...::aligned_alloc | semmle.label | ...::aligned_alloc | | main.rs:220:36:220:36 | v | semmle.label | v | | main.rs:222:13:222:24 | ...::calloc | semmle.label | ...::calloc | -| main.rs:222:13:222:24 | ...::calloc | semmle.label | ...::calloc | | main.rs:222:30:222:30 | v | semmle.label | v | | main.rs:223:13:223:24 | ...::calloc | semmle.label | ...::calloc | -| main.rs:223:13:223:24 | ...::calloc | semmle.label | ...::calloc | | main.rs:223:26:223:26 | v | semmle.label | v | | main.rs:224:13:224:25 | ...::realloc | semmle.label | ...::realloc | -| main.rs:224:13:224:25 | ...::realloc | semmle.label | ...::realloc | | main.rs:224:31:224:31 | v | semmle.label | v | | main.rs:279:24:279:41 | ...: String | semmle.label | ...: String | | main.rs:280:9:280:17 | num_bytes | semmle.label | num_bytes | From 416643ce3906480834d6592b19a5fb1f3aaab37e Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 31 Mar 2025 21:09:21 -0400 Subject: [PATCH 041/372] Java: update qhelp recommendation and example --- .../Undesirable Calls/DoNotCallFinalize.md | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 46dd0802b96..26c46286cd5 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -4,14 +4,43 @@ Triggering garbage collection by directly calling `finalize()` may either have n ## Recommendation -Avoid calling `finalize()` in application code. Allow the JVM to determine a garbage collection schedule instead. +Avoid calling `finalize()` in application code. Allow the JVM to determine a garbage collection schedule instead. If you need to explicitly release resources, provide a specific method to do so, such as by implementing the `AutoCloseable` interface and overriding its `close` method. You can then use a `try-with-resources` block to ensure that the resource is closed. ## Example ```java -public class Test { - void f() throws Throwable { - this.finalize(); // NON_COMPLIANT +class LocalCache { + private Collection cacheFiles = ...; + // ... +} + +void main() { + LocalCache cache = new LocalCache(); + // ... + cache.finalize(); // NON_COMPLIANT +} + +``` + +```java +import java.lang.AutoCloseable; +import java.lang.Override; + +class LocalCache implements AutoCloseable { + private Collection cacheFiles = ...; + // ... + + @Override + public void close() throws Exception { + // release resources here if required + } +} + +void main() { + // COMPLIANT: uses try-with-resources to ensure that + // a resource implementing AutoCloseable is closed. + try (LocalCache cache = new LocalCache()) { + // ... } } @@ -25,4 +54,6 @@ This rule is focused on the use of existing `finalize()` invocations rather than - SEI CERT Oracle Coding Standard for Java: [MET12-J. Do not use finalizers](https://wiki.sei.cmu.edu/confluence/display/java/MET12-J.+Do+not+use+finalizers). - Java API Specification: [Object.finalize()](https://docs.oracle.com/javase/10/docs/api/java/lang/Object.html#finalize()). +- Java API Specification: [Interface AutoCloseable](https://docs.oracle.com/javase/10/docs/api/java/lang/AutoCloseable.html). +- Java SE Documentation: [The try-with-resources Statement](https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html). - Common Weakness Enumeration: [CWE-586](https://cwe.mitre.org/data/definitions/586). From 0ccbe3ef7fb3c97c877f36744b88be3c921cd683 Mon Sep 17 00:00:00 2001 From: Alex Eyers-Taylor Date: Tue, 25 Mar 2025 16:13:44 +0000 Subject: [PATCH 042/372] Ruby: Make module graph queries avoid relying on evalaution order. --- .../library-tests/modules/ancestors.expected | 20 +++++------ .../test/library-tests/modules/ancestors.ql | 35 ++++++++++++------- .../modules/superclasses.expected | 20 +++++------ .../library-tests/modules/superclasses.ql | 35 ++++++++++++------- 4 files changed, 66 insertions(+), 44 deletions(-) diff --git a/ruby/ql/test/library-tests/modules/ancestors.expected b/ruby/ql/test/library-tests/modules/ancestors.expected index 942bb00ccac..b8ebd1d1a52 100644 --- a/ruby/ql/test/library-tests/modules/ancestors.expected +++ b/ruby/ql/test/library-tests/modules/ancestors.expected @@ -1,25 +1,21 @@ +#-----| BasicObject + #-----| Class #-----| super -> Module -#-----| EsotericInstanceMethods - -#-----| MyStruct - -#-----| Struct - -#-----| UnresolvedNamespace - -#-----| BasicObject - #-----| Complex #-----| super -> Numeric +#-----| EsotericInstanceMethods + #-----| FalseClass #-----| super -> Object #-----| Float #-----| super -> Numeric +#-----| MyStruct + #-----| NilClass #-----| super -> Object @@ -31,11 +27,15 @@ #-----| Rational #-----| super -> Numeric +#-----| Struct + #-----| Symbol #-----| TrueClass #-----| super -> Object +#-----| UnresolvedNamespace + #-----| UnresolvedNamespace::X1 #-----| UnresolvedNamespace::X1::X2 diff --git a/ruby/ql/test/library-tests/modules/ancestors.ql b/ruby/ql/test/library-tests/modules/ancestors.ql index 89f1c9ca256..2c1e4e5af71 100644 --- a/ruby/ql/test/library-tests/modules/ancestors.ql +++ b/ruby/ql/test/library-tests/modules/ancestors.ql @@ -5,22 +5,33 @@ import codeql.ruby.AST +int locationModuleRank(Module node) { + node = + rank[result](Module m, Location l | + l = m.getLocation() + | + m + order by + l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), + l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() + ) +} + +int stringModuleRank(Module node) { + node = rank[result](Module m | not exists(locationModuleRank(m)) | m order by m.toString()) +} + +int moduleRank(Module node) { + result = locationModuleRank(node) + max(stringModuleRank(_)) + or + result = stringModuleRank(node) +} + query predicate nodes(Module node, string key, string value) { key = "semmle.label" and value = node.toString() or key = "semmle.order" and - value = - any(int i | - node = - rank[i](Module m, Location l | - l = m.getLocation() - | - m - order by - l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), - l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() - ) - ).toString() + value = moduleRank(node).toString() } Module getATarget(Module source, string value) { diff --git a/ruby/ql/test/library-tests/modules/superclasses.expected b/ruby/ql/test/library-tests/modules/superclasses.expected index ca19e00a71a..60acb625eaf 100644 --- a/ruby/ql/test/library-tests/modules/superclasses.expected +++ b/ruby/ql/test/library-tests/modules/superclasses.expected @@ -1,25 +1,21 @@ +#-----| BasicObject + #-----| Class #-----| -> Module -#-----| EsotericInstanceMethods - -#-----| MyStruct - -#-----| Struct - -#-----| UnresolvedNamespace - -#-----| BasicObject - #-----| Complex #-----| -> Numeric +#-----| EsotericInstanceMethods + #-----| FalseClass #-----| -> Object #-----| Float #-----| -> Numeric +#-----| MyStruct + #-----| NilClass #-----| -> Object @@ -31,11 +27,15 @@ #-----| Rational #-----| -> Numeric +#-----| Struct + #-----| Symbol #-----| TrueClass #-----| -> Object +#-----| UnresolvedNamespace + #-----| UnresolvedNamespace::X1 #-----| UnresolvedNamespace::X1::X2 diff --git a/ruby/ql/test/library-tests/modules/superclasses.ql b/ruby/ql/test/library-tests/modules/superclasses.ql index e8f4fd02704..f3dfd43a80d 100644 --- a/ruby/ql/test/library-tests/modules/superclasses.ql +++ b/ruby/ql/test/library-tests/modules/superclasses.ql @@ -5,22 +5,33 @@ import codeql.ruby.AST +int locationModuleRank(Module node) { + node = + rank[result](Module m, Location l | + l = m.getLocation() + | + m + order by + l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), + l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() + ) +} + +int stringModuleRank(Module node) { + node = rank[result](Module m | not exists(locationModuleRank(m)) | m order by m.toString()) +} + +int moduleRank(Module node) { + result = locationModuleRank(node) + max(stringModuleRank(_)) + or + result = stringModuleRank(node) +} + query predicate nodes(Module node, string key, string value) { key = "semmle.label" and value = node.toString() or key = "semmle.order" and - value = - any(int i | - node = - rank[i](Module m, Location l | - l = m.getLocation() - | - m - order by - l.getFile().getBaseName(), l.getFile().getAbsolutePath(), l.getStartLine(), - l.getStartColumn(), l.getEndLine(), l.getEndColumn(), m.toString() - ) - ).toString() + value = moduleRank(node).toString() } query predicate edges(Module source, Module target, string key, string value) { From faeb7ab8909eefb087cdc1cf235506c875bbf451 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Tue, 1 Apr 2025 14:54:46 -0400 Subject: [PATCH 043/372] Java: add blank lines to qldocs --- java/ql/lib/semmle/code/java/UnitTests.qll | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/ql/lib/semmle/code/java/UnitTests.qll b/java/ql/lib/semmle/code/java/UnitTests.qll index 25452d0fd51..f229440e4ee 100644 --- a/java/ql/lib/semmle/code/java/UnitTests.qll +++ b/java/ql/lib/semmle/code/java/UnitTests.qll @@ -127,10 +127,12 @@ class JUnitJupiterTestMethod extends Method { /** * A JUnit 5 test method. + * * A test method is defined by JUnit as "any instance method * that is directly annotated or meta-annotated with `@Test`, * `@RepeatedTest`, `@ParameterizedTest`, `@TestFactory`, or * `@TestTemplate`." + * * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions */ class JUnit5TestMethod extends Method { @@ -147,8 +149,10 @@ class JUnit5TestMethod extends Method { /** * A JUnit 5 test class. + * * A test class must contain at least one test method, and * cannot be abstract. + * * See https://junit.org/junit5/docs/current/user-guide/#writing-tests-definitions */ class JUnit5TestClass extends Class { From e621f9fd4903d60ca266e87afbd8f9969955bddc Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Tue, 1 Apr 2025 15:48:52 -0400 Subject: [PATCH 044/372] Java: update comments in tests --- java/ql/test/query-tests/DoNotCallFinalize/Test.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/test/query-tests/DoNotCallFinalize/Test.java b/java/ql/test/query-tests/DoNotCallFinalize/Test.java index eb7ac19da59..b70d0e47581 100644 --- a/java/ql/test/query-tests/DoNotCallFinalize/Test.java +++ b/java/ql/test/query-tests/DoNotCallFinalize/Test.java @@ -17,11 +17,11 @@ public class Test { // Overload of `finalize` protected void finalize(String s) throws Throwable { - System.out.println(s); + // ... } - // COMPLIANT: call to overload of `finalize` void f2() throws Throwable { + // COMPLIANT: call to overload of `finalize` this.finalize("overload"); } From c4b83963334bb29137d921e3dbf4bf5a221bee01 Mon Sep 17 00:00:00 2001 From: Jami <57204504+jcogs33@users.noreply.github.com> Date: Tue, 1 Apr 2025 15:52:57 -0400 Subject: [PATCH 045/372] fix typo in query description Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com> --- .../Undesirable Calls/DoNotCallFinalize.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 8ee12909a6d..80171e4d49e 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -3,7 +3,7 @@ * @previous-id java/do-not-use-finalizers * @name Do not call `finalize()` * @description Calling `finalize()` in application code may cause - * inconsistent program state or unpredicatable behavior. + * inconsistent program state or unpredictable behavior. * @kind problem * @precision high * @problem.severity error From 1a2c34dd28d25eba9d1c214af07bf569f6c6a492 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Tue, 1 Apr 2025 16:24:13 -0400 Subject: [PATCH 046/372] Java: update qhelp implementation notes for clarity --- .../Undesirable Calls/DoNotCallFinalize.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 26c46286cd5..b2bcfdae612 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -48,7 +48,8 @@ void main() { # Implementation Notes -This rule is focused on the use of existing `finalize()` invocations rather than attempts to write a custom implementation. +This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on overrides of `finalize()`. + ## References From efdb4a6d82845fe0ef1ccaaf6cda4ac2d1bcdcd1 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Thu, 27 Mar 2025 10:11:11 +0000 Subject: [PATCH 047/372] Use global dataflow for loop variable capture --- .../ql/src/Variables/LoopVariableCapture.ql | 66 ++++++++++++------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture.ql index e4ccd73e5e1..16130d5d50f 100644 --- a/python/ql/src/Variables/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture.ql @@ -10,38 +10,60 @@ */ import python +import semmle.python.dataflow.new.DataFlow -// Gets the scope of the iteration variable of the looping scope -Scope iteration_variable_scope(AstNode loop) { - result = loop.(For).getScope() - or - result = loop.(Comp).getFunction() +abstract class Loop extends AstNode { + abstract Variable getALoopVariable(); } -predicate capturing_looping_construct(CallableExpr capturing, AstNode loop, Variable var) { - var.getScope() = iteration_variable_scope(loop) and +class ForLoop extends Loop, For { + override Variable getALoopVariable() { + this.getTarget() = result.getAnAccess().getParentNode*() and + result.getScope() = this.getScope() + } +} + +predicate capturesLoopVariable(CallableExpr capturing, Loop loop, Variable var) { var.getAnAccess().getScope() = capturing.getInnerScope() and capturing.getParentNode+() = loop and - ( - loop.(For).getTarget() = var.getAnAccess() - or - var = loop.(Comp).getAnIterationVariable() - ) + var = loop.getALoopVariable() } -predicate escaping_capturing_looping_construct(CallableExpr capturing, AstNode loop, Variable var) { - capturing_looping_construct(capturing, loop, var) and - // Escapes if used out side of for loop or is a lambda in a comprehension - ( - loop instanceof For and - exists(Expr e | e.pointsTo(_, _, capturing) | not loop.contains(e)) +module EscapingCaptureFlowSig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node node) { capturesLoopVariable(node.asExpr(), _, _) } + + predicate isSink(DataFlow::Node node) { + // Stored in a field. + exists(DataFlow::AttrWrite aw | aw.getObject() = node) or - loop.(Comp).getElt() = capturing + // Stored in a dict/list. + exists(Assign assign, Subscript sub | + sub = assign.getATarget() and node.asExpr() = assign.getValue() + ) or - loop.(Comp).getElt().(Tuple).getAnElt() = capturing - ) + // Stored in a list. + exists(DataFlow::MethodCallNode mc | mc.calls(_, "append") and node = mc.getArg(0)) + or + // Used in a yeild statement, likely included in a collection. + // The element of comprehension expressions desugar to involve a yield statement internally. + exists(Yield y | node.asExpr() = y.getValue()) + } + + predicate isBarrierOut(DataFlow::Node node) { isSink(node) } + + predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet cs) { + isSink(node) and + exists(cs) + } +} + +module EscapingCaptureFlow = DataFlow::Global; + +predicate escapingCapture(CallableExpr capturing, Loop loop, Variable var) { + capturesLoopVariable(capturing, loop, var) and + EscapingCaptureFlow::flow(DataFlow::exprNode(capturing), _) } from CallableExpr capturing, AstNode loop, Variable var -where escaping_capturing_looping_construct(capturing, loop, var) +where escapingCapture(capturing, loop, var) select capturing, "Capture of loop variable $@.", loop, var.getId() From 08b428118790ee14875d4f8ea1d59e12142ae94c Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Mon, 31 Mar 2025 10:23:12 +0100 Subject: [PATCH 048/372] Update query message and remove field case --- python/ql/src/Variables/LoopVariableCapture.ql | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture.ql index 16130d5d50f..4682e682d81 100644 --- a/python/ql/src/Variables/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture.ql @@ -34,8 +34,9 @@ module EscapingCaptureFlowSig implements DataFlow::ConfigSig { predicate isSink(DataFlow::Node node) { // Stored in a field. - exists(DataFlow::AttrWrite aw | aw.getObject() = node) - or + // This appeared to lead to FPs through wrapper classes. + // exists(DataFlow::AttrWrite aw | aw.getObject() = node) + // or // Stored in a dict/list. exists(Assign assign, Subscript sub | sub = assign.getATarget() and node.asExpr() = assign.getValue() @@ -44,7 +45,7 @@ module EscapingCaptureFlowSig implements DataFlow::ConfigSig { // Stored in a list. exists(DataFlow::MethodCallNode mc | mc.calls(_, "append") and node = mc.getArg(0)) or - // Used in a yeild statement, likely included in a collection. + // Used in a yield statement, likely included in a collection. // The element of comprehension expressions desugar to involve a yield statement internally. exists(Yield y | node.asExpr() = y.getValue()) } @@ -64,6 +65,8 @@ predicate escapingCapture(CallableExpr capturing, Loop loop, Variable var) { EscapingCaptureFlow::flow(DataFlow::exprNode(capturing), _) } -from CallableExpr capturing, AstNode loop, Variable var -where escapingCapture(capturing, loop, var) -select capturing, "Capture of loop variable $@.", loop, var.getId() +from CallableExpr capturing, AstNode loop, Variable var, string descr +where + escapingCapture(capturing, loop, var) and + if capturing instanceof Lambda then descr = "lambda" else descr = "function" +select capturing, "This " + descr + " captures the loop variable $@.", loop, var.getId() From 5b7200a0418ca7a86a8ed863de755cd355c44634 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Mon, 31 Mar 2025 11:04:13 +0100 Subject: [PATCH 049/372] Use flow path in alerts --- .../ql/src/Variables/LoopVariableCapture.ql | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture.ql index 4682e682d81..e0a3d521144 100644 --- a/python/ql/src/Variables/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture.ql @@ -1,7 +1,7 @@ /** * @name Loop variable capture * @description Capture of a loop variable is not the same as capturing the value of a loop variable, and may be erroneous. - * @kind problem + * @kind path-problem * @tags correctness * @problem.severity error * @sub-severity low @@ -60,13 +60,23 @@ module EscapingCaptureFlowSig implements DataFlow::ConfigSig { module EscapingCaptureFlow = DataFlow::Global; -predicate escapingCapture(CallableExpr capturing, Loop loop, Variable var) { +import EscapingCaptureFlow::PathGraph + +predicate escapingCapture( + CallableExpr capturing, Loop loop, Variable var, EscapingCaptureFlow::PathNode source, + EscapingCaptureFlow::PathNode sink +) { capturesLoopVariable(capturing, loop, var) and - EscapingCaptureFlow::flow(DataFlow::exprNode(capturing), _) + capturing = source.getNode().asExpr() and + EscapingCaptureFlow::flowPath(source, sink) } -from CallableExpr capturing, AstNode loop, Variable var, string descr +from + CallableExpr capturing, AstNode loop, Variable var, string descr, + EscapingCaptureFlow::PathNode source, EscapingCaptureFlow::PathNode sink where - escapingCapture(capturing, loop, var) and + escapingCapture(capturing, loop, var, source, sink) and if capturing instanceof Lambda then descr = "lambda" else descr = "function" -select capturing, "This " + descr + " captures the loop variable $@.", loop, var.getId() +select capturing, source, sink, + "This " + descr + " captures the loop variable $@, and may escape the loop by being stored $@.", + loop, var.getId(), sink, "here" From 11830bf66132f39c9df6567ef71193ac98213a4b Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Mon, 31 Mar 2025 14:33:55 +0100 Subject: [PATCH 050/372] Move to separate folder --- .../{ => LoopVariableCapture}/LoopVariableCapture.py | 0 .../{ => LoopVariableCapture}/LoopVariableCapture.qhelp | 0 .../{ => LoopVariableCapture}/LoopVariableCapture.ql | 8 ++++++++ .../{ => LoopVariableCapture}/LoopVariableCapture2.py | 0 4 files changed, 8 insertions(+) rename python/ql/src/Variables/{ => LoopVariableCapture}/LoopVariableCapture.py (100%) rename python/ql/src/Variables/{ => LoopVariableCapture}/LoopVariableCapture.qhelp (100%) rename python/ql/src/Variables/{ => LoopVariableCapture}/LoopVariableCapture.ql (91%) rename python/ql/src/Variables/{ => LoopVariableCapture}/LoopVariableCapture2.py (100%) diff --git a/python/ql/src/Variables/LoopVariableCapture.py b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.py similarity index 100% rename from python/ql/src/Variables/LoopVariableCapture.py rename to python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.py diff --git a/python/ql/src/Variables/LoopVariableCapture.qhelp b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp similarity index 100% rename from python/ql/src/Variables/LoopVariableCapture.qhelp rename to python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp diff --git a/python/ql/src/Variables/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql similarity index 91% rename from python/ql/src/Variables/LoopVariableCapture.ql rename to python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index e0a3d521144..b2ed802e9c3 100644 --- a/python/ql/src/Variables/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -52,6 +52,14 @@ module EscapingCaptureFlowSig implements DataFlow::ConfigSig { predicate isBarrierOut(DataFlow::Node node) { isSink(node) } + predicate isBarrier(DataFlow::Node node) { + // Incorrect virtual dispatch to __call__ methods is a source of FPs. + exists(Function call | + call.getName() = "__call__" and + call.getArg(0) = node.(DataFlow::ParameterNode).getParameter() + ) + } + predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet cs) { isSink(node) and exists(cs) diff --git a/python/ql/src/Variables/LoopVariableCapture2.py b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture2.py similarity index 100% rename from python/ql/src/Variables/LoopVariableCapture2.py rename to python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture2.py From 2d6476ad2138138c6fa1ac3b5fb6127254496aa4 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Tue, 1 Apr 2025 09:56:01 +0100 Subject: [PATCH 051/372] Update names and alert message --- .../Variables/LoopVariableCapture/LoopVariableCapture.ql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index b2ed802e9c3..6c979ffdf82 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -29,7 +29,7 @@ predicate capturesLoopVariable(CallableExpr capturing, Loop loop, Variable var) var = loop.getALoopVariable() } -module EscapingCaptureFlowSig implements DataFlow::ConfigSig { +module EscapingCaptureFlowConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node node) { capturesLoopVariable(node.asExpr(), _, _) } predicate isSink(DataFlow::Node node) { @@ -66,7 +66,7 @@ module EscapingCaptureFlowSig implements DataFlow::ConfigSig { } } -module EscapingCaptureFlow = DataFlow::Global; +module EscapingCaptureFlow = DataFlow::Global; import EscapingCaptureFlow::PathGraph @@ -86,5 +86,5 @@ where escapingCapture(capturing, loop, var, source, sink) and if capturing instanceof Lambda then descr = "lambda" else descr = "function" select capturing, source, sink, - "This " + descr + " captures the loop variable $@, and may escape the loop by being stored $@.", - loop, var.getId(), sink, "here" + "This " + descr + " captures the loop variable $@, and may escape the loop by being stored at $@.", + loop, var.getId(), sink, "this location" From c37809a187bf948186b23d548471931a398cc808 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Wed, 2 Apr 2025 09:33:30 +0100 Subject: [PATCH 052/372] Reduce scope of allowImplicitRead to avoid cartesian product. --- .../Variables/LoopVariableCapture/LoopVariableCapture.ql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index 6c979ffdf82..49392e3d01e 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -62,7 +62,12 @@ module EscapingCaptureFlowConfig implements DataFlow::ConfigSig { predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet cs) { isSink(node) and - exists(cs) + ( + cs instanceof DataFlow::TupleElementContent or + cs instanceof DataFlow::ListElementContent or + cs instanceof DataFlow::SetElementContent or + cs instanceof DataFlow::DictionaryElementAnyContent + ) } } From 9ebaac82cf4ecdeb50cb118e644b584d4837bf98 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 2 Apr 2025 13:47:18 +0200 Subject: [PATCH 053/372] JS: Add tests for Response object sink --- .../CWE-079/ReflectedXss/response-object.js | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js new file mode 100644 index 00000000000..7dbeb14d30d --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js @@ -0,0 +1,39 @@ +const express = require('express'); + +// Note: We're using using express for the taint source in order to to test 'Response' +// in isolation from the more complicated http frameworks. + +express().get('/foo', (req) => { + const data = req.body; // $ MISSING: Source + + new Response(data); // $ MISSING: Alert + new Response(data, {}); // $ MISSING: Alert + new Response(data, { headers: null }); // $ MISSING: Alert + + new Response(data, { headers: { 'content-type': 'text/plain'}}); + new Response(data, { headers: { 'content-type': 'text/html'}}); // $ MISSING: Alert + + new Response(data, { headers: { 'Content-Type': 'text/plain'}}); + new Response(data, { headers: { 'Content-Type': 'text/html'}}); // $ MISSING: Alert + + const headers1 = new Headers({ 'content-type': 'text/plain'}); + new Response(data, { headers: headers1 }); + + const headers2 = new Headers({ 'content-type': 'text/html'}); + new Response(data, { headers: headers2 }); // $ MISSING: Alert + + const headers3 = new Headers(); + new Response(data, { headers: headers3 }); // $ MISSING: Alert + + const headers4 = new Headers(); + headers4.set('content-type', 'text/plain'); + new Response(data, { headers: headers4 }); + + const headers5 = new Headers(); + headers5.set('content-type', 'text/html'); + new Response(data, { headers: headers5 }); // $ MISSING: Alert + + const headers6 = new Headers(); + headers6.set('unrelated-header', 'text/plain'); + new Response(data, { headers: headers6 }); // $ MISSING: Alert +}); From 6ade97892f3a43dddd60b3fe4402bba4c34d9d26 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Wed, 2 Apr 2025 19:06:02 -0400 Subject: [PATCH 054/372] Java: update maintainability tag to reliability instead --- .../Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql index 3540ad8d942..8072a68c61d 100644 --- a/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql +++ b/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql @@ -9,7 +9,7 @@ * @precision very-high * @problem.severity warning * @tags quality - * maintainability + * reliability * correctness * testability * frameworks/junit From 05d7b9a19a1e84266fbb5f46505c3a577b7f99f8 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Wed, 2 Apr 2025 19:11:26 -0400 Subject: [PATCH 055/372] Java: add reliability tag --- .../Undesirable Calls/DoNotCallFinalize.ql | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql index 80171e4d49e..1abe96f9185 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql @@ -8,6 +8,7 @@ * @precision high * @problem.severity error * @tags quality + * reliability * correctness * performance * external/cwe/cwe-586 From 0380279c39079c713a1d64a412669b18abccee7a Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Wed, 2 Apr 2025 19:43:33 -0400 Subject: [PATCH 056/372] Java: update qhelp implementation notes for more clarity --- .../Undesirable Calls/DoNotCallFinalize.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index b2bcfdae612..46ce835d50d 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -48,8 +48,7 @@ void main() { # Implementation Notes -This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on overrides of `finalize()`. - +This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on method overrides of `finalize()`. ## References From 533f1a93e2d500bd63dd5915c0408526c0ebb97f Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 2 Apr 2025 14:50:44 +0200 Subject: [PATCH 057/372] JS: Added test cases for `mkdirp`. --- .../CWE-022/TaintedPath/TaintedPath.expected | 13 +++++++++++ .../Security/CWE-022/TaintedPath/mkdirp.js | 22 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected index 99be2545b8e..28cbc6908d6 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected @@ -52,6 +52,8 @@ | handlebars.js:11:32:11:39 | filePath | handlebars.js:29:46:29:60 | req.params.path | handlebars.js:11:32:11:39 | filePath | This path depends on a $@. | handlebars.js:29:46:29:60 | req.params.path | user-provided value | | handlebars.js:15:25:15:32 | filePath | handlebars.js:43:15:43:29 | req.params.path | handlebars.js:15:25:15:32 | filePath | This path depends on a $@. | handlebars.js:43:15:43:29 | req.params.path | user-provided value | | hapi.js:15:44:15:51 | filepath | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:15:44:15:51 | filepath | This path depends on a $@. | hapi.js:14:30:14:51 | request ... ilepath | user-provided value | +| mkdirp.js:11:12:11:18 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:11:12:11:18 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:12:17:12:23 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:12:17:12:23 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | | more-fs-extra.js:10:15:10:22 | filename | more-fs-extra.js:8:26:8:33 | req.body | more-fs-extra.js:10:15:10:22 | filename | This path depends on a $@. | more-fs-extra.js:8:26:8:33 | req.body | user-provided value | | more-fs-extra.js:11:11:11:18 | filename | more-fs-extra.js:8:26:8:33 | req.body | more-fs-extra.js:11:11:11:18 | filename | This path depends on a $@. | more-fs-extra.js:8:26:8:33 | req.body | user-provided value | | more-fs-extra.js:12:14:12:21 | filename | more-fs-extra.js:8:26:8:33 | req.body | more-fs-extra.js:12:14:12:21 | filename | This path depends on a $@. | more-fs-extra.js:8:26:8:33 | req.body | user-provided value | @@ -390,6 +392,11 @@ edges | handlebars.js:43:15:43:29 | req.params.path | handlebars.js:13:73:13:80 | filePath | provenance | | | hapi.js:14:19:14:51 | filepath | hapi.js:15:44:15:51 | filepath | provenance | | | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:14:19:14:51 | filepath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:11:12:11:18 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:12:17:12:23 | dirPath | provenance | | +| mkdirp.js:9:21:9:76 | path.jo ... ltDir') | mkdirp.js:9:11:9:76 | dirPath | provenance | | +| mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:9:42:9:75 | req.que ... ultDir' | provenance | | +| mkdirp.js:9:42:9:75 | req.que ... ultDir' | mkdirp.js:9:21:9:76 | path.jo ... ltDir') | provenance | Config | | more-fs-extra.js:8:11:8:22 | { filename } | more-fs-extra.js:8:13:8:20 | filename | provenance | Config | | more-fs-extra.js:8:11:8:33 | filename | more-fs-extra.js:10:15:10:22 | filename | provenance | | | more-fs-extra.js:8:11:8:33 | filename | more-fs-extra.js:11:11:11:18 | filename | provenance | | @@ -919,6 +926,12 @@ nodes | hapi.js:14:19:14:51 | filepath | semmle.label | filepath | | hapi.js:14:30:14:51 | request ... ilepath | semmle.label | request ... ilepath | | hapi.js:15:44:15:51 | filepath | semmle.label | filepath | +| mkdirp.js:9:11:9:76 | dirPath | semmle.label | dirPath | +| mkdirp.js:9:21:9:76 | path.jo ... ltDir') | semmle.label | path.jo ... ltDir') | +| mkdirp.js:9:42:9:59 | req.query.filename | semmle.label | req.query.filename | +| mkdirp.js:9:42:9:75 | req.que ... ultDir' | semmle.label | req.que ... ultDir' | +| mkdirp.js:11:12:11:18 | dirPath | semmle.label | dirPath | +| mkdirp.js:12:17:12:23 | dirPath | semmle.label | dirPath | | more-fs-extra.js:8:11:8:22 | { filename } | semmle.label | { filename } | | more-fs-extra.js:8:11:8:33 | filename | semmle.label | filename | | more-fs-extra.js:8:13:8:20 | filename | semmle.label | filename | diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js new file mode 100644 index 00000000000..06518acbc0c --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js @@ -0,0 +1,22 @@ +const express = require('express'); +const mkdirp = require('mkdirp'); +const path = require('path'); + +const app = express(); +app.use(express.json()); + +app.post('/foo', async (req, res) => { + const dirPath = path.join(__dirname, req.query.filename || 'defaultDir'); // $ Source + + mkdirp(dirPath); // $ Alert + mkdirp.sync(dirPath); // $ Alert + mkdirp.nativeSync(dirPath); // $ MISSING: Alert + mkdirp.native(dirPath); // $ MISSING: Alert + mkdirp.manual(dirPath); // $ MISSING: Alert + mkdirp.manualSync(dirPath); // $ MISSING: Alert + mkdirp.mkdirpNative(dirPath); // $ MISSING: Alert + mkdirp.mkdirpManual(dirPath); // $ MISSING: Alert + mkdirp.mkdirpManualSync(dirPath); // $ MISSING: Alert + mkdirp.mkdirpNativeSync(dirPath); // $ MISSING: Alert + mkdirp.mkdirpSync(dirPath); // $ MISSING: Alert +}); From 3fa24d60261f4ee0945d66ac889ba19f182aac10 Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 2 Apr 2025 16:29:18 +0200 Subject: [PATCH 058/372] Add sink model for `mkdirp` and update tests for path injection alerts. --- javascript/ql/lib/ext/mkdirp.model.yml | 6 +++++ .../CWE-022/TaintedPath/TaintedPath.expected | 27 +++++++++++++++++++ .../Security/CWE-022/TaintedPath/mkdirp.js | 18 ++++++------- 3 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 javascript/ql/lib/ext/mkdirp.model.yml diff --git a/javascript/ql/lib/ext/mkdirp.model.yml b/javascript/ql/lib/ext/mkdirp.model.yml new file mode 100644 index 00000000000..488b46e2ee2 --- /dev/null +++ b/javascript/ql/lib/ext/mkdirp.model.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/javascript-all + extensible: sinkModel + data: + - ["mkdirp", "Member[nativeSync,native,manual,manualSync,mkdirpNative,mkdirpManual,mkdirpManualSync,mkdirpNativeSync,mkdirpSync].Argument[0]", "path-injection"] diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected index 28cbc6908d6..b486ca5e663 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected @@ -54,6 +54,15 @@ | hapi.js:15:44:15:51 | filepath | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:15:44:15:51 | filepath | This path depends on a $@. | hapi.js:14:30:14:51 | request ... ilepath | user-provided value | | mkdirp.js:11:12:11:18 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:11:12:11:18 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | | mkdirp.js:12:17:12:23 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:12:17:12:23 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:13:23:13:29 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:13:23:13:29 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:14:19:14:25 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:14:19:14:25 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:15:19:15:25 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:15:19:15:25 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:16:23:16:29 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:16:23:16:29 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:17:25:17:31 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:17:25:17:31 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:18:25:18:31 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:18:25:18:31 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:19:29:19:35 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:19:29:19:35 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:20:29:20:35 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:20:29:20:35 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | +| mkdirp.js:21:23:21:29 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:21:23:21:29 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | | more-fs-extra.js:10:15:10:22 | filename | more-fs-extra.js:8:26:8:33 | req.body | more-fs-extra.js:10:15:10:22 | filename | This path depends on a $@. | more-fs-extra.js:8:26:8:33 | req.body | user-provided value | | more-fs-extra.js:11:11:11:18 | filename | more-fs-extra.js:8:26:8:33 | req.body | more-fs-extra.js:11:11:11:18 | filename | This path depends on a $@. | more-fs-extra.js:8:26:8:33 | req.body | user-provided value | | more-fs-extra.js:12:14:12:21 | filename | more-fs-extra.js:8:26:8:33 | req.body | more-fs-extra.js:12:14:12:21 | filename | This path depends on a $@. | more-fs-extra.js:8:26:8:33 | req.body | user-provided value | @@ -394,6 +403,15 @@ edges | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:14:19:14:51 | filepath | provenance | | | mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:11:12:11:18 | dirPath | provenance | | | mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:12:17:12:23 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:13:23:13:29 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:14:19:14:25 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:15:19:15:25 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:16:23:16:29 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:17:25:17:31 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:18:25:18:31 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:19:29:19:35 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:20:29:20:35 | dirPath | provenance | | +| mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:21:23:21:29 | dirPath | provenance | | | mkdirp.js:9:21:9:76 | path.jo ... ltDir') | mkdirp.js:9:11:9:76 | dirPath | provenance | | | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:9:42:9:75 | req.que ... ultDir' | provenance | | | mkdirp.js:9:42:9:75 | req.que ... ultDir' | mkdirp.js:9:21:9:76 | path.jo ... ltDir') | provenance | Config | @@ -932,6 +950,15 @@ nodes | mkdirp.js:9:42:9:75 | req.que ... ultDir' | semmle.label | req.que ... ultDir' | | mkdirp.js:11:12:11:18 | dirPath | semmle.label | dirPath | | mkdirp.js:12:17:12:23 | dirPath | semmle.label | dirPath | +| mkdirp.js:13:23:13:29 | dirPath | semmle.label | dirPath | +| mkdirp.js:14:19:14:25 | dirPath | semmle.label | dirPath | +| mkdirp.js:15:19:15:25 | dirPath | semmle.label | dirPath | +| mkdirp.js:16:23:16:29 | dirPath | semmle.label | dirPath | +| mkdirp.js:17:25:17:31 | dirPath | semmle.label | dirPath | +| mkdirp.js:18:25:18:31 | dirPath | semmle.label | dirPath | +| mkdirp.js:19:29:19:35 | dirPath | semmle.label | dirPath | +| mkdirp.js:20:29:20:35 | dirPath | semmle.label | dirPath | +| mkdirp.js:21:23:21:29 | dirPath | semmle.label | dirPath | | more-fs-extra.js:8:11:8:22 | { filename } | semmle.label | { filename } | | more-fs-extra.js:8:11:8:33 | filename | semmle.label | filename | | more-fs-extra.js:8:13:8:20 | filename | semmle.label | filename | diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js index 06518acbc0c..975c46df2cc 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/mkdirp.js @@ -10,13 +10,13 @@ app.post('/foo', async (req, res) => { mkdirp(dirPath); // $ Alert mkdirp.sync(dirPath); // $ Alert - mkdirp.nativeSync(dirPath); // $ MISSING: Alert - mkdirp.native(dirPath); // $ MISSING: Alert - mkdirp.manual(dirPath); // $ MISSING: Alert - mkdirp.manualSync(dirPath); // $ MISSING: Alert - mkdirp.mkdirpNative(dirPath); // $ MISSING: Alert - mkdirp.mkdirpManual(dirPath); // $ MISSING: Alert - mkdirp.mkdirpManualSync(dirPath); // $ MISSING: Alert - mkdirp.mkdirpNativeSync(dirPath); // $ MISSING: Alert - mkdirp.mkdirpSync(dirPath); // $ MISSING: Alert + mkdirp.nativeSync(dirPath); // $ Alert + mkdirp.native(dirPath); // $ Alert + mkdirp.manual(dirPath); // $ Alert + mkdirp.manualSync(dirPath); // $ Alert + mkdirp.mkdirpNative(dirPath); // $ Alert + mkdirp.mkdirpManual(dirPath); // $ Alert + mkdirp.mkdirpManualSync(dirPath); // $ Alert + mkdirp.mkdirpNativeSync(dirPath); // $ Alert + mkdirp.mkdirpSync(dirPath); // $ Alert }); From 04a39eb735f7e97288f647453a29890e56bd149e Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 2 Apr 2025 16:33:02 +0200 Subject: [PATCH 059/372] Removed old `mkdirp` modeling and replaced it with `MaD`. --- javascript/ql/lib/ext/mkdirp.model.yml | 3 ++- .../ql/lib/semmle/javascript/frameworks/Files.qll | 13 ------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/javascript/ql/lib/ext/mkdirp.model.yml b/javascript/ql/lib/ext/mkdirp.model.yml index 488b46e2ee2..1a3bcce767c 100644 --- a/javascript/ql/lib/ext/mkdirp.model.yml +++ b/javascript/ql/lib/ext/mkdirp.model.yml @@ -3,4 +3,5 @@ extensions: pack: codeql/javascript-all extensible: sinkModel data: - - ["mkdirp", "Member[nativeSync,native,manual,manualSync,mkdirpNative,mkdirpManual,mkdirpManualSync,mkdirpNativeSync,mkdirpSync].Argument[0]", "path-injection"] + - ["mkdirp", "Member[nativeSync,native,manual,manualSync,mkdirpNative,mkdirpManual,mkdirpManualSync,mkdirpNativeSync,mkdirpSync,sync].Argument[0]", "path-injection"] + - ["mkdirp", "Argument[0]", "path-injection"] diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Files.qll b/javascript/ql/lib/semmle/javascript/frameworks/Files.qll index 853d122b301..30f07396dcc 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Files.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Files.qll @@ -427,16 +427,3 @@ class Chokidar extends FileNameProducer, FileSystemAccess, API::CallNode { ) } } - -/** - * A call to the [`mkdirp`](https://www.npmjs.com/package/mkdirp) library. - */ -private class Mkdirp extends FileSystemAccess, API::CallNode { - Mkdirp() { - this = API::moduleImport("mkdirp").getACall() - or - this = API::moduleImport("mkdirp").getMember("sync").getACall() - } - - override DataFlow::Node getAPathArgument() { result = this.getArgument(0) } -} From 0e7bff0f81bfc2321023d6f09b62582aeae2319f Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 2 Apr 2025 16:34:06 +0200 Subject: [PATCH 060/372] Added change note. --- javascript/ql/lib/change-notes/2025-04-02-mkdirp.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2025-04-02-mkdirp.md diff --git a/javascript/ql/lib/change-notes/2025-04-02-mkdirp.md b/javascript/ql/lib/change-notes/2025-04-02-mkdirp.md new file mode 100644 index 00000000000..132bbf0cbe4 --- /dev/null +++ b/javascript/ql/lib/change-notes/2025-04-02-mkdirp.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added support for additional `mkdirp` methods as sinks in path-injection queries. From db2720ea5bad641b76c416e5a11c53193a3e1099 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 2 Apr 2025 13:50:41 +0200 Subject: [PATCH 061/372] JS: Initial model of Response --- javascript/ql/lib/javascript.qll | 1 + .../javascript/frameworks/WebResponse.qll | 96 +++++++++++++++++++ .../ReflectedXss/ReflectedXss.expected | 42 ++++++++ .../ReflectedXssWithCustomSanitizer.expected | 13 +++ .../CWE-079/ReflectedXss/response-object.js | 28 +++--- 5 files changed, 166 insertions(+), 14 deletions(-) create mode 100644 javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll diff --git a/javascript/ql/lib/javascript.qll b/javascript/ql/lib/javascript.qll index cc4d15158b9..d75eed29b8e 100644 --- a/javascript/ql/lib/javascript.qll +++ b/javascript/ql/lib/javascript.qll @@ -136,6 +136,7 @@ import semmle.javascript.frameworks.UriLibraries import semmle.javascript.frameworks.Vue import semmle.javascript.frameworks.Vuex import semmle.javascript.frameworks.Webix +import semmle.javascript.frameworks.WebResponse import semmle.javascript.frameworks.WebSocket import semmle.javascript.frameworks.XmlParsers import semmle.javascript.frameworks.xUnit diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll new file mode 100644 index 00000000000..613e189fcfe --- /dev/null +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll @@ -0,0 +1,96 @@ +/** + * Models the `Request` and `Response` objects from the Web standards. + */ + +private import javascript + +/** Treats `Response` as an entry point for API graphs. */ +private class ResponseEntryPoint extends API::EntryPoint { + ResponseEntryPoint() { this = "global.Response" } + + override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Response") } +} + +/** Treats `Headers` as an entry point for API graphs. */ +private class HeadersEntryPoint extends API::EntryPoint { + HeadersEntryPoint() { this = "global.Headers" } + + override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Headers") } +} + +/** + * A call to the `Response` constructor. + */ +private class ResponseCall extends API::InvokeNode { + ResponseCall() { this = any(ResponseEntryPoint e).getANode().getAnInstantiation() } +} + +/** + * A call to the `Headers` constructor. + */ +private class HeadersCall extends API::InvokeNode { + HeadersCall() { this = any(HeadersEntryPoint e).getANode().getAnInstantiation() } +} + +/** + * The `headers` in `new Response(body, { headers })` + */ +private class ResponseArgumentHeaders extends Http::HeaderDefinition { + private ResponseCall response; + private API::Node headerNode; + + ResponseArgumentHeaders() { + headerNode = response.getParameter(1).getMember("headers") and + this = headerNode.asSink() + } + + ResponseCall getResponse() { result = response } + + /** + * Gets a call to `new Headers()` that is passed as the headers to this call. + */ + private HeadersCall getHeadersCall() { headerNode.refersTo(result.getReturn()) } + + /** + * Gets an object whose properties are interpreted as headers, such as `{'content-type': 'foo'}`. + */ + private API::Node getAPlainHeaderObject() { + // new Response(body, {...}) + result = headerNode + or + // new Response(body, new Headers({...})) + result = this.getHeadersCall().getParameter(0) + } + + private API::Node getHeaderNode(string headerName) { + exists(string prop | + result = this.getAPlainHeaderObject().getMember(prop) and + headerName = prop.toLowerCase() + ) + or + exists(API::CallNode append | + append = this.getHeadersCall().getReturn().getMember(["append", "set"]).getACall() and + headerName = append.getArgument(0).getStringValue().toLowerCase() and + result = append.getParameter(1) + ) + } + + override predicate defines(string headerName, string headerValue) { + this.getHeaderNode(headerName).getAValueReachingSink().getStringValue() = headerValue + } + + override string getAHeaderName() { exists(this.getHeaderNode(result)) } + + override Http::RouteHandler getRouteHandler() { none() } +} + +/** + * Data passed as the body in `new Response(body, ...)`. + */ +private class ResponseSink extends Http::ResponseSendArgument { + private ResponseCall response; + + ResponseSink() { this = response.getArgument(0) } + + override Http::RouteHandler getRouteHandler() { none() } +} diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected index d85a90e4026..9fc3e08fdb0 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected @@ -40,6 +40,19 @@ | partial.js:28:14:28:18 | x + y | partial.js:31:47:31:53 | req.url | partial.js:28:14:28:18 | x + y | Cross-site scripting vulnerability due to a $@. | partial.js:31:47:31:53 | req.url | user-provided value | | partial.js:37:14:37:18 | x + y | partial.js:40:43:40:49 | req.url | partial.js:37:14:37:18 | x + y | Cross-site scripting vulnerability due to a $@. | partial.js:40:43:40:49 | req.url | user-provided value | | promises.js:6:25:6:25 | x | promises.js:5:44:5:57 | req.query.data | promises.js:6:25:6:25 | x | Cross-site scripting vulnerability due to a $@. | promises.js:5:44:5:57 | req.query.data | user-provided value | +| response-object.js:9:18:9:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:9:18:9:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:10:18:10:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:10:18:10:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:11:18:11:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:11:18:11:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:13:18:13:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:13:18:13:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:14:18:14:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:14:18:14:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:16:18:16:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:16:18:16:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:17:18:17:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:17:18:17:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:20:18:20:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:20:18:20:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:23:18:23:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:23:18:23:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:26:18:26:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:26:18:26:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:30:18:30:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:30:18:30:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:34:18:34:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:34:18:34:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:38:18:38:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:38:18:38:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | tst2.js:7:12:7:12 | p | tst2.js:6:9:6:9 | p | tst2.js:7:12:7:12 | p | Cross-site scripting vulnerability due to a $@. | tst2.js:6:9:6:9 | p | user-provided value | | tst2.js:8:12:8:12 | r | tst2.js:6:12:6:15 | q: r | tst2.js:8:12:8:12 | r | Cross-site scripting vulnerability due to a $@. | tst2.js:6:12:6:15 | q: r | user-provided value | | tst2.js:18:12:18:12 | p | tst2.js:14:9:14:9 | p | tst2.js:18:12:18:12 | p | Cross-site scripting vulnerability due to a $@. | tst2.js:14:9:14:9 | p | user-provided value | @@ -149,6 +162,20 @@ edges | promises.js:5:36:5:42 | [post update] resolve [resolve-value] | promises.js:5:16:5:22 | resolve [Return] [resolve-value] | provenance | | | promises.js:5:44:5:57 | req.query.data | promises.js:5:36:5:42 | [post update] resolve [resolve-value] | provenance | | | promises.js:6:11:6:11 | x | promises.js:6:25:6:25 | x | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:9:18:9:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:10:18:10:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:11:18:11:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:13:18:13:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:14:18:14:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:16:18:16:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:17:18:17:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:20:18:20:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:23:18:23:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:26:18:26:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:30:18:30:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:34:18:34:21 | data | provenance | | +| response-object.js:7:11:7:25 | data | response-object.js:38:18:38:21 | data | provenance | | +| response-object.js:7:18:7:25 | req.body | response-object.js:7:11:7:25 | data | provenance | | | tst2.js:6:7:6:30 | p | tst2.js:7:12:7:12 | p | provenance | | | tst2.js:6:7:6:30 | r | tst2.js:8:12:8:12 | r | provenance | | | tst2.js:6:9:6:9 | p | tst2.js:6:7:6:30 | p | provenance | | @@ -332,6 +359,21 @@ nodes | promises.js:5:44:5:57 | req.query.data | semmle.label | req.query.data | | promises.js:6:11:6:11 | x | semmle.label | x | | promises.js:6:25:6:25 | x | semmle.label | x | +| response-object.js:7:11:7:25 | data | semmle.label | data | +| response-object.js:7:18:7:25 | req.body | semmle.label | req.body | +| response-object.js:9:18:9:21 | data | semmle.label | data | +| response-object.js:10:18:10:21 | data | semmle.label | data | +| response-object.js:11:18:11:21 | data | semmle.label | data | +| response-object.js:13:18:13:21 | data | semmle.label | data | +| response-object.js:14:18:14:21 | data | semmle.label | data | +| response-object.js:16:18:16:21 | data | semmle.label | data | +| response-object.js:17:18:17:21 | data | semmle.label | data | +| response-object.js:20:18:20:21 | data | semmle.label | data | +| response-object.js:23:18:23:21 | data | semmle.label | data | +| response-object.js:26:18:26:21 | data | semmle.label | data | +| response-object.js:30:18:30:21 | data | semmle.label | data | +| response-object.js:34:18:34:21 | data | semmle.label | data | +| response-object.js:38:18:38:21 | data | semmle.label | data | | tst2.js:6:7:6:30 | p | semmle.label | p | | tst2.js:6:7:6:30 | r | semmle.label | r | | tst2.js:6:9:6:9 | p | semmle.label | p | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected index fb0748b3acd..dff0741ec88 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected @@ -38,6 +38,19 @@ | partial.js:28:14:28:18 | x + y | Cross-site scripting vulnerability due to $@. | partial.js:31:47:31:53 | req.url | user-provided value | | partial.js:37:14:37:18 | x + y | Cross-site scripting vulnerability due to $@. | partial.js:40:43:40:49 | req.url | user-provided value | | promises.js:6:25:6:25 | x | Cross-site scripting vulnerability due to $@. | promises.js:5:44:5:57 | req.query.data | user-provided value | +| response-object.js:9:18:9:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:10:18:10:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:11:18:11:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:13:18:13:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:14:18:14:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:16:18:16:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:17:18:17:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:20:18:20:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:23:18:23:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:26:18:26:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:30:18:30:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:34:18:34:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | +| response-object.js:38:18:38:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | tst2.js:7:12:7:12 | p | Cross-site scripting vulnerability due to $@. | tst2.js:6:9:6:9 | p | user-provided value | | tst2.js:8:12:8:12 | r | Cross-site scripting vulnerability due to $@. | tst2.js:6:12:6:15 | q: r | user-provided value | | tst2.js:18:12:18:12 | p | Cross-site scripting vulnerability due to $@. | tst2.js:14:9:14:9 | p | user-provided value | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js index 7dbeb14d30d..eaadaeaba07 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js @@ -4,36 +4,36 @@ const express = require('express'); // in isolation from the more complicated http frameworks. express().get('/foo', (req) => { - const data = req.body; // $ MISSING: Source + const data = req.body; // $ Source - new Response(data); // $ MISSING: Alert - new Response(data, {}); // $ MISSING: Alert - new Response(data, { headers: null }); // $ MISSING: Alert + new Response(data); // $ Alert + new Response(data, {}); // $ Alert + new Response(data, { headers: null }); // $ Alert - new Response(data, { headers: { 'content-type': 'text/plain'}}); - new Response(data, { headers: { 'content-type': 'text/html'}}); // $ MISSING: Alert + new Response(data, { headers: { 'content-type': 'text/plain'}}); // $ SPURIOUS: Alert + new Response(data, { headers: { 'content-type': 'text/html'}}); // $ Alert - new Response(data, { headers: { 'Content-Type': 'text/plain'}}); - new Response(data, { headers: { 'Content-Type': 'text/html'}}); // $ MISSING: Alert + new Response(data, { headers: { 'Content-Type': 'text/plain'}}); // $ SPURIOUS: Alert + new Response(data, { headers: { 'Content-Type': 'text/html'}}); // $ Alert const headers1 = new Headers({ 'content-type': 'text/plain'}); - new Response(data, { headers: headers1 }); + new Response(data, { headers: headers1 }); // $ SPURIOUS: Alert const headers2 = new Headers({ 'content-type': 'text/html'}); - new Response(data, { headers: headers2 }); // $ MISSING: Alert + new Response(data, { headers: headers2 }); // $ Alert const headers3 = new Headers(); - new Response(data, { headers: headers3 }); // $ MISSING: Alert + new Response(data, { headers: headers3 }); // $ Alert const headers4 = new Headers(); headers4.set('content-type', 'text/plain'); - new Response(data, { headers: headers4 }); + new Response(data, { headers: headers4 }); // $ SPURIOUS: Alert const headers5 = new Headers(); headers5.set('content-type', 'text/html'); - new Response(data, { headers: headers5 }); // $ MISSING: Alert + new Response(data, { headers: headers5 }); // $ Alert const headers6 = new Headers(); headers6.set('unrelated-header', 'text/plain'); - new Response(data, { headers: headers6 }); // $ MISSING: Alert + new Response(data, { headers: headers6 }); // $ Alert }); From 6c33013788e7a3c551c1a8a9268471fa65fe3334 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 2 Apr 2025 13:52:55 +0200 Subject: [PATCH 062/372] JS: Enable association with headers without needing a route handler Previously it was not possible to associate a ResponseSendArgument with its header definitions if they did not have the same route handler. But for calls like `new Response(body, { headers })` the headers are fairly obvious whereas the route handler is unnecessarily hard to find. So we use the direct and obvious association between 'body' and 'headers' in the call. --- .../lib/semmle/javascript/frameworks/HTTP.qll | 6 ++++ .../javascript/frameworks/WebResponse.qll | 4 +++ .../dataflow/ReflectedXssCustomizations.qll | 30 ++++++++++++------- .../ReflectedXss/ReflectedXss.expected | 12 -------- .../ReflectedXssWithCustomSanitizer.expected | 4 --- .../CWE-079/ReflectedXss/response-object.js | 8 ++--- 6 files changed, 33 insertions(+), 31 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/HTTP.qll b/javascript/ql/lib/semmle/javascript/frameworks/HTTP.qll index 61770cdb9ba..2d068d6b4bf 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/HTTP.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/HTTP.qll @@ -108,6 +108,12 @@ module Http { * Gets the route handler that sends this expression. */ abstract RouteHandler getRouteHandler(); + + /** + * Gets a header definition associated with this response body, if it they are provided + * by the same call. + */ + HeaderDefinition getAnAssociatedHeaderDefinition() { none() } } /** diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll index 613e189fcfe..0e3f93d8099 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll @@ -93,4 +93,8 @@ private class ResponseSink extends Http::ResponseSendArgument { ResponseSink() { this = response.getArgument(0) } override Http::RouteHandler getRouteHandler() { none() } + + override ResponseArgumentHeaders getAnAssociatedHeaderDefinition() { + result.getResponse() = response + } } diff --git a/javascript/ql/lib/semmle/javascript/security/dataflow/ReflectedXssCustomizations.qll b/javascript/ql/lib/semmle/javascript/security/dataflow/ReflectedXssCustomizations.qll index 6ddedd4f727..70b2685d90d 100644 --- a/javascript/ql/lib/semmle/javascript/security/dataflow/ReflectedXssCustomizations.qll +++ b/javascript/ql/lib/semmle/javascript/security/dataflow/ReflectedXssCustomizations.qll @@ -32,11 +32,11 @@ module ReflectedXss { * Gets a HeaderDefinition that defines a XSS safe content-type for `send`. */ Http::HeaderDefinition getAXssSafeHeaderDefinition(Http::ResponseSendArgument send) { - exists(Http::RouteHandler h | - send.getRouteHandler() = h and - result = xssSafeContentTypeHeader(h) - | - // The HeaderDefinition affects a response sent at `send`. + isSafeContentTypeHeader(result) and + ( + result = send.getAnAssociatedHeaderDefinition() + or + result = send.getRouteHandler().getAResponseHeader("content-type") and headerAffects(result, send) ) } @@ -54,16 +54,22 @@ module ReflectedXss { ] } - /** - * Holds if `h` may send a response with a content type that is safe for XSS. - */ - Http::HeaderDefinition xssSafeContentTypeHeader(Http::RouteHandler h) { - result = h.getAResponseHeader("content-type") and - not exists(string tp | result.defines("content-type", tp) | + private predicate isSafeContentTypeHeader(Http::HeaderDefinition header) { + header.getAHeaderName() = "content-type" and + not exists(string tp | header.defines("content-type", tp) | tp.toLowerCase().matches(xssUnsafeContentType() + "%") ) } + /** + * DEPRECATED. Use `getAXssSafeHeaderDefinition` instead. + * Holds if `h` may send a response with a content type that is safe for XSS. + */ + deprecated Http::HeaderDefinition xssSafeContentTypeHeader(Http::RouteHandler h) { + result = h.getAResponseHeader("content-type") and + isSafeContentTypeHeader(result) + } + /** * Holds if a header set in `header` is likely to affect a response sent at `sender`. */ @@ -80,6 +86,8 @@ module ReflectedXss { dominatingHeader.getBasicBlock().(ReachableBasicBlock).dominates(sender.getBasicBlock()) ) ) + or + header = sender.getAnAssociatedHeaderDefinition() } bindingset[headerBlock] diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected index 9fc3e08fdb0..75bef3e1b3b 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected @@ -43,14 +43,10 @@ | response-object.js:9:18:9:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:9:18:9:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:10:18:10:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:10:18:10:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:11:18:11:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:11:18:11:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:13:18:13:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:13:18:13:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:14:18:14:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:14:18:14:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:16:18:16:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:16:18:16:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:17:18:17:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:17:18:17:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:20:18:20:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:20:18:20:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:23:18:23:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:23:18:23:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:26:18:26:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:26:18:26:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:30:18:30:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:30:18:30:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:34:18:34:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:34:18:34:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:38:18:38:21 | data | response-object.js:7:18:7:25 | req.body | response-object.js:38:18:38:21 | data | Cross-site scripting vulnerability due to a $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | tst2.js:7:12:7:12 | p | tst2.js:6:9:6:9 | p | tst2.js:7:12:7:12 | p | Cross-site scripting vulnerability due to a $@. | tst2.js:6:9:6:9 | p | user-provided value | @@ -165,14 +161,10 @@ edges | response-object.js:7:11:7:25 | data | response-object.js:9:18:9:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:10:18:10:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:11:18:11:21 | data | provenance | | -| response-object.js:7:11:7:25 | data | response-object.js:13:18:13:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:14:18:14:21 | data | provenance | | -| response-object.js:7:11:7:25 | data | response-object.js:16:18:16:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:17:18:17:21 | data | provenance | | -| response-object.js:7:11:7:25 | data | response-object.js:20:18:20:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:23:18:23:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:26:18:26:21 | data | provenance | | -| response-object.js:7:11:7:25 | data | response-object.js:30:18:30:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:34:18:34:21 | data | provenance | | | response-object.js:7:11:7:25 | data | response-object.js:38:18:38:21 | data | provenance | | | response-object.js:7:18:7:25 | req.body | response-object.js:7:11:7:25 | data | provenance | | @@ -364,14 +356,10 @@ nodes | response-object.js:9:18:9:21 | data | semmle.label | data | | response-object.js:10:18:10:21 | data | semmle.label | data | | response-object.js:11:18:11:21 | data | semmle.label | data | -| response-object.js:13:18:13:21 | data | semmle.label | data | | response-object.js:14:18:14:21 | data | semmle.label | data | -| response-object.js:16:18:16:21 | data | semmle.label | data | | response-object.js:17:18:17:21 | data | semmle.label | data | -| response-object.js:20:18:20:21 | data | semmle.label | data | | response-object.js:23:18:23:21 | data | semmle.label | data | | response-object.js:26:18:26:21 | data | semmle.label | data | -| response-object.js:30:18:30:21 | data | semmle.label | data | | response-object.js:34:18:34:21 | data | semmle.label | data | | response-object.js:38:18:38:21 | data | semmle.label | data | | tst2.js:6:7:6:30 | p | semmle.label | p | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected index dff0741ec88..5532af3cf11 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected @@ -41,14 +41,10 @@ | response-object.js:9:18:9:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:10:18:10:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:11:18:11:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:13:18:13:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:14:18:14:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:16:18:16:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:17:18:17:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:20:18:20:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:23:18:23:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:26:18:26:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | -| response-object.js:30:18:30:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:34:18:34:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | response-object.js:38:18:38:21 | data | Cross-site scripting vulnerability due to $@. | response-object.js:7:18:7:25 | req.body | user-provided value | | tst2.js:7:12:7:12 | p | Cross-site scripting vulnerability due to $@. | tst2.js:6:9:6:9 | p | user-provided value | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js index eaadaeaba07..030cff46733 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/response-object.js @@ -10,14 +10,14 @@ express().get('/foo', (req) => { new Response(data, {}); // $ Alert new Response(data, { headers: null }); // $ Alert - new Response(data, { headers: { 'content-type': 'text/plain'}}); // $ SPURIOUS: Alert + new Response(data, { headers: { 'content-type': 'text/plain'}}); new Response(data, { headers: { 'content-type': 'text/html'}}); // $ Alert - new Response(data, { headers: { 'Content-Type': 'text/plain'}}); // $ SPURIOUS: Alert + new Response(data, { headers: { 'Content-Type': 'text/plain'}}); new Response(data, { headers: { 'Content-Type': 'text/html'}}); // $ Alert const headers1 = new Headers({ 'content-type': 'text/plain'}); - new Response(data, { headers: headers1 }); // $ SPURIOUS: Alert + new Response(data, { headers: headers1 }); const headers2 = new Headers({ 'content-type': 'text/html'}); new Response(data, { headers: headers2 }); // $ Alert @@ -27,7 +27,7 @@ express().get('/foo', (req) => { const headers4 = new Headers(); headers4.set('content-type', 'text/plain'); - new Response(data, { headers: headers4 }); // $ SPURIOUS: Alert + new Response(data, { headers: headers4 }); const headers5 = new Headers(); headers5.set('content-type', 'text/html'); From fc21abc7e4af6b6b1045c5b3e25e8a7114126680 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Thu, 3 Apr 2025 16:05:23 -0400 Subject: [PATCH 063/372] Java: update qhelp implementation notes to say 'method declarations' --- .../Undesirable Calls/DoNotCallFinalize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index 46ce835d50d..d6fd5cf76bd 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -48,7 +48,7 @@ void main() { # Implementation Notes -This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on method overrides of `finalize()`. +This rule ignores `super.finalize()` calls that occur within `finalize()` overrides since calling the superclass finalizer is required when overriding `finalize()`. Also, although overriding `finalize()` is not recommended, this rule only alerts on direct calls to `finalize()` and does not alert on method declarations overriding `finalize()`. ## References From a572ac60d28c8a2ab1c843fcd2c2e4025e31d87c Mon Sep 17 00:00:00 2001 From: Napalys Date: Thu, 3 Apr 2025 18:31:27 +0200 Subject: [PATCH 064/372] Added inline test expectations for `WebSocket` --- .../frameworks/WebSocket/browser.js | 18 +++++----- .../frameworks/WebSocket/client.js | 8 ++--- .../frameworks/WebSocket/server.js | 10 +++--- .../frameworks/WebSocket/sockjs.js | 8 ++--- .../frameworks/WebSocket/test.expected | 34 +++++++++---------- .../frameworks/WebSocket/test.qlref | 2 ++ 6 files changed, 41 insertions(+), 39 deletions(-) create mode 100644 javascript/ql/test/library-tests/frameworks/WebSocket/test.qlref diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js index e138d397c7f..7e15bb532c5 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js @@ -1,32 +1,32 @@ (function () { - const socket = new WebSocket('ws://localhost:8080'); + const socket = new WebSocket('ws://localhost:8080'); // $clientSocket socket.addEventListener('open', function (event) { - socket.send('Hi from browser!'); + socket.send('Hi from browser!'); // $clientSend }); socket.addEventListener('message', function (event) { console.log('Message from server ', event.data); - }); + }); // $clientReceive socket.onmessage = function (event) { console.log("Message from server 2", event.data) - }; + }; // $clientReceive })(); (function () { - var sock = new SockJS('http://0.0.0.0:9999/echo'); + var sock = new SockJS('http://0.0.0.0:9999/echo'); // $clientSocket sock.onopen = function () { - sock.send('test'); + sock.send('test'); // $clientSend }; sock.onmessage = function (e) { console.log('message', e.data); sock.close(); - }; + }; // $clientReceive sock.addEventListener('message', function (event) { console.log('Using addEventListener ', event.data); - }); -}) \ No newline at end of file + }); // $clientReceive +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js index c98c71973bf..c49df5afc3c 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js @@ -1,13 +1,13 @@ (function () { const WebSocket = require('ws'); - const ws = new WebSocket('ws://example.org'); + const ws = new WebSocket('ws://example.org'); // $clientSocket ws.on('open', function open() { - ws.send('Hi from client!'); + ws.send('Hi from client!'); // $clientSend }); ws.on('message', function incoming(data) { console.log(data); - }); -})(); \ No newline at end of file + }); // $clientReceive +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server.js index d135f652b45..2f9173ecfc9 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/server.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server.js @@ -3,11 +3,11 @@ const wss = new WebSocket.Server({ port: 8080 }); - wss.on('connection', function connection(ws) { - ws.on('message', function incoming(message) { + wss.on('connection', function connection(ws) { // $serverSocket + ws.on('message', function incoming(message) { // $remoteFlow console.log('received: %s', message); - }); + }); // $serverReceive - ws.send('Hi from server!'); + ws.send('Hi from server!'); // $serverSend }); -})(); \ No newline at end of file +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/sockjs.js b/javascript/ql/test/library-tests/frameworks/WebSocket/sockjs.js index 3616caf90fd..4b599cf5fed 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/sockjs.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/sockjs.js @@ -5,11 +5,11 @@ const sockjs = require('sockjs'); const app = express(); const server = http.createServer(app); const sockjs_echo = sockjs.createServer({}); -sockjs_echo.on('connection', function (conn) { - conn.on('data', function (message) { +sockjs_echo.on('connection', function (conn) { // $serverSocket + conn.on('data', function (message) { // $remoteFlow var data = JSON.parse(message); - conn.write(JSON.stringify(eval(data.test))); - }); + conn.write(JSON.stringify(eval(data.test))); // $serverSend + }); // $serverReceive }); sockjs_echo.installHandlers(server, { prefix: '/echo' }); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 96c5aedb737..0ea8e8b690b 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -1,26 +1,17 @@ -clientSocket -| browser.js:2:17:2:52 | new Web ... :8080') | -| browser.js:19:13:19:50 | new Soc ... /echo') | -| client.js:4:13:4:45 | new Web ... e.org') | -clientSend -| browser.js:5:3:5:33 | socket. ... wser!') | -| browser.js:21:3:21:19 | sock.send('test') | -| client.js:7:3:7:28 | ws.send ... ient!') | clientReceive | browser.js:8:37:10:2 | functio ... ta);\\n\\t} | | browser.js:12:21:14:2 | functio ... ata)\\n\\t} | | browser.js:24:19:27:2 | functio ... e();\\n\\t} | | browser.js:29:35:31:2 | functio ... ta);\\n\\t} | | client.js:10:19:12:2 | functio ... ta);\\n\\t} | -serverSocket -| server.js:6:43:6:44 | ws | -| sockjs.js:8:40:8:43 | conn | -serverSend -| server.js:11:3:11:28 | ws.send ... rver!') | -| sockjs.js:11:9:11:51 | conn.wr ... test))) | -serverReceive -| server.js:7:3:9:4 | ws.on(' ... );\\n\\t\\t}) | -| sockjs.js:9:5:12:6 | conn.on ... \\n }) | +clientSend +| browser.js:5:3:5:33 | socket. ... wser!') | +| browser.js:21:3:21:19 | sock.send('test') | +| client.js:7:3:7:28 | ws.send ... ient!') | +clientSocket +| browser.js:2:17:2:52 | new Web ... :8080') | +| browser.js:19:13:19:50 | new Soc ... /echo') | +| client.js:4:13:4:45 | new Web ... e.org') | flowSteps | browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser.js:21:13:21:18 | 'test' | sockjs.js:9:31:9:37 | message | @@ -33,3 +24,12 @@ flowSteps remoteFlow | server.js:7:38:7:44 | message | | sockjs.js:9:31:9:37 | message | +serverReceive +| server.js:7:3:9:4 | ws.on(' ... );\\n\\t\\t}) | +| sockjs.js:9:5:12:6 | conn.on ... \\n }) | +serverSend +| server.js:11:3:11:28 | ws.send ... rver!') | +| sockjs.js:11:9:11:51 | conn.wr ... test))) | +serverSocket +| server.js:6:43:6:44 | ws | +| sockjs.js:8:40:8:43 | conn | diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.qlref b/javascript/ql/test/library-tests/frameworks/WebSocket/test.qlref new file mode 100644 index 00000000000..ab6773f15f9 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.qlref @@ -0,0 +1,2 @@ +query: test.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql From c7fad0966478a9ed43591bbde553e6f79c2f177f Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 08:33:26 +0200 Subject: [PATCH 065/372] Added test cases with custom exports/imports. --- .../frameworks/WebSocket/browser-custom.js | 34 +++++++++++++++++++ .../frameworks/WebSocket/browser.js | 3 ++ .../frameworks/WebSocket/client-custom.js | 13 +++++++ .../frameworks/WebSocket/client.js | 2 ++ .../frameworks/WebSocket/server-custom.js | 13 +++++++ .../frameworks/WebSocket/server.js | 2 ++ .../frameworks/WebSocket/test.expected | 3 ++ 7 files changed, 70 insertions(+) create mode 100644 javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js create mode 100644 javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js create mode 100644 javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js new file mode 100644 index 00000000000..f14f1d19fa6 --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -0,0 +1,34 @@ +import { MyWebSocket, MySockJS } from './browser.js'; + +(function () { + const socket = new MyWebSocket('ws://localhost:9080'); // $ MISSING: clientSocket + + socket.addEventListener('open', function (event) { + socket.send('Hi from browser!'); // $ MISSING: clientSend + }); + + socket.addEventListener('message', function (event) { + console.log('Message from server ', event.data); + }); // $ MISSING: clientReceive + + socket.onmessage = function (event) { + console.log("Message from server 2", event.data) + }; // $ MISSING: clientReceive +})(); + + +(function () { + var sock = new MySockJS('http://0.0.0.0:9999/echo'); // $ MISSING: clientSocket + sock.onopen = function () { + sock.send('test'); // $ MISSING: clientSend + }; + + sock.onmessage = function (e) { + console.log('message', e.data); + sock.close(); + }; // $ MISSING: clientReceive + + sock.addEventListener('message', function (event) { + console.log('Using addEventListener ', event.data); + }); // $ MISSING: clientReceive +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js index 7e15bb532c5..2540abaf3e7 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js @@ -30,3 +30,6 @@ console.log('Using addEventListener ', event.data); }); // $clientReceive })(); + +export const MyWebSocket = WebSocket; +export const MySockJS = SockJS; diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js new file mode 100644 index 00000000000..92db7ac339c --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js @@ -0,0 +1,13 @@ +const { MyWebSocketWS } = require('./client.js'); + +(function () { + const ws = new MyWebSocketWS('ws://example.org'); // $ MISSING: clientSocket + + ws.on('open', function open() { + ws.send('Hi from client!'); // $ MISSING: clientSend + }); + + ws.on('message', function incoming(data) { + console.log(data); + }); // $ MISSING: clientReceive +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js index c49df5afc3c..710bf0aa7da 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js @@ -11,3 +11,5 @@ console.log(data); }); // $clientReceive })(); + +module.exports.MyWebSocketWS = require('ws'); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js new file mode 100644 index 00000000000..e01bd38d57b --- /dev/null +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js @@ -0,0 +1,13 @@ +const { MyWebSocketServer } = require('./client.js'); + +(function () { + const wss = new MyWebSocketServer({ port: 8080 }); + + wss.on('connection', function connection(ws) { // $ MISSING: serverSocket + ws.on('message', function incoming(message) { // $ MISSING: remoteFlow + console.log('received: %s', message); + }); // $ MISSING: serverReceive + + ws.send('Hi from server!'); // $ MISSING: serverSend + }); +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server.js index 2f9173ecfc9..3e1a408a4a4 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/server.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server.js @@ -11,3 +11,5 @@ ws.send('Hi from server!'); // $serverSend }); })(); + +module.exports.MyWebSocketServer = require('ws').Server; diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 0ea8e8b690b..93068e683b4 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -13,9 +13,12 @@ clientSocket | browser.js:19:13:19:50 | new Soc ... /echo') | | client.js:4:13:4:45 | new Web ... e.org') | flowSteps +| browser-custom.js:1:10:1:20 | MyWebSocket | browser-custom.js:1:10:1:20 | MyWebSocket | +| browser-custom.js:1:23:1:30 | MySockJS | browser-custom.js:1:23:1:30 | MySockJS | | browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser.js:21:13:21:18 | 'test' | sockjs.js:9:31:9:37 | message | | client.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | +| client.js:15:32:15:44 | require('ws') | client-custom.js:1:9:1:21 | MyWebSocketWS | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | client.js:10:37:10:40 | data | From e16a20e69f4d9c59955de194da5cdeb925b5b860 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 08:41:47 +0200 Subject: [PATCH 066/372] Updated `SocketClass` to use API Graphs. --- .../javascript/frameworks/WebSocket.qll | 24 +++++++++++++++---- javascript/ql/src/Security/trest/test.ql | 10 ++++++++ .../frameworks/WebSocket/browser-custom.js | 16 ++++++------- .../frameworks/WebSocket/client-custom.js | 6 ++--- .../frameworks/WebSocket/server-custom.js | 2 +- .../frameworks/WebSocket/test.expected | 19 +++++++++++++++ 6 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 javascript/ql/src/Security/trest/test.ql diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index d2fc69751d6..7437e68bda8 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -47,6 +47,20 @@ private predicate areLibrariesCompatible( (client = LibraryNames::ws() or client = LibraryNames::websocket()) } +/** Treats `WebSocket` as an entry point for API graphs. */ +private class WebSocketEntryPoint extends API::EntryPoint { + WebSocketEntryPoint() { this = "global.WebSocket" } + + override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("WebSocket") } +} + +/** Treats `SockJS` as an entry point for API graphs. */ +private class SockJSEntryPoint extends API::EntryPoint { + SockJSEntryPoint() { this = "global.SockJS" } + + override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("SockJS") } +} + /** * Provides classes that model WebSockets clients. */ @@ -56,19 +70,19 @@ module ClientWebSocket { /** * A class that can be used to instantiate a WebSocket instance. */ - class SocketClass extends DataFlow::SourceNode { + class SocketClass extends API::Node { LibraryName library; // the name of the WebSocket library. Can be one of the libraries defined in `LibraryNames`. SocketClass() { - this = DataFlow::globalVarRef("WebSocket") and library = websocket() + this = any(WebSocketEntryPoint e).getANode() and library = websocket() or - this = DataFlow::moduleImport("ws") and library = ws() + this = API::moduleImport("ws") and library = ws() or // the sockjs-client library:https://www.npmjs.com/package/sockjs-client library = sockjs() and ( - this = DataFlow::moduleImport("sockjs-client") or - this = DataFlow::globalVarRef("SockJS") + this = API::moduleImport("sockjs-client") or + this = any(SockJSEntryPoint e).getANode() ) } diff --git a/javascript/ql/src/Security/trest/test.ql b/javascript/ql/src/Security/trest/test.ql new file mode 100644 index 00000000000..076271d9fb6 --- /dev/null +++ b/javascript/ql/src/Security/trest/test.ql @@ -0,0 +1,10 @@ +import javascript + +API::NewNode getAWebSocketInstance() { result instanceof ClientWebSocket::ClientSocket } + +from DataFlow::Node handler +where + handler = getAWebSocketInstance().getReturn().getMember("onmessage").asSource() + or + handler = getAWebSocketInstance().getAPropertyWrite("onmessage").getRhs() +select handler, "This is a WebSocket onmessage handler." diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index f14f1d19fa6..d3a739697d1 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -1,34 +1,34 @@ import { MyWebSocket, MySockJS } from './browser.js'; (function () { - const socket = new MyWebSocket('ws://localhost:9080'); // $ MISSING: clientSocket + const socket = new MyWebSocket('ws://localhost:9080'); // $ clientSocket socket.addEventListener('open', function (event) { - socket.send('Hi from browser!'); // $ MISSING: clientSend + socket.send('Hi from browser!'); // $ clientSend }); socket.addEventListener('message', function (event) { console.log('Message from server ', event.data); - }); // $ MISSING: clientReceive + }); // $ clientReceive socket.onmessage = function (event) { console.log("Message from server 2", event.data) - }; // $ MISSING: clientReceive + }; // $ clientReceive })(); (function () { - var sock = new MySockJS('http://0.0.0.0:9999/echo'); // $ MISSING: clientSocket + var sock = new MySockJS('http://0.0.0.0:9999/echo'); // $ clientSocket sock.onopen = function () { - sock.send('test'); // $ MISSING: clientSend + sock.send('test'); // $ clientSend }; sock.onmessage = function (e) { console.log('message', e.data); sock.close(); - }; // $ MISSING: clientReceive + }; // $ clientReceive sock.addEventListener('message', function (event) { console.log('Using addEventListener ', event.data); - }); // $ MISSING: clientReceive + }); // $ clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js index 92db7ac339c..6aefeb3a07f 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js @@ -1,13 +1,13 @@ const { MyWebSocketWS } = require('./client.js'); (function () { - const ws = new MyWebSocketWS('ws://example.org'); // $ MISSING: clientSocket + const ws = new MyWebSocketWS('ws://example.org'); // $ clientSocket ws.on('open', function open() { - ws.send('Hi from client!'); // $ MISSING: clientSend + ws.send('Hi from client!'); // $ clientSend }); ws.on('message', function incoming(data) { console.log(data); - }); // $ MISSING: clientReceive + }); // $ clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js index e01bd38d57b..6911d8f8523 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js @@ -1,4 +1,4 @@ -const { MyWebSocketServer } = require('./client.js'); +const { MyWebSocketServer } = require('./server.js'); (function () { const wss = new MyWebSocketServer({ port: 8080 }); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 93068e683b4..fb5fe14793c 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -1,27 +1,46 @@ clientReceive +| browser-custom.js:10:37:12:2 | functio ... ta);\\n\\t} | +| browser-custom.js:14:21:16:2 | functio ... ata)\\n\\t} | +| browser-custom.js:26:19:29:2 | functio ... e();\\n\\t} | +| browser-custom.js:31:35:33:2 | functio ... ta);\\n\\t} | | browser.js:8:37:10:2 | functio ... ta);\\n\\t} | | browser.js:12:21:14:2 | functio ... ata)\\n\\t} | | browser.js:24:19:27:2 | functio ... e();\\n\\t} | | browser.js:29:35:31:2 | functio ... ta);\\n\\t} | +| client-custom.js:10:19:12:2 | functio ... ta);\\n\\t} | | client.js:10:19:12:2 | functio ... ta);\\n\\t} | clientSend +| browser-custom.js:7:3:7:33 | socket. ... wser!') | +| browser-custom.js:23:3:23:19 | sock.send('test') | | browser.js:5:3:5:33 | socket. ... wser!') | | browser.js:21:3:21:19 | sock.send('test') | +| client-custom.js:7:3:7:28 | ws.send ... ient!') | | client.js:7:3:7:28 | ws.send ... ient!') | clientSocket +| browser-custom.js:4:17:4:54 | new MyW ... :9080') | +| browser-custom.js:21:13:21:52 | new MyS ... /echo') | | browser.js:2:17:2:52 | new Web ... :8080') | | browser.js:19:13:19:50 | new Soc ... /echo') | +| client-custom.js:4:13:4:49 | new MyW ... e.org') | | client.js:4:13:4:45 | new Web ... e.org') | flowSteps | browser-custom.js:1:10:1:20 | MyWebSocket | browser-custom.js:1:10:1:20 | MyWebSocket | | browser-custom.js:1:23:1:30 | MySockJS | browser-custom.js:1:23:1:30 | MySockJS | +| browser-custom.js:7:15:7:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | +| browser-custom.js:23:13:23:18 | 'test' | sockjs.js:9:31:9:37 | message | | browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser.js:21:13:21:18 | 'test' | sockjs.js:9:31:9:37 | message | +| client-custom.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:15:32:15:44 | require('ws') | client-custom.js:1:9:1:21 | MyWebSocketWS | +| server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:11:39:11:48 | event.data | +| server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | +| server.js:11:11:11:27 | 'Hi from server!' | client-custom.js:10:37:10:40 | data | | server.js:11:11:11:27 | 'Hi from server!' | client.js:10:37:10:40 | data | +| sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:27:26:27:31 | e.data | +| sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:32:42:32:51 | event.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:25:26:25:31 | e.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:30:42:30:51 | event.data | remoteFlow From 455ce595835c963165d090956574322f5bf6d88b Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 08:59:19 +0200 Subject: [PATCH 067/372] Added test cases with export of an instance. --- .../frameworks/WebSocket/browser-custom.js | 33 ++++++++++++++++++- .../frameworks/WebSocket/browser.js | 2 ++ .../frameworks/WebSocket/client-custom.js | 12 ++++++- .../frameworks/WebSocket/client.js | 5 +-- .../frameworks/WebSocket/server-custom.js | 12 ++++++- .../frameworks/WebSocket/server.js | 5 +-- .../frameworks/WebSocket/test.expected | 8 +++++ 7 files changed, 70 insertions(+), 7 deletions(-) diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index d3a739697d1..c411a90f35a 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -1,4 +1,4 @@ -import { MyWebSocket, MySockJS } from './browser.js'; +import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './browser.js'; (function () { const socket = new MyWebSocket('ws://localhost:9080'); // $ clientSocket @@ -32,3 +32,34 @@ import { MyWebSocket, MySockJS } from './browser.js'; console.log('Using addEventListener ', event.data); }); // $ clientReceive })(); + + +(function () { + myWebSocketInstance.addEventListener('open', function (event) { + myWebSocketInstance.send('Hi from browser!'); // $ MISSING: clientSend + }); + + myWebSocketInstance.addEventListener('message', function (event) { + console.log('Message from server ', event.data); + }); // $ MISSING: clientReceive + + myWebSocketInstance.onmessage = function (event) { + console.log("Message from server 2", event.data) + }; // $ MISSING: clientReceive +})(); + + +(function () { + mySockJSInstance.onopen = function () { + mySockJSInstance.send('test'); // $ MISSING: clientSend + }; + + mySockJSInstance.onmessage = function (e) { + console.log('message', e.data); + mySockJSInstance.close(); + }; // $ MISSING: clientReceive + + mySockJSInstance.addEventListener('message', function (event) { + console.log('Using addEventListener ', event.data); + }); // $ MISSING: clientReceive +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js index 2540abaf3e7..f966879f9f2 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js @@ -33,3 +33,5 @@ export const MyWebSocket = WebSocket; export const MySockJS = SockJS; +export const myWebSocketInstance = new WebSocket('ws://localhost:8080'); // $ clientSocket +export const mySockJSInstance = new SockJS('http://0.0.0.0:9999/echo'); // $ clientSocket diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js index 6aefeb3a07f..9718bd6185c 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js @@ -1,4 +1,4 @@ -const { MyWebSocketWS } = require('./client.js'); +const { MyWebSocketWS, myWebSocketWSInstance } = require('./client.js'); (function () { const ws = new MyWebSocketWS('ws://example.org'); // $ clientSocket @@ -11,3 +11,13 @@ const { MyWebSocketWS } = require('./client.js'); console.log(data); }); // $ clientReceive })(); + +(function () { + myWebSocketWSInstance.on('open', function open() { + myWebSocketWSInstance.send('Hi from client!'); // $ MISSING: clientSend + }); + + myWebSocketWSInstance.on('message', function incoming(data) { + console.log(data); + }); // $ MISSING: clientReceive +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js index 710bf0aa7da..54a200f3379 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js @@ -1,6 +1,6 @@ -(function () { - const WebSocket = require('ws'); +const WebSocket = require('ws'); +(function () { const ws = new WebSocket('ws://example.org'); // $clientSocket ws.on('open', function open() { @@ -13,3 +13,4 @@ })(); module.exports.MyWebSocketWS = require('ws'); +module.exports.myWebSocketWSInstance = new WebSocket('ws://example.org'); // $ clientSocket diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js index 6911d8f8523..63893ba2f5c 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js @@ -1,4 +1,4 @@ -const { MyWebSocketServer } = require('./server.js'); +const { MyWebSocketServer, myWebSocketServerInstance } = require('./server.js'); (function () { const wss = new MyWebSocketServer({ port: 8080 }); @@ -11,3 +11,13 @@ const { MyWebSocketServer } = require('./server.js'); ws.send('Hi from server!'); // $ MISSING: serverSend }); })(); + +(function () { + myWebSocketServerInstance.on('connection', function connection(ws) { // $ MISSING: serverSocket + ws.on('message', function incoming(message) { // $ MISSING: remoteFlow + console.log('received: %s', message); + }); // $ MISSING: serverReceive + + ws.send('Hi from server!'); // $ MISSING: serverSend + }); +})(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server.js index 3e1a408a4a4..a1fd536501e 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/server.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server.js @@ -1,6 +1,6 @@ -(function () { - const WebSocket = require('ws'); +const WebSocket = require('ws'); +(function () { const wss = new WebSocket.Server({ port: 8080 }); wss.on('connection', function connection(ws) { // $serverSocket @@ -13,3 +13,4 @@ })(); module.exports.MyWebSocketServer = require('ws').Server; +module.exports.myWebSocketServerInstance = new WebSocket.Server({ port: 8080 }); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index fb5fe14793c..21e9f1aae64 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -21,11 +21,16 @@ clientSocket | browser-custom.js:21:13:21:52 | new MyS ... /echo') | | browser.js:2:17:2:52 | new Web ... :8080') | | browser.js:19:13:19:50 | new Soc ... /echo') | +| browser.js:36:36:36:71 | new Web ... :8080') | +| browser.js:37:33:37:70 | new Soc ... /echo') | | client-custom.js:4:13:4:49 | new MyW ... e.org') | | client.js:4:13:4:45 | new Web ... e.org') | +| client.js:16:40:16:72 | new Web ... e.org') | flowSteps | browser-custom.js:1:10:1:20 | MyWebSocket | browser-custom.js:1:10:1:20 | MyWebSocket | | browser-custom.js:1:23:1:30 | MySockJS | browser-custom.js:1:23:1:30 | MySockJS | +| browser-custom.js:1:33:1:51 | myWebSocketInstance | browser-custom.js:1:33:1:51 | myWebSocketInstance | +| browser-custom.js:1:54:1:69 | mySockJSInstance | browser-custom.js:1:54:1:69 | mySockJSInstance | | browser-custom.js:7:15:7:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser-custom.js:23:13:23:18 | 'test' | sockjs.js:9:31:9:37 | message | | browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | @@ -33,12 +38,15 @@ flowSteps | client-custom.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:15:32:15:44 | require('ws') | client-custom.js:1:9:1:21 | MyWebSocketWS | +| client.js:16:40:16:72 | new Web ... e.org') | client-custom.js:1:24:1:44 | myWebSo ... nstance | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:11:39:11:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | client-custom.js:10:37:10:40 | data | | server.js:11:11:11:27 | 'Hi from server!' | client.js:10:37:10:40 | data | +| server.js:15:36:15:55 | require('ws').Server | server-custom.js:1:9:1:25 | MyWebSocketServer | +| server.js:16:44:16:79 | new Web ... 8080 }) | server-custom.js:1:28:1:52 | myWebSo ... nstance | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:27:26:27:31 | e.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:32:42:32:51 | event.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:25:26:25:31 | e.data | From 0dbf9512911f4299050816a5894d25742bb7b48e Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 09:12:42 +0200 Subject: [PATCH 068/372] Updated `ClientSocket` and `SendNode` with API graphs. --- .../ql/lib/semmle/javascript/frameworks/WebSocket.qll | 8 ++++---- .../library-tests/frameworks/WebSocket/browser-custom.js | 4 ++-- .../library-tests/frameworks/WebSocket/client-custom.js | 2 +- .../test/library-tests/frameworks/WebSocket/test.expected | 6 ++++++ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index 7437e68bda8..09c9f98e3f0 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -95,10 +95,10 @@ module ClientWebSocket { /** * A client WebSocket instance. */ - class ClientSocket extends EventEmitter::Range, DataFlow::NewNode, ClientRequest::Range { + class ClientSocket extends EventEmitter::Range, API::NewNode, ClientRequest::Range { SocketClass socketClass; - ClientSocket() { this = socketClass.getAnInstantiation() } + ClientSocket() { this = socketClass.getAnInvocation() } /** * Gets the WebSocket library name. @@ -129,10 +129,10 @@ module ClientWebSocket { /** * A message sent from a WebSocket client. */ - class SendNode extends EventDispatch::Range, DataFlow::CallNode { + class SendNode extends EventDispatch::Range, API::CallNode { override ClientSocket emitter; - SendNode() { this = emitter.getAMemberCall("send") } + SendNode() { this = emitter.getReturn().getMember("send").getACall() } override string getChannel() { result = channelName() } diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index c411a90f35a..11765138f55 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -36,7 +36,7 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ (function () { myWebSocketInstance.addEventListener('open', function (event) { - myWebSocketInstance.send('Hi from browser!'); // $ MISSING: clientSend + myWebSocketInstance.send('Hi from browser!'); // $ clientSend }); myWebSocketInstance.addEventListener('message', function (event) { @@ -51,7 +51,7 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ (function () { mySockJSInstance.onopen = function () { - mySockJSInstance.send('test'); // $ MISSING: clientSend + mySockJSInstance.send('test'); // $ clientSend }; mySockJSInstance.onmessage = function (e) { diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js index 9718bd6185c..5d7ac4b564d 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js @@ -14,7 +14,7 @@ const { MyWebSocketWS, myWebSocketWSInstance } = require('./client.js'); (function () { myWebSocketWSInstance.on('open', function open() { - myWebSocketWSInstance.send('Hi from client!'); // $ MISSING: clientSend + myWebSocketWSInstance.send('Hi from client!'); // $ clientSend }); myWebSocketWSInstance.on('message', function incoming(data) { diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 21e9f1aae64..4d7e33f5402 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -12,9 +12,12 @@ clientReceive clientSend | browser-custom.js:7:3:7:33 | socket. ... wser!') | | browser-custom.js:23:3:23:19 | sock.send('test') | +| browser-custom.js:39:9:39:52 | myWebSo ... wser!') | +| browser-custom.js:54:9:54:37 | mySockJ ... 'test') | | browser.js:5:3:5:33 | socket. ... wser!') | | browser.js:21:3:21:19 | sock.send('test') | | client-custom.js:7:3:7:28 | ws.send ... ient!') | +| client-custom.js:17:3:17:47 | myWebSo ... ient!') | | client.js:7:3:7:28 | ws.send ... ient!') | clientSocket | browser-custom.js:4:17:4:54 | new MyW ... :9080') | @@ -33,9 +36,12 @@ flowSteps | browser-custom.js:1:54:1:69 | mySockJSInstance | browser-custom.js:1:54:1:69 | mySockJSInstance | | browser-custom.js:7:15:7:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser-custom.js:23:13:23:18 | 'test' | sockjs.js:9:31:9:37 | message | +| browser-custom.js:39:34:39:51 | 'Hi from browser!' | server.js:7:38:7:44 | message | +| browser-custom.js:54:31:54:36 | 'test' | sockjs.js:9:31:9:37 | message | | browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser.js:21:13:21:18 | 'test' | sockjs.js:9:31:9:37 | message | | client-custom.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | +| client-custom.js:17:30:17:46 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:15:32:15:44 | require('ws') | client-custom.js:1:9:1:21 | MyWebSocketWS | | client.js:16:40:16:72 | new Web ... e.org') | client-custom.js:1:24:1:44 | myWebSo ... nstance | From f9ff92a705307e9b4ed76bb0ac774b9ab117c496 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Fri, 4 Apr 2025 10:13:10 +0200 Subject: [PATCH 069/372] Rust: Expand on type inference tests for associated types --- .../test/library-tests/type-inference/main.rs | 94 +- .../type-inference/type-inference.expected | 1128 +++++++++-------- 2 files changed, 678 insertions(+), 544 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 2a432d50b8d..1a4462d54c4 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -329,9 +329,21 @@ mod function_trait_bounds { } mod trait_associated_type { + #[derive(Debug)] + struct Wrapper { + field: A, + } + + impl Wrapper { + fn unwrap(self) -> A { + self.field // $ fieldof=Wrapper + } + } + trait MyTrait { type AssociatedType; + // MyTrait::m1 fn m1(self) -> Self::AssociatedType; fn m2(self) -> Self::AssociatedType @@ -339,28 +351,96 @@ mod trait_associated_type { Self::AssociatedType: Default, Self: Sized, { + self.m1(); // $ method=MyTrait::m1 Self::AssociatedType::default() } } + trait MyTraitAssoc2 { + type GenericAssociatedType; + + // MyTrait::put + fn put(&self, a: A) -> Self::GenericAssociatedType; + + fn putTwo(&self, a: A, b: A) -> Self::GenericAssociatedType { + self.put(a); // $ method=MyTrait::put + self.put(b) // $ method=MyTrait::put + } + } + #[derive(Debug, Default)] struct S; + #[derive(Debug, Default)] + struct S2; + + #[derive(Debug, Default)] + struct AT; + impl MyTrait for S { - type AssociatedType = S; + type AssociatedType = AT; // S::m1 fn m1(self) -> Self::AssociatedType { - S + AT } } - pub fn f() { - let x = S; - println!("{:?}", x.m1()); // $ method=S::m1 + impl MyTraitAssoc2 for S { + // Associated type with a type parameter + type GenericAssociatedType = Wrapper; - let x = S; - println!("{:?}", x.m2()); // $ method=m2 + // S::put + fn put(&self, a: A) -> Wrapper { + Wrapper { field: a } + } + } + + impl MyTrait for S2 { + // Associated type definition with a type argument + type AssociatedType = Wrapper; + + fn m1(self) -> Self::AssociatedType { + Wrapper { field: self } + } + } + + // NOTE: This implementation is just to make it possible to call `m2` on `S2.` + impl Default for Wrapper { + fn default() -> Self { + Wrapper { field: S2 } + } + } + + // Function that returns an associated type from a trait bound + fn g(thing: T) -> ::AssociatedType { + thing.m1() // $ method=MyTrait::m1 + } + + pub fn f() { + let x1 = S; + // Call to method in `impl` block + println!("{:?}", x1.m1()); // $ method=S::m1 type=x1.m1():AT + + let x2 = S; + // Call to default method in `trait` block + let y = x2.m2(); // $ method=m2 MISSING: type=y:AT + println!("{:?}", y); + + let x3 = S; + // Call to the method in `impl` block + println!("{:?}", x3.put(1).unwrap()); // $ method=S::put method=unwrap + + // Call to default implementation in `trait` block + println!("{:?}", x3.putTwo(2, 3).unwrap()); // $ method=putTwo MISSING: method=unwrap + + let x4 = g(S); // $ MISSING: type=x4:AT + println!("{:?}", x4); + + let x5 = S2; + println!("{:?}", x5.m1()); // $ method=m1 MISSING: type=x5.m1():A.S2 + let x6 = S2; + println!("{:?}", x6.m2()); // $ method=m2 MISSING: type=x6.m2():A.S2 } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index d8164f4be81..94cc8c42a0b 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -328,540 +328,594 @@ inferType | main.rs:327:46:327:47 | y3 | | main.rs:263:5:266:5 | MyThing | | main.rs:327:46:327:47 | y3 | T | main.rs:263:5:266:5 | MyThing | | main.rs:327:46:327:47 | y3 | T.T | main.rs:270:5:271:14 | S2 | -| main.rs:335:15:335:18 | SelfParam | | main.rs:332:5:344:5 | Self [trait MyTrait] | -| main.rs:337:15:337:18 | SelfParam | | main.rs:332:5:344:5 | Self [trait MyTrait] | -| main.rs:353:15:353:18 | SelfParam | | main.rs:346:5:347:13 | S | -| main.rs:353:45:355:9 | { ... } | | main.rs:346:5:347:13 | S | -| main.rs:354:13:354:13 | S | | main.rs:346:5:347:13 | S | -| main.rs:359:13:359:13 | x | | main.rs:346:5:347:13 | S | -| main.rs:359:17:359:17 | S | | main.rs:346:5:347:13 | S | -| main.rs:360:26:360:26 | x | | main.rs:346:5:347:13 | S | -| main.rs:360:26:360:31 | x.m1() | | main.rs:346:5:347:13 | S | -| main.rs:362:13:362:13 | x | | main.rs:346:5:347:13 | S | -| main.rs:362:17:362:17 | S | | main.rs:346:5:347:13 | S | -| main.rs:363:26:363:26 | x | | main.rs:346:5:347:13 | S | -| main.rs:380:15:380:18 | SelfParam | | main.rs:368:5:372:5 | MyEnum | -| main.rs:380:15:380:18 | SelfParam | A | main.rs:379:10:379:10 | T | -| main.rs:380:26:385:9 | { ... } | | main.rs:379:10:379:10 | T | -| main.rs:381:13:384:13 | match self { ... } | | main.rs:379:10:379:10 | T | -| main.rs:381:19:381:22 | self | | main.rs:368:5:372:5 | MyEnum | -| main.rs:381:19:381:22 | self | A | main.rs:379:10:379:10 | T | -| main.rs:382:28:382:28 | a | | main.rs:379:10:379:10 | T | -| main.rs:382:34:382:34 | a | | main.rs:379:10:379:10 | T | -| main.rs:383:30:383:30 | a | | main.rs:379:10:379:10 | T | -| main.rs:383:37:383:37 | a | | main.rs:379:10:379:10 | T | -| main.rs:389:13:389:13 | x | | main.rs:368:5:372:5 | MyEnum | -| main.rs:389:13:389:13 | x | A | main.rs:374:5:375:14 | S1 | -| main.rs:389:17:389:30 | ...::C1(...) | | main.rs:368:5:372:5 | MyEnum | -| main.rs:389:17:389:30 | ...::C1(...) | A | main.rs:374:5:375:14 | S1 | -| main.rs:389:28:389:29 | S1 | | main.rs:374:5:375:14 | S1 | -| main.rs:390:13:390:13 | y | | main.rs:368:5:372:5 | MyEnum | -| main.rs:390:13:390:13 | y | A | main.rs:376:5:377:14 | S2 | -| main.rs:390:17:390:36 | ...::C2 {...} | | main.rs:368:5:372:5 | MyEnum | -| main.rs:390:17:390:36 | ...::C2 {...} | A | main.rs:376:5:377:14 | S2 | -| main.rs:390:33:390:34 | S2 | | main.rs:376:5:377:14 | S2 | -| main.rs:392:26:392:26 | x | | main.rs:368:5:372:5 | MyEnum | -| main.rs:392:26:392:26 | x | A | main.rs:374:5:375:14 | S1 | -| main.rs:392:26:392:31 | x.m1() | | main.rs:374:5:375:14 | S1 | -| main.rs:393:26:393:26 | y | | main.rs:368:5:372:5 | MyEnum | -| main.rs:393:26:393:26 | y | A | main.rs:376:5:377:14 | S2 | -| main.rs:393:26:393:31 | y.m1() | | main.rs:376:5:377:14 | S2 | -| main.rs:415:15:415:18 | SelfParam | | main.rs:413:5:416:5 | Self [trait MyTrait1] | -| main.rs:419:15:419:18 | SelfParam | | main.rs:418:5:429:5 | Self [trait MyTrait2] | -| main.rs:422:9:428:9 | { ... } | | main.rs:418:20:418:22 | Tr2 | -| main.rs:423:13:427:13 | if ... {...} else {...} | | main.rs:418:20:418:22 | Tr2 | -| main.rs:423:26:425:13 | { ... } | | main.rs:418:20:418:22 | Tr2 | -| main.rs:424:17:424:20 | self | | main.rs:418:5:429:5 | Self [trait MyTrait2] | -| main.rs:424:17:424:25 | self.m1() | | main.rs:418:20:418:22 | Tr2 | -| main.rs:425:20:427:13 | { ... } | | main.rs:418:20:418:22 | Tr2 | -| main.rs:426:17:426:30 | ...::m1(...) | | main.rs:418:20:418:22 | Tr2 | -| main.rs:426:26:426:29 | self | | main.rs:418:5:429:5 | Self [trait MyTrait2] | -| main.rs:432:15:432:18 | SelfParam | | main.rs:431:5:442:5 | Self [trait MyTrait3] | -| main.rs:435:9:441:9 | { ... } | | main.rs:431:20:431:22 | Tr3 | -| main.rs:436:13:440:13 | if ... {...} else {...} | | main.rs:431:20:431:22 | Tr3 | -| main.rs:436:26:438:13 | { ... } | | main.rs:431:20:431:22 | Tr3 | -| main.rs:437:17:437:20 | self | | main.rs:431:5:442:5 | Self [trait MyTrait3] | -| main.rs:437:17:437:25 | self.m2() | | main.rs:398:5:401:5 | MyThing | -| main.rs:437:17:437:25 | self.m2() | A | main.rs:431:20:431:22 | Tr3 | -| main.rs:437:17:437:27 | ... .a | | main.rs:431:20:431:22 | Tr3 | -| main.rs:438:20:440:13 | { ... } | | main.rs:431:20:431:22 | Tr3 | -| main.rs:439:17:439:30 | ...::m2(...) | | main.rs:398:5:401:5 | MyThing | -| main.rs:439:17:439:30 | ...::m2(...) | A | main.rs:431:20:431:22 | Tr3 | -| main.rs:439:17:439:32 | ... .a | | main.rs:431:20:431:22 | Tr3 | -| main.rs:439:26:439:29 | self | | main.rs:431:5:442:5 | Self [trait MyTrait3] | -| main.rs:446:15:446:18 | SelfParam | | main.rs:398:5:401:5 | MyThing | -| main.rs:446:15:446:18 | SelfParam | A | main.rs:444:10:444:10 | T | -| main.rs:446:26:448:9 | { ... } | | main.rs:444:10:444:10 | T | -| main.rs:447:13:447:16 | self | | main.rs:398:5:401:5 | MyThing | -| main.rs:447:13:447:16 | self | A | main.rs:444:10:444:10 | T | -| main.rs:447:13:447:18 | self.a | | main.rs:444:10:444:10 | T | -| main.rs:455:15:455:18 | SelfParam | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:455:15:455:18 | SelfParam | A | main.rs:453:10:453:10 | T | -| main.rs:455:35:457:9 | { ... } | | main.rs:398:5:401:5 | MyThing | -| main.rs:455:35:457:9 | { ... } | A | main.rs:453:10:453:10 | T | -| main.rs:456:13:456:33 | MyThing {...} | | main.rs:398:5:401:5 | MyThing | -| main.rs:456:13:456:33 | MyThing {...} | A | main.rs:453:10:453:10 | T | -| main.rs:456:26:456:29 | self | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:456:26:456:29 | self | A | main.rs:453:10:453:10 | T | -| main.rs:456:26:456:31 | self.a | | main.rs:453:10:453:10 | T | -| main.rs:465:13:465:13 | x | | main.rs:398:5:401:5 | MyThing | -| main.rs:465:13:465:13 | x | A | main.rs:408:5:409:14 | S1 | -| main.rs:465:17:465:33 | MyThing {...} | | main.rs:398:5:401:5 | MyThing | -| main.rs:465:17:465:33 | MyThing {...} | A | main.rs:408:5:409:14 | S1 | -| main.rs:465:30:465:31 | S1 | | main.rs:408:5:409:14 | S1 | -| main.rs:466:13:466:13 | y | | main.rs:398:5:401:5 | MyThing | -| main.rs:466:13:466:13 | y | A | main.rs:410:5:411:14 | S2 | -| main.rs:466:17:466:33 | MyThing {...} | | main.rs:398:5:401:5 | MyThing | -| main.rs:466:17:466:33 | MyThing {...} | A | main.rs:410:5:411:14 | S2 | -| main.rs:466:30:466:31 | S2 | | main.rs:410:5:411:14 | S2 | -| main.rs:468:26:468:26 | x | | main.rs:398:5:401:5 | MyThing | -| main.rs:468:26:468:26 | x | A | main.rs:408:5:409:14 | S1 | -| main.rs:468:26:468:31 | x.m1() | | main.rs:408:5:409:14 | S1 | -| main.rs:469:26:469:26 | y | | main.rs:398:5:401:5 | MyThing | -| main.rs:469:26:469:26 | y | A | main.rs:410:5:411:14 | S2 | -| main.rs:469:26:469:31 | y.m1() | | main.rs:410:5:411:14 | S2 | -| main.rs:471:13:471:13 | x | | main.rs:398:5:401:5 | MyThing | -| main.rs:471:13:471:13 | x | A | main.rs:408:5:409:14 | S1 | -| main.rs:471:17:471:33 | MyThing {...} | | main.rs:398:5:401:5 | MyThing | -| main.rs:471:17:471:33 | MyThing {...} | A | main.rs:408:5:409:14 | S1 | -| main.rs:471:30:471:31 | S1 | | main.rs:408:5:409:14 | S1 | -| main.rs:472:13:472:13 | y | | main.rs:398:5:401:5 | MyThing | -| main.rs:472:13:472:13 | y | A | main.rs:410:5:411:14 | S2 | -| main.rs:472:17:472:33 | MyThing {...} | | main.rs:398:5:401:5 | MyThing | -| main.rs:472:17:472:33 | MyThing {...} | A | main.rs:410:5:411:14 | S2 | -| main.rs:472:30:472:31 | S2 | | main.rs:410:5:411:14 | S2 | -| main.rs:474:26:474:26 | x | | main.rs:398:5:401:5 | MyThing | -| main.rs:474:26:474:26 | x | A | main.rs:408:5:409:14 | S1 | -| main.rs:474:26:474:31 | x.m2() | | main.rs:408:5:409:14 | S1 | -| main.rs:475:26:475:26 | y | | main.rs:398:5:401:5 | MyThing | -| main.rs:475:26:475:26 | y | A | main.rs:410:5:411:14 | S2 | -| main.rs:475:26:475:31 | y.m2() | | main.rs:410:5:411:14 | S2 | -| main.rs:477:13:477:13 | x | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:477:13:477:13 | x | A | main.rs:408:5:409:14 | S1 | -| main.rs:477:17:477:34 | MyThing2 {...} | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:477:17:477:34 | MyThing2 {...} | A | main.rs:408:5:409:14 | S1 | -| main.rs:477:31:477:32 | S1 | | main.rs:408:5:409:14 | S1 | -| main.rs:478:13:478:13 | y | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:478:13:478:13 | y | A | main.rs:410:5:411:14 | S2 | -| main.rs:478:17:478:34 | MyThing2 {...} | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:478:17:478:34 | MyThing2 {...} | A | main.rs:410:5:411:14 | S2 | -| main.rs:478:31:478:32 | S2 | | main.rs:410:5:411:14 | S2 | -| main.rs:480:26:480:26 | x | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:480:26:480:26 | x | A | main.rs:408:5:409:14 | S1 | -| main.rs:480:26:480:31 | x.m3() | | main.rs:408:5:409:14 | S1 | -| main.rs:481:26:481:26 | y | | main.rs:403:5:406:5 | MyThing2 | -| main.rs:481:26:481:26 | y | A | main.rs:410:5:411:14 | S2 | -| main.rs:481:26:481:31 | y.m3() | | main.rs:410:5:411:14 | S2 | -| main.rs:499:22:499:22 | x | | file://:0:0:0:0 | & | -| main.rs:499:22:499:22 | x | &T | main.rs:499:11:499:19 | T | -| main.rs:499:35:501:5 | { ... } | | file://:0:0:0:0 | & | -| main.rs:499:35:501:5 | { ... } | &T | main.rs:499:11:499:19 | T | -| main.rs:500:9:500:9 | x | | file://:0:0:0:0 | & | -| main.rs:500:9:500:9 | x | &T | main.rs:499:11:499:19 | T | -| main.rs:504:17:504:20 | SelfParam | | main.rs:489:5:490:14 | S1 | -| main.rs:504:29:506:9 | { ... } | | main.rs:492:5:493:14 | S2 | -| main.rs:505:13:505:14 | S2 | | main.rs:492:5:493:14 | S2 | -| main.rs:509:21:509:21 | x | | main.rs:509:13:509:14 | T1 | -| main.rs:512:5:514:5 | { ... } | | main.rs:509:17:509:18 | T2 | -| main.rs:513:9:513:9 | x | | main.rs:509:13:509:14 | T1 | -| main.rs:513:9:513:16 | x.into() | | main.rs:509:17:509:18 | T2 | -| main.rs:517:13:517:13 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:517:17:517:18 | S1 | | main.rs:489:5:490:14 | S1 | -| main.rs:518:26:518:31 | id(...) | | file://:0:0:0:0 | & | -| main.rs:518:26:518:31 | id(...) | &T | main.rs:489:5:490:14 | S1 | -| main.rs:518:29:518:30 | &x | | file://:0:0:0:0 | & | -| main.rs:518:29:518:30 | &x | &T | main.rs:489:5:490:14 | S1 | -| main.rs:518:30:518:30 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:520:13:520:13 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:520:17:520:18 | S1 | | main.rs:489:5:490:14 | S1 | -| main.rs:521:26:521:37 | id::<...>(...) | | file://:0:0:0:0 | & | -| main.rs:521:26:521:37 | id::<...>(...) | &T | main.rs:489:5:490:14 | S1 | -| main.rs:521:35:521:36 | &x | | file://:0:0:0:0 | & | -| main.rs:521:35:521:36 | &x | &T | main.rs:489:5:490:14 | S1 | -| main.rs:521:36:521:36 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:523:13:523:13 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:523:17:523:18 | S1 | | main.rs:489:5:490:14 | S1 | -| main.rs:524:26:524:44 | id::<...>(...) | | file://:0:0:0:0 | & | -| main.rs:524:26:524:44 | id::<...>(...) | &T | main.rs:489:5:490:14 | S1 | -| main.rs:524:42:524:43 | &x | | file://:0:0:0:0 | & | -| main.rs:524:42:524:43 | &x | &T | main.rs:489:5:490:14 | S1 | -| main.rs:524:43:524:43 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:526:13:526:13 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:526:17:526:18 | S1 | | main.rs:489:5:490:14 | S1 | -| main.rs:527:9:527:25 | into::<...>(...) | | main.rs:492:5:493:14 | S2 | -| main.rs:527:24:527:24 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:529:13:529:13 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:529:17:529:18 | S1 | | main.rs:489:5:490:14 | S1 | -| main.rs:530:13:530:13 | y | | main.rs:492:5:493:14 | S2 | -| main.rs:530:21:530:27 | into(...) | | main.rs:492:5:493:14 | S2 | -| main.rs:530:26:530:26 | x | | main.rs:489:5:490:14 | S1 | -| main.rs:560:13:560:14 | p1 | | main.rs:535:5:541:5 | PairOption | -| main.rs:560:13:560:14 | p1 | Fst | main.rs:543:5:544:14 | S1 | -| main.rs:560:13:560:14 | p1 | Snd | main.rs:546:5:547:14 | S2 | -| main.rs:560:26:560:53 | ...::PairBoth(...) | | main.rs:535:5:541:5 | PairOption | -| main.rs:560:26:560:53 | ...::PairBoth(...) | Fst | main.rs:543:5:544:14 | S1 | -| main.rs:560:26:560:53 | ...::PairBoth(...) | Snd | main.rs:546:5:547:14 | S2 | -| main.rs:560:47:560:48 | S1 | | main.rs:543:5:544:14 | S1 | -| main.rs:560:51:560:52 | S2 | | main.rs:546:5:547:14 | S2 | -| main.rs:561:26:561:27 | p1 | | main.rs:535:5:541:5 | PairOption | -| main.rs:561:26:561:27 | p1 | Fst | main.rs:543:5:544:14 | S1 | -| main.rs:561:26:561:27 | p1 | Snd | main.rs:546:5:547:14 | S2 | -| main.rs:564:13:564:14 | p2 | | main.rs:535:5:541:5 | PairOption | -| main.rs:564:26:564:47 | ...::PairNone(...) | | main.rs:535:5:541:5 | PairOption | -| main.rs:565:26:565:27 | p2 | | main.rs:535:5:541:5 | PairOption | -| main.rs:568:13:568:14 | p3 | | main.rs:535:5:541:5 | PairOption | -| main.rs:568:13:568:14 | p3 | Snd | main.rs:549:5:550:14 | S3 | -| main.rs:568:34:568:56 | ...::PairSnd(...) | | main.rs:535:5:541:5 | PairOption | -| main.rs:568:34:568:56 | ...::PairSnd(...) | Snd | main.rs:549:5:550:14 | S3 | -| main.rs:568:54:568:55 | S3 | | main.rs:549:5:550:14 | S3 | -| main.rs:569:26:569:27 | p3 | | main.rs:535:5:541:5 | PairOption | -| main.rs:569:26:569:27 | p3 | Snd | main.rs:549:5:550:14 | S3 | -| main.rs:572:13:572:14 | p3 | | main.rs:535:5:541:5 | PairOption | -| main.rs:572:13:572:14 | p3 | Fst | main.rs:549:5:550:14 | S3 | -| main.rs:572:35:572:56 | ...::PairNone(...) | | main.rs:535:5:541:5 | PairOption | -| main.rs:572:35:572:56 | ...::PairNone(...) | Fst | main.rs:549:5:550:14 | S3 | -| main.rs:573:26:573:27 | p3 | | main.rs:535:5:541:5 | PairOption | -| main.rs:573:26:573:27 | p3 | Fst | main.rs:549:5:550:14 | S3 | -| main.rs:586:16:586:24 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:586:16:586:24 | SelfParam | &T | main.rs:584:5:591:5 | Self [trait MyTrait] | -| main.rs:586:27:586:31 | value | | main.rs:584:19:584:19 | S | -| main.rs:588:21:588:29 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:588:21:588:29 | SelfParam | &T | main.rs:584:5:591:5 | Self [trait MyTrait] | -| main.rs:588:32:588:36 | value | | main.rs:584:19:584:19 | S | -| main.rs:589:13:589:16 | self | | file://:0:0:0:0 | & | -| main.rs:589:13:589:16 | self | &T | main.rs:584:5:591:5 | Self [trait MyTrait] | -| main.rs:589:22:589:26 | value | | main.rs:584:19:584:19 | S | -| main.rs:595:16:595:24 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:595:16:595:24 | SelfParam | &T | main.rs:578:5:582:5 | MyOption | -| main.rs:595:16:595:24 | SelfParam | &T.T | main.rs:593:10:593:10 | T | -| main.rs:595:27:595:31 | value | | main.rs:593:10:593:10 | T | -| main.rs:599:26:601:9 | { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:599:26:601:9 | { ... } | T | main.rs:598:10:598:10 | T | -| main.rs:600:13:600:30 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:600:13:600:30 | ...::MyNone(...) | T | main.rs:598:10:598:10 | T | -| main.rs:605:20:605:23 | SelfParam | | main.rs:578:5:582:5 | MyOption | -| main.rs:605:20:605:23 | SelfParam | T | main.rs:578:5:582:5 | MyOption | -| main.rs:605:20:605:23 | SelfParam | T.T | main.rs:604:10:604:10 | T | -| main.rs:605:41:610:9 | { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:605:41:610:9 | { ... } | T | main.rs:604:10:604:10 | T | -| main.rs:606:13:609:13 | match self { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:606:13:609:13 | match self { ... } | T | main.rs:604:10:604:10 | T | -| main.rs:606:19:606:22 | self | | main.rs:578:5:582:5 | MyOption | -| main.rs:606:19:606:22 | self | T | main.rs:578:5:582:5 | MyOption | -| main.rs:606:19:606:22 | self | T.T | main.rs:604:10:604:10 | T | -| main.rs:607:39:607:56 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:607:39:607:56 | ...::MyNone(...) | T | main.rs:604:10:604:10 | T | -| main.rs:608:34:608:34 | x | | main.rs:578:5:582:5 | MyOption | -| main.rs:608:34:608:34 | x | T | main.rs:604:10:604:10 | T | -| main.rs:608:40:608:40 | x | | main.rs:578:5:582:5 | MyOption | -| main.rs:608:40:608:40 | x | T | main.rs:604:10:604:10 | T | -| main.rs:617:13:617:14 | x1 | | main.rs:578:5:582:5 | MyOption | -| main.rs:617:18:617:37 | ...::new(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:618:26:618:27 | x1 | | main.rs:578:5:582:5 | MyOption | -| main.rs:620:13:620:18 | mut x2 | | main.rs:578:5:582:5 | MyOption | -| main.rs:620:13:620:18 | mut x2 | T | main.rs:613:5:614:13 | S | -| main.rs:620:22:620:36 | ...::new(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:620:22:620:36 | ...::new(...) | T | main.rs:613:5:614:13 | S | -| main.rs:621:9:621:10 | x2 | | main.rs:578:5:582:5 | MyOption | -| main.rs:621:9:621:10 | x2 | T | main.rs:613:5:614:13 | S | -| main.rs:621:16:621:16 | S | | main.rs:613:5:614:13 | S | -| main.rs:622:26:622:27 | x2 | | main.rs:578:5:582:5 | MyOption | -| main.rs:622:26:622:27 | x2 | T | main.rs:613:5:614:13 | S | -| main.rs:624:13:624:18 | mut x3 | | main.rs:578:5:582:5 | MyOption | -| main.rs:624:22:624:36 | ...::new(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:625:9:625:10 | x3 | | main.rs:578:5:582:5 | MyOption | -| main.rs:625:21:625:21 | S | | main.rs:613:5:614:13 | S | -| main.rs:626:26:626:27 | x3 | | main.rs:578:5:582:5 | MyOption | -| main.rs:628:13:628:18 | mut x4 | | main.rs:578:5:582:5 | MyOption | -| main.rs:628:13:628:18 | mut x4 | T | main.rs:613:5:614:13 | S | -| main.rs:628:22:628:36 | ...::new(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:628:22:628:36 | ...::new(...) | T | main.rs:613:5:614:13 | S | -| main.rs:629:23:629:29 | &mut x4 | | file://:0:0:0:0 | & | -| main.rs:629:23:629:29 | &mut x4 | &T | main.rs:578:5:582:5 | MyOption | -| main.rs:629:23:629:29 | &mut x4 | &T.T | main.rs:613:5:614:13 | S | -| main.rs:629:28:629:29 | x4 | | main.rs:578:5:582:5 | MyOption | -| main.rs:629:28:629:29 | x4 | T | main.rs:613:5:614:13 | S | -| main.rs:629:32:629:32 | S | | main.rs:613:5:614:13 | S | -| main.rs:630:26:630:27 | x4 | | main.rs:578:5:582:5 | MyOption | -| main.rs:630:26:630:27 | x4 | T | main.rs:613:5:614:13 | S | -| main.rs:632:13:632:14 | x5 | | main.rs:578:5:582:5 | MyOption | -| main.rs:632:13:632:14 | x5 | T | main.rs:578:5:582:5 | MyOption | -| main.rs:632:13:632:14 | x5 | T.T | main.rs:613:5:614:13 | S | -| main.rs:632:18:632:58 | ...::MySome(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:632:18:632:58 | ...::MySome(...) | T | main.rs:578:5:582:5 | MyOption | -| main.rs:632:18:632:58 | ...::MySome(...) | T.T | main.rs:613:5:614:13 | S | -| main.rs:632:35:632:57 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:632:35:632:57 | ...::MyNone(...) | T | main.rs:613:5:614:13 | S | -| main.rs:633:26:633:27 | x5 | | main.rs:578:5:582:5 | MyOption | -| main.rs:633:26:633:27 | x5 | T | main.rs:578:5:582:5 | MyOption | -| main.rs:633:26:633:27 | x5 | T.T | main.rs:613:5:614:13 | S | -| main.rs:635:13:635:14 | x6 | | main.rs:578:5:582:5 | MyOption | -| main.rs:635:13:635:14 | x6 | T | main.rs:578:5:582:5 | MyOption | -| main.rs:635:13:635:14 | x6 | T.T | main.rs:613:5:614:13 | S | -| main.rs:635:18:635:58 | ...::MySome(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:635:18:635:58 | ...::MySome(...) | T | main.rs:578:5:582:5 | MyOption | -| main.rs:635:18:635:58 | ...::MySome(...) | T.T | main.rs:613:5:614:13 | S | -| main.rs:635:35:635:57 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:635:35:635:57 | ...::MyNone(...) | T | main.rs:613:5:614:13 | S | -| main.rs:636:26:636:61 | ...::flatten(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:636:26:636:61 | ...::flatten(...) | T | main.rs:613:5:614:13 | S | -| main.rs:636:59:636:60 | x6 | | main.rs:578:5:582:5 | MyOption | -| main.rs:636:59:636:60 | x6 | T | main.rs:578:5:582:5 | MyOption | -| main.rs:636:59:636:60 | x6 | T.T | main.rs:613:5:614:13 | S | -| main.rs:638:13:638:19 | from_if | | main.rs:578:5:582:5 | MyOption | -| main.rs:638:13:638:19 | from_if | T | main.rs:613:5:614:13 | S | -| main.rs:638:23:642:9 | if ... {...} else {...} | | main.rs:578:5:582:5 | MyOption | -| main.rs:638:23:642:9 | if ... {...} else {...} | T | main.rs:613:5:614:13 | S | -| main.rs:638:36:640:9 | { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:638:36:640:9 | { ... } | T | main.rs:613:5:614:13 | S | -| main.rs:639:13:639:30 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:639:13:639:30 | ...::MyNone(...) | T | main.rs:613:5:614:13 | S | -| main.rs:640:16:642:9 | { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:640:16:642:9 | { ... } | T | main.rs:613:5:614:13 | S | -| main.rs:641:13:641:31 | ...::MySome(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:641:13:641:31 | ...::MySome(...) | T | main.rs:613:5:614:13 | S | -| main.rs:641:30:641:30 | S | | main.rs:613:5:614:13 | S | -| main.rs:643:26:643:32 | from_if | | main.rs:578:5:582:5 | MyOption | -| main.rs:643:26:643:32 | from_if | T | main.rs:613:5:614:13 | S | -| main.rs:645:13:645:22 | from_match | | main.rs:578:5:582:5 | MyOption | -| main.rs:645:13:645:22 | from_match | T | main.rs:613:5:614:13 | S | -| main.rs:645:26:648:9 | match ... { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:645:26:648:9 | match ... { ... } | T | main.rs:613:5:614:13 | S | -| main.rs:646:21:646:38 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:646:21:646:38 | ...::MyNone(...) | T | main.rs:613:5:614:13 | S | -| main.rs:647:22:647:40 | ...::MySome(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:647:22:647:40 | ...::MySome(...) | T | main.rs:613:5:614:13 | S | -| main.rs:647:39:647:39 | S | | main.rs:613:5:614:13 | S | -| main.rs:649:26:649:35 | from_match | | main.rs:578:5:582:5 | MyOption | -| main.rs:649:26:649:35 | from_match | T | main.rs:613:5:614:13 | S | -| main.rs:651:13:651:21 | from_loop | | main.rs:578:5:582:5 | MyOption | -| main.rs:651:13:651:21 | from_loop | T | main.rs:613:5:614:13 | S | -| main.rs:651:25:656:9 | loop { ... } | | main.rs:578:5:582:5 | MyOption | -| main.rs:651:25:656:9 | loop { ... } | T | main.rs:613:5:614:13 | S | -| main.rs:653:23:653:40 | ...::MyNone(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:653:23:653:40 | ...::MyNone(...) | T | main.rs:613:5:614:13 | S | -| main.rs:655:19:655:37 | ...::MySome(...) | | main.rs:578:5:582:5 | MyOption | -| main.rs:655:19:655:37 | ...::MySome(...) | T | main.rs:613:5:614:13 | S | -| main.rs:655:36:655:36 | S | | main.rs:613:5:614:13 | S | -| main.rs:657:26:657:34 | from_loop | | main.rs:578:5:582:5 | MyOption | -| main.rs:657:26:657:34 | from_loop | T | main.rs:613:5:614:13 | S | -| main.rs:670:15:670:18 | SelfParam | | main.rs:663:5:664:19 | S | -| main.rs:670:15:670:18 | SelfParam | T | main.rs:669:10:669:10 | T | -| main.rs:670:26:672:9 | { ... } | | main.rs:669:10:669:10 | T | -| main.rs:671:13:671:16 | self | | main.rs:663:5:664:19 | S | -| main.rs:671:13:671:16 | self | T | main.rs:669:10:669:10 | T | -| main.rs:671:13:671:18 | self.0 | | main.rs:669:10:669:10 | T | -| main.rs:674:15:674:19 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:674:15:674:19 | SelfParam | &T | main.rs:663:5:664:19 | S | -| main.rs:674:15:674:19 | SelfParam | &T.T | main.rs:669:10:669:10 | T | -| main.rs:674:28:676:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:674:28:676:9 | { ... } | &T | main.rs:669:10:669:10 | T | -| main.rs:675:13:675:19 | &... | | file://:0:0:0:0 | & | -| main.rs:675:13:675:19 | &... | &T | main.rs:669:10:669:10 | T | -| main.rs:675:14:675:17 | self | | file://:0:0:0:0 | & | -| main.rs:675:14:675:17 | self | &T | main.rs:663:5:664:19 | S | -| main.rs:675:14:675:17 | self | &T.T | main.rs:669:10:669:10 | T | -| main.rs:675:14:675:19 | self.0 | | main.rs:669:10:669:10 | T | -| main.rs:678:15:678:25 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:678:15:678:25 | SelfParam | &T | main.rs:663:5:664:19 | S | -| main.rs:678:15:678:25 | SelfParam | &T.T | main.rs:669:10:669:10 | T | -| main.rs:678:34:680:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:678:34:680:9 | { ... } | &T | main.rs:669:10:669:10 | T | -| main.rs:679:13:679:19 | &... | | file://:0:0:0:0 | & | -| main.rs:679:13:679:19 | &... | &T | main.rs:669:10:669:10 | T | -| main.rs:679:14:679:17 | self | | file://:0:0:0:0 | & | -| main.rs:679:14:679:17 | self | &T | main.rs:663:5:664:19 | S | -| main.rs:679:14:679:17 | self | &T.T | main.rs:669:10:669:10 | T | -| main.rs:679:14:679:19 | self.0 | | main.rs:669:10:669:10 | T | -| main.rs:684:13:684:14 | x1 | | main.rs:663:5:664:19 | S | -| main.rs:684:13:684:14 | x1 | T | main.rs:666:5:667:14 | S2 | -| main.rs:684:18:684:22 | S(...) | | main.rs:663:5:664:19 | S | -| main.rs:684:18:684:22 | S(...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:684:20:684:21 | S2 | | main.rs:666:5:667:14 | S2 | -| main.rs:685:26:685:27 | x1 | | main.rs:663:5:664:19 | S | -| main.rs:685:26:685:27 | x1 | T | main.rs:666:5:667:14 | S2 | -| main.rs:685:26:685:32 | x1.m1() | | main.rs:666:5:667:14 | S2 | -| main.rs:687:13:687:14 | x2 | | main.rs:663:5:664:19 | S | -| main.rs:687:13:687:14 | x2 | T | main.rs:666:5:667:14 | S2 | -| main.rs:687:18:687:22 | S(...) | | main.rs:663:5:664:19 | S | -| main.rs:687:18:687:22 | S(...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:687:20:687:21 | S2 | | main.rs:666:5:667:14 | S2 | -| main.rs:689:26:689:27 | x2 | | main.rs:663:5:664:19 | S | -| main.rs:689:26:689:27 | x2 | T | main.rs:666:5:667:14 | S2 | -| main.rs:689:26:689:32 | x2.m2() | | file://:0:0:0:0 | & | -| main.rs:689:26:689:32 | x2.m2() | &T | main.rs:666:5:667:14 | S2 | -| main.rs:690:26:690:27 | x2 | | main.rs:663:5:664:19 | S | -| main.rs:690:26:690:27 | x2 | T | main.rs:666:5:667:14 | S2 | -| main.rs:690:26:690:32 | x2.m3() | | file://:0:0:0:0 | & | -| main.rs:690:26:690:32 | x2.m3() | &T | main.rs:666:5:667:14 | S2 | -| main.rs:692:13:692:14 | x3 | | main.rs:663:5:664:19 | S | -| main.rs:692:13:692:14 | x3 | T | main.rs:666:5:667:14 | S2 | -| main.rs:692:18:692:22 | S(...) | | main.rs:663:5:664:19 | S | -| main.rs:692:18:692:22 | S(...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:692:20:692:21 | S2 | | main.rs:666:5:667:14 | S2 | -| main.rs:694:26:694:41 | ...::m2(...) | | file://:0:0:0:0 | & | -| main.rs:694:26:694:41 | ...::m2(...) | &T | main.rs:666:5:667:14 | S2 | -| main.rs:694:38:694:40 | &x3 | | file://:0:0:0:0 | & | -| main.rs:694:38:694:40 | &x3 | &T | main.rs:663:5:664:19 | S | -| main.rs:694:38:694:40 | &x3 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:694:39:694:40 | x3 | | main.rs:663:5:664:19 | S | -| main.rs:694:39:694:40 | x3 | T | main.rs:666:5:667:14 | S2 | -| main.rs:695:26:695:41 | ...::m3(...) | | file://:0:0:0:0 | & | -| main.rs:695:26:695:41 | ...::m3(...) | &T | main.rs:666:5:667:14 | S2 | -| main.rs:695:38:695:40 | &x3 | | file://:0:0:0:0 | & | -| main.rs:695:38:695:40 | &x3 | &T | main.rs:663:5:664:19 | S | -| main.rs:695:38:695:40 | &x3 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:695:39:695:40 | x3 | | main.rs:663:5:664:19 | S | -| main.rs:695:39:695:40 | x3 | T | main.rs:666:5:667:14 | S2 | -| main.rs:697:13:697:14 | x4 | | file://:0:0:0:0 | & | -| main.rs:697:13:697:14 | x4 | &T | main.rs:663:5:664:19 | S | -| main.rs:697:13:697:14 | x4 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:697:18:697:23 | &... | | file://:0:0:0:0 | & | -| main.rs:697:18:697:23 | &... | &T | main.rs:663:5:664:19 | S | -| main.rs:697:18:697:23 | &... | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:697:19:697:23 | S(...) | | main.rs:663:5:664:19 | S | -| main.rs:697:19:697:23 | S(...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:697:21:697:22 | S2 | | main.rs:666:5:667:14 | S2 | -| main.rs:699:26:699:27 | x4 | | file://:0:0:0:0 | & | -| main.rs:699:26:699:27 | x4 | &T | main.rs:663:5:664:19 | S | -| main.rs:699:26:699:27 | x4 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:699:26:699:32 | x4.m2() | | file://:0:0:0:0 | & | -| main.rs:699:26:699:32 | x4.m2() | &T | main.rs:666:5:667:14 | S2 | -| main.rs:700:26:700:27 | x4 | | file://:0:0:0:0 | & | -| main.rs:700:26:700:27 | x4 | &T | main.rs:663:5:664:19 | S | -| main.rs:700:26:700:27 | x4 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:700:26:700:32 | x4.m3() | | file://:0:0:0:0 | & | -| main.rs:700:26:700:32 | x4.m3() | &T | main.rs:666:5:667:14 | S2 | -| main.rs:702:13:702:14 | x5 | | file://:0:0:0:0 | & | -| main.rs:702:13:702:14 | x5 | &T | main.rs:663:5:664:19 | S | -| main.rs:702:13:702:14 | x5 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:702:18:702:23 | &... | | file://:0:0:0:0 | & | -| main.rs:702:18:702:23 | &... | &T | main.rs:663:5:664:19 | S | -| main.rs:702:18:702:23 | &... | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:702:19:702:23 | S(...) | | main.rs:663:5:664:19 | S | -| main.rs:702:19:702:23 | S(...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:702:21:702:22 | S2 | | main.rs:666:5:667:14 | S2 | -| main.rs:704:26:704:27 | x5 | | file://:0:0:0:0 | & | -| main.rs:704:26:704:27 | x5 | &T | main.rs:663:5:664:19 | S | -| main.rs:704:26:704:27 | x5 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:704:26:704:32 | x5.m1() | | main.rs:666:5:667:14 | S2 | -| main.rs:705:26:705:27 | x5 | | file://:0:0:0:0 | & | -| main.rs:705:26:705:27 | x5 | &T | main.rs:663:5:664:19 | S | -| main.rs:705:26:705:27 | x5 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:705:26:705:29 | x5.0 | | main.rs:666:5:667:14 | S2 | -| main.rs:707:13:707:14 | x6 | | file://:0:0:0:0 | & | -| main.rs:707:13:707:14 | x6 | &T | main.rs:663:5:664:19 | S | -| main.rs:707:13:707:14 | x6 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:707:18:707:23 | &... | | file://:0:0:0:0 | & | -| main.rs:707:18:707:23 | &... | &T | main.rs:663:5:664:19 | S | -| main.rs:707:18:707:23 | &... | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:707:19:707:23 | S(...) | | main.rs:663:5:664:19 | S | -| main.rs:707:19:707:23 | S(...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:707:21:707:22 | S2 | | main.rs:666:5:667:14 | S2 | -| main.rs:709:26:709:30 | (...) | | main.rs:663:5:664:19 | S | -| main.rs:709:26:709:30 | (...) | T | main.rs:666:5:667:14 | S2 | -| main.rs:709:26:709:35 | ... .m1() | | main.rs:666:5:667:14 | S2 | -| main.rs:709:27:709:29 | * ... | | main.rs:663:5:664:19 | S | -| main.rs:709:27:709:29 | * ... | T | main.rs:666:5:667:14 | S2 | -| main.rs:709:28:709:29 | x6 | | file://:0:0:0:0 | & | -| main.rs:709:28:709:29 | x6 | &T | main.rs:663:5:664:19 | S | -| main.rs:709:28:709:29 | x6 | &T.T | main.rs:666:5:667:14 | S2 | -| main.rs:716:16:716:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:716:16:716:20 | SelfParam | &T | main.rs:714:5:722:5 | Self [trait MyTrait] | -| main.rs:719:16:719:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:719:16:719:20 | SelfParam | &T | main.rs:714:5:722:5 | Self [trait MyTrait] | -| main.rs:719:32:721:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:719:32:721:9 | { ... } | &T | main.rs:714:5:722:5 | Self [trait MyTrait] | -| main.rs:720:13:720:16 | self | | file://:0:0:0:0 | & | -| main.rs:720:13:720:16 | self | &T | main.rs:714:5:722:5 | Self [trait MyTrait] | -| main.rs:720:13:720:22 | self.foo() | | file://:0:0:0:0 | & | -| main.rs:720:13:720:22 | self.foo() | &T | main.rs:714:5:722:5 | Self [trait MyTrait] | -| main.rs:728:16:728:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:728:16:728:20 | SelfParam | &T | main.rs:724:5:724:20 | MyStruct | -| main.rs:728:36:730:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:728:36:730:9 | { ... } | &T | main.rs:724:5:724:20 | MyStruct | -| main.rs:729:13:729:16 | self | | file://:0:0:0:0 | & | -| main.rs:729:13:729:16 | self | &T | main.rs:724:5:724:20 | MyStruct | -| main.rs:734:13:734:13 | x | | main.rs:724:5:724:20 | MyStruct | -| main.rs:734:17:734:24 | MyStruct | | main.rs:724:5:724:20 | MyStruct | -| main.rs:735:9:735:9 | x | | main.rs:724:5:724:20 | MyStruct | -| main.rs:735:9:735:15 | x.bar() | | file://:0:0:0:0 | & | -| main.rs:735:9:735:15 | x.bar() | &T | main.rs:724:5:724:20 | MyStruct | -| main.rs:745:16:745:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:745:16:745:20 | SelfParam | &T | main.rs:742:5:742:26 | MyStruct | -| main.rs:745:16:745:20 | SelfParam | &T.T | main.rs:744:10:744:10 | T | -| main.rs:745:32:747:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:745:32:747:9 | { ... } | &T | main.rs:742:5:742:26 | MyStruct | -| main.rs:745:32:747:9 | { ... } | &T.T | main.rs:744:10:744:10 | T | -| main.rs:746:13:746:16 | self | | file://:0:0:0:0 | & | -| main.rs:746:13:746:16 | self | &T | main.rs:742:5:742:26 | MyStruct | -| main.rs:746:13:746:16 | self | &T.T | main.rs:744:10:744:10 | T | -| main.rs:751:13:751:13 | x | | main.rs:742:5:742:26 | MyStruct | -| main.rs:751:13:751:13 | x | T | main.rs:740:5:740:13 | S | -| main.rs:751:17:751:27 | MyStruct(...) | | main.rs:742:5:742:26 | MyStruct | -| main.rs:751:17:751:27 | MyStruct(...) | T | main.rs:740:5:740:13 | S | -| main.rs:751:26:751:26 | S | | main.rs:740:5:740:13 | S | -| main.rs:752:9:752:9 | x | | main.rs:742:5:742:26 | MyStruct | -| main.rs:752:9:752:9 | x | T | main.rs:740:5:740:13 | S | -| main.rs:752:9:752:15 | x.foo() | | file://:0:0:0:0 | & | -| main.rs:752:9:752:15 | x.foo() | &T | main.rs:742:5:742:26 | MyStruct | -| main.rs:752:9:752:15 | x.foo() | &T.T | main.rs:740:5:740:13 | S | -| main.rs:760:15:760:19 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:760:15:760:19 | SelfParam | &T | main.rs:757:5:757:13 | S | -| main.rs:760:31:762:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:760:31:762:9 | { ... } | &T | main.rs:757:5:757:13 | S | -| main.rs:761:13:761:19 | &... | | file://:0:0:0:0 | & | -| main.rs:761:13:761:19 | &... | &T | main.rs:757:5:757:13 | S | -| main.rs:761:14:761:19 | &... | | file://:0:0:0:0 | & | -| main.rs:761:14:761:19 | &... | &T | main.rs:757:5:757:13 | S | -| main.rs:761:15:761:19 | &self | | file://:0:0:0:0 | & | -| main.rs:761:15:761:19 | &self | &T | main.rs:757:5:757:13 | S | -| main.rs:761:16:761:19 | self | | file://:0:0:0:0 | & | -| main.rs:761:16:761:19 | self | &T | main.rs:757:5:757:13 | S | -| main.rs:764:15:764:25 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:764:15:764:25 | SelfParam | &T | main.rs:757:5:757:13 | S | -| main.rs:764:37:766:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:764:37:766:9 | { ... } | &T | main.rs:757:5:757:13 | S | -| main.rs:765:13:765:19 | &... | | file://:0:0:0:0 | & | -| main.rs:765:13:765:19 | &... | &T | main.rs:757:5:757:13 | S | -| main.rs:765:14:765:19 | &... | | file://:0:0:0:0 | & | -| main.rs:765:14:765:19 | &... | &T | main.rs:757:5:757:13 | S | -| main.rs:765:15:765:19 | &self | | file://:0:0:0:0 | & | -| main.rs:765:15:765:19 | &self | &T | main.rs:757:5:757:13 | S | -| main.rs:765:16:765:19 | self | | file://:0:0:0:0 | & | -| main.rs:765:16:765:19 | self | &T | main.rs:757:5:757:13 | S | -| main.rs:768:15:768:15 | x | | file://:0:0:0:0 | & | -| main.rs:768:15:768:15 | x | &T | main.rs:757:5:757:13 | S | -| main.rs:768:34:770:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:768:34:770:9 | { ... } | &T | main.rs:757:5:757:13 | S | -| main.rs:769:13:769:13 | x | | file://:0:0:0:0 | & | -| main.rs:769:13:769:13 | x | &T | main.rs:757:5:757:13 | S | -| main.rs:772:15:772:15 | x | | file://:0:0:0:0 | & | -| main.rs:772:15:772:15 | x | &T | main.rs:757:5:757:13 | S | -| main.rs:772:34:774:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:772:34:774:9 | { ... } | &T | main.rs:757:5:757:13 | S | -| main.rs:773:13:773:16 | &... | | file://:0:0:0:0 | & | -| main.rs:773:13:773:16 | &... | &T | main.rs:757:5:757:13 | S | -| main.rs:773:14:773:16 | &... | | file://:0:0:0:0 | & | -| main.rs:773:14:773:16 | &... | &T | main.rs:757:5:757:13 | S | -| main.rs:773:15:773:16 | &x | | file://:0:0:0:0 | & | -| main.rs:773:15:773:16 | &x | &T | main.rs:757:5:757:13 | S | -| main.rs:773:16:773:16 | x | | file://:0:0:0:0 | & | -| main.rs:773:16:773:16 | x | &T | main.rs:757:5:757:13 | S | -| main.rs:778:13:778:13 | x | | main.rs:757:5:757:13 | S | -| main.rs:778:17:778:20 | S {...} | | main.rs:757:5:757:13 | S | -| main.rs:779:9:779:9 | x | | main.rs:757:5:757:13 | S | -| main.rs:779:9:779:14 | x.f1() | | file://:0:0:0:0 | & | -| main.rs:779:9:779:14 | x.f1() | &T | main.rs:757:5:757:13 | S | -| main.rs:780:9:780:9 | x | | main.rs:757:5:757:13 | S | -| main.rs:780:9:780:14 | x.f2() | | file://:0:0:0:0 | & | -| main.rs:780:9:780:14 | x.f2() | &T | main.rs:757:5:757:13 | S | -| main.rs:781:9:781:17 | ...::f3(...) | | file://:0:0:0:0 | & | -| main.rs:781:9:781:17 | ...::f3(...) | &T | main.rs:757:5:757:13 | S | -| main.rs:781:15:781:16 | &x | | file://:0:0:0:0 | & | -| main.rs:781:15:781:16 | &x | &T | main.rs:757:5:757:13 | S | -| main.rs:781:16:781:16 | x | | main.rs:757:5:757:13 | S | -| main.rs:787:5:787:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo | -| main.rs:788:5:788:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo | -| main.rs:788:20:788:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | -| main.rs:788:41:788:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | +| main.rs:338:19:338:22 | SelfParam | | main.rs:332:5:335:5 | Wrapper | +| main.rs:338:19:338:22 | SelfParam | A | main.rs:337:10:337:10 | A | +| main.rs:338:30:340:9 | { ... } | | main.rs:337:10:337:10 | A | +| main.rs:339:13:339:16 | self | | main.rs:332:5:335:5 | Wrapper | +| main.rs:339:13:339:16 | self | A | main.rs:337:10:337:10 | A | +| main.rs:339:13:339:22 | self.field | | main.rs:337:10:337:10 | A | +| main.rs:347:15:347:18 | SelfParam | | main.rs:343:5:357:5 | Self [trait MyTrait] | +| main.rs:349:15:349:18 | SelfParam | | main.rs:343:5:357:5 | Self [trait MyTrait] | +| main.rs:354:13:354:16 | self | | main.rs:343:5:357:5 | Self [trait MyTrait] | +| main.rs:363:19:363:23 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:363:19:363:23 | SelfParam | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | +| main.rs:363:26:363:26 | a | | main.rs:363:16:363:16 | A | +| main.rs:365:22:365:26 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:365:22:365:26 | SelfParam | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | +| main.rs:365:29:365:29 | a | | main.rs:365:19:365:19 | A | +| main.rs:365:35:365:35 | b | | main.rs:365:19:365:19 | A | +| main.rs:366:13:366:16 | self | | file://:0:0:0:0 | & | +| main.rs:366:13:366:16 | self | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | +| main.rs:366:22:366:22 | a | | main.rs:365:19:365:19 | A | +| main.rs:367:13:367:16 | self | | file://:0:0:0:0 | & | +| main.rs:367:13:367:16 | self | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | +| main.rs:367:22:367:22 | b | | main.rs:365:19:365:19 | A | +| main.rs:384:15:384:18 | SelfParam | | main.rs:371:5:372:13 | S | +| main.rs:384:45:386:9 | { ... } | | main.rs:377:5:378:14 | AT | +| main.rs:385:13:385:14 | AT | | main.rs:377:5:378:14 | AT | +| main.rs:394:19:394:23 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:394:19:394:23 | SelfParam | &T | main.rs:371:5:372:13 | S | +| main.rs:394:26:394:26 | a | | main.rs:394:16:394:16 | A | +| main.rs:394:46:396:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | +| main.rs:394:46:396:9 | { ... } | A | main.rs:394:16:394:16 | A | +| main.rs:395:13:395:32 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | +| main.rs:395:13:395:32 | Wrapper {...} | A | main.rs:394:16:394:16 | A | +| main.rs:395:30:395:30 | a | | main.rs:394:16:394:16 | A | +| main.rs:403:15:403:18 | SelfParam | | main.rs:374:5:375:14 | S2 | +| main.rs:403:45:405:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | +| main.rs:403:45:405:9 | { ... } | A | main.rs:374:5:375:14 | S2 | +| main.rs:404:13:404:35 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | +| main.rs:404:13:404:35 | Wrapper {...} | A | main.rs:374:5:375:14 | S2 | +| main.rs:404:30:404:33 | self | | main.rs:374:5:375:14 | S2 | +| main.rs:410:30:412:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | +| main.rs:410:30:412:9 | { ... } | A | main.rs:374:5:375:14 | S2 | +| main.rs:411:13:411:33 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | +| main.rs:411:13:411:33 | Wrapper {...} | A | main.rs:374:5:375:14 | S2 | +| main.rs:411:30:411:31 | S2 | | main.rs:374:5:375:14 | S2 | +| main.rs:416:22:416:26 | thing | | main.rs:416:10:416:19 | T | +| main.rs:417:9:417:13 | thing | | main.rs:416:10:416:19 | T | +| main.rs:421:13:421:14 | x1 | | main.rs:371:5:372:13 | S | +| main.rs:421:18:421:18 | S | | main.rs:371:5:372:13 | S | +| main.rs:423:26:423:27 | x1 | | main.rs:371:5:372:13 | S | +| main.rs:423:26:423:32 | x1.m1() | | main.rs:377:5:378:14 | AT | +| main.rs:425:13:425:14 | x2 | | main.rs:371:5:372:13 | S | +| main.rs:425:18:425:18 | S | | main.rs:371:5:372:13 | S | +| main.rs:427:17:427:18 | x2 | | main.rs:371:5:372:13 | S | +| main.rs:430:13:430:14 | x3 | | main.rs:371:5:372:13 | S | +| main.rs:430:18:430:18 | S | | main.rs:371:5:372:13 | S | +| main.rs:432:26:432:27 | x3 | | main.rs:371:5:372:13 | S | +| main.rs:432:26:432:34 | x3.put(...) | | main.rs:332:5:335:5 | Wrapper | +| main.rs:435:26:435:27 | x3 | | main.rs:371:5:372:13 | S | +| main.rs:437:20:437:20 | S | | main.rs:371:5:372:13 | S | +| main.rs:440:13:440:14 | x5 | | main.rs:374:5:375:14 | S2 | +| main.rs:440:18:440:19 | S2 | | main.rs:374:5:375:14 | S2 | +| main.rs:441:26:441:27 | x5 | | main.rs:374:5:375:14 | S2 | +| main.rs:441:26:441:32 | x5.m1() | | main.rs:332:5:335:5 | Wrapper | +| main.rs:442:13:442:14 | x6 | | main.rs:374:5:375:14 | S2 | +| main.rs:442:18:442:19 | S2 | | main.rs:374:5:375:14 | S2 | +| main.rs:443:26:443:27 | x6 | | main.rs:374:5:375:14 | S2 | +| main.rs:460:15:460:18 | SelfParam | | main.rs:448:5:452:5 | MyEnum | +| main.rs:460:15:460:18 | SelfParam | A | main.rs:459:10:459:10 | T | +| main.rs:460:26:465:9 | { ... } | | main.rs:459:10:459:10 | T | +| main.rs:461:13:464:13 | match self { ... } | | main.rs:459:10:459:10 | T | +| main.rs:461:19:461:22 | self | | main.rs:448:5:452:5 | MyEnum | +| main.rs:461:19:461:22 | self | A | main.rs:459:10:459:10 | T | +| main.rs:462:28:462:28 | a | | main.rs:459:10:459:10 | T | +| main.rs:462:34:462:34 | a | | main.rs:459:10:459:10 | T | +| main.rs:463:30:463:30 | a | | main.rs:459:10:459:10 | T | +| main.rs:463:37:463:37 | a | | main.rs:459:10:459:10 | T | +| main.rs:469:13:469:13 | x | | main.rs:448:5:452:5 | MyEnum | +| main.rs:469:13:469:13 | x | A | main.rs:454:5:455:14 | S1 | +| main.rs:469:17:469:30 | ...::C1(...) | | main.rs:448:5:452:5 | MyEnum | +| main.rs:469:17:469:30 | ...::C1(...) | A | main.rs:454:5:455:14 | S1 | +| main.rs:469:28:469:29 | S1 | | main.rs:454:5:455:14 | S1 | +| main.rs:470:13:470:13 | y | | main.rs:448:5:452:5 | MyEnum | +| main.rs:470:13:470:13 | y | A | main.rs:456:5:457:14 | S2 | +| main.rs:470:17:470:36 | ...::C2 {...} | | main.rs:448:5:452:5 | MyEnum | +| main.rs:470:17:470:36 | ...::C2 {...} | A | main.rs:456:5:457:14 | S2 | +| main.rs:470:33:470:34 | S2 | | main.rs:456:5:457:14 | S2 | +| main.rs:472:26:472:26 | x | | main.rs:448:5:452:5 | MyEnum | +| main.rs:472:26:472:26 | x | A | main.rs:454:5:455:14 | S1 | +| main.rs:472:26:472:31 | x.m1() | | main.rs:454:5:455:14 | S1 | +| main.rs:473:26:473:26 | y | | main.rs:448:5:452:5 | MyEnum | +| main.rs:473:26:473:26 | y | A | main.rs:456:5:457:14 | S2 | +| main.rs:473:26:473:31 | y.m1() | | main.rs:456:5:457:14 | S2 | +| main.rs:495:15:495:18 | SelfParam | | main.rs:493:5:496:5 | Self [trait MyTrait1] | +| main.rs:499:15:499:18 | SelfParam | | main.rs:498:5:509:5 | Self [trait MyTrait2] | +| main.rs:502:9:508:9 | { ... } | | main.rs:498:20:498:22 | Tr2 | +| main.rs:503:13:507:13 | if ... {...} else {...} | | main.rs:498:20:498:22 | Tr2 | +| main.rs:503:26:505:13 | { ... } | | main.rs:498:20:498:22 | Tr2 | +| main.rs:504:17:504:20 | self | | main.rs:498:5:509:5 | Self [trait MyTrait2] | +| main.rs:504:17:504:25 | self.m1() | | main.rs:498:20:498:22 | Tr2 | +| main.rs:505:20:507:13 | { ... } | | main.rs:498:20:498:22 | Tr2 | +| main.rs:506:17:506:30 | ...::m1(...) | | main.rs:498:20:498:22 | Tr2 | +| main.rs:506:26:506:29 | self | | main.rs:498:5:509:5 | Self [trait MyTrait2] | +| main.rs:512:15:512:18 | SelfParam | | main.rs:511:5:522:5 | Self [trait MyTrait3] | +| main.rs:515:9:521:9 | { ... } | | main.rs:511:20:511:22 | Tr3 | +| main.rs:516:13:520:13 | if ... {...} else {...} | | main.rs:511:20:511:22 | Tr3 | +| main.rs:516:26:518:13 | { ... } | | main.rs:511:20:511:22 | Tr3 | +| main.rs:517:17:517:20 | self | | main.rs:511:5:522:5 | Self [trait MyTrait3] | +| main.rs:517:17:517:25 | self.m2() | | main.rs:478:5:481:5 | MyThing | +| main.rs:517:17:517:25 | self.m2() | A | main.rs:511:20:511:22 | Tr3 | +| main.rs:517:17:517:27 | ... .a | | main.rs:511:20:511:22 | Tr3 | +| main.rs:518:20:520:13 | { ... } | | main.rs:511:20:511:22 | Tr3 | +| main.rs:519:17:519:30 | ...::m2(...) | | main.rs:478:5:481:5 | MyThing | +| main.rs:519:17:519:30 | ...::m2(...) | A | main.rs:511:20:511:22 | Tr3 | +| main.rs:519:17:519:32 | ... .a | | main.rs:511:20:511:22 | Tr3 | +| main.rs:519:26:519:29 | self | | main.rs:511:5:522:5 | Self [trait MyTrait3] | +| main.rs:526:15:526:18 | SelfParam | | main.rs:478:5:481:5 | MyThing | +| main.rs:526:15:526:18 | SelfParam | A | main.rs:524:10:524:10 | T | +| main.rs:526:26:528:9 | { ... } | | main.rs:524:10:524:10 | T | +| main.rs:527:13:527:16 | self | | main.rs:478:5:481:5 | MyThing | +| main.rs:527:13:527:16 | self | A | main.rs:524:10:524:10 | T | +| main.rs:527:13:527:18 | self.a | | main.rs:524:10:524:10 | T | +| main.rs:535:15:535:18 | SelfParam | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:535:15:535:18 | SelfParam | A | main.rs:533:10:533:10 | T | +| main.rs:535:35:537:9 | { ... } | | main.rs:478:5:481:5 | MyThing | +| main.rs:535:35:537:9 | { ... } | A | main.rs:533:10:533:10 | T | +| main.rs:536:13:536:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | +| main.rs:536:13:536:33 | MyThing {...} | A | main.rs:533:10:533:10 | T | +| main.rs:536:26:536:29 | self | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:536:26:536:29 | self | A | main.rs:533:10:533:10 | T | +| main.rs:536:26:536:31 | self.a | | main.rs:533:10:533:10 | T | +| main.rs:545:13:545:13 | x | | main.rs:478:5:481:5 | MyThing | +| main.rs:545:13:545:13 | x | A | main.rs:488:5:489:14 | S1 | +| main.rs:545:17:545:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | +| main.rs:545:17:545:33 | MyThing {...} | A | main.rs:488:5:489:14 | S1 | +| main.rs:545:30:545:31 | S1 | | main.rs:488:5:489:14 | S1 | +| main.rs:546:13:546:13 | y | | main.rs:478:5:481:5 | MyThing | +| main.rs:546:13:546:13 | y | A | main.rs:490:5:491:14 | S2 | +| main.rs:546:17:546:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | +| main.rs:546:17:546:33 | MyThing {...} | A | main.rs:490:5:491:14 | S2 | +| main.rs:546:30:546:31 | S2 | | main.rs:490:5:491:14 | S2 | +| main.rs:548:26:548:26 | x | | main.rs:478:5:481:5 | MyThing | +| main.rs:548:26:548:26 | x | A | main.rs:488:5:489:14 | S1 | +| main.rs:548:26:548:31 | x.m1() | | main.rs:488:5:489:14 | S1 | +| main.rs:549:26:549:26 | y | | main.rs:478:5:481:5 | MyThing | +| main.rs:549:26:549:26 | y | A | main.rs:490:5:491:14 | S2 | +| main.rs:549:26:549:31 | y.m1() | | main.rs:490:5:491:14 | S2 | +| main.rs:551:13:551:13 | x | | main.rs:478:5:481:5 | MyThing | +| main.rs:551:13:551:13 | x | A | main.rs:488:5:489:14 | S1 | +| main.rs:551:17:551:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | +| main.rs:551:17:551:33 | MyThing {...} | A | main.rs:488:5:489:14 | S1 | +| main.rs:551:30:551:31 | S1 | | main.rs:488:5:489:14 | S1 | +| main.rs:552:13:552:13 | y | | main.rs:478:5:481:5 | MyThing | +| main.rs:552:13:552:13 | y | A | main.rs:490:5:491:14 | S2 | +| main.rs:552:17:552:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | +| main.rs:552:17:552:33 | MyThing {...} | A | main.rs:490:5:491:14 | S2 | +| main.rs:552:30:552:31 | S2 | | main.rs:490:5:491:14 | S2 | +| main.rs:554:26:554:26 | x | | main.rs:478:5:481:5 | MyThing | +| main.rs:554:26:554:26 | x | A | main.rs:488:5:489:14 | S1 | +| main.rs:554:26:554:31 | x.m2() | | main.rs:488:5:489:14 | S1 | +| main.rs:555:26:555:26 | y | | main.rs:478:5:481:5 | MyThing | +| main.rs:555:26:555:26 | y | A | main.rs:490:5:491:14 | S2 | +| main.rs:555:26:555:31 | y.m2() | | main.rs:490:5:491:14 | S2 | +| main.rs:557:13:557:13 | x | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:557:13:557:13 | x | A | main.rs:488:5:489:14 | S1 | +| main.rs:557:17:557:34 | MyThing2 {...} | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:557:17:557:34 | MyThing2 {...} | A | main.rs:488:5:489:14 | S1 | +| main.rs:557:31:557:32 | S1 | | main.rs:488:5:489:14 | S1 | +| main.rs:558:13:558:13 | y | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:558:13:558:13 | y | A | main.rs:490:5:491:14 | S2 | +| main.rs:558:17:558:34 | MyThing2 {...} | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:558:17:558:34 | MyThing2 {...} | A | main.rs:490:5:491:14 | S2 | +| main.rs:558:31:558:32 | S2 | | main.rs:490:5:491:14 | S2 | +| main.rs:560:26:560:26 | x | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:560:26:560:26 | x | A | main.rs:488:5:489:14 | S1 | +| main.rs:560:26:560:31 | x.m3() | | main.rs:488:5:489:14 | S1 | +| main.rs:561:26:561:26 | y | | main.rs:483:5:486:5 | MyThing2 | +| main.rs:561:26:561:26 | y | A | main.rs:490:5:491:14 | S2 | +| main.rs:561:26:561:31 | y.m3() | | main.rs:490:5:491:14 | S2 | +| main.rs:579:22:579:22 | x | | file://:0:0:0:0 | & | +| main.rs:579:22:579:22 | x | &T | main.rs:579:11:579:19 | T | +| main.rs:579:35:581:5 | { ... } | | file://:0:0:0:0 | & | +| main.rs:579:35:581:5 | { ... } | &T | main.rs:579:11:579:19 | T | +| main.rs:580:9:580:9 | x | | file://:0:0:0:0 | & | +| main.rs:580:9:580:9 | x | &T | main.rs:579:11:579:19 | T | +| main.rs:584:17:584:20 | SelfParam | | main.rs:569:5:570:14 | S1 | +| main.rs:584:29:586:9 | { ... } | | main.rs:572:5:573:14 | S2 | +| main.rs:585:13:585:14 | S2 | | main.rs:572:5:573:14 | S2 | +| main.rs:589:21:589:21 | x | | main.rs:589:13:589:14 | T1 | +| main.rs:592:5:594:5 | { ... } | | main.rs:589:17:589:18 | T2 | +| main.rs:593:9:593:9 | x | | main.rs:589:13:589:14 | T1 | +| main.rs:593:9:593:16 | x.into() | | main.rs:589:17:589:18 | T2 | +| main.rs:597:13:597:13 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:597:17:597:18 | S1 | | main.rs:569:5:570:14 | S1 | +| main.rs:598:26:598:31 | id(...) | | file://:0:0:0:0 | & | +| main.rs:598:26:598:31 | id(...) | &T | main.rs:569:5:570:14 | S1 | +| main.rs:598:29:598:30 | &x | | file://:0:0:0:0 | & | +| main.rs:598:29:598:30 | &x | &T | main.rs:569:5:570:14 | S1 | +| main.rs:598:30:598:30 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:600:13:600:13 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:600:17:600:18 | S1 | | main.rs:569:5:570:14 | S1 | +| main.rs:601:26:601:37 | id::<...>(...) | | file://:0:0:0:0 | & | +| main.rs:601:26:601:37 | id::<...>(...) | &T | main.rs:569:5:570:14 | S1 | +| main.rs:601:35:601:36 | &x | | file://:0:0:0:0 | & | +| main.rs:601:35:601:36 | &x | &T | main.rs:569:5:570:14 | S1 | +| main.rs:601:36:601:36 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:603:13:603:13 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:603:17:603:18 | S1 | | main.rs:569:5:570:14 | S1 | +| main.rs:604:26:604:44 | id::<...>(...) | | file://:0:0:0:0 | & | +| main.rs:604:26:604:44 | id::<...>(...) | &T | main.rs:569:5:570:14 | S1 | +| main.rs:604:42:604:43 | &x | | file://:0:0:0:0 | & | +| main.rs:604:42:604:43 | &x | &T | main.rs:569:5:570:14 | S1 | +| main.rs:604:43:604:43 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:606:13:606:13 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:606:17:606:18 | S1 | | main.rs:569:5:570:14 | S1 | +| main.rs:607:9:607:25 | into::<...>(...) | | main.rs:572:5:573:14 | S2 | +| main.rs:607:24:607:24 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:609:13:609:13 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:609:17:609:18 | S1 | | main.rs:569:5:570:14 | S1 | +| main.rs:610:13:610:13 | y | | main.rs:572:5:573:14 | S2 | +| main.rs:610:21:610:27 | into(...) | | main.rs:572:5:573:14 | S2 | +| main.rs:610:26:610:26 | x | | main.rs:569:5:570:14 | S1 | +| main.rs:640:13:640:14 | p1 | | main.rs:615:5:621:5 | PairOption | +| main.rs:640:13:640:14 | p1 | Fst | main.rs:623:5:624:14 | S1 | +| main.rs:640:13:640:14 | p1 | Snd | main.rs:626:5:627:14 | S2 | +| main.rs:640:26:640:53 | ...::PairBoth(...) | | main.rs:615:5:621:5 | PairOption | +| main.rs:640:26:640:53 | ...::PairBoth(...) | Fst | main.rs:623:5:624:14 | S1 | +| main.rs:640:26:640:53 | ...::PairBoth(...) | Snd | main.rs:626:5:627:14 | S2 | +| main.rs:640:47:640:48 | S1 | | main.rs:623:5:624:14 | S1 | +| main.rs:640:51:640:52 | S2 | | main.rs:626:5:627:14 | S2 | +| main.rs:641:26:641:27 | p1 | | main.rs:615:5:621:5 | PairOption | +| main.rs:641:26:641:27 | p1 | Fst | main.rs:623:5:624:14 | S1 | +| main.rs:641:26:641:27 | p1 | Snd | main.rs:626:5:627:14 | S2 | +| main.rs:644:13:644:14 | p2 | | main.rs:615:5:621:5 | PairOption | +| main.rs:644:26:644:47 | ...::PairNone(...) | | main.rs:615:5:621:5 | PairOption | +| main.rs:645:26:645:27 | p2 | | main.rs:615:5:621:5 | PairOption | +| main.rs:648:13:648:14 | p3 | | main.rs:615:5:621:5 | PairOption | +| main.rs:648:13:648:14 | p3 | Snd | main.rs:629:5:630:14 | S3 | +| main.rs:648:34:648:56 | ...::PairSnd(...) | | main.rs:615:5:621:5 | PairOption | +| main.rs:648:34:648:56 | ...::PairSnd(...) | Snd | main.rs:629:5:630:14 | S3 | +| main.rs:648:54:648:55 | S3 | | main.rs:629:5:630:14 | S3 | +| main.rs:649:26:649:27 | p3 | | main.rs:615:5:621:5 | PairOption | +| main.rs:649:26:649:27 | p3 | Snd | main.rs:629:5:630:14 | S3 | +| main.rs:652:13:652:14 | p3 | | main.rs:615:5:621:5 | PairOption | +| main.rs:652:13:652:14 | p3 | Fst | main.rs:629:5:630:14 | S3 | +| main.rs:652:35:652:56 | ...::PairNone(...) | | main.rs:615:5:621:5 | PairOption | +| main.rs:652:35:652:56 | ...::PairNone(...) | Fst | main.rs:629:5:630:14 | S3 | +| main.rs:653:26:653:27 | p3 | | main.rs:615:5:621:5 | PairOption | +| main.rs:653:26:653:27 | p3 | Fst | main.rs:629:5:630:14 | S3 | +| main.rs:666:16:666:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:666:16:666:24 | SelfParam | &T | main.rs:664:5:671:5 | Self [trait MyTrait] | +| main.rs:666:27:666:31 | value | | main.rs:664:19:664:19 | S | +| main.rs:668:21:668:29 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:668:21:668:29 | SelfParam | &T | main.rs:664:5:671:5 | Self [trait MyTrait] | +| main.rs:668:32:668:36 | value | | main.rs:664:19:664:19 | S | +| main.rs:669:13:669:16 | self | | file://:0:0:0:0 | & | +| main.rs:669:13:669:16 | self | &T | main.rs:664:5:671:5 | Self [trait MyTrait] | +| main.rs:669:22:669:26 | value | | main.rs:664:19:664:19 | S | +| main.rs:675:16:675:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:675:16:675:24 | SelfParam | &T | main.rs:658:5:662:5 | MyOption | +| main.rs:675:16:675:24 | SelfParam | &T.T | main.rs:673:10:673:10 | T | +| main.rs:675:27:675:31 | value | | main.rs:673:10:673:10 | T | +| main.rs:679:26:681:9 | { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:679:26:681:9 | { ... } | T | main.rs:678:10:678:10 | T | +| main.rs:680:13:680:30 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:680:13:680:30 | ...::MyNone(...) | T | main.rs:678:10:678:10 | T | +| main.rs:685:20:685:23 | SelfParam | | main.rs:658:5:662:5 | MyOption | +| main.rs:685:20:685:23 | SelfParam | T | main.rs:658:5:662:5 | MyOption | +| main.rs:685:20:685:23 | SelfParam | T.T | main.rs:684:10:684:10 | T | +| main.rs:685:41:690:9 | { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:685:41:690:9 | { ... } | T | main.rs:684:10:684:10 | T | +| main.rs:686:13:689:13 | match self { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:686:13:689:13 | match self { ... } | T | main.rs:684:10:684:10 | T | +| main.rs:686:19:686:22 | self | | main.rs:658:5:662:5 | MyOption | +| main.rs:686:19:686:22 | self | T | main.rs:658:5:662:5 | MyOption | +| main.rs:686:19:686:22 | self | T.T | main.rs:684:10:684:10 | T | +| main.rs:687:39:687:56 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:687:39:687:56 | ...::MyNone(...) | T | main.rs:684:10:684:10 | T | +| main.rs:688:34:688:34 | x | | main.rs:658:5:662:5 | MyOption | +| main.rs:688:34:688:34 | x | T | main.rs:684:10:684:10 | T | +| main.rs:688:40:688:40 | x | | main.rs:658:5:662:5 | MyOption | +| main.rs:688:40:688:40 | x | T | main.rs:684:10:684:10 | T | +| main.rs:697:13:697:14 | x1 | | main.rs:658:5:662:5 | MyOption | +| main.rs:697:18:697:37 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:698:26:698:27 | x1 | | main.rs:658:5:662:5 | MyOption | +| main.rs:700:13:700:18 | mut x2 | | main.rs:658:5:662:5 | MyOption | +| main.rs:700:13:700:18 | mut x2 | T | main.rs:693:5:694:13 | S | +| main.rs:700:22:700:36 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:700:22:700:36 | ...::new(...) | T | main.rs:693:5:694:13 | S | +| main.rs:701:9:701:10 | x2 | | main.rs:658:5:662:5 | MyOption | +| main.rs:701:9:701:10 | x2 | T | main.rs:693:5:694:13 | S | +| main.rs:701:16:701:16 | S | | main.rs:693:5:694:13 | S | +| main.rs:702:26:702:27 | x2 | | main.rs:658:5:662:5 | MyOption | +| main.rs:702:26:702:27 | x2 | T | main.rs:693:5:694:13 | S | +| main.rs:704:13:704:18 | mut x3 | | main.rs:658:5:662:5 | MyOption | +| main.rs:704:22:704:36 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:705:9:705:10 | x3 | | main.rs:658:5:662:5 | MyOption | +| main.rs:705:21:705:21 | S | | main.rs:693:5:694:13 | S | +| main.rs:706:26:706:27 | x3 | | main.rs:658:5:662:5 | MyOption | +| main.rs:708:13:708:18 | mut x4 | | main.rs:658:5:662:5 | MyOption | +| main.rs:708:13:708:18 | mut x4 | T | main.rs:693:5:694:13 | S | +| main.rs:708:22:708:36 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:708:22:708:36 | ...::new(...) | T | main.rs:693:5:694:13 | S | +| main.rs:709:23:709:29 | &mut x4 | | file://:0:0:0:0 | & | +| main.rs:709:23:709:29 | &mut x4 | &T | main.rs:658:5:662:5 | MyOption | +| main.rs:709:23:709:29 | &mut x4 | &T.T | main.rs:693:5:694:13 | S | +| main.rs:709:28:709:29 | x4 | | main.rs:658:5:662:5 | MyOption | +| main.rs:709:28:709:29 | x4 | T | main.rs:693:5:694:13 | S | +| main.rs:709:32:709:32 | S | | main.rs:693:5:694:13 | S | +| main.rs:710:26:710:27 | x4 | | main.rs:658:5:662:5 | MyOption | +| main.rs:710:26:710:27 | x4 | T | main.rs:693:5:694:13 | S | +| main.rs:712:13:712:14 | x5 | | main.rs:658:5:662:5 | MyOption | +| main.rs:712:13:712:14 | x5 | T | main.rs:658:5:662:5 | MyOption | +| main.rs:712:13:712:14 | x5 | T.T | main.rs:693:5:694:13 | S | +| main.rs:712:18:712:58 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:712:18:712:58 | ...::MySome(...) | T | main.rs:658:5:662:5 | MyOption | +| main.rs:712:18:712:58 | ...::MySome(...) | T.T | main.rs:693:5:694:13 | S | +| main.rs:712:35:712:57 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:712:35:712:57 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | +| main.rs:713:26:713:27 | x5 | | main.rs:658:5:662:5 | MyOption | +| main.rs:713:26:713:27 | x5 | T | main.rs:658:5:662:5 | MyOption | +| main.rs:713:26:713:27 | x5 | T.T | main.rs:693:5:694:13 | S | +| main.rs:715:13:715:14 | x6 | | main.rs:658:5:662:5 | MyOption | +| main.rs:715:13:715:14 | x6 | T | main.rs:658:5:662:5 | MyOption | +| main.rs:715:13:715:14 | x6 | T.T | main.rs:693:5:694:13 | S | +| main.rs:715:18:715:58 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:715:18:715:58 | ...::MySome(...) | T | main.rs:658:5:662:5 | MyOption | +| main.rs:715:18:715:58 | ...::MySome(...) | T.T | main.rs:693:5:694:13 | S | +| main.rs:715:35:715:57 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:715:35:715:57 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | +| main.rs:716:26:716:61 | ...::flatten(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:716:26:716:61 | ...::flatten(...) | T | main.rs:693:5:694:13 | S | +| main.rs:716:59:716:60 | x6 | | main.rs:658:5:662:5 | MyOption | +| main.rs:716:59:716:60 | x6 | T | main.rs:658:5:662:5 | MyOption | +| main.rs:716:59:716:60 | x6 | T.T | main.rs:693:5:694:13 | S | +| main.rs:718:13:718:19 | from_if | | main.rs:658:5:662:5 | MyOption | +| main.rs:718:13:718:19 | from_if | T | main.rs:693:5:694:13 | S | +| main.rs:718:23:722:9 | if ... {...} else {...} | | main.rs:658:5:662:5 | MyOption | +| main.rs:718:23:722:9 | if ... {...} else {...} | T | main.rs:693:5:694:13 | S | +| main.rs:718:36:720:9 | { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:718:36:720:9 | { ... } | T | main.rs:693:5:694:13 | S | +| main.rs:719:13:719:30 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:719:13:719:30 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | +| main.rs:720:16:722:9 | { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:720:16:722:9 | { ... } | T | main.rs:693:5:694:13 | S | +| main.rs:721:13:721:31 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:721:13:721:31 | ...::MySome(...) | T | main.rs:693:5:694:13 | S | +| main.rs:721:30:721:30 | S | | main.rs:693:5:694:13 | S | +| main.rs:723:26:723:32 | from_if | | main.rs:658:5:662:5 | MyOption | +| main.rs:723:26:723:32 | from_if | T | main.rs:693:5:694:13 | S | +| main.rs:725:13:725:22 | from_match | | main.rs:658:5:662:5 | MyOption | +| main.rs:725:13:725:22 | from_match | T | main.rs:693:5:694:13 | S | +| main.rs:725:26:728:9 | match ... { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:725:26:728:9 | match ... { ... } | T | main.rs:693:5:694:13 | S | +| main.rs:726:21:726:38 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:726:21:726:38 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | +| main.rs:727:22:727:40 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:727:22:727:40 | ...::MySome(...) | T | main.rs:693:5:694:13 | S | +| main.rs:727:39:727:39 | S | | main.rs:693:5:694:13 | S | +| main.rs:729:26:729:35 | from_match | | main.rs:658:5:662:5 | MyOption | +| main.rs:729:26:729:35 | from_match | T | main.rs:693:5:694:13 | S | +| main.rs:731:13:731:21 | from_loop | | main.rs:658:5:662:5 | MyOption | +| main.rs:731:13:731:21 | from_loop | T | main.rs:693:5:694:13 | S | +| main.rs:731:25:736:9 | loop { ... } | | main.rs:658:5:662:5 | MyOption | +| main.rs:731:25:736:9 | loop { ... } | T | main.rs:693:5:694:13 | S | +| main.rs:733:23:733:40 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:733:23:733:40 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | +| main.rs:735:19:735:37 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | +| main.rs:735:19:735:37 | ...::MySome(...) | T | main.rs:693:5:694:13 | S | +| main.rs:735:36:735:36 | S | | main.rs:693:5:694:13 | S | +| main.rs:737:26:737:34 | from_loop | | main.rs:658:5:662:5 | MyOption | +| main.rs:737:26:737:34 | from_loop | T | main.rs:693:5:694:13 | S | +| main.rs:750:15:750:18 | SelfParam | | main.rs:743:5:744:19 | S | +| main.rs:750:15:750:18 | SelfParam | T | main.rs:749:10:749:10 | T | +| main.rs:750:26:752:9 | { ... } | | main.rs:749:10:749:10 | T | +| main.rs:751:13:751:16 | self | | main.rs:743:5:744:19 | S | +| main.rs:751:13:751:16 | self | T | main.rs:749:10:749:10 | T | +| main.rs:751:13:751:18 | self.0 | | main.rs:749:10:749:10 | T | +| main.rs:754:15:754:19 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:754:15:754:19 | SelfParam | &T | main.rs:743:5:744:19 | S | +| main.rs:754:15:754:19 | SelfParam | &T.T | main.rs:749:10:749:10 | T | +| main.rs:754:28:756:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:754:28:756:9 | { ... } | &T | main.rs:749:10:749:10 | T | +| main.rs:755:13:755:19 | &... | | file://:0:0:0:0 | & | +| main.rs:755:13:755:19 | &... | &T | main.rs:749:10:749:10 | T | +| main.rs:755:14:755:17 | self | | file://:0:0:0:0 | & | +| main.rs:755:14:755:17 | self | &T | main.rs:743:5:744:19 | S | +| main.rs:755:14:755:17 | self | &T.T | main.rs:749:10:749:10 | T | +| main.rs:755:14:755:19 | self.0 | | main.rs:749:10:749:10 | T | +| main.rs:758:15:758:25 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:758:15:758:25 | SelfParam | &T | main.rs:743:5:744:19 | S | +| main.rs:758:15:758:25 | SelfParam | &T.T | main.rs:749:10:749:10 | T | +| main.rs:758:34:760:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:758:34:760:9 | { ... } | &T | main.rs:749:10:749:10 | T | +| main.rs:759:13:759:19 | &... | | file://:0:0:0:0 | & | +| main.rs:759:13:759:19 | &... | &T | main.rs:749:10:749:10 | T | +| main.rs:759:14:759:17 | self | | file://:0:0:0:0 | & | +| main.rs:759:14:759:17 | self | &T | main.rs:743:5:744:19 | S | +| main.rs:759:14:759:17 | self | &T.T | main.rs:749:10:749:10 | T | +| main.rs:759:14:759:19 | self.0 | | main.rs:749:10:749:10 | T | +| main.rs:764:13:764:14 | x1 | | main.rs:743:5:744:19 | S | +| main.rs:764:13:764:14 | x1 | T | main.rs:746:5:747:14 | S2 | +| main.rs:764:18:764:22 | S(...) | | main.rs:743:5:744:19 | S | +| main.rs:764:18:764:22 | S(...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:764:20:764:21 | S2 | | main.rs:746:5:747:14 | S2 | +| main.rs:765:26:765:27 | x1 | | main.rs:743:5:744:19 | S | +| main.rs:765:26:765:27 | x1 | T | main.rs:746:5:747:14 | S2 | +| main.rs:765:26:765:32 | x1.m1() | | main.rs:746:5:747:14 | S2 | +| main.rs:767:13:767:14 | x2 | | main.rs:743:5:744:19 | S | +| main.rs:767:13:767:14 | x2 | T | main.rs:746:5:747:14 | S2 | +| main.rs:767:18:767:22 | S(...) | | main.rs:743:5:744:19 | S | +| main.rs:767:18:767:22 | S(...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:767:20:767:21 | S2 | | main.rs:746:5:747:14 | S2 | +| main.rs:769:26:769:27 | x2 | | main.rs:743:5:744:19 | S | +| main.rs:769:26:769:27 | x2 | T | main.rs:746:5:747:14 | S2 | +| main.rs:769:26:769:32 | x2.m2() | | file://:0:0:0:0 | & | +| main.rs:769:26:769:32 | x2.m2() | &T | main.rs:746:5:747:14 | S2 | +| main.rs:770:26:770:27 | x2 | | main.rs:743:5:744:19 | S | +| main.rs:770:26:770:27 | x2 | T | main.rs:746:5:747:14 | S2 | +| main.rs:770:26:770:32 | x2.m3() | | file://:0:0:0:0 | & | +| main.rs:770:26:770:32 | x2.m3() | &T | main.rs:746:5:747:14 | S2 | +| main.rs:772:13:772:14 | x3 | | main.rs:743:5:744:19 | S | +| main.rs:772:13:772:14 | x3 | T | main.rs:746:5:747:14 | S2 | +| main.rs:772:18:772:22 | S(...) | | main.rs:743:5:744:19 | S | +| main.rs:772:18:772:22 | S(...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:772:20:772:21 | S2 | | main.rs:746:5:747:14 | S2 | +| main.rs:774:26:774:41 | ...::m2(...) | | file://:0:0:0:0 | & | +| main.rs:774:26:774:41 | ...::m2(...) | &T | main.rs:746:5:747:14 | S2 | +| main.rs:774:38:774:40 | &x3 | | file://:0:0:0:0 | & | +| main.rs:774:38:774:40 | &x3 | &T | main.rs:743:5:744:19 | S | +| main.rs:774:38:774:40 | &x3 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:774:39:774:40 | x3 | | main.rs:743:5:744:19 | S | +| main.rs:774:39:774:40 | x3 | T | main.rs:746:5:747:14 | S2 | +| main.rs:775:26:775:41 | ...::m3(...) | | file://:0:0:0:0 | & | +| main.rs:775:26:775:41 | ...::m3(...) | &T | main.rs:746:5:747:14 | S2 | +| main.rs:775:38:775:40 | &x3 | | file://:0:0:0:0 | & | +| main.rs:775:38:775:40 | &x3 | &T | main.rs:743:5:744:19 | S | +| main.rs:775:38:775:40 | &x3 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:775:39:775:40 | x3 | | main.rs:743:5:744:19 | S | +| main.rs:775:39:775:40 | x3 | T | main.rs:746:5:747:14 | S2 | +| main.rs:777:13:777:14 | x4 | | file://:0:0:0:0 | & | +| main.rs:777:13:777:14 | x4 | &T | main.rs:743:5:744:19 | S | +| main.rs:777:13:777:14 | x4 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:777:18:777:23 | &... | | file://:0:0:0:0 | & | +| main.rs:777:18:777:23 | &... | &T | main.rs:743:5:744:19 | S | +| main.rs:777:18:777:23 | &... | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:777:19:777:23 | S(...) | | main.rs:743:5:744:19 | S | +| main.rs:777:19:777:23 | S(...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:777:21:777:22 | S2 | | main.rs:746:5:747:14 | S2 | +| main.rs:779:26:779:27 | x4 | | file://:0:0:0:0 | & | +| main.rs:779:26:779:27 | x4 | &T | main.rs:743:5:744:19 | S | +| main.rs:779:26:779:27 | x4 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:779:26:779:32 | x4.m2() | | file://:0:0:0:0 | & | +| main.rs:779:26:779:32 | x4.m2() | &T | main.rs:746:5:747:14 | S2 | +| main.rs:780:26:780:27 | x4 | | file://:0:0:0:0 | & | +| main.rs:780:26:780:27 | x4 | &T | main.rs:743:5:744:19 | S | +| main.rs:780:26:780:27 | x4 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:780:26:780:32 | x4.m3() | | file://:0:0:0:0 | & | +| main.rs:780:26:780:32 | x4.m3() | &T | main.rs:746:5:747:14 | S2 | +| main.rs:782:13:782:14 | x5 | | file://:0:0:0:0 | & | +| main.rs:782:13:782:14 | x5 | &T | main.rs:743:5:744:19 | S | +| main.rs:782:13:782:14 | x5 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:782:18:782:23 | &... | | file://:0:0:0:0 | & | +| main.rs:782:18:782:23 | &... | &T | main.rs:743:5:744:19 | S | +| main.rs:782:18:782:23 | &... | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:782:19:782:23 | S(...) | | main.rs:743:5:744:19 | S | +| main.rs:782:19:782:23 | S(...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:782:21:782:22 | S2 | | main.rs:746:5:747:14 | S2 | +| main.rs:784:26:784:27 | x5 | | file://:0:0:0:0 | & | +| main.rs:784:26:784:27 | x5 | &T | main.rs:743:5:744:19 | S | +| main.rs:784:26:784:27 | x5 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:784:26:784:32 | x5.m1() | | main.rs:746:5:747:14 | S2 | +| main.rs:785:26:785:27 | x5 | | file://:0:0:0:0 | & | +| main.rs:785:26:785:27 | x5 | &T | main.rs:743:5:744:19 | S | +| main.rs:785:26:785:27 | x5 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:785:26:785:29 | x5.0 | | main.rs:746:5:747:14 | S2 | +| main.rs:787:13:787:14 | x6 | | file://:0:0:0:0 | & | +| main.rs:787:13:787:14 | x6 | &T | main.rs:743:5:744:19 | S | +| main.rs:787:13:787:14 | x6 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:787:18:787:23 | &... | | file://:0:0:0:0 | & | +| main.rs:787:18:787:23 | &... | &T | main.rs:743:5:744:19 | S | +| main.rs:787:18:787:23 | &... | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:787:19:787:23 | S(...) | | main.rs:743:5:744:19 | S | +| main.rs:787:19:787:23 | S(...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:787:21:787:22 | S2 | | main.rs:746:5:747:14 | S2 | +| main.rs:789:26:789:30 | (...) | | main.rs:743:5:744:19 | S | +| main.rs:789:26:789:30 | (...) | T | main.rs:746:5:747:14 | S2 | +| main.rs:789:26:789:35 | ... .m1() | | main.rs:746:5:747:14 | S2 | +| main.rs:789:27:789:29 | * ... | | main.rs:743:5:744:19 | S | +| main.rs:789:27:789:29 | * ... | T | main.rs:746:5:747:14 | S2 | +| main.rs:789:28:789:29 | x6 | | file://:0:0:0:0 | & | +| main.rs:789:28:789:29 | x6 | &T | main.rs:743:5:744:19 | S | +| main.rs:789:28:789:29 | x6 | &T.T | main.rs:746:5:747:14 | S2 | +| main.rs:796:16:796:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:796:16:796:20 | SelfParam | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | +| main.rs:799:16:799:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:799:16:799:20 | SelfParam | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | +| main.rs:799:32:801:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:799:32:801:9 | { ... } | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | +| main.rs:800:13:800:16 | self | | file://:0:0:0:0 | & | +| main.rs:800:13:800:16 | self | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | +| main.rs:800:13:800:22 | self.foo() | | file://:0:0:0:0 | & | +| main.rs:800:13:800:22 | self.foo() | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | +| main.rs:808:16:808:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:808:16:808:20 | SelfParam | &T | main.rs:804:5:804:20 | MyStruct | +| main.rs:808:36:810:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:808:36:810:9 | { ... } | &T | main.rs:804:5:804:20 | MyStruct | +| main.rs:809:13:809:16 | self | | file://:0:0:0:0 | & | +| main.rs:809:13:809:16 | self | &T | main.rs:804:5:804:20 | MyStruct | +| main.rs:814:13:814:13 | x | | main.rs:804:5:804:20 | MyStruct | +| main.rs:814:17:814:24 | MyStruct | | main.rs:804:5:804:20 | MyStruct | +| main.rs:815:9:815:9 | x | | main.rs:804:5:804:20 | MyStruct | +| main.rs:815:9:815:15 | x.bar() | | file://:0:0:0:0 | & | +| main.rs:815:9:815:15 | x.bar() | &T | main.rs:804:5:804:20 | MyStruct | +| main.rs:825:16:825:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:825:16:825:20 | SelfParam | &T | main.rs:822:5:822:26 | MyStruct | +| main.rs:825:16:825:20 | SelfParam | &T.T | main.rs:824:10:824:10 | T | +| main.rs:825:32:827:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:825:32:827:9 | { ... } | &T | main.rs:822:5:822:26 | MyStruct | +| main.rs:825:32:827:9 | { ... } | &T.T | main.rs:824:10:824:10 | T | +| main.rs:826:13:826:16 | self | | file://:0:0:0:0 | & | +| main.rs:826:13:826:16 | self | &T | main.rs:822:5:822:26 | MyStruct | +| main.rs:826:13:826:16 | self | &T.T | main.rs:824:10:824:10 | T | +| main.rs:831:13:831:13 | x | | main.rs:822:5:822:26 | MyStruct | +| main.rs:831:13:831:13 | x | T | main.rs:820:5:820:13 | S | +| main.rs:831:17:831:27 | MyStruct(...) | | main.rs:822:5:822:26 | MyStruct | +| main.rs:831:17:831:27 | MyStruct(...) | T | main.rs:820:5:820:13 | S | +| main.rs:831:26:831:26 | S | | main.rs:820:5:820:13 | S | +| main.rs:832:9:832:9 | x | | main.rs:822:5:822:26 | MyStruct | +| main.rs:832:9:832:9 | x | T | main.rs:820:5:820:13 | S | +| main.rs:832:9:832:15 | x.foo() | | file://:0:0:0:0 | & | +| main.rs:832:9:832:15 | x.foo() | &T | main.rs:822:5:822:26 | MyStruct | +| main.rs:832:9:832:15 | x.foo() | &T.T | main.rs:820:5:820:13 | S | +| main.rs:840:15:840:19 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:840:15:840:19 | SelfParam | &T | main.rs:837:5:837:13 | S | +| main.rs:840:31:842:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:840:31:842:9 | { ... } | &T | main.rs:837:5:837:13 | S | +| main.rs:841:13:841:19 | &... | | file://:0:0:0:0 | & | +| main.rs:841:13:841:19 | &... | &T | main.rs:837:5:837:13 | S | +| main.rs:841:14:841:19 | &... | | file://:0:0:0:0 | & | +| main.rs:841:14:841:19 | &... | &T | main.rs:837:5:837:13 | S | +| main.rs:841:15:841:19 | &self | | file://:0:0:0:0 | & | +| main.rs:841:15:841:19 | &self | &T | main.rs:837:5:837:13 | S | +| main.rs:841:16:841:19 | self | | file://:0:0:0:0 | & | +| main.rs:841:16:841:19 | self | &T | main.rs:837:5:837:13 | S | +| main.rs:844:15:844:25 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:844:15:844:25 | SelfParam | &T | main.rs:837:5:837:13 | S | +| main.rs:844:37:846:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:844:37:846:9 | { ... } | &T | main.rs:837:5:837:13 | S | +| main.rs:845:13:845:19 | &... | | file://:0:0:0:0 | & | +| main.rs:845:13:845:19 | &... | &T | main.rs:837:5:837:13 | S | +| main.rs:845:14:845:19 | &... | | file://:0:0:0:0 | & | +| main.rs:845:14:845:19 | &... | &T | main.rs:837:5:837:13 | S | +| main.rs:845:15:845:19 | &self | | file://:0:0:0:0 | & | +| main.rs:845:15:845:19 | &self | &T | main.rs:837:5:837:13 | S | +| main.rs:845:16:845:19 | self | | file://:0:0:0:0 | & | +| main.rs:845:16:845:19 | self | &T | main.rs:837:5:837:13 | S | +| main.rs:848:15:848:15 | x | | file://:0:0:0:0 | & | +| main.rs:848:15:848:15 | x | &T | main.rs:837:5:837:13 | S | +| main.rs:848:34:850:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:848:34:850:9 | { ... } | &T | main.rs:837:5:837:13 | S | +| main.rs:849:13:849:13 | x | | file://:0:0:0:0 | & | +| main.rs:849:13:849:13 | x | &T | main.rs:837:5:837:13 | S | +| main.rs:852:15:852:15 | x | | file://:0:0:0:0 | & | +| main.rs:852:15:852:15 | x | &T | main.rs:837:5:837:13 | S | +| main.rs:852:34:854:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:852:34:854:9 | { ... } | &T | main.rs:837:5:837:13 | S | +| main.rs:853:13:853:16 | &... | | file://:0:0:0:0 | & | +| main.rs:853:13:853:16 | &... | &T | main.rs:837:5:837:13 | S | +| main.rs:853:14:853:16 | &... | | file://:0:0:0:0 | & | +| main.rs:853:14:853:16 | &... | &T | main.rs:837:5:837:13 | S | +| main.rs:853:15:853:16 | &x | | file://:0:0:0:0 | & | +| main.rs:853:15:853:16 | &x | &T | main.rs:837:5:837:13 | S | +| main.rs:853:16:853:16 | x | | file://:0:0:0:0 | & | +| main.rs:853:16:853:16 | x | &T | main.rs:837:5:837:13 | S | +| main.rs:858:13:858:13 | x | | main.rs:837:5:837:13 | S | +| main.rs:858:17:858:20 | S {...} | | main.rs:837:5:837:13 | S | +| main.rs:859:9:859:9 | x | | main.rs:837:5:837:13 | S | +| main.rs:859:9:859:14 | x.f1() | | file://:0:0:0:0 | & | +| main.rs:859:9:859:14 | x.f1() | &T | main.rs:837:5:837:13 | S | +| main.rs:860:9:860:9 | x | | main.rs:837:5:837:13 | S | +| main.rs:860:9:860:14 | x.f2() | | file://:0:0:0:0 | & | +| main.rs:860:9:860:14 | x.f2() | &T | main.rs:837:5:837:13 | S | +| main.rs:861:9:861:17 | ...::f3(...) | | file://:0:0:0:0 | & | +| main.rs:861:9:861:17 | ...::f3(...) | &T | main.rs:837:5:837:13 | S | +| main.rs:861:15:861:16 | &x | | file://:0:0:0:0 | & | +| main.rs:861:15:861:16 | &x | &T | main.rs:837:5:837:13 | S | +| main.rs:861:16:861:16 | x | | main.rs:837:5:837:13 | S | +| main.rs:867:5:867:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo | +| main.rs:868:5:868:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo | +| main.rs:868:20:868:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | +| main.rs:868:41:868:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | From 77e1b231a6410cca1c8912ce7fe79bd31e925c10 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Fri, 4 Apr 2025 10:12:23 +0200 Subject: [PATCH 070/372] Rust: Handle associated types in trait methods --- .../rust/elements/internal/TraitImpl.qll | 10 +++ rust/ql/lib/codeql/rust/internal/Type.qll | 64 ++++++++++++++++++- .../codeql/rust/internal/TypeInference.qll | 27 ++++---- .../lib/codeql/rust/internal/TypeMention.qll | 40 +++++++++++- .../test/library-tests/type-inference/main.rs | 6 +- .../type-inference/type-inference.expected | 11 ++++ 6 files changed, 138 insertions(+), 20 deletions(-) diff --git a/rust/ql/lib/codeql/rust/elements/internal/TraitImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/TraitImpl.qll index 63a13673465..0926db57c97 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/TraitImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/TraitImpl.qll @@ -26,5 +26,15 @@ module Impl { */ class Trait extends Generated::Trait { override string toStringImpl() { result = "trait " + this.getName().getText() } + + /** + * Gets the number of generic parameters of this trait. + */ + int getNumberOfGenericParams() { + result = this.getGenericParamList().getNumberOfGenericParams() + or + not this.hasGenericParamList() and + result = 0 + } } } diff --git a/rust/ql/lib/codeql/rust/internal/Type.qll b/rust/ql/lib/codeql/rust/internal/Type.qll index ef311fae6c8..c3eb83c8dfa 100644 --- a/rust/ql/lib/codeql/rust/internal/Type.qll +++ b/rust/ql/lib/codeql/rust/internal/Type.qll @@ -2,9 +2,10 @@ private import rust private import PathResolution -private import TypeInference private import TypeMention private import codeql.rust.internal.CachedStages +private import codeql.rust.elements.internal.generated.Raw +private import codeql.rust.elements.internal.generated.Synth cached newtype TType = @@ -15,6 +16,7 @@ newtype TType = TArrayType() or // todo: add size? TRefType() or // todo: add mut? TTypeParamTypeParameter(TypeParam t) or + TAssociatedTypeTypeParameter(TypeAlias t) { any(TraitItemNode trait).getADescendant() = t } or TRefTypeParameter() or TSelfTypeParameter(Trait t) @@ -144,6 +146,9 @@ class TraitType extends Type, TTrait { override TypeParameter getTypeParameter(int i) { result = TTypeParamTypeParameter(trait.getGenericParamList().getTypeParam(i)) + or + result = + any(AssociatedTypeTypeParameter param | param.getTrait() = trait and param.getIndex() = i) } pragma[nomagic] @@ -297,6 +302,14 @@ abstract class TypeParameter extends Type { override TypeParameter getTypeParameter(int i) { none() } } +private class RawTypeParameter = @type_param or @trait or @type_alias; + +private predicate id(RawTypeParameter x, RawTypeParameter y) { x = y } + +private predicate idOfRaw(RawTypeParameter x, int y) = equivalenceRelation(id/2)(x, y) + +int idOfTypeParameterAstNode(AstNode node) { idOfRaw(Synth::convertAstNodeToRaw(node), result) } + /** A type parameter from source code. */ class TypeParamTypeParameter extends TypeParameter, TTypeParamTypeParameter { private TypeParam typeParam; @@ -320,6 +333,55 @@ class TypeParamTypeParameter extends TypeParameter, TTypeParamTypeParameter { } } +/** Gets type alias that is the `i`th type parameter of `trait`. */ +predicate traitAliasIndex(Trait trait, int i, TypeAlias typeAlias) { + typeAlias = + rank[i + 1 - trait.getNumberOfGenericParams()](TypeAlias alias | + trait.(TraitItemNode).getADescendant() = alias + | + alias order by idOfTypeParameterAstNode(alias) + ) +} + +/** + * A type parameter corresponding to an associated type in a trait. + * + * We treat associated type declarations in traits as type parameters. E.g., a + * trait such as + * ```rust + * trait ATrait { + * type AssociatedType; + * // ... + * } + * ``` + * is treated as if it where + * ```rust + * trait ATrait { + * // ... + * } + * ``` + */ +class AssociatedTypeTypeParameter extends TypeParameter, TAssociatedTypeTypeParameter { + private TypeAlias typeAlias; + + AssociatedTypeTypeParameter() { this = TAssociatedTypeTypeParameter(typeAlias) } + + TypeAlias getTypeAlias() { result = typeAlias } + + /** Gets the trait that contains this associated type declaration. */ + TraitItemNode getTrait() { result.getADescendant() = typeAlias } + + int getIndex() { traitAliasIndex(this.getTrait(), result, typeAlias) } + + override Function getMethod(string name) { none() } + + override string toString() { result = typeAlias.getName().getText() } + + override Location getLocation() { result = typeAlias.getLocation() } + + override TypeMention getABaseTypeMention() { none() } +} + /** An implicit reference type parameter. */ class RefTypeParameter extends TypeParameter, TRefTypeParameter { override Function getMethod(string name) { none() } diff --git a/rust/ql/lib/codeql/rust/internal/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/TypeInference.qll index ed6370f1638..9e38c41cf35 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeInference.qll @@ -40,17 +40,21 @@ private module Input1 implements InputSig1 { private newtype TTypeParameterPosition = TTypeParamTypeParameterPosition(TypeParam tp) or - TSelfTypeParameterPosition() + TImplicitTypeParameterPosition() class TypeParameterPosition extends TTypeParameterPosition { TypeParam asTypeParam() { this = TTypeParamTypeParameterPosition(result) } - predicate isSelf() { this = TSelfTypeParameterPosition() } + /** + * Holds if this is the implicit type parameter position used to represent + * parameters that are never passed explicitly as arguments. + */ + predicate isImplicit() { this = TImplicitTypeParameterPosition() } string toString() { result = this.asTypeParam().toString() or - result = "Self" and this.isSelf() + result = "Implicit" and this.isImplicit() } } @@ -69,15 +73,6 @@ private module Input1 implements InputSig1 { apos.asMethodTypeArgumentPosition() = ppos.asTypeParam().getPosition() } - /** A raw AST node that might correspond to a type parameter. */ - private class RawTypeParameter = @type_param or @trait; - - private predicate id(RawTypeParameter x, RawTypeParameter y) { x = y } - - private predicate idOfRaw(RawTypeParameter x, int y) = equivalenceRelation(id/2)(x, y) - - private int idOf(AstNode node) { idOfRaw(Synth::convertAstNodeToRaw(node), result) } - int getTypeParameterId(TypeParameter tp) { tp = rank[result](TypeParameter tp0, int kind, int id | @@ -86,8 +81,9 @@ private module Input1 implements InputSig1 { id = 0 or kind = 1 and - exists(AstNode node | id = idOf(node) | + exists(AstNode node | id = idOfTypeParameterAstNode(node) | node = tp0.(TypeParamTypeParameter).getTypeParam() or + node = tp0.(AssociatedTypeTypeParameter).getTypeAlias() or node = tp0.(SelfTypeParameter).getTrait() ) | @@ -500,7 +496,10 @@ private module CallExprBaseMatchingInput implements MatchingInputSig { exists(TraitItemNode trait | this = trait.getAnAssocItem() | typeParamMatchPosition(trait.getTypeParam(_), result, ppos) or - ppos.isSelf() and result = TSelfTypeParameter(trait) + ppos.isImplicit() and result = TSelfTypeParameter(trait) + or + ppos.isImplicit() and + result.(AssociatedTypeTypeParameter).getTrait() = trait ) } diff --git a/rust/ql/lib/codeql/rust/internal/TypeMention.qll b/rust/ql/lib/codeql/rust/internal/TypeMention.qll index a5e696313a3..b049d9b7177 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeMention.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeMention.qll @@ -75,6 +75,27 @@ class PathMention extends TypeMention, Path { this = node.getASelfPath() and result = node.(ImplItemNode).getSelfPath().getSegment().getGenericArgList().getTypeArg(i) ) + or + // If `this` is the trait of an `impl` block then any associated types + // defined in the `impl` block are type arguments to the trait. + // + // For instance, for a trait implementation like this + // ```rust + // impl MyTrait for MyType { + // ^^^^^^^ this + // type AssociatedType = i64 + // ^^^ result + // // ... + // } + // ``` + // the rhs. of the type alias is a type argument to the trait. + exists(ImplItemNode impl, AssociatedTypeTypeParameter param, TypeAlias alias | + this = impl.getTraitPath() and + param.getTrait() = resolvePath(this) and + alias = impl.getASuccessor(param.getTypeAlias().getName().getText()) and + result = alias.getTypeRepr() and + param.getIndex() = i + ) } override Type resolveType() { @@ -93,7 +114,11 @@ class PathMention extends TypeMention, Path { or result = TTypeParamTypeParameter(i) or - result = i.(TypeAlias).getTypeRepr().(TypeReprMention).resolveType() + exists(TypeAlias alias | alias = i | + result.(AssociatedTypeTypeParameter).getTypeAlias() = alias + or + result = alias.getTypeRepr().(TypeReprMention).resolveType() + ) ) } } @@ -106,6 +131,13 @@ class TypeParamMention extends TypeMention, TypeParam { override Type resolveType() { result = TTypeParamTypeParameter(this) } } +// Used to represent implicit associated type type arguments in traits. +class TypeAliasMention extends TypeMention, TypeAlias { + override TypeReprMention getTypeArgument(int i) { none() } + + override Type resolveType() { result = TAssociatedTypeTypeParameter(this) } +} + /** * Holds if the `i`th type argument of `selfPath`, belonging to `impl`, resolves * to type parameter `tp`. @@ -157,7 +189,11 @@ class ImplMention extends TypeMention, ImplItemNode { } class TraitMention extends TypeMention, TraitItemNode { - override TypeMention getTypeArgument(int i) { result = this.getTypeParam(i) } + override TypeMention getTypeArgument(int i) { + result = this.getTypeParam(i) + or + traitAliasIndex(this, i, result) + } override Type resolveType() { result = TTrait(this) } } diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index 1a4462d54c4..efe1a3444e0 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -351,7 +351,7 @@ mod trait_associated_type { Self::AssociatedType: Default, Self: Sized, { - self.m1(); // $ method=MyTrait::m1 + self.m1(); // $ method=MyTrait::m1 type=self.m1():AssociatedType Self::AssociatedType::default() } } @@ -424,7 +424,7 @@ mod trait_associated_type { let x2 = S; // Call to default method in `trait` block - let y = x2.m2(); // $ method=m2 MISSING: type=y:AT + let y = x2.m2(); // $ method=m2 type=y:AT println!("{:?}", y); let x3 = S; @@ -440,7 +440,7 @@ mod trait_associated_type { let x5 = S2; println!("{:?}", x5.m1()); // $ method=m1 MISSING: type=x5.m1():A.S2 let x6 = S2; - println!("{:?}", x6.m2()); // $ method=m2 MISSING: type=x6.m2():A.S2 + println!("{:?}", x6.m2()); // $ method=m2 type=x6.m2():A.S2 } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 94cc8c42a0b..907ea9fcc53 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -336,7 +336,10 @@ inferType | main.rs:339:13:339:22 | self.field | | main.rs:337:10:337:10 | A | | main.rs:347:15:347:18 | SelfParam | | main.rs:343:5:357:5 | Self [trait MyTrait] | | main.rs:349:15:349:18 | SelfParam | | main.rs:343:5:357:5 | Self [trait MyTrait] | +| main.rs:353:9:356:9 | { ... } | | main.rs:344:9:344:28 | AssociatedType | | main.rs:354:13:354:16 | self | | main.rs:343:5:357:5 | Self [trait MyTrait] | +| main.rs:354:13:354:21 | self.m1() | | main.rs:344:9:344:28 | AssociatedType | +| main.rs:355:13:355:43 | ...::default(...) | | main.rs:344:9:344:28 | AssociatedType | | main.rs:363:19:363:23 | SelfParam | | file://:0:0:0:0 | & | | main.rs:363:19:363:23 | SelfParam | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | | main.rs:363:26:363:26 | a | | main.rs:363:16:363:16 | A | @@ -344,11 +347,14 @@ inferType | main.rs:365:22:365:26 | SelfParam | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | | main.rs:365:29:365:29 | a | | main.rs:365:19:365:19 | A | | main.rs:365:35:365:35 | b | | main.rs:365:19:365:19 | A | +| main.rs:365:75:368:9 | { ... } | | main.rs:360:9:360:52 | GenericAssociatedType | | main.rs:366:13:366:16 | self | | file://:0:0:0:0 | & | | main.rs:366:13:366:16 | self | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | +| main.rs:366:13:366:23 | self.put(...) | | main.rs:360:9:360:52 | GenericAssociatedType | | main.rs:366:22:366:22 | a | | main.rs:365:19:365:19 | A | | main.rs:367:13:367:16 | self | | file://:0:0:0:0 | & | | main.rs:367:13:367:16 | self | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | +| main.rs:367:13:367:23 | self.put(...) | | main.rs:360:9:360:52 | GenericAssociatedType | | main.rs:367:22:367:22 | b | | main.rs:365:19:365:19 | A | | main.rs:384:15:384:18 | SelfParam | | main.rs:371:5:372:13 | S | | main.rs:384:45:386:9 | { ... } | | main.rs:377:5:378:14 | AT | @@ -380,7 +386,10 @@ inferType | main.rs:423:26:423:32 | x1.m1() | | main.rs:377:5:378:14 | AT | | main.rs:425:13:425:14 | x2 | | main.rs:371:5:372:13 | S | | main.rs:425:18:425:18 | S | | main.rs:371:5:372:13 | S | +| main.rs:427:13:427:13 | y | | main.rs:377:5:378:14 | AT | | main.rs:427:17:427:18 | x2 | | main.rs:371:5:372:13 | S | +| main.rs:427:17:427:23 | x2.m2() | | main.rs:377:5:378:14 | AT | +| main.rs:428:26:428:26 | y | | main.rs:377:5:378:14 | AT | | main.rs:430:13:430:14 | x3 | | main.rs:371:5:372:13 | S | | main.rs:430:18:430:18 | S | | main.rs:371:5:372:13 | S | | main.rs:432:26:432:27 | x3 | | main.rs:371:5:372:13 | S | @@ -394,6 +403,8 @@ inferType | main.rs:442:13:442:14 | x6 | | main.rs:374:5:375:14 | S2 | | main.rs:442:18:442:19 | S2 | | main.rs:374:5:375:14 | S2 | | main.rs:443:26:443:27 | x6 | | main.rs:374:5:375:14 | S2 | +| main.rs:443:26:443:32 | x6.m2() | | main.rs:332:5:335:5 | Wrapper | +| main.rs:443:26:443:32 | x6.m2() | A | main.rs:374:5:375:14 | S2 | | main.rs:460:15:460:18 | SelfParam | | main.rs:448:5:452:5 | MyEnum | | main.rs:460:15:460:18 | SelfParam | A | main.rs:459:10:459:10 | T | | main.rs:460:26:465:9 | { ... } | | main.rs:459:10:459:10 | T | From adfe89fadc4b2f83a9d5c34ab8cd3e4cd3746ccc Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Fri, 4 Apr 2025 09:47:21 +0100 Subject: [PATCH 071/372] Update test output --- .../capture/LoopVariableCapture.expected | 34 ++++++++++++++----- .../capture/LoopVariableCapture.qlref | 2 +- .../query-tests/Variables/capture/test.py | 19 ++++++----- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected b/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected index 8fd40c120a6..d7e15f44e6c 100644 --- a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected +++ b/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected @@ -1,8 +1,26 @@ -| test.py:5:9:5:20 | FunctionExpr | Capture of loop variable $@. | test.py:4:5:4:23 | For | x | -| test.py:10:6:10:14 | Lambda | Capture of loop variable $@. | test.py:10:5:10:36 | ListComp | i | -| test.py:42:6:42:14 | Lambda | Capture of loop variable $@. | test.py:42:5:42:56 | ListComp | i | -| test.py:43:6:43:14 | Lambda | Capture of loop variable $@. | test.py:43:5:43:56 | ListComp | j | -| test.py:45:6:45:14 | Lambda | Capture of loop variable $@. | test.py:45:5:45:36 | SetComp | i | -| test.py:49:8:49:16 | Lambda | Capture of loop variable $@. | test.py:49:5:49:38 | DictComp | i | -| test.py:57:6:57:14 | Lambda | Capture of loop variable $@. | test.py:57:6:57:35 | GeneratorExp | i | -| test.py:62:10:62:18 | Lambda | Capture of loop variable $@. | test.py:62:10:62:39 | GeneratorExp | i | +edges +| test.py:5:9:5:20 | ControlFlowNode for FunctionExpr | test.py:5:13:5:17 | ControlFlowNode for inner | provenance | | +| test.py:5:13:5:17 | ControlFlowNode for inner | test.py:7:20:7:24 | ControlFlowNode for inner | provenance | | +| test.py:49:8:49:16 | ControlFlowNode for Lambda | test.py:49:6:49:16 | ControlFlowNode for Tuple | provenance | | +nodes +| test.py:5:9:5:20 | ControlFlowNode for FunctionExpr | semmle.label | ControlFlowNode for FunctionExpr | +| test.py:5:13:5:17 | ControlFlowNode for inner | semmle.label | ControlFlowNode for inner | +| test.py:7:20:7:24 | ControlFlowNode for inner | semmle.label | ControlFlowNode for inner | +| test.py:10:6:10:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +| test.py:42:6:42:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +| test.py:43:6:43:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +| test.py:45:6:45:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +| test.py:49:6:49:16 | ControlFlowNode for Tuple | semmle.label | ControlFlowNode for Tuple | +| test.py:49:8:49:16 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +| test.py:57:6:57:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +| test.py:62:10:62:18 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | +subpaths +#select +| test.py:5:9:5:20 | FunctionExpr | test.py:5:9:5:20 | ControlFlowNode for FunctionExpr | test.py:7:20:7:24 | ControlFlowNode for inner | This function captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:4:5:4:23 | For | x | test.py:7:20:7:24 | ControlFlowNode for inner | this location | +| test.py:10:6:10:14 | Lambda | test.py:10:6:10:14 | ControlFlowNode for Lambda | test.py:10:6:10:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:10:5:10:36 | For | i | test.py:10:6:10:14 | ControlFlowNode for Lambda | this location | +| test.py:42:6:42:14 | Lambda | test.py:42:6:42:14 | ControlFlowNode for Lambda | test.py:42:6:42:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:42:5:42:56 | For | i | test.py:42:6:42:14 | ControlFlowNode for Lambda | this location | +| test.py:43:6:43:14 | Lambda | test.py:43:6:43:14 | ControlFlowNode for Lambda | test.py:43:6:43:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:43:5:43:56 | For | j | test.py:43:6:43:14 | ControlFlowNode for Lambda | this location | +| test.py:45:6:45:14 | Lambda | test.py:45:6:45:14 | ControlFlowNode for Lambda | test.py:45:6:45:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:45:5:45:36 | For | i | test.py:45:6:45:14 | ControlFlowNode for Lambda | this location | +| test.py:49:8:49:16 | Lambda | test.py:49:8:49:16 | ControlFlowNode for Lambda | test.py:49:6:49:16 | ControlFlowNode for Tuple | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:49:5:49:38 | For | i | test.py:49:6:49:16 | ControlFlowNode for Tuple | this location | +| test.py:57:6:57:14 | Lambda | test.py:57:6:57:14 | ControlFlowNode for Lambda | test.py:57:6:57:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:57:6:57:35 | For | i | test.py:57:6:57:14 | ControlFlowNode for Lambda | this location | +| test.py:62:10:62:18 | Lambda | test.py:62:10:62:18 | ControlFlowNode for Lambda | test.py:62:10:62:18 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:62:10:62:39 | For | i | test.py:62:10:62:18 | ControlFlowNode for Lambda | this location | diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref b/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref index 1e2a71cd6a7..05bfcbd9420 100644 --- a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref +++ b/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref @@ -1 +1 @@ -Variables/LoopVariableCapture.ql +Variables/LoopVariableCapture/LoopVariableCapture.ql diff --git a/python/ql/test/query-tests/Variables/capture/test.py b/python/ql/test/query-tests/Variables/capture/test.py index 480bc58862e..5ffccc7a9e4 100644 --- a/python/ql/test/query-tests/Variables/capture/test.py +++ b/python/ql/test/query-tests/Variables/capture/test.py @@ -2,12 +2,12 @@ def bad1(): results = [] for x in range(10): - def inner(): + def inner(): # $capturedVar=x return x results.append(inner) return results -a = [lambda: i for i in range(1, 4)] +a = [lambda: i for i in range(1, 4)] # $capturedVar=a for f in a: print(f()) @@ -39,14 +39,14 @@ def ok1(): result += inner() return result -b = [lambda: i for i in range(1, 4) for j in range(1,5)] -c = [lambda: j for i in range(1, 4) for j in range(1,5)] +b = [lambda: i for i in range(1, 4) for j in range(1,5)] # $capturedVar=i +c = [lambda: j for i in range(1, 4) for j in range(1,5)] # $capturedVar=j -s = {lambda: i for i in range(1, 4)} +s = {lambda: i for i in range(1, 4)} # $capturedVar=i for f in s: print(f()) -d = {i:lambda: i for i in range(1, 4)} +d = {i:lambda: i for i in range(1, 4)} # $capturedVar=d for k, f in d.items(): print(k, f()) @@ -54,14 +54,15 @@ for k, f in d.items(): #When the captured variable is used. #So technically this is a false positive, but it is extremely fragile #code, so I (Mark) think it is fine to report it as a violation. -g = (lambda: i for i in range(1, 4)) +g = (lambda: i for i in range(1, 4)) # $capturedVar=i for f in g: print(f()) #But not if evaluated eagerly -l = list(lambda: i for i in range(1, 4)) +l = list(lambda: i for i in range(1, 4)) # $capturedVar=i for f in l: print(f()) +# This result is MISSING since the lambda is not detected to escape the loop def odasa4860(asset_ids): - return dict((asset_id, filter(lambda c : c.asset_id == asset_id, xxx)) for asset_id in asset_ids) + return dict((asset_id, filter(lambda c : c.asset_id == asset_id, xxx)) for asset_id in asset_ids) # $MISSING: capturedVar=asset_id From f96b00a62ab667bea496948718cdf59dd510311d Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:53:13 +0100 Subject: [PATCH 072/372] Update rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs Co-authored-by: Simon Friis Vindum --- .../queries/security/CWE-770/UncontrolledAllocationSizeGood.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs index c0758431289..92c9a5b291b 100644 --- a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSizeGood.rs @@ -3,7 +3,7 @@ const BUFFER_LIMIT: usize = 10 * 1024; fn allocate_buffer(user_input: String) -> Result<*mut u8, Error> { let size = user_input.parse::()?; - if (size > BUFFER_LIMIT) { + if size > BUFFER_LIMIT { return Err("Size exceeds limit".into()); } let num_bytes = size * std::mem::size_of::(); From 44b26e5ae6a8912a34ac9e776b3f39220277a0b1 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:54:41 +0100 Subject: [PATCH 073/372] Rust: Change the test copy of the example as well. --- rust/ql/test/query-tests/security/CWE-770/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/test/query-tests/security/CWE-770/main.rs b/rust/ql/test/query-tests/security/CWE-770/main.rs index 37533e746ed..6d786dd0323 100644 --- a/rust/ql/test/query-tests/security/CWE-770/main.rs +++ b/rust/ql/test/query-tests/security/CWE-770/main.rs @@ -291,7 +291,7 @@ const BUFFER_LIMIT: usize = 10 * 1024; fn allocate_buffer_good(user_input: String) -> Result<*mut u8, Error> { let size = user_input.parse::()?; - if (size > BUFFER_LIMIT) { + if size > BUFFER_LIMIT { return Err("Size exceeds limit".into()); } let num_bytes = size * std::mem::size_of::(); From 9fb1c312067e50c29010947d0b19de7178c08a3d Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Fri, 4 Apr 2025 10:13:39 +0100 Subject: [PATCH 074/372] Update tests to inline expectations --- .../LoopVariableCapture.ql | 72 +---------------- .../LoopVariableCaptureQuery.qll | 81 +++++++++++++++++++ .../capture/LoopVariableCapture.expected | 26 ------ .../capture/LoopVariableCapture.qlref | 1 - .../capture/LoopVariableCaptureTest.expected | 0 .../capture/LoopVariableCaptureTest.ql | 19 +++++ .../query-tests/Variables/capture/test.py | 15 +++- 7 files changed, 112 insertions(+), 102 deletions(-) create mode 100644 python/ql/src/Variables/LoopVariableCapture/LoopVariableCaptureQuery.qll delete mode 100644 python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected delete mode 100644 python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref create mode 100644 python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.expected create mode 100644 python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index 49392e3d01e..9c8822a3f6b 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -10,80 +10,10 @@ */ import python +import LoopVariableCaptureQuery import semmle.python.dataflow.new.DataFlow - -abstract class Loop extends AstNode { - abstract Variable getALoopVariable(); -} - -class ForLoop extends Loop, For { - override Variable getALoopVariable() { - this.getTarget() = result.getAnAccess().getParentNode*() and - result.getScope() = this.getScope() - } -} - -predicate capturesLoopVariable(CallableExpr capturing, Loop loop, Variable var) { - var.getAnAccess().getScope() = capturing.getInnerScope() and - capturing.getParentNode+() = loop and - var = loop.getALoopVariable() -} - -module EscapingCaptureFlowConfig implements DataFlow::ConfigSig { - predicate isSource(DataFlow::Node node) { capturesLoopVariable(node.asExpr(), _, _) } - - predicate isSink(DataFlow::Node node) { - // Stored in a field. - // This appeared to lead to FPs through wrapper classes. - // exists(DataFlow::AttrWrite aw | aw.getObject() = node) - // or - // Stored in a dict/list. - exists(Assign assign, Subscript sub | - sub = assign.getATarget() and node.asExpr() = assign.getValue() - ) - or - // Stored in a list. - exists(DataFlow::MethodCallNode mc | mc.calls(_, "append") and node = mc.getArg(0)) - or - // Used in a yield statement, likely included in a collection. - // The element of comprehension expressions desugar to involve a yield statement internally. - exists(Yield y | node.asExpr() = y.getValue()) - } - - predicate isBarrierOut(DataFlow::Node node) { isSink(node) } - - predicate isBarrier(DataFlow::Node node) { - // Incorrect virtual dispatch to __call__ methods is a source of FPs. - exists(Function call | - call.getName() = "__call__" and - call.getArg(0) = node.(DataFlow::ParameterNode).getParameter() - ) - } - - predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet cs) { - isSink(node) and - ( - cs instanceof DataFlow::TupleElementContent or - cs instanceof DataFlow::ListElementContent or - cs instanceof DataFlow::SetElementContent or - cs instanceof DataFlow::DictionaryElementAnyContent - ) - } -} - -module EscapingCaptureFlow = DataFlow::Global; - import EscapingCaptureFlow::PathGraph -predicate escapingCapture( - CallableExpr capturing, Loop loop, Variable var, EscapingCaptureFlow::PathNode source, - EscapingCaptureFlow::PathNode sink -) { - capturesLoopVariable(capturing, loop, var) and - capturing = source.getNode().asExpr() and - EscapingCaptureFlow::flowPath(source, sink) -} - from CallableExpr capturing, AstNode loop, Variable var, string descr, EscapingCaptureFlow::PathNode source, EscapingCaptureFlow::PathNode sink diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCaptureQuery.qll b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCaptureQuery.qll new file mode 100644 index 00000000000..ed0c6496141 --- /dev/null +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCaptureQuery.qll @@ -0,0 +1,81 @@ +/** Definitions for reasoning about loop variable capture issues. */ + +import python +import semmle.python.dataflow.new.DataFlow + +/** A looping construct. */ +abstract class Loop extends AstNode { + /** + * Gets a loop variable of this loop. + * For example, `x` and `y` in `for x,y in pairs: print(x+y)` + */ + abstract Variable getALoopVariable(); +} + +/** A `for` loop. */ +private class ForLoop extends Loop, For { + override Variable getALoopVariable() { + this.getTarget() = result.getAnAccess().getParentNode*() and + result.getScope() = this.getScope() + } +} + +/** Holds if the callable `capturing` captures the variable `var` from the loop `loop`. */ +predicate capturesLoopVariable(CallableExpr capturing, Loop loop, Variable var) { + var.getAnAccess().getScope() = capturing.getInnerScope() and + capturing.getParentNode+() = loop and + var = loop.getALoopVariable() +} + +/** Dataflow configuration for reasoning about callables that capture a loop variable and then may escape from the loop. */ +module EscapingCaptureFlowConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node node) { capturesLoopVariable(node.asExpr(), _, _) } + + predicate isSink(DataFlow::Node node) { + // Stored in a dict/list. + exists(Assign assign, Subscript sub | + sub = assign.getATarget() and node.asExpr() = assign.getValue() + ) + or + // Stored in a list. + exists(DataFlow::MethodCallNode mc | mc.calls(_, "append") and node = mc.getArg(0)) + or + // Used in a yield statement, likely included in a collection. + // The element of comprehension expressions desugar to involve a yield statement internally. + exists(Yield y | node.asExpr() = y.getValue()) + // Checks for storing in a field leads to false positives, so are omitted. + } + + predicate isBarrierOut(DataFlow::Node node) { isSink(node) } + + predicate isBarrier(DataFlow::Node node) { + // Incorrect virtual dispatch to __call__ methods is a source of FPs. + exists(Function call | + call.getName() = "__call__" and + call.getArg(0) = node.(DataFlow::ParameterNode).getParameter() + ) + } + + predicate allowImplicitRead(DataFlow::Node node, DataFlow::ContentSet cs) { + isSink(node) and + ( + cs instanceof DataFlow::TupleElementContent or + cs instanceof DataFlow::ListElementContent or + cs instanceof DataFlow::SetElementContent or + cs instanceof DataFlow::DictionaryElementAnyContent + ) + } +} + +/** Dataflow for reasoning about callables that capture a loop variable and then escape from the loop. */ +module EscapingCaptureFlow = DataFlow::Global; + +/** Holds if `capturing` is a callable that captures the variable `var` of the loop `loop`, and then may escape the loop via a flow path from `source` to `sink`. */ +predicate escapingCapture( + CallableExpr capturing, Loop loop, Variable var, EscapingCaptureFlow::PathNode source, + EscapingCaptureFlow::PathNode sink +) { + capturesLoopVariable(capturing, loop, var) and + capturing = source.getNode().asExpr() and + EscapingCaptureFlow::flowPath(source, sink) +} diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected b/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected deleted file mode 100644 index d7e15f44e6c..00000000000 --- a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.expected +++ /dev/null @@ -1,26 +0,0 @@ -edges -| test.py:5:9:5:20 | ControlFlowNode for FunctionExpr | test.py:5:13:5:17 | ControlFlowNode for inner | provenance | | -| test.py:5:13:5:17 | ControlFlowNode for inner | test.py:7:20:7:24 | ControlFlowNode for inner | provenance | | -| test.py:49:8:49:16 | ControlFlowNode for Lambda | test.py:49:6:49:16 | ControlFlowNode for Tuple | provenance | | -nodes -| test.py:5:9:5:20 | ControlFlowNode for FunctionExpr | semmle.label | ControlFlowNode for FunctionExpr | -| test.py:5:13:5:17 | ControlFlowNode for inner | semmle.label | ControlFlowNode for inner | -| test.py:7:20:7:24 | ControlFlowNode for inner | semmle.label | ControlFlowNode for inner | -| test.py:10:6:10:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -| test.py:42:6:42:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -| test.py:43:6:43:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -| test.py:45:6:45:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -| test.py:49:6:49:16 | ControlFlowNode for Tuple | semmle.label | ControlFlowNode for Tuple | -| test.py:49:8:49:16 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -| test.py:57:6:57:14 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -| test.py:62:10:62:18 | ControlFlowNode for Lambda | semmle.label | ControlFlowNode for Lambda | -subpaths -#select -| test.py:5:9:5:20 | FunctionExpr | test.py:5:9:5:20 | ControlFlowNode for FunctionExpr | test.py:7:20:7:24 | ControlFlowNode for inner | This function captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:4:5:4:23 | For | x | test.py:7:20:7:24 | ControlFlowNode for inner | this location | -| test.py:10:6:10:14 | Lambda | test.py:10:6:10:14 | ControlFlowNode for Lambda | test.py:10:6:10:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:10:5:10:36 | For | i | test.py:10:6:10:14 | ControlFlowNode for Lambda | this location | -| test.py:42:6:42:14 | Lambda | test.py:42:6:42:14 | ControlFlowNode for Lambda | test.py:42:6:42:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:42:5:42:56 | For | i | test.py:42:6:42:14 | ControlFlowNode for Lambda | this location | -| test.py:43:6:43:14 | Lambda | test.py:43:6:43:14 | ControlFlowNode for Lambda | test.py:43:6:43:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:43:5:43:56 | For | j | test.py:43:6:43:14 | ControlFlowNode for Lambda | this location | -| test.py:45:6:45:14 | Lambda | test.py:45:6:45:14 | ControlFlowNode for Lambda | test.py:45:6:45:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:45:5:45:36 | For | i | test.py:45:6:45:14 | ControlFlowNode for Lambda | this location | -| test.py:49:8:49:16 | Lambda | test.py:49:8:49:16 | ControlFlowNode for Lambda | test.py:49:6:49:16 | ControlFlowNode for Tuple | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:49:5:49:38 | For | i | test.py:49:6:49:16 | ControlFlowNode for Tuple | this location | -| test.py:57:6:57:14 | Lambda | test.py:57:6:57:14 | ControlFlowNode for Lambda | test.py:57:6:57:14 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:57:6:57:35 | For | i | test.py:57:6:57:14 | ControlFlowNode for Lambda | this location | -| test.py:62:10:62:18 | Lambda | test.py:62:10:62:18 | ControlFlowNode for Lambda | test.py:62:10:62:18 | ControlFlowNode for Lambda | This lambda captures the loop variable $@, and may escape the loop by being stored at $@. | test.py:62:10:62:39 | For | i | test.py:62:10:62:18 | ControlFlowNode for Lambda | this location | diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref b/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref deleted file mode 100644 index 05bfcbd9420..00000000000 --- a/python/ql/test/query-tests/Variables/capture/LoopVariableCapture.qlref +++ /dev/null @@ -1 +0,0 @@ -Variables/LoopVariableCapture/LoopVariableCapture.ql diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.expected b/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql b/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql new file mode 100644 index 00000000000..792fa2159cb --- /dev/null +++ b/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql @@ -0,0 +1,19 @@ +import python +import Variables.LoopVariableCapture.LoopVariableCaptureQuery +import utils.test.InlineExpectationsTest + +module MethodArgTest implements TestSig { + string getARelevantTag() { result = ["capturedVar"] } + + predicate hasActualResult(Location location, string element, string tag, string value) { + exists(CallableExpr capturing, AstNode loop, Variable var | + escapingCapture(capturing, loop, var, _, _) and + element = capturing.toString() and + location = capturing.getLocation() and + tag = "capturedVar" and + value = var.getId() + ) + } +} + +import MakeTest diff --git a/python/ql/test/query-tests/Variables/capture/test.py b/python/ql/test/query-tests/Variables/capture/test.py index 5ffccc7a9e4..186a19b7570 100644 --- a/python/ql/test/query-tests/Variables/capture/test.py +++ b/python/ql/test/query-tests/Variables/capture/test.py @@ -4,10 +4,10 @@ def bad1(): for x in range(10): def inner(): # $capturedVar=x return x - results.append(inner) + results.append(inner) return results -a = [lambda: i for i in range(1, 4)] # $capturedVar=a +a = [lambda: i for i in range(1, 4)] # $capturedVar=i for f in a: print(f()) @@ -18,7 +18,14 @@ def good1(): for y in range(10): def inner(y=y): return y - results.append(inner) + results.append(inner) + return results + +# OK: Using default argument. +def good2(): + results = [] + for y in range(10): + results.append(lambda y=y: y) return results #Factory function @@ -46,7 +53,7 @@ s = {lambda: i for i in range(1, 4)} # $capturedVar=i for f in s: print(f()) -d = {i:lambda: i for i in range(1, 4)} # $capturedVar=d +d = {i:lambda: i for i in range(1, 4)} # $capturedVar=i for k, f in d.items(): print(k, f()) From 49194b03400ad8f940e80bef5940f88e12afc575 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 09:20:40 +0200 Subject: [PATCH 075/372] Updated `WebSocketReceiveNode` with API graphs. --- .../ql/lib/semmle/javascript/frameworks/WebSocket.qll | 6 +++--- .../frameworks/WebSocket/browser-custom.js | 8 ++++---- .../frameworks/WebSocket/client-custom.js | 2 +- .../library-tests/frameworks/WebSocket/test.expected | 10 ++++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index 09c9f98e3f0..0455bb69172 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -159,8 +159,8 @@ module ClientWebSocket { private DataFlow::FunctionNode getAMessageHandler( ClientWebSocket::ClientSocket emitter, string methodName ) { - exists(DataFlow::CallNode call | - call = emitter.getAMemberCall(methodName) and + exists(API::CallNode call | + call = emitter.getReturn().getMember(methodName).getACall() and call.getArgument(0).mayHaveStringValue("message") and result = call.getCallback(1) ) @@ -175,7 +175,7 @@ module ClientWebSocket { WebSocketReceiveNode() { this = getAMessageHandler(emitter, "addEventListener") or - this = emitter.getAPropertyWrite("onmessage").getRhs() + this = emitter.getReturn().getMember("onmessage").getAValueReachingSink() } override DataFlow::Node getReceivedItem(int i) { diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index 11765138f55..95c931f5cee 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -41,11 +41,11 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ myWebSocketInstance.addEventListener('message', function (event) { console.log('Message from server ', event.data); - }); // $ MISSING: clientReceive + }); // $ clientReceive myWebSocketInstance.onmessage = function (event) { console.log("Message from server 2", event.data) - }; // $ MISSING: clientReceive + }; // $ clientReceive })(); @@ -57,9 +57,9 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ mySockJSInstance.onmessage = function (e) { console.log('message', e.data); mySockJSInstance.close(); - }; // $ MISSING: clientReceive + }; // $ clientReceive mySockJSInstance.addEventListener('message', function (event) { console.log('Using addEventListener ', event.data); - }); // $ MISSING: clientReceive + }); // $ clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js index 5d7ac4b564d..dd8c84e87c0 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js @@ -19,5 +19,5 @@ const { MyWebSocketWS, myWebSocketWSInstance } = require('./client.js'); myWebSocketWSInstance.on('message', function incoming(data) { console.log(data); - }); // $ MISSING: clientReceive + }); // $ clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 4d7e33f5402..a5c55cf6363 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -3,11 +3,16 @@ clientReceive | browser-custom.js:14:21:16:2 | functio ... ata)\\n\\t} | | browser-custom.js:26:19:29:2 | functio ... e();\\n\\t} | | browser-custom.js:31:35:33:2 | functio ... ta);\\n\\t} | +| browser-custom.js:42:53:44:5 | functio ... ;\\n } | +| browser-custom.js:46:37:48:5 | functio ... )\\n } | +| browser-custom.js:57:34:60:5 | functio ... ;\\n } | +| browser-custom.js:62:50:64:5 | functio ... ;\\n } | | browser.js:8:37:10:2 | functio ... ta);\\n\\t} | | browser.js:12:21:14:2 | functio ... ata)\\n\\t} | | browser.js:24:19:27:2 | functio ... e();\\n\\t} | | browser.js:29:35:31:2 | functio ... ta);\\n\\t} | | client-custom.js:10:19:12:2 | functio ... ta);\\n\\t} | +| client-custom.js:20:38:22:2 | functio ... ta);\\n\\t} | | client.js:10:19:12:2 | functio ... ta);\\n\\t} | clientSend | browser-custom.js:7:3:7:33 | socket. ... wser!') | @@ -47,14 +52,19 @@ flowSteps | client.js:16:40:16:72 | new Web ... e.org') | client-custom.js:1:24:1:44 | myWebSo ... nstance | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:11:39:11:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | +| server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:43:45:43:54 | event.data | +| server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:47:46:47:55 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | client-custom.js:10:37:10:40 | data | +| server.js:11:11:11:27 | 'Hi from server!' | client-custom.js:20:56:20:59 | data | | server.js:11:11:11:27 | 'Hi from server!' | client.js:10:37:10:40 | data | | server.js:15:36:15:55 | require('ws').Server | server-custom.js:1:9:1:25 | MyWebSocketServer | | server.js:16:44:16:79 | new Web ... 8080 }) | server-custom.js:1:28:1:52 | myWebSo ... nstance | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:27:26:27:31 | e.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:32:42:32:51 | event.data | +| sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:58:32:58:37 | e.data | +| sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser-custom.js:63:48:63:57 | event.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:25:26:25:31 | e.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:30:42:30:51 | event.data | remoteFlow From 4b7a9cd399d68ac8bb1b06f05f07bd5d84142b63 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 09:25:50 +0200 Subject: [PATCH 076/372] Added test case with `bind`. --- .../library-tests/frameworks/WebSocket/browser-custom.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index 95c931f5cee..a426b6768a6 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -63,3 +63,12 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ console.log('Using addEventListener ', event.data); }); // $ clientReceive })(); + + +const recv_message = function (e) { + console.log('Received message:', e.data); +}; // $ MISSING: clientReceive + +(function () { + myWebSocketInstance.onmessage = recv_message.bind(this); +})(); From c5860e92ec84b3d681175b83ab534a80501c6418 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 09:26:45 +0200 Subject: [PATCH 077/372] Updated `WebSocketReceiveNode` to match bind functions. --- .../ql/lib/semmle/javascript/frameworks/WebSocket.qll | 6 ++++++ .../library-tests/frameworks/WebSocket/browser-custom.js | 2 +- .../test/library-tests/frameworks/WebSocket/test.expected | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index 0455bb69172..98aef6ed096 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -176,6 +176,12 @@ module ClientWebSocket { this = getAMessageHandler(emitter, "addEventListener") or this = emitter.getReturn().getMember("onmessage").getAValueReachingSink() + or + exists(DataFlow::MethodCallNode bindCall | + bindCall = emitter.getReturn().getMember("onmessage").getAValueReachingSink() and + bindCall.getMethodName() = "bind" and + this = bindCall.getReceiver().getAFunctionValue() + ) } override DataFlow::Node getReceivedItem(int i) { diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index a426b6768a6..ad0d30fb01e 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -67,7 +67,7 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ const recv_message = function (e) { console.log('Received message:', e.data); -}; // $ MISSING: clientReceive +}; // $ clientReceive (function () { myWebSocketInstance.onmessage = recv_message.bind(this); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index a5c55cf6363..16fc0f0d267 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -7,6 +7,7 @@ clientReceive | browser-custom.js:46:37:48:5 | functio ... )\\n } | | browser-custom.js:57:34:60:5 | functio ... ;\\n } | | browser-custom.js:62:50:64:5 | functio ... ;\\n } | +| browser-custom.js:68:22:70:1 | functio ... ata);\\n} | | browser.js:8:37:10:2 | functio ... ta);\\n\\t} | | browser.js:12:21:14:2 | functio ... ata)\\n\\t} | | browser.js:24:19:27:2 | functio ... e();\\n\\t} | @@ -54,6 +55,7 @@ flowSteps | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:43:45:43:54 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:47:46:47:55 | event.data | +| server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:69:38:69:43 | e.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | client-custom.js:10:37:10:40 | data | From 6bcfd8c91ded71561d6a58ead3aca5c053465e54 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 4 Apr 2025 09:31:16 +0200 Subject: [PATCH 078/372] Updated `getAServer` with API graphs. --- .../javascript/frameworks/WebSocket.qll | 8 ++-- .../frameworks/WebSocket/server-custom.js | 16 ++++---- .../frameworks/WebSocket/test.expected | 40 +++++++++++++++++++ 3 files changed, 52 insertions(+), 12 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index 98aef6ed096..da110c6562c 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -212,19 +212,19 @@ module ServerWebSocket { /** * Gets a server created by a library named `library`. */ - DataFlow::SourceNode getAServer(LibraryName library) { + API::InvokeNode getAServer(LibraryName library) { library = ws() and - result = DataFlow::moduleImport("ws").getAConstructorInvocation("Server") + result = API::moduleImport("ws").getMember("Server").getAnInvocation() or library = sockjs() and - result = DataFlow::moduleImport("sockjs").getAMemberCall("createServer") + result = API::moduleImport("sockjs").getMember("createServer").getAnInvocation() } /** * Gets a `socket.on("connection", (msg, req) => {})` call. */ private DataFlow::CallNode getAConnectionCall(LibraryName library) { - result = getAServer(library).getAMemberCall(EventEmitter::on()) and + result = getAServer(library).getReturn().getMember(EventEmitter::on()).getACall() and result.getArgument(0).mayHaveStringValue("connection") } diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js index 63893ba2f5c..65d49c0d73e 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/server-custom.js @@ -3,21 +3,21 @@ const { MyWebSocketServer, myWebSocketServerInstance } = require('./server.js'); (function () { const wss = new MyWebSocketServer({ port: 8080 }); - wss.on('connection', function connection(ws) { // $ MISSING: serverSocket - ws.on('message', function incoming(message) { // $ MISSING: remoteFlow + wss.on('connection', function connection(ws) { // $ serverSocket + ws.on('message', function incoming(message) { // $ remoteFlow console.log('received: %s', message); - }); // $ MISSING: serverReceive + }); // $ serverReceive - ws.send('Hi from server!'); // $ MISSING: serverSend + ws.send('Hi from server!'); // $ serverSend }); })(); (function () { - myWebSocketServerInstance.on('connection', function connection(ws) { // $ MISSING: serverSocket - ws.on('message', function incoming(message) { // $ MISSING: remoteFlow + myWebSocketServerInstance.on('connection', function connection(ws) { // $ serverSocket + ws.on('message', function incoming(message) { // $ remoteFlow console.log('received: %s', message); - }); // $ MISSING: serverReceive + }); // $ serverReceive - ws.send('Hi from server!'); // $ MISSING: serverSend + ws.send('Hi from server!'); // $ serverSend }); })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 16fc0f0d267..7480e066876 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -40,17 +40,49 @@ flowSteps | browser-custom.js:1:23:1:30 | MySockJS | browser-custom.js:1:23:1:30 | MySockJS | | browser-custom.js:1:33:1:51 | myWebSocketInstance | browser-custom.js:1:33:1:51 | myWebSocketInstance | | browser-custom.js:1:54:1:69 | mySockJSInstance | browser-custom.js:1:54:1:69 | mySockJSInstance | +| browser-custom.js:7:15:7:32 | 'Hi from browser!' | server-custom.js:7:38:7:44 | message | +| browser-custom.js:7:15:7:32 | 'Hi from browser!' | server-custom.js:17:38:17:44 | message | | browser-custom.js:7:15:7:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser-custom.js:23:13:23:18 | 'test' | sockjs.js:9:31:9:37 | message | +| browser-custom.js:39:34:39:51 | 'Hi from browser!' | server-custom.js:7:38:7:44 | message | +| browser-custom.js:39:34:39:51 | 'Hi from browser!' | server-custom.js:17:38:17:44 | message | | browser-custom.js:39:34:39:51 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser-custom.js:54:31:54:36 | 'test' | sockjs.js:9:31:9:37 | message | +| browser.js:5:15:5:32 | 'Hi from browser!' | server-custom.js:7:38:7:44 | message | +| browser.js:5:15:5:32 | 'Hi from browser!' | server-custom.js:17:38:17:44 | message | | browser.js:5:15:5:32 | 'Hi from browser!' | server.js:7:38:7:44 | message | | browser.js:21:13:21:18 | 'test' | sockjs.js:9:31:9:37 | message | +| client-custom.js:7:11:7:27 | 'Hi from client!' | server-custom.js:7:38:7:44 | message | +| client-custom.js:7:11:7:27 | 'Hi from client!' | server-custom.js:17:38:17:44 | message | | client-custom.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | +| client-custom.js:17:30:17:46 | 'Hi from client!' | server-custom.js:7:38:7:44 | message | +| client-custom.js:17:30:17:46 | 'Hi from client!' | server-custom.js:17:38:17:44 | message | | client-custom.js:17:30:17:46 | 'Hi from client!' | server.js:7:38:7:44 | message | +| client.js:7:11:7:27 | 'Hi from client!' | server-custom.js:7:38:7:44 | message | +| client.js:7:11:7:27 | 'Hi from client!' | server-custom.js:17:38:17:44 | message | | client.js:7:11:7:27 | 'Hi from client!' | server.js:7:38:7:44 | message | | client.js:15:32:15:44 | require('ws') | client-custom.js:1:9:1:21 | MyWebSocketWS | | client.js:16:40:16:72 | new Web ... e.org') | client-custom.js:1:24:1:44 | myWebSo ... nstance | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:11:39:11:48 | event.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:43:45:43:54 | event.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:47:46:47:55 | event.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:69:38:69:43 | e.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | client-custom.js:10:37:10:40 | data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | client-custom.js:20:56:20:59 | data | +| server-custom.js:11:11:11:27 | 'Hi from server!' | client.js:10:37:10:40 | data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser-custom.js:11:39:11:48 | event.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser-custom.js:43:45:43:54 | event.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser-custom.js:47:46:47:55 | event.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser-custom.js:69:38:69:43 | e.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser.js:9:39:9:48 | event.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | browser.js:13:40:13:49 | event.data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | client-custom.js:10:37:10:40 | data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | client-custom.js:20:56:20:59 | data | +| server-custom.js:21:11:21:27 | 'Hi from server!' | client.js:10:37:10:40 | data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:11:39:11:48 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:15:40:15:49 | event.data | | server.js:11:11:11:27 | 'Hi from server!' | browser-custom.js:43:45:43:54 | event.data | @@ -70,14 +102,22 @@ flowSteps | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:25:26:25:31 | e.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:30:42:30:51 | event.data | remoteFlow +| server-custom.js:7:38:7:44 | message | +| server-custom.js:17:38:17:44 | message | | server.js:7:38:7:44 | message | | sockjs.js:9:31:9:37 | message | serverReceive +| server-custom.js:7:3:9:4 | ws.on(' ... );\\n\\t\\t}) | +| server-custom.js:17:3:19:4 | ws.on(' ... );\\n\\t\\t}) | | server.js:7:3:9:4 | ws.on(' ... );\\n\\t\\t}) | | sockjs.js:9:5:12:6 | conn.on ... \\n }) | serverSend +| server-custom.js:11:3:11:28 | ws.send ... rver!') | +| server-custom.js:21:3:21:28 | ws.send ... rver!') | | server.js:11:3:11:28 | ws.send ... rver!') | | sockjs.js:11:9:11:51 | conn.wr ... test))) | serverSocket +| server-custom.js:6:43:6:44 | ws | +| server-custom.js:16:65:16:66 | ws | | server.js:6:43:6:44 | ws | | sockjs.js:8:40:8:43 | conn | From b5805503fe34f76a6e31ec0fd7ad53d437488ad1 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Fri, 4 Apr 2025 11:56:07 +0100 Subject: [PATCH 079/372] Cleanups --- .../Variables/LoopVariableCapture/LoopVariableCapture.ql | 1 - .../Variables/capture/LoopVariableCaptureTest.ql | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index 9c8822a3f6b..9c41e52cc45 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -11,7 +11,6 @@ import python import LoopVariableCaptureQuery -import semmle.python.dataflow.new.DataFlow import EscapingCaptureFlow::PathGraph from diff --git a/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql b/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql index 792fa2159cb..dc9fbed27dc 100644 --- a/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql +++ b/python/ql/test/query-tests/Variables/capture/LoopVariableCaptureTest.ql @@ -3,11 +3,11 @@ import Variables.LoopVariableCapture.LoopVariableCaptureQuery import utils.test.InlineExpectationsTest module MethodArgTest implements TestSig { - string getARelevantTag() { result = ["capturedVar"] } + string getARelevantTag() { result = "capturedVar" } predicate hasActualResult(Location location, string element, string tag, string value) { - exists(CallableExpr capturing, AstNode loop, Variable var | - escapingCapture(capturing, loop, var, _, _) and + exists(CallableExpr capturing, Variable var | + escapingCapture(capturing, _, var, _, _) and element = capturing.toString() and location = capturing.getLocation() and tag = "capturedVar" and From de7e6119624c99e6e1c990904162a3b3c78c2619 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Fri, 4 Apr 2025 12:36:13 +0100 Subject: [PATCH 080/372] Rewrite documentation --- .../LoopVariableCapture.py | 18 -------- .../LoopVariableCapture.qhelp | 46 ++++++------------- .../LoopVariableCapture.ql | 1 + .../LoopVariableCapture/examples/bad.py | 8 ++++ .../LoopVariableCapture/examples/good.py | 8 ++++ .../LoopVariableCapture/examples/good2.py | 9 ++++ 6 files changed, 41 insertions(+), 49 deletions(-) delete mode 100644 python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.py create mode 100644 python/ql/src/Variables/LoopVariableCapture/examples/bad.py create mode 100644 python/ql/src/Variables/LoopVariableCapture/examples/good.py create mode 100644 python/ql/src/Variables/LoopVariableCapture/examples/good2.py diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.py b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.py deleted file mode 100644 index 4a6abcb8894..00000000000 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.py +++ /dev/null @@ -1,18 +0,0 @@ - -#Make a list of functions to increment their arguments by 0 to 9. -def make_incrementers(): - result = [] - for i in range(10): - def incrementer(x): - return x + i - result.append(incrementer) - return result - -#This will fail -def test(): - incs = make_incrementers() - for x in range(10): - for y in range(10): - assert incs[x](y) == x+y - -test() \ No newline at end of file diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp index 15f2b185eb9..ae23584344c 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp @@ -5,56 +5,40 @@

    -Nested functions are a useful feature of Python as it allows a function to access the variables of its enclosing function. -However, the programmer needs to be aware that when an inner function accesses a variable in an outer scope, -it is the variable that is captured, not the value of that variable. +In Python, a nested function or lambda expression that captures a variable from its surrounding scope is a late-binding closure, +meaning that the value of the variable is determined when the closure is called, not when it is created.

    -Therefore, care must be taken when the captured variable is a loop variable, since it is the loop variable and -not the value of that variable that is captured. -This will mean that by the time that the inner function executes, -the loop variable will have its final value, not the value when the inner function was created. +Care must be taken when the captured variable is a loop variable. If the closure is called after the loop ends, it will use the value of the variable on the last iteration of the loop, rather than the value at the iteration at which it was created.

    -The simplest way to fix this problem is to add a local variable of the same name as the outer variable and initialize that -using the outer variable as a default. - -for var in seq: - ... - def inner_func(arg): - ... - use(var) - -becomes - -for var in seq: - ... - def inner_func(arg, var=var): - ... - use(var) - +Ensure that closures that capture loop variables aren't used outside of a single iteration of the loop. +To capture the value of a loop variable at the time the closure is created, use a default parameter, or functools.partial.

    -In this example, a list of functions is created which should each increment its argument by its index in the list. -However, since i will be 9 when the functions execute, they will each increment their argument by 9. +In the following (BAD) example, a `tasks` list is created, but each task captures the loop variable i, and reads the same value when run.

    - +

    -This can be fixed by adding the default value as shown below. The default value is computed when the function is created, so the desired effect is achieved. +In the following (GOOD) example, each closure has an `i` default parameter, shadowing the outer i variable, the default value of which is determined as the value of the loop variable i at the time the closure is created. + +In the following (GOOD) example, functools.partial is used to partially evaluate the lambda expression with the value of i. +

    -
    -
  • The Hitchhiker’s Guide to Python: Late Binding Closures
  • -
  • Python Language Reference: Naming and binding
  • +
  • The Hitchhiker's Guide to Python: Late Binding Closures.
  • +
  • Python Language Reference: Naming and binding.
  • +
  • Stack Overflow: Creating functions (or lambdas) in a loop (or comprehension).
  • +
  • Python Language Reference: functools.partial.
  • diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index 9c41e52cc45..514a6790ea0 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -3,6 +3,7 @@ * @description Capture of a loop variable is not the same as capturing the value of a loop variable, and may be erroneous. * @kind path-problem * @tags correctness + * quality * @problem.severity error * @sub-severity low * @precision high diff --git a/python/ql/src/Variables/LoopVariableCapture/examples/bad.py b/python/ql/src/Variables/LoopVariableCapture/examples/bad.py new file mode 100644 index 00000000000..1e70d20fd1d --- /dev/null +++ b/python/ql/src/Variables/LoopVariableCapture/examples/bad.py @@ -0,0 +1,8 @@ +# BAD: The loop variable `i` is captured. +tasks = [] +for i in range(5): + tasks.append(lambda: print(i)) + +# This will print `4,4,4,4,4`, rather than `0,1,2,3,4` as likely intended. +for t in tasks: + t() \ No newline at end of file diff --git a/python/ql/src/Variables/LoopVariableCapture/examples/good.py b/python/ql/src/Variables/LoopVariableCapture/examples/good.py new file mode 100644 index 00000000000..67ed2624f0a --- /dev/null +++ b/python/ql/src/Variables/LoopVariableCapture/examples/good.py @@ -0,0 +1,8 @@ +# GOOD: A default parameter is used, so the variable `i` is not being captured. +tasks = [] +for i in range(5): + tasks.append(lambda i=i: print(i)) + +# This will print `0,1,2,3,4``. +for t in tasks: + t() \ No newline at end of file diff --git a/python/ql/src/Variables/LoopVariableCapture/examples/good2.py b/python/ql/src/Variables/LoopVariableCapture/examples/good2.py new file mode 100644 index 00000000000..1a2469b4220 --- /dev/null +++ b/python/ql/src/Variables/LoopVariableCapture/examples/good2.py @@ -0,0 +1,9 @@ +import functools +# GOOD: A default parameter is used, so the variable `i` is not being captured. +tasks = [] +for i in range(5): + tasks.append(functools.partial(lambda i: print(i), i)) + +# This will print `0,1,2,3,4``. +for t in tasks: + t() \ No newline at end of file From e08072d77b7bc99c9af1c525de419c6736754412 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Fri, 4 Apr 2025 12:43:23 +0100 Subject: [PATCH 081/372] Fix qhelp formatting --- .../LoopVariableCapture/LoopVariableCapture.qhelp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp index ae23584344c..b902f976a53 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp @@ -27,10 +27,13 @@ In the following (BAD) example, a `tasks` list is created, but each task capture

    In the following (GOOD) example, each closure has an `i` default parameter, shadowing the outer i variable, the default value of which is determined as the value of the loop variable i at the time the closure is created. - -In the following (GOOD) example, functools.partial is used to partially evaluate the lambda expression with the value of i. -

    + +

    +In the following (GOOD) example, functools.partial is used to partially evaluate the lambda expression with the value of i. +

    + + From 77eeab33a6a985038b0b6c64ad90d93ca5a86bb5 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 4 Apr 2025 13:57:34 -0400 Subject: [PATCH 082/372] Java: remove change note --- .../2025-03-21-junit-missing-nested-annotation.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md diff --git a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md b/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md deleted file mode 100644 index c663ddc04f6..00000000000 --- a/java/ql/src/change-notes/2025-03-21-junit-missing-nested-annotation.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* Added a new quality query, `java/junit5-missing-nested-annotation`, to detect missing `@Nested` annotations on JUnit 5 inner test classes. From 798907dc5045d644d67e15ac2130a5f48c4f66fe Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Fri, 4 Apr 2025 14:01:35 -0400 Subject: [PATCH 083/372] Java: remove change note --- java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md diff --git a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md b/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md deleted file mode 100644 index 8317dce595c..00000000000 --- a/java/ql/src/change-notes/2025-03-20-do-not-call-finalize.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: newQuery ---- -* Added a new quality query, `java/do-not-call-finalize`, to detect calls to `finalize()`. From a5883b1627a8edfc7bca0196d5ce219f31baede8 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 4 Apr 2025 21:45:37 +0100 Subject: [PATCH 084/372] Rust: Accept test changes (due to added models?). --- .../dataflow/local/DataFlowStep.expected | 9 ++ .../security/CWE-020/RegexInjection.expected | 8 +- .../UncontrolledAllocationSize.expected | 152 +++++++++--------- 3 files changed, 89 insertions(+), 80 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index 9676fd3f2af..6edba8b73ba 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -2161,6 +2161,13 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Err(0)].Reference in lang:core::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Err(0)] in lang:core::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::search_tree_for_bifurcation | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::search_tree_for_bifurcation | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::from_str | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::from_str | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::align_to | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::align_to | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::array | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::array | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::extend | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::extend | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::extend_packed | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::extend_packed | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::from_size_align | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::from_size_align | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::repeat | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::repeat | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::repeat_packed | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::repeat_packed | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::try_insert | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::try_insert | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::ok_or | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::ok_or | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::ok_or_else | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::ok_or_else | @@ -2194,6 +2201,8 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in repo:https://github.com/seanmonstar/reqwest:reqwest::_::::text_with_charset | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in repo:https://github.com/seanmonstar/reqwest:reqwest::_::::text_with_charset | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in repo:https://github.com/servo/rust-url:url::_::::parse | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in repo:https://github.com/servo/rust-url:url::_::::parse | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)].Field[0] in lang:alloc::_::::search_tree_for_bifurcation | tuple.0 | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::search_tree_for_bifurcation | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)].Field[0] in lang:core::_::::extend | tuple.0 | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::extend | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)].Field[0] in lang:core::_::::repeat | tuple.0 | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::repeat | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)].Field[0] in lang:std::_::::wait_timeout | tuple.0 | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait_timeout | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)].Field[0] in lang:std::_::::wait_timeout_ms | tuple.0 | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait_timeout_ms | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)].Field[0] in lang:std::_::::wait_timeout_while | tuple.0 | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait_timeout_while | diff --git a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected index 1dd626144da..4d5a046ccc5 100644 --- a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected @@ -2,15 +2,15 @@ | main.rs:6:25:6:30 | ®ex | main.rs:4:20:4:32 | ...::var | main.rs:6:25:6:30 | ®ex | This regular expression is constructed from a $@. | main.rs:4:20:4:32 | ...::var | user-provided value | edges | main.rs:4:9:4:16 | username | main.rs:5:25:5:44 | MacroExpr | provenance | | -| main.rs:4:20:4:32 | ...::var | main.rs:4:20:4:40 | ...::var(...) [Ok] | provenance | Src:MaD:64 | -| main.rs:4:20:4:40 | ...::var(...) [Ok] | main.rs:4:20:4:66 | ... .unwrap_or(...) | provenance | MaD:1627 | +| main.rs:4:20:4:32 | ...::var | main.rs:4:20:4:40 | ...::var(...) [Ok] | provenance | Src:MaD:68 | +| main.rs:4:20:4:40 | ...::var(...) [Ok] | main.rs:4:20:4:66 | ... .unwrap_or(...) | provenance | MaD:1660 | | main.rs:4:20:4:66 | ... .unwrap_or(...) | main.rs:4:9:4:16 | username | provenance | | | main.rs:5:9:5:13 | regex | main.rs:6:26:6:30 | regex | provenance | | | main.rs:5:17:5:45 | res | main.rs:5:25:5:44 | { ... } | provenance | | | main.rs:5:25:5:44 | ...::format(...) | main.rs:5:17:5:45 | res | provenance | | | main.rs:5:25:5:44 | ...::must_use(...) | main.rs:5:9:5:13 | regex | provenance | | -| main.rs:5:25:5:44 | MacroExpr | main.rs:5:25:5:44 | ...::format(...) | provenance | MaD:100 | -| main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:3050 | +| main.rs:5:25:5:44 | MacroExpr | main.rs:5:25:5:44 | ...::format(...) | provenance | MaD:119 | +| main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:3083 | | main.rs:6:26:6:30 | regex | main.rs:6:25:6:30 | ®ex | provenance | | nodes | main.rs:4:9:4:16 | username | semmle.label | username | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 9cc7f803aac..8fbaf765939 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -53,18 +53,18 @@ edges | main.rs:18:41:18:41 | v | main.rs:32:60:32:89 | ... * ... | provenance | | | main.rs:18:41:18:41 | v | main.rs:35:9:35:10 | s6 | provenance | | | main.rs:20:9:20:10 | l2 | main.rs:21:31:21:32 | l2 | provenance | | -| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:20:14:20:63 | ... .unwrap(...) | main.rs:20:9:20:10 | l2 | provenance | | +| main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | main.rs:20:14:20:63 | ... .unwrap() | provenance | MaD:31 | +| main.rs:20:14:20:63 | ... .unwrap() | main.rs:20:9:20:10 | l2 | provenance | | | main.rs:20:50:20:50 | v | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:21:31:21:32 | l2 | main.rs:21:13:21:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:21:31:21:32 | l2 | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | provenance | MaD:17 | | main.rs:21:31:21:32 | l2 | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | provenance | MaD:17 | | main.rs:21:31:21:32 | l2 | main.rs:24:38:24:39 | l2 | provenance | | -| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:22:31:22:53 | ... .unwrap(...) | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:23:31:23:53 | ... .unwrap(...) | main.rs:23:31:23:68 | ... .pad_to_align(...) | provenance | MaD:25 | -| main.rs:23:31:23:68 | ... .pad_to_align(...) | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:22:31:22:44 | l2.align_to(...) [Ok] | main.rs:22:31:22:53 | ... .unwrap() | provenance | MaD:31 | +| main.rs:22:31:22:53 | ... .unwrap() | main.rs:22:13:22:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:23:31:23:44 | l2.align_to(...) [Ok] | main.rs:23:31:23:53 | ... .unwrap() | provenance | MaD:31 | +| main.rs:23:31:23:53 | ... .unwrap() | main.rs:23:31:23:68 | ... .pad_to_align() | provenance | MaD:25 | +| main.rs:23:31:23:68 | ... .pad_to_align() | main.rs:23:13:23:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:24:38:24:39 | l2 | main.rs:24:13:24:36 | ...::alloc_zeroed | provenance | MaD:4 Sink:MaD:4 | | main.rs:29:9:29:10 | l4 | main.rs:30:31:30:32 | l4 | provenance | | | main.rs:29:14:29:64 | ...::from_size_align_unchecked(...) | main.rs:29:9:29:10 | l4 | provenance | | @@ -79,10 +79,10 @@ edges | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | main.rs:36:9:36:10 | l6 | provenance | | | main.rs:36:60:36:61 | s6 | main.rs:36:14:36:65 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | | main.rs:37:31:37:32 | l6 | main.rs:37:13:37:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size(...) | provenance | MaD:28 | +| main.rs:37:31:37:32 | l6 | main.rs:39:60:39:68 | l6.size() | provenance | MaD:28 | | main.rs:39:9:39:10 | l7 | main.rs:40:31:40:32 | l7 | provenance | | | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | main.rs:39:9:39:10 | l7 | provenance | | -| main.rs:39:60:39:68 | l6.size(...) | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | +| main.rs:39:60:39:68 | l6.size() | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | provenance | MaD:24 | | main.rs:40:31:40:32 | l7 | main.rs:40:13:40:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:43:44:43:51 | ...: usize | main.rs:50:41:50:41 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:51:41:51:45 | ... + ... | provenance | | @@ -90,19 +90,19 @@ edges | main.rs:43:44:43:51 | ...: usize | main.rs:54:48:54:53 | ... * ... | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:58:34:58:34 | v | provenance | | | main.rs:43:44:43:51 | ...: usize | main.rs:67:46:67:46 | v | provenance | | -| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | -| main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | +| main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | provenance | MaD:31 | +| main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | main.rs:50:31:50:53 | ... .0 | provenance | | | main.rs:50:31:50:53 | ... .0 | main.rs:50:13:50:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:50:41:50:41 | v | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:26 | -| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | -| main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | +| main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | provenance | MaD:31 | +| main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | main.rs:51:31:51:57 | ... .0 | provenance | | | main.rs:51:31:51:57 | ... .0 | main.rs:51:13:51:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:51:41:51:45 | ... + ... | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | provenance | MaD:26 | -| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:53:31:53:58 | ... .unwrap(...) | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | main.rs:53:31:53:58 | ... .unwrap() | provenance | MaD:31 | +| main.rs:53:31:53:58 | ... .unwrap() | main.rs:53:13:53:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:53:48:53:48 | v | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | provenance | MaD:27 | -| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:54:31:54:63 | ... .unwrap(...) | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | main.rs:54:31:54:63 | ... .unwrap() | provenance | MaD:31 | +| main.rs:54:31:54:63 | ... .unwrap() | main.rs:54:13:54:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:54:48:54:53 | ... * ... | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | provenance | MaD:27 | | main.rs:58:9:58:20 | TuplePat [tuple.0] | main.rs:58:10:58:11 | k1 | provenance | | | main.rs:58:10:58:11 | k1 | main.rs:59:31:59:32 | k1 | provenance | | @@ -116,29 +116,29 @@ edges | main.rs:59:31:59:32 | k1 | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | provenance | MaD:22 | | main.rs:60:9:60:20 | TuplePat [tuple.0] | main.rs:60:10:60:11 | k2 | provenance | | | main.rs:60:10:60:11 | k2 | main.rs:61:31:61:32 | k2 | provenance | | -| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | -| main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | +| main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | provenance | MaD:31 | +| main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | main.rs:60:9:60:20 | TuplePat [tuple.0] | provenance | | | main.rs:60:34:60:35 | k1 | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | provenance | MaD:19 | | main.rs:61:31:61:32 | k2 | main.rs:61:13:61:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:62:9:62:20 | TuplePat [tuple.0] | main.rs:62:10:62:11 | k3 | provenance | | | main.rs:62:10:62:11 | k3 | main.rs:63:31:63:32 | k3 | provenance | | -| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | provenance | MaD:31 | -| main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | main.rs:62:9:62:20 | TuplePat [tuple.0] | provenance | | +| main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | provenance | MaD:31 | +| main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | main.rs:62:9:62:20 | TuplePat [tuple.0] | provenance | | | main.rs:63:31:63:32 | k3 | main.rs:63:13:63:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | -| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:64:31:64:59 | ... .unwrap(...) | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | main.rs:64:31:64:59 | ... .unwrap() | provenance | MaD:31 | +| main.rs:64:31:64:59 | ... .unwrap() | main.rs:64:13:64:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:64:48:64:49 | k1 | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | provenance | MaD:21 | -| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:65:31:65:59 | ... .unwrap(...) | main.rs:65:13:65:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | +| main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | main.rs:65:31:65:59 | ... .unwrap() | provenance | MaD:31 | +| main.rs:65:31:65:59 | ... .unwrap() | main.rs:65:13:65:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:67:9:67:10 | l4 | main.rs:68:31:68:32 | l4 | provenance | | -| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:67:14:67:56 | ... .unwrap(...) | main.rs:67:9:67:10 | l4 | provenance | | +| main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | main.rs:67:14:67:56 | ... .unwrap() | provenance | MaD:31 | +| main.rs:67:14:67:56 | ... .unwrap() | main.rs:67:9:67:10 | l4 | provenance | | | main.rs:67:46:67:46 | v | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:68:31:68:32 | l4 | main.rs:68:13:68:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:86:35:86:42 | ...: usize | main.rs:87:54:87:54 | v | provenance | | | main.rs:87:9:87:14 | layout | main.rs:88:31:88:36 | layout | provenance | | -| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:87:18:87:67 | ... .unwrap(...) | main.rs:87:9:87:14 | layout | provenance | | +| main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | main.rs:87:18:87:67 | ... .unwrap() | provenance | MaD:31 | +| main.rs:87:18:87:67 | ... .unwrap() | main.rs:87:9:87:14 | layout | provenance | | | main.rs:87:54:87:54 | v | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:88:31:88:36 | layout | main.rs:88:13:88:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:91:38:91:45 | ...: usize | main.rs:92:47:92:47 | v | provenance | | @@ -150,15 +150,15 @@ edges | main.rs:91:38:91:45 | ...: usize | main.rs:161:55:161:55 | v | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:96:35:96:36 | l1 | provenance | | | main.rs:92:9:92:10 | l1 | main.rs:102:35:102:36 | l1 | provenance | | -| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:92:14:92:57 | ... .unwrap(...) | main.rs:92:9:92:10 | l1 | provenance | | +| main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | main.rs:92:14:92:57 | ... .unwrap() | provenance | MaD:31 | +| main.rs:92:14:92:57 | ... .unwrap() | main.rs:92:9:92:10 | l1 | provenance | | | main.rs:92:47:92:47 | v | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:96:35:96:36 | l1 | main.rs:96:17:96:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:96:35:96:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | | main.rs:96:35:96:36 | l1 | main.rs:111:35:111:36 | l1 | provenance | | | main.rs:101:13:101:14 | l3 | main.rs:103:35:103:36 | l3 | provenance | | -| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:101:18:101:61 | ... .unwrap(...) | main.rs:101:13:101:14 | l3 | provenance | | +| main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | main.rs:101:18:101:61 | ... .unwrap() | provenance | MaD:31 | +| main.rs:101:18:101:61 | ... .unwrap() | main.rs:101:13:101:14 | l3 | provenance | | | main.rs:101:51:101:51 | v | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:102:35:102:36 | l1 | main.rs:102:17:102:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:102:35:102:36 | l1 | main.rs:109:35:109:36 | l1 | provenance | | @@ -170,27 +170,27 @@ edges | main.rs:111:35:111:36 | l1 | main.rs:111:17:111:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:111:35:111:36 | l1 | main.rs:146:35:146:36 | l1 | provenance | | | main.rs:145:13:145:14 | l9 | main.rs:148:35:148:36 | l9 | provenance | | -| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:145:18:145:61 | ... .unwrap(...) | main.rs:145:13:145:14 | l9 | provenance | | +| main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | main.rs:145:18:145:61 | ... .unwrap() | provenance | MaD:31 | +| main.rs:145:18:145:61 | ... .unwrap() | main.rs:145:13:145:14 | l9 | provenance | | | main.rs:145:51:145:51 | v | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:146:35:146:36 | l1 | main.rs:146:17:146:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:146:35:146:36 | l1 | main.rs:177:31:177:32 | l1 | provenance | | | main.rs:148:35:148:36 | l9 | main.rs:148:17:148:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:151:9:151:11 | l10 | main.rs:152:31:152:33 | l10 | provenance | | -| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:151:15:151:78 | ... .unwrap(...) | main.rs:151:9:151:11 | l10 | provenance | | +| main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | main.rs:151:15:151:78 | ... .unwrap() | provenance | MaD:31 | +| main.rs:151:15:151:78 | ... .unwrap() | main.rs:151:9:151:11 | l10 | provenance | | | main.rs:151:48:151:68 | ...::min(...) | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:151:62:151:62 | v | main.rs:151:48:151:68 | ...::min(...) | provenance | MaD:34 | | main.rs:152:31:152:33 | l10 | main.rs:152:13:152:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:154:9:154:11 | l11 | main.rs:155:31:155:33 | l11 | provenance | | -| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:154:15:154:78 | ... .unwrap(...) | main.rs:154:9:154:11 | l11 | provenance | | +| main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | main.rs:154:15:154:78 | ... .unwrap() | provenance | MaD:31 | +| main.rs:154:15:154:78 | ... .unwrap() | main.rs:154:9:154:11 | l11 | provenance | | | main.rs:154:48:154:68 | ...::max(...) | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:154:62:154:62 | v | main.rs:154:48:154:68 | ...::max(...) | provenance | MaD:33 | | main.rs:155:31:155:33 | l11 | main.rs:155:13:155:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:161:13:161:15 | l13 | main.rs:162:35:162:37 | l13 | provenance | | -| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:161:19:161:68 | ... .unwrap(...) | main.rs:161:13:161:15 | l13 | provenance | | +| main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | main.rs:161:19:161:68 | ... .unwrap() | provenance | MaD:31 | +| main.rs:161:19:161:68 | ... .unwrap() | main.rs:161:13:161:15 | l13 | provenance | | | main.rs:161:55:161:55 | v | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:162:35:162:37 | l13 | main.rs:162:17:162:33 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:162:35:162:37 | l13 | main.rs:169:35:169:37 | l13 | provenance | | @@ -198,8 +198,8 @@ edges | main.rs:177:31:177:32 | l1 | main.rs:177:13:177:29 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:183:29:183:36 | ...: usize | main.rs:192:46:192:46 | v | provenance | | | main.rs:192:9:192:10 | l2 | main.rs:193:38:193:39 | l2 | provenance | | -| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:192:14:192:56 | ... .unwrap(...) | main.rs:192:9:192:10 | l2 | provenance | | +| main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | main.rs:192:14:192:56 | ... .unwrap() | provenance | MaD:31 | +| main.rs:192:14:192:56 | ... .unwrap() | main.rs:192:9:192:10 | l2 | provenance | | | main.rs:192:46:192:46 | v | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | provenance | MaD:18 | | main.rs:193:38:193:39 | l2 | main.rs:193:32:193:36 | alloc | provenance | MaD:10 Sink:MaD:10 | | main.rs:193:38:193:39 | l2 | main.rs:194:45:194:46 | l2 | provenance | | @@ -226,13 +226,13 @@ edges | main.rs:223:26:223:26 | v | main.rs:223:13:223:24 | ...::calloc | provenance | MaD:13 Sink:MaD:13 | | main.rs:223:26:223:26 | v | main.rs:224:31:224:31 | v | provenance | | | main.rs:224:31:224:31 | v | main.rs:224:13:224:25 | ...::realloc | provenance | MaD:15 Sink:MaD:15 | -| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse(...) [Ok] | provenance | MaD:32 | +| main.rs:279:24:279:41 | ...: String | main.rs:280:21:280:47 | user_input.parse() [Ok] | provenance | MaD:32 | | main.rs:280:9:280:17 | num_bytes | main.rs:282:54:282:62 | num_bytes | provenance | | -| main.rs:280:21:280:47 | user_input.parse(...) [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | +| main.rs:280:21:280:47 | user_input.parse() [Ok] | main.rs:280:21:280:48 | TryExpr | provenance | | | main.rs:280:21:280:48 | TryExpr | main.rs:280:9:280:17 | num_bytes | provenance | | | main.rs:282:9:282:14 | layout | main.rs:284:40:284:45 | layout | provenance | | -| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:282:18:282:75 | ... .unwrap(...) | main.rs:282:9:282:14 | layout | provenance | | +| main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | main.rs:282:18:282:75 | ... .unwrap() | provenance | MaD:31 | +| main.rs:282:18:282:75 | ... .unwrap() | main.rs:282:9:282:14 | layout | provenance | | | main.rs:282:54:282:62 | num_bytes | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | provenance | MaD:23 | | main.rs:284:40:284:45 | layout | main.rs:284:22:284:38 | ...::alloc | provenance | MaD:3 Sink:MaD:3 | | main.rs:308:25:308:38 | ...::args | main.rs:308:25:308:40 | ...::args(...) [element] | provenance | Src:MaD:16 | @@ -247,9 +247,9 @@ edges | main.rs:317:13:317:26 | ...::args | main.rs:317:13:317:28 | ...::args(...) [element] | provenance | Src:MaD:16 | | main.rs:317:13:317:28 | ...::args(...) [element] | main.rs:317:13:317:35 | ... .nth(...) [Some] | provenance | MaD:35 | | main.rs:317:13:317:35 | ... .nth(...) [Some] | main.rs:317:13:317:65 | ... .unwrap_or(...) | provenance | MaD:29 | -| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse(...) [Ok] | provenance | MaD:32 | -| main.rs:317:13:317:82 | ... .parse(...) [Ok] | main.rs:317:13:317:91 | ... .unwrap(...) | provenance | MaD:31 | -| main.rs:317:13:317:91 | ... .unwrap(...) | main.rs:317:9:317:9 | v | provenance | | +| main.rs:317:13:317:65 | ... .unwrap_or(...) | main.rs:317:13:317:82 | ... .parse() [Ok] | provenance | MaD:32 | +| main.rs:317:13:317:82 | ... .parse() [Ok] | main.rs:317:13:317:91 | ... .unwrap() | provenance | MaD:31 | +| main.rs:317:13:317:91 | ... .unwrap() | main.rs:317:9:317:9 | v | provenance | | | main.rs:320:34:320:34 | v | main.rs:12:36:12:43 | ...: usize | provenance | | | main.rs:321:42:321:42 | v | main.rs:43:44:43:51 | ...: usize | provenance | | | main.rs:322:36:322:36 | v | main.rs:91:38:91:45 | ...: usize | provenance | | @@ -297,17 +297,17 @@ nodes | main.rs:18:41:18:41 | v | semmle.label | v | | main.rs:20:9:20:10 | l2 | semmle.label | l2 | | main.rs:20:14:20:54 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:20:14:20:63 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:20:14:20:63 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:20:50:20:50 | v | semmle.label | v | | main.rs:21:13:21:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:21:31:21:32 | l2 | semmle.label | l2 | | main.rs:22:13:22:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:22:31:22:44 | l2.align_to(...) [Ok] | semmle.label | l2.align_to(...) [Ok] | -| main.rs:22:31:22:53 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:22:31:22:53 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:23:13:23:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:23:31:23:44 | l2.align_to(...) [Ok] | semmle.label | l2.align_to(...) [Ok] | -| main.rs:23:31:23:53 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | -| main.rs:23:31:23:68 | ... .pad_to_align(...) | semmle.label | ... .pad_to_align(...) | +| main.rs:23:31:23:53 | ... .unwrap() | semmle.label | ... .unwrap() | +| main.rs:23:31:23:68 | ... .pad_to_align() | semmle.label | ... .pad_to_align() | | main.rs:24:13:24:36 | ...::alloc_zeroed | semmle.label | ...::alloc_zeroed | | main.rs:24:38:24:39 | l2 | semmle.label | l2 | | main.rs:29:9:29:10 | l4 | semmle.label | l4 | @@ -328,27 +328,27 @@ nodes | main.rs:37:31:37:32 | l6 | semmle.label | l6 | | main.rs:39:9:39:10 | l7 | semmle.label | l7 | | main.rs:39:14:39:72 | ...::from_size_align_unchecked(...) | semmle.label | ...::from_size_align_unchecked(...) | -| main.rs:39:60:39:68 | l6.size(...) | semmle.label | l6.size(...) | +| main.rs:39:60:39:68 | l6.size() | semmle.label | l6.size() | | main.rs:40:13:40:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:40:31:40:32 | l7 | semmle.label | l7 | | main.rs:43:44:43:51 | ...: usize | semmle.label | ...: usize | | main.rs:50:13:50:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:50:31:50:42 | l2.repeat(...) [Ok, tuple.0] | semmle.label | l2.repeat(...) [Ok, tuple.0] | -| main.rs:50:31:50:51 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:50:31:50:51 | ... .unwrap() [tuple.0] | semmle.label | ... .unwrap() [tuple.0] | | main.rs:50:31:50:53 | ... .0 | semmle.label | ... .0 | | main.rs:50:41:50:41 | v | semmle.label | v | | main.rs:51:13:51:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:51:31:51:46 | l2.repeat(...) [Ok, tuple.0] | semmle.label | l2.repeat(...) [Ok, tuple.0] | -| main.rs:51:31:51:55 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:51:31:51:55 | ... .unwrap() [tuple.0] | semmle.label | ... .unwrap() [tuple.0] | | main.rs:51:31:51:57 | ... .0 | semmle.label | ... .0 | | main.rs:51:41:51:45 | ... + ... | semmle.label | ... + ... | | main.rs:53:13:53:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:53:31:53:49 | l2.repeat_packed(...) [Ok] | semmle.label | l2.repeat_packed(...) [Ok] | -| main.rs:53:31:53:58 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:53:31:53:58 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:53:48:53:48 | v | semmle.label | v | | main.rs:54:13:54:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:54:31:54:54 | l2.repeat_packed(...) [Ok] | semmle.label | l2.repeat_packed(...) [Ok] | -| main.rs:54:31:54:63 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:54:31:54:63 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:54:48:54:53 | ... * ... | semmle.label | ... * ... | | main.rs:58:9:58:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | | main.rs:58:10:58:11 | k1 | semmle.label | k1 | @@ -360,46 +360,46 @@ nodes | main.rs:60:9:60:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | | main.rs:60:10:60:11 | k2 | semmle.label | k2 | | main.rs:60:24:60:36 | l3.extend(...) [Ok, tuple.0] | semmle.label | l3.extend(...) [Ok, tuple.0] | -| main.rs:60:24:60:45 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:60:24:60:45 | ... .unwrap() [tuple.0] | semmle.label | ... .unwrap() [tuple.0] | | main.rs:60:34:60:35 | k1 | semmle.label | k1 | | main.rs:61:13:61:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:61:31:61:32 | k2 | semmle.label | k2 | | main.rs:62:9:62:20 | TuplePat [tuple.0] | semmle.label | TuplePat [tuple.0] | | main.rs:62:10:62:11 | k3 | semmle.label | k3 | | main.rs:62:24:62:36 | k1.extend(...) [Ok, tuple.0] | semmle.label | k1.extend(...) [Ok, tuple.0] | -| main.rs:62:24:62:45 | ... .unwrap(...) [tuple.0] | semmle.label | ... .unwrap(...) [tuple.0] | +| main.rs:62:24:62:45 | ... .unwrap() [tuple.0] | semmle.label | ... .unwrap() [tuple.0] | | main.rs:63:13:63:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:63:31:63:32 | k3 | semmle.label | k3 | | main.rs:64:13:64:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:64:31:64:50 | l3.extend_packed(...) [Ok] | semmle.label | l3.extend_packed(...) [Ok] | -| main.rs:64:31:64:59 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:64:31:64:59 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:64:48:64:49 | k1 | semmle.label | k1 | | main.rs:65:13:65:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:65:31:65:50 | k1.extend_packed(...) [Ok] | semmle.label | k1.extend_packed(...) [Ok] | -| main.rs:65:31:65:59 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:65:31:65:59 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:67:9:67:10 | l4 | semmle.label | l4 | | main.rs:67:14:67:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:67:14:67:56 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:67:14:67:56 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:67:46:67:46 | v | semmle.label | v | | main.rs:68:13:68:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:68:31:68:32 | l4 | semmle.label | l4 | | main.rs:86:35:86:42 | ...: usize | semmle.label | ...: usize | | main.rs:87:9:87:14 | layout | semmle.label | layout | | main.rs:87:18:87:58 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:87:18:87:67 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:87:18:87:67 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:87:54:87:54 | v | semmle.label | v | | main.rs:88:13:88:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:88:31:88:36 | layout | semmle.label | layout | | main.rs:91:38:91:45 | ...: usize | semmle.label | ...: usize | | main.rs:92:9:92:10 | l1 | semmle.label | l1 | | main.rs:92:14:92:48 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:92:14:92:57 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:92:14:92:57 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:92:47:92:47 | v | semmle.label | v | | main.rs:96:17:96:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:96:35:96:36 | l1 | semmle.label | l1 | | main.rs:101:13:101:14 | l3 | semmle.label | l3 | | main.rs:101:18:101:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:101:18:101:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:101:18:101:61 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:101:51:101:51 | v | semmle.label | v | | main.rs:102:17:102:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:102:35:102:36 | l1 | semmle.label | l1 | @@ -412,7 +412,7 @@ nodes | main.rs:111:35:111:36 | l1 | semmle.label | l1 | | main.rs:145:13:145:14 | l9 | semmle.label | l9 | | main.rs:145:18:145:52 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:145:18:145:61 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:145:18:145:61 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:145:51:145:51 | v | semmle.label | v | | main.rs:146:17:146:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:146:35:146:36 | l1 | semmle.label | l1 | @@ -420,21 +420,21 @@ nodes | main.rs:148:35:148:36 | l9 | semmle.label | l9 | | main.rs:151:9:151:11 | l10 | semmle.label | l10 | | main.rs:151:15:151:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:151:15:151:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:151:15:151:78 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:151:48:151:68 | ...::min(...) | semmle.label | ...::min(...) | | main.rs:151:62:151:62 | v | semmle.label | v | | main.rs:152:13:152:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:152:31:152:33 | l10 | semmle.label | l10 | | main.rs:154:9:154:11 | l11 | semmle.label | l11 | | main.rs:154:15:154:69 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:154:15:154:78 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:154:15:154:78 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:154:48:154:68 | ...::max(...) | semmle.label | ...::max(...) | | main.rs:154:62:154:62 | v | semmle.label | v | | main.rs:155:13:155:29 | ...::alloc | semmle.label | ...::alloc | | main.rs:155:31:155:33 | l11 | semmle.label | l11 | | main.rs:161:13:161:15 | l13 | semmle.label | l13 | | main.rs:161:19:161:59 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:161:19:161:68 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:161:19:161:68 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:161:55:161:55 | v | semmle.label | v | | main.rs:162:17:162:33 | ...::alloc | semmle.label | ...::alloc | | main.rs:162:35:162:37 | l13 | semmle.label | l13 | @@ -445,7 +445,7 @@ nodes | main.rs:183:29:183:36 | ...: usize | semmle.label | ...: usize | | main.rs:192:9:192:10 | l2 | semmle.label | l2 | | main.rs:192:14:192:47 | ...::array::<...>(...) [Ok] | semmle.label | ...::array::<...>(...) [Ok] | -| main.rs:192:14:192:56 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:192:14:192:56 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:192:46:192:46 | v | semmle.label | v | | main.rs:193:32:193:36 | alloc | semmle.label | alloc | | main.rs:193:38:193:39 | l2 | semmle.label | l2 | @@ -476,11 +476,11 @@ nodes | main.rs:224:31:224:31 | v | semmle.label | v | | main.rs:279:24:279:41 | ...: String | semmle.label | ...: String | | main.rs:280:9:280:17 | num_bytes | semmle.label | num_bytes | -| main.rs:280:21:280:47 | user_input.parse(...) [Ok] | semmle.label | user_input.parse(...) [Ok] | +| main.rs:280:21:280:47 | user_input.parse() [Ok] | semmle.label | user_input.parse() [Ok] | | main.rs:280:21:280:48 | TryExpr | semmle.label | TryExpr | | main.rs:282:9:282:14 | layout | semmle.label | layout | | main.rs:282:18:282:66 | ...::from_size_align(...) [Ok] | semmle.label | ...::from_size_align(...) [Ok] | -| main.rs:282:18:282:75 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:282:18:282:75 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:282:54:282:62 | num_bytes | semmle.label | num_bytes | | main.rs:284:22:284:38 | ...::alloc | semmle.label | ...::alloc | | main.rs:284:40:284:45 | layout | semmle.label | layout | @@ -493,8 +493,8 @@ nodes | main.rs:317:13:317:28 | ...::args(...) [element] | semmle.label | ...::args(...) [element] | | main.rs:317:13:317:35 | ... .nth(...) [Some] | semmle.label | ... .nth(...) [Some] | | main.rs:317:13:317:65 | ... .unwrap_or(...) | semmle.label | ... .unwrap_or(...) | -| main.rs:317:13:317:82 | ... .parse(...) [Ok] | semmle.label | ... .parse(...) [Ok] | -| main.rs:317:13:317:91 | ... .unwrap(...) | semmle.label | ... .unwrap(...) | +| main.rs:317:13:317:82 | ... .parse() [Ok] | semmle.label | ... .parse() [Ok] | +| main.rs:317:13:317:91 | ... .unwrap() | semmle.label | ... .unwrap() | | main.rs:320:34:320:34 | v | semmle.label | v | | main.rs:321:42:321:42 | v | semmle.label | v | | main.rs:322:36:322:36 | v | semmle.label | v | From c9939387f8512d39e52b8f201d89926519d8be48 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 4 Apr 2025 21:47:22 +0100 Subject: [PATCH 085/372] Rust: Turn on PrettyPrintModels for RegexInjection so we hopefully don't have to deal with test result changes there as often. --- .../security/CWE-020/RegexInjection.expected | 13 +++++++++---- .../security/CWE-020/RegexInjection.qlref | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected index 4d5a046ccc5..c86d5f444d6 100644 --- a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected @@ -2,16 +2,21 @@ | main.rs:6:25:6:30 | ®ex | main.rs:4:20:4:32 | ...::var | main.rs:6:25:6:30 | ®ex | This regular expression is constructed from a $@. | main.rs:4:20:4:32 | ...::var | user-provided value | edges | main.rs:4:9:4:16 | username | main.rs:5:25:5:44 | MacroExpr | provenance | | -| main.rs:4:20:4:32 | ...::var | main.rs:4:20:4:40 | ...::var(...) [Ok] | provenance | Src:MaD:68 | -| main.rs:4:20:4:40 | ...::var(...) [Ok] | main.rs:4:20:4:66 | ... .unwrap_or(...) | provenance | MaD:1660 | +| main.rs:4:20:4:32 | ...::var | main.rs:4:20:4:40 | ...::var(...) [Ok] | provenance | Src:MaD:1 | +| main.rs:4:20:4:40 | ...::var(...) [Ok] | main.rs:4:20:4:66 | ... .unwrap_or(...) | provenance | MaD:3 | | main.rs:4:20:4:66 | ... .unwrap_or(...) | main.rs:4:9:4:16 | username | provenance | | | main.rs:5:9:5:13 | regex | main.rs:6:26:6:30 | regex | provenance | | | main.rs:5:17:5:45 | res | main.rs:5:25:5:44 | { ... } | provenance | | | main.rs:5:25:5:44 | ...::format(...) | main.rs:5:17:5:45 | res | provenance | | | main.rs:5:25:5:44 | ...::must_use(...) | main.rs:5:9:5:13 | regex | provenance | | -| main.rs:5:25:5:44 | MacroExpr | main.rs:5:25:5:44 | ...::format(...) | provenance | MaD:119 | -| main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:3083 | +| main.rs:5:25:5:44 | MacroExpr | main.rs:5:25:5:44 | ...::format(...) | provenance | MaD:2 | +| main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:4 | | main.rs:6:26:6:30 | regex | main.rs:6:25:6:30 | ®ex | provenance | | +models +| 1 | Source: lang:std; crate::env::var; environment-source; ReturnValue.Field[crate::result::Result::Ok(0)] | +| 2 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | +| 3 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 4 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | nodes | main.rs:4:9:4:16 | username | semmle.label | username | | main.rs:4:20:4:32 | ...::var | semmle.label | ...::var | diff --git a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.qlref b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.qlref index bc028b7e20d..390ef3fe575 100644 --- a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.qlref +++ b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.qlref @@ -1,2 +1,4 @@ query: queries/security/CWE-020/RegexInjection.ql -postprocess: utils/test/InlineExpectationsTestQuery.ql +postprocess: + - utils/test/PrettyPrintModels.ql + - utils/test/InlineExpectationsTestQuery.ql From 6fb5376c5f65259ef1e185c3d83820c5130b1c26 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 11:44:40 +0200 Subject: [PATCH 086/372] Refactor `ReceivedItemAsRemoteFlow` to handle data from both client and server WebSocket sources --- .../javascript/frameworks/WebSocket.qll | 25 +++++++------ .../frameworks/WebSocket/browser-custom.js | 18 +++++----- .../frameworks/WebSocket/browser.js | 8 ++--- .../frameworks/WebSocket/client-custom.js | 4 +-- .../frameworks/WebSocket/client.js | 2 +- .../frameworks/WebSocket/test.expected | 36 +++++++++++++------ 6 files changed, 56 insertions(+), 37 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index da110c6562c..5e40360a4d8 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -344,15 +344,18 @@ module ServerWebSocket { result = this.getCallback(1).getParameter(0) } } - - /** - * A data flow node representing data received from a client, viewed as remote user input. - */ - private class ReceivedItemAsRemoteFlow extends RemoteFlowSource { - ReceivedItemAsRemoteFlow() { this = any(ReceiveNode rercv).getReceivedItem(_) } - - override string getSourceType() { result = "WebSocket client data" } - - override predicate isUserControlledObject() { any() } - } +} + +/** + * A data flow node representing data received from a client or server, viewed as remote user input. + */ +private class ReceivedItemAsRemoteFlow extends RemoteFlowSource { + ReceivedItemAsRemoteFlow() { + this = any(ClientWebSocket::ReceiveNode rercv).getReceivedItem(_) or + this = any(ServerWebSocket::ReceiveNode rercv).getReceivedItem(_) + } + + override string getSourceType() { result = "WebSocket transmitted data" } + + override predicate isUserControlledObject() { any() } } diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js index ad0d30fb01e..f7ac5b0f4fe 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser-custom.js @@ -8,11 +8,11 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ }); socket.addEventListener('message', function (event) { - console.log('Message from server ', event.data); + console.log('Message from server ', event.data); // $ remoteFlow }); // $ clientReceive socket.onmessage = function (event) { - console.log("Message from server 2", event.data) + console.log("Message from server 2", event.data); // $ remoteFlow }; // $ clientReceive })(); @@ -24,12 +24,12 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ }; sock.onmessage = function (e) { - console.log('message', e.data); + console.log('message', e.data); // $ remoteFlow sock.close(); }; // $ clientReceive sock.addEventListener('message', function (event) { - console.log('Using addEventListener ', event.data); + console.log('Using addEventListener ', event.data); // $ remoteFlow }); // $ clientReceive })(); @@ -40,11 +40,11 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ }); myWebSocketInstance.addEventListener('message', function (event) { - console.log('Message from server ', event.data); + console.log('Message from server ', event.data); // $ remoteFlow }); // $ clientReceive myWebSocketInstance.onmessage = function (event) { - console.log("Message from server 2", event.data) + console.log("Message from server 2", event.data); // $ remoteFlow }; // $ clientReceive })(); @@ -55,18 +55,18 @@ import { MyWebSocket, MySockJS, myWebSocketInstance, mySockJSInstance } from './ }; mySockJSInstance.onmessage = function (e) { - console.log('message', e.data); + console.log('message', e.data); // $ remoteFlow mySockJSInstance.close(); }; // $ clientReceive mySockJSInstance.addEventListener('message', function (event) { - console.log('Using addEventListener ', event.data); + console.log('Using addEventListener ', event.data); // $ remoteFlow }); // $ clientReceive })(); const recv_message = function (e) { - console.log('Received message:', e.data); + console.log('Received message:', e.data); // $ remoteFlow }; // $ clientReceive (function () { diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js index f966879f9f2..4d82c113e08 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/browser.js @@ -6,11 +6,11 @@ }); socket.addEventListener('message', function (event) { - console.log('Message from server ', event.data); + console.log('Message from server ', event.data); // $ remoteFlow }); // $clientReceive socket.onmessage = function (event) { - console.log("Message from server 2", event.data) + console.log("Message from server 2", event.data); // $ remoteFlow }; // $clientReceive })(); @@ -22,12 +22,12 @@ }; sock.onmessage = function (e) { - console.log('message', e.data); + console.log('message', e.data); // $ remoteFlow sock.close(); }; // $clientReceive sock.addEventListener('message', function (event) { - console.log('Using addEventListener ', event.data); + console.log('Using addEventListener ', event.data); // $ remoteFlow }); // $clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js index dd8c84e87c0..24eeebdb4cc 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client-custom.js @@ -7,7 +7,7 @@ const { MyWebSocketWS, myWebSocketWSInstance } = require('./client.js'); ws.send('Hi from client!'); // $ clientSend }); - ws.on('message', function incoming(data) { + ws.on('message', function incoming(data) { // $ remoteFlow console.log(data); }); // $ clientReceive })(); @@ -17,7 +17,7 @@ const { MyWebSocketWS, myWebSocketWSInstance } = require('./client.js'); myWebSocketWSInstance.send('Hi from client!'); // $ clientSend }); - myWebSocketWSInstance.on('message', function incoming(data) { + myWebSocketWSInstance.on('message', function incoming(data) { // $ remoteFlow console.log(data); }); // $ clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js index 54a200f3379..7061d51a954 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/client.js +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/client.js @@ -7,7 +7,7 @@ const WebSocket = require('ws'); ws.send('Hi from client!'); // $clientSend }); - ws.on('message', function incoming(data) { + ws.on('message', function incoming(data) { // $ remoteFlow console.log(data); }); // $clientReceive })(); diff --git a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected index 7480e066876..d08070a1a71 100644 --- a/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected +++ b/javascript/ql/test/library-tests/frameworks/WebSocket/test.expected @@ -1,17 +1,17 @@ clientReceive -| browser-custom.js:10:37:12:2 | functio ... ta);\\n\\t} | -| browser-custom.js:14:21:16:2 | functio ... ata)\\n\\t} | +| browser-custom.js:10:37:12:2 | functio ... Flow\\n\\t} | +| browser-custom.js:14:21:16:2 | functio ... Flow\\n\\t} | | browser-custom.js:26:19:29:2 | functio ... e();\\n\\t} | -| browser-custom.js:31:35:33:2 | functio ... ta);\\n\\t} | -| browser-custom.js:42:53:44:5 | functio ... ;\\n } | -| browser-custom.js:46:37:48:5 | functio ... )\\n } | +| browser-custom.js:31:35:33:2 | functio ... Flow\\n\\t} | +| browser-custom.js:42:53:44:5 | functio ... w\\n } | +| browser-custom.js:46:37:48:5 | functio ... w\\n } | | browser-custom.js:57:34:60:5 | functio ... ;\\n } | -| browser-custom.js:62:50:64:5 | functio ... ;\\n } | -| browser-custom.js:68:22:70:1 | functio ... ata);\\n} | -| browser.js:8:37:10:2 | functio ... ta);\\n\\t} | -| browser.js:12:21:14:2 | functio ... ata)\\n\\t} | +| browser-custom.js:62:50:64:5 | functio ... w\\n } | +| browser-custom.js:68:22:70:1 | functio ... eFlow\\n} | +| browser.js:8:37:10:2 | functio ... Flow\\n\\t} | +| browser.js:12:21:14:2 | functio ... Flow\\n\\t} | | browser.js:24:19:27:2 | functio ... e();\\n\\t} | -| browser.js:29:35:31:2 | functio ... ta);\\n\\t} | +| browser.js:29:35:31:2 | functio ... Flow\\n\\t} | | client-custom.js:10:19:12:2 | functio ... ta);\\n\\t} | | client-custom.js:20:38:22:2 | functio ... ta);\\n\\t} | | client.js:10:19:12:2 | functio ... ta);\\n\\t} | @@ -102,6 +102,22 @@ flowSteps | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:25:26:25:31 | e.data | | sockjs.js:11:20:11:50 | JSON.st ... .test)) | browser.js:30:42:30:51 | event.data | remoteFlow +| browser-custom.js:11:39:11:48 | event.data | +| browser-custom.js:15:40:15:49 | event.data | +| browser-custom.js:27:26:27:31 | e.data | +| browser-custom.js:32:42:32:51 | event.data | +| browser-custom.js:43:45:43:54 | event.data | +| browser-custom.js:47:46:47:55 | event.data | +| browser-custom.js:58:32:58:37 | e.data | +| browser-custom.js:63:48:63:57 | event.data | +| browser-custom.js:69:38:69:43 | e.data | +| browser.js:9:39:9:48 | event.data | +| browser.js:13:40:13:49 | event.data | +| browser.js:25:26:25:31 | e.data | +| browser.js:30:42:30:51 | event.data | +| client-custom.js:10:37:10:40 | data | +| client-custom.js:20:56:20:59 | data | +| client.js:10:37:10:40 | data | | server-custom.js:7:38:7:44 | message | | server-custom.js:17:38:17:44 | message | | server.js:7:38:7:44 | message | From c4fa4176802a27405e418ba0a87325c502b34cc0 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 12:11:33 +0200 Subject: [PATCH 087/372] Added change note --- javascript/ql/lib/change-notes/2025-04-07-websocket.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2025-04-07-websocket.md diff --git a/javascript/ql/lib/change-notes/2025-04-07-websocket.md b/javascript/ql/lib/change-notes/2025-04-07-websocket.md new file mode 100644 index 00000000000..a6f6e214f3a --- /dev/null +++ b/javascript/ql/lib/change-notes/2025-04-07-websocket.md @@ -0,0 +1,5 @@ +--- +category: minorAnalysis +--- +* Improved `WebSocket` analysis by refactoring the model to use API graphs. +* Added data received from `WebSocket` clients as a remote flow source. From 93882263f934cf1c717b259b72e99ae747b8e749 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 12:32:18 +0200 Subject: [PATCH 088/372] Added test case for `Uint8Array` and `TypedArray.prototype.buffer` --- .../TaintTracking/BasicTaintTracking.expected | 3 +++ .../test/library-tests/TaintTracking/typed-arrays.js | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 javascript/ql/test/library-tests/TaintTracking/typed-arrays.js diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index 4a0575eb73e..b16953795b1 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -40,6 +40,9 @@ consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:5 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:7 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:11 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js new file mode 100644 index 00000000000..c29c7bef954 --- /dev/null +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -0,0 +1,12 @@ +function test() { + let x = source(); + + let y = new Uint8Array(x); + sink(y); // NOT OK + + sink(y.buffer); // NOT OK + sink(y.length); + + var arr = new Uint8Array(y.buffer, y.byteOffset, y.byteLength); + sink(arr); // NOT OK +} From d17d44125cac4b2898a5f1093d4e7d068b634065 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Mon, 7 Apr 2025 12:43:37 +0200 Subject: [PATCH 089/372] Java: add integration test for query suite contents --- .../java-code-quality.qls.expected | 11 + .../java-code-scanning.qls.expected | 79 ++++++ .../java-security-and-quality.qls.expected | 243 ++++++++++++++++++ .../java-security-extended.qls.expected | 123 +++++++++ .../java/query-suite/test.py | 15 ++ 5 files changed, 471 insertions(+) create mode 100644 java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected create mode 100644 java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected create mode 100644 java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected create mode 100644 java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected create mode 100644 java/ql/integration-tests/java/query-suite/test.py diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected new file mode 100644 index 00000000000..1b231590e6a --- /dev/null +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -0,0 +1,11 @@ +/ql/java/ql/src/Language Abuse/TypeVariableHidesType.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql +/ql/java/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql +/ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql +/ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql +/ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql +/ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql +/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql +/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql diff --git a/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected new file mode 100644 index 00000000000..9f22d395c39 --- /dev/null +++ b/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected @@ -0,0 +1,79 @@ +/ql/java/ql/src/Diagnostics/ExtractionErrors.ql +/ql/java/ql/src/Diagnostics/ExtractionWarnings.ql +/ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql +/ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql +/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql +/ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql +/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql +/ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql +/ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql +/ql/java/ql/src/Security/CWE/CWE-079/XSS.ql +/ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql +/ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql +/ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql +/ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql +/ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql +/ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql +/ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql +/ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql +/ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql +/ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql +/ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql +/ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql +/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql +/ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql +/ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql +/ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql +/ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql +/ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql +/ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql +/ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql +/ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql +/ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql +/ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql +/ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql +/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql +/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql +/ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql +/ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql +/ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql +/ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql +/ql/java/ql/src/Security/CWE/CWE-611/XXE.ql +/ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql +/ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql +/ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql +/ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql +/ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql +/ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql +/ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql +/ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql +/ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +/ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql +/ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql +/ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql +/ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql +/ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql +/ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql +/ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql +/ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +/ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql +/ql/java/ql/src/Telemetry/ExtractorInformation.ql +/ql/java/ql/src/Telemetry/SupportedExternalApis.ql +/ql/java/ql/src/Telemetry/SupportedExternalSinks.ql +/ql/java/ql/src/Telemetry/SupportedExternalSources.ql +/ql/java/ql/src/Telemetry/SupportedExternalTaint.ql +/ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql diff --git a/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected new file mode 100644 index 00000000000..7da7bc5119e --- /dev/null +++ b/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected @@ -0,0 +1,243 @@ +/ql/java/ql/src/Advisory/Declarations/MissingOverrideAnnotation.ql +/ql/java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.ql +/ql/java/ql/src/Advisory/Documentation/ImpossibleJavadocThrows.ql +/ql/java/ql/src/Advisory/Documentation/SpuriousJavadocParam.ql +/ql/java/ql/src/Compatibility/JDK9/JdkInternalAccess.ql +/ql/java/ql/src/Compatibility/JDK9/UnderscoreIdentifier.ql +/ql/java/ql/src/DeadCode/UselessParameter.ql +/ql/java/ql/src/Diagnostics/ExtractionErrors.ql +/ql/java/ql/src/Diagnostics/ExtractionWarnings.ql +/ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +/ql/java/ql/src/Language Abuse/ChainedInstanceof.ql +/ql/java/ql/src/Language Abuse/IterableIterator.ql +/ql/java/ql/src/Language Abuse/OverridePackagePrivate.ql +/ql/java/ql/src/Language Abuse/TypeVarExtendsFinalType.ql +/ql/java/ql/src/Language Abuse/TypeVariableHidesType.ql +/ql/java/ql/src/Language Abuse/UselessNullCheck.ql +/ql/java/ql/src/Language Abuse/UselessTypeTest.ql +/ql/java/ql/src/Language Abuse/WrappedIterator.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/BadAbsOfRandom.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/LShiftLargerThanTypeWidth.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/MultiplyRemainder.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/RandomUsedOnce.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql +/ql/java/ql/src/Likely Bugs/Cloning/MissingCallToSuperClone.ql +/ql/java/ql/src/Likely Bugs/Cloning/MissingMethodClone.ql +/ql/java/ql/src/Likely Bugs/Collections/ArrayIndexOutOfBounds.ql +/ql/java/ql/src/Likely Bugs/Collections/ContainsTypeMismatch.ql +/ql/java/ql/src/Likely Bugs/Collections/IteratorRemoveMayFail.ql +/ql/java/ql/src/Likely Bugs/Collections/ReadOnlyContainer.ql +/ql/java/ql/src/Likely Bugs/Collections/RemoveTypeMismatch.ql +/ql/java/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql +/ql/java/ql/src/Likely Bugs/Comparison/CompareIdenticalValues.ql +/ql/java/ql/src/Likely Bugs/Comparison/CovariantCompareTo.ql +/ql/java/ql/src/Likely Bugs/Comparison/CovariantEquals.ql +/ql/java/ql/src/Likely Bugs/Comparison/EqualsArray.ql +/ql/java/ql/src/Likely Bugs/Comparison/HashedButNoHash.ql +/ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql +/ql/java/ql/src/Likely Bugs/Comparison/InconsistentCompareTo.ql +/ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql +/ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql +/ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql +/ql/java/ql/src/Likely Bugs/Comparison/StringComparison.ql +/ql/java/ql/src/Likely Bugs/Comparison/UselessComparisonTest.ql +/ql/java/ql/src/Likely Bugs/Comparison/WrongNanComparison.ql +/ql/java/ql/src/Likely Bugs/Concurrency/CallsToConditionWait.ql +/ql/java/ql/src/Likely Bugs/Concurrency/CallsToRunnableRun.ql +/ql/java/ql/src/Likely Bugs/Concurrency/DateFormatThreadUnsafe.ql +/ql/java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLocking.ql +/ql/java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLockingWithInitRace.ql +/ql/java/ql/src/Likely Bugs/Concurrency/FutileSynchOnField.ql +/ql/java/ql/src/Likely Bugs/Concurrency/NonSynchronizedOverride.ql +/ql/java/ql/src/Likely Bugs/Concurrency/NotifyNotNotifyAll.ql +/ql/java/ql/src/Likely Bugs/Concurrency/SleepWithLock.ql +/ql/java/ql/src/Likely Bugs/Concurrency/StartInConstructor.ql +/ql/java/ql/src/Likely Bugs/Concurrency/SynchOnBoxedType.ql +/ql/java/ql/src/Likely Bugs/Concurrency/SynchSetUnsynchGet.ql +/ql/java/ql/src/Likely Bugs/Concurrency/SynchWriteObject.ql +/ql/java/ql/src/Likely Bugs/Concurrency/UnreleasedLock.ql +/ql/java/ql/src/Likely Bugs/Finalization/NullifiedSuperFinalize.ql +/ql/java/ql/src/Likely Bugs/Frameworks/JUnit/BadSuiteMethod.ql +/ql/java/ql/src/Likely Bugs/Frameworks/Swing/BadlyOverriddenAdapter.ql +/ql/java/ql/src/Likely Bugs/Inheritance/NoNonFinalInConstructor.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/ContainerSizeCmpZero.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/DangerousNonCircuitLogic.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/EqualsTypo.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/HashCodeTypo.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/MissingFormatArg.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/MissingSpaceTypo.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/SelfAssignment.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/StringBufferCharInit.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/ToStringTypo.ql +/ql/java/ql/src/Likely Bugs/Likely Typos/UnusedFormatArg.ql +/ql/java/ql/src/Likely Bugs/Nullness/NullAlways.ql +/ql/java/ql/src/Likely Bugs/Nullness/NullExprDeref.ql +/ql/java/ql/src/Likely Bugs/Nullness/NullMaybe.ql +/ql/java/ql/src/Likely Bugs/Reflection/AnnotationPresentCheck.ql +/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql +/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseSql.ql +/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql +/ql/java/ql/src/Likely Bugs/Serialization/IncorrectSerialVersionUID.ql +/ql/java/ql/src/Likely Bugs/Serialization/IncorrectSerializableMethods.ql +/ql/java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorOnExternalizable.ql +/ql/java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorsOnSerializable.ql +/ql/java/ql/src/Likely Bugs/Serialization/NonSerializableInnerClass.ql +/ql/java/ql/src/Likely Bugs/Serialization/ReadResolveObject.ql +/ql/java/ql/src/Likely Bugs/Statements/ContinueInFalseLoop.ql +/ql/java/ql/src/Likely Bugs/Statements/MissingEnumInSwitch.ql +/ql/java/ql/src/Likely Bugs/Statements/PartiallyMaskedCatch.ql +/ql/java/ql/src/Likely Bugs/Statements/UseBraces.ql +/ql/java/ql/src/Likely Bugs/Termination/ConstantLoopCondition.ql +/ql/java/ql/src/Likely Bugs/Termination/SpinOnField.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql +/ql/java/ql/src/Performance/InefficientEmptyStringTest.ql +/ql/java/ql/src/Performance/InefficientKeySetIterator.ql +/ql/java/ql/src/Performance/InefficientOutputStream.ql +/ql/java/ql/src/Performance/InefficientPrimConstructor.ql +/ql/java/ql/src/Performance/InnerClassCouldBeStatic.ql +/ql/java/ql/src/Performance/NewStringString.ql +/ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql +/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql +/ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql +/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql +/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql +/ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql +/ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecRelative.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql +/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewAddJavascriptInterface.ql +/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql +/ql/java/ql/src/Security/CWE/CWE-079/XSS.ql +/ql/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql +/ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql +/ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/ArbitraryApkInstallation.ql +/ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql +/ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql +/ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql +/ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql +/ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql +/ql/java/ql/src/Security/CWE/CWE-117/LogInjection.ql +/ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql +/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql +/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql +/ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql +/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql +/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql +/ql/java/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveNotifications.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveTextField.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsAllowsContentAccess.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql +/ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql +/ql/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql +/ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql +/ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql +/ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql +/ql/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql +/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql +/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql +/ql/java/ql/src/Security/CWE/CWE-295/AndroidMissingCertificatePinning.ql +/ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql +/ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql +/ql/java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql +/ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql +/ql/java/ql/src/Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageProperties.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.ql +/ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql +/ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql +/ql/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql +/ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql +/ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql +/ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql +/ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql +/ql/java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.ql +/ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql +/ql/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql +/ql/java/ql/src/Security/CWE/CWE-421/SocketAuthRace.ql +/ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql +/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql +/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql +/ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql +/ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql +/ql/java/ql/src/Security/CWE/CWE-522/InsecureBasicAuth.ql +/ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql +/ql/java/ql/src/Security/CWE/CWE-524/SensitiveKeyboardCache.ql +/ql/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql +/ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql +/ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql +/ql/java/ql/src/Security/CWE/CWE-611/XXE.ql +/ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql +/ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql +/ql/java/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql +/ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql +/ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql +/ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql +/ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql +/ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql +/ql/java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql +/ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql +/ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql +/ql/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql +/ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +/ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql +/ql/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql +/ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql +/ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql +/ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql +/ql/java/ql/src/Security/CWE/CWE-926/ContentProviderIncompletePermissions.ql +/ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql +/ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql +/ql/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql +/ql/java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql +/ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql +/ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +/ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql +/ql/java/ql/src/Telemetry/ExtractorInformation.ql +/ql/java/ql/src/Telemetry/SupportedExternalApis.ql +/ql/java/ql/src/Telemetry/SupportedExternalSinks.ql +/ql/java/ql/src/Telemetry/SupportedExternalSources.ql +/ql/java/ql/src/Telemetry/SupportedExternalTaint.ql +/ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql +/ql/java/ql/src/Violations of Best Practice/Boxed Types/BoxedVariable.ql +/ql/java/ql/src/Violations of Best Practice/Dead Code/CreatesEmptyZip.ql +/ql/java/ql/src/Violations of Best Practice/Dead Code/DeadRefTypes.ql +/ql/java/ql/src/Violations of Best Practice/Dead Code/InterfaceCannotBeImplemented.ql +/ql/java/ql/src/Violations of Best Practice/Dead Code/UnreadLocal.ql +/ql/java/ql/src/Violations of Best Practice/Dead Code/UnusedLabel.ql +/ql/java/ql/src/Violations of Best Practice/Declarations/NoConstantsOnly.ql +/ql/java/ql/src/Violations of Best Practice/Exception Handling/IgnoreExceptionalReturn.ql +/ql/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql +/ql/java/ql/src/Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql +/ql/java/ql/src/Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql +/ql/java/ql/src/Violations of Best Practice/Implementation Hiding/GetClassGetResource.ql +/ql/java/ql/src/Violations of Best Practice/Naming Conventions/AmbiguousOuterSuper.ql +/ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingMethodNames.ql +/ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql +/ql/java/ql/src/Violations of Best Practice/Naming Conventions/FieldMasksSuperField.ql +/ql/java/ql/src/Violations of Best Practice/Naming Conventions/LocalShadowsFieldConfusing.ql +/ql/java/ql/src/Violations of Best Practice/Naming Conventions/SameNameAsSuper.ql +/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToRunFinalizersOnExit.ql +/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToStringToString.ql +/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/DefaultToString.ql +/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/NextFromIterator.ql +/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/PrintLnArray.ql diff --git a/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected b/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected new file mode 100644 index 00000000000..adcdc17c6c1 --- /dev/null +++ b/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected @@ -0,0 +1,123 @@ +/ql/java/ql/src/Diagnostics/ExtractionErrors.ql +/ql/java/ql/src/Diagnostics/ExtractionWarnings.ql +/ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +/ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql +/ql/java/ql/src/Likely Bugs/Concurrency/UnreleasedLock.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql +/ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql +/ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql +/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql +/ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql +/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql +/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql +/ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql +/ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecRelative.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql +/ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql +/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewAddJavascriptInterface.ql +/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql +/ql/java/ql/src/Security/CWE/CWE-079/XSS.ql +/ql/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql +/ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql +/ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/ArbitraryApkInstallation.ql +/ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql +/ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql +/ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql +/ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql +/ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql +/ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql +/ql/java/ql/src/Security/CWE/CWE-117/LogInjection.ql +/ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql +/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql +/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql +/ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql +/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql +/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql +/ql/java/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveNotifications.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveTextField.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsAllowsContentAccess.ql +/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql +/ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql +/ql/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql +/ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql +/ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql +/ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql +/ql/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql +/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql +/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql +/ql/java/ql/src/Security/CWE/CWE-295/AndroidMissingCertificatePinning.ql +/ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql +/ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql +/ql/java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql +/ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql +/ql/java/ql/src/Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageProperties.ql +/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.ql +/ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql +/ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql +/ql/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql +/ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql +/ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql +/ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql +/ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql +/ql/java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.ql +/ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql +/ql/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql +/ql/java/ql/src/Security/CWE/CWE-421/SocketAuthRace.ql +/ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql +/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql +/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql +/ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql +/ql/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql +/ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql +/ql/java/ql/src/Security/CWE/CWE-522/InsecureBasicAuth.ql +/ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql +/ql/java/ql/src/Security/CWE/CWE-524/SensitiveKeyboardCache.ql +/ql/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql +/ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql +/ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql +/ql/java/ql/src/Security/CWE/CWE-611/XXE.ql +/ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql +/ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql +/ql/java/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql +/ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql +/ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql +/ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql +/ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql +/ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql +/ql/java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql +/ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql +/ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql +/ql/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql +/ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +/ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql +/ql/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql +/ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql +/ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql +/ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql +/ql/java/ql/src/Security/CWE/CWE-926/ContentProviderIncompletePermissions.ql +/ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql +/ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql +/ql/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql +/ql/java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql +/ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql +/ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +/ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql +/ql/java/ql/src/Telemetry/ExtractorInformation.ql +/ql/java/ql/src/Telemetry/SupportedExternalApis.ql +/ql/java/ql/src/Telemetry/SupportedExternalSinks.ql +/ql/java/ql/src/Telemetry/SupportedExternalSources.ql +/ql/java/ql/src/Telemetry/SupportedExternalTaint.ql +/ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql diff --git a/java/ql/integration-tests/java/query-suite/test.py b/java/ql/integration-tests/java/query-suite/test.py new file mode 100644 index 00000000000..9a95a808998 --- /dev/null +++ b/java/ql/integration-tests/java/query-suite/test.py @@ -0,0 +1,15 @@ +import runs_on + +@runs_on.linux +def test(codeql, java, cwd, expected_files, semmle_code_dir): + query_suites = ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls'] + + for query_suite in query_suites: + actual = codeql.resolve.queries(query_suite, _capture=True).strip() + actual = sorted(actual.split('\n')) + print(semmle_code_dir) + index = len(str(semmle_code_dir)) + actual = [line[index:] for line in actual] + actual_file_name = query_suite + '.actual' + expected_files.add(actual_file_name) + (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') From db9c908d1d8d7491fe1314cc3887e7e5305f10b2 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 14:30:00 +0200 Subject: [PATCH 090/372] Cargo: upgrade dependencies --- Cargo.lock | 284 +++++----- MODULE.bazel | 34 +- ...UILD.android_system_properties-0.1.5.bazel | 2 +- .../tree_sitter_extractors_deps/BUILD.bazel | 106 ++-- ...2.8.0.bazel => BUILD.bitflags-2.9.0.bazel} | 2 +- ...sh-1.5.3.bazel => BUILD.borsh-1.5.5.bazel} | 6 +- ...azel => BUILD.cargo_metadata-0.19.2.bazel} | 8 +- .../BUILD.chalk-ir-0.100.0.bazel | 2 +- .../BUILD.chalk-solve-0.100.0.bazel | 2 +- ...p-4.5.32.bazel => BUILD.clap-4.5.35.bazel} | 4 +- ....bazel => BUILD.clap_builder-4.5.35.bazel} | 2 +- .../BUILD.ena-0.14.3.bazel | 2 +- ...0.1.bazel => BUILD.equivalent-1.0.2.bazel} | 2 +- .../BUILD.filetime-0.2.25.bazel | 48 +- .../BUILD.fsevent-sys-4.1.0.bazel | 2 +- .../BUILD.generator-0.8.4.bazel | 50 +- .../BUILD.getrandom-0.3.1.bazel | 44 +- .../BUILD.globset-0.4.15.bazel | 2 +- .../BUILD.hashbrown-0.15.2.bazel | 2 +- ...2.7.0.bazel => BUILD.indexmap-2.9.0.bazel} | 4 +- .../BUILD.inotify-0.11.0.bazel | 4 +- .../BUILD.inotify-sys-0.1.5.bazel | 2 +- ...a-1.0.14.bazel => BUILD.itoa-1.0.15.bazel} | 2 +- .../BUILD.kqueue-1.0.8.bazel | 2 +- .../BUILD.kqueue-sys-1.0.4.bazel | 2 +- ...0.2.169.bazel => BUILD.libc-0.2.171.bazel} | 6 +- .../BUILD.libredox-0.1.3.bazel | 4 +- .../BUILD.log-0.3.9.bazel | 2 +- ...og-0.4.25.bazel => BUILD.log-0.4.27.bazel} | 2 +- .../BUILD.lz4_flex-0.11.3.bazel | 83 --- .../BUILD.mio-1.0.3.bazel | 52 +- .../BUILD.notify-8.0.0.bazel | 10 +- .../BUILD.num_cpus-1.16.0.bazel | 66 +-- ....1.4.bazel => BUILD.oorandom-11.1.5.bazel} | 2 +- .../BUILD.parking_lot_core-0.9.10.bazel | 48 +- .../BUILD.perf-event-0.4.7.bazel | 2 +- .../BUILD.perf-event-open-sys-1.0.1.bazel | 2 +- .../BUILD.petgraph-0.6.5.bazel | 2 +- .../BUILD.proc-macro2-1.0.94.bazel | 2 +- .../BUILD.ra-ap-rustc_abi-0.100.0.bazel | 2 +- ...ra-ap-rustc_pattern_analysis-0.100.0.bazel | 2 +- ...azel => BUILD.ra_ap_base_db-0.0.273.bazel} | 31 +- ...70.bazel => BUILD.ra_ap_cfg-0.0.273.bazel} | 10 +- ...azel => BUILD.ra_ap_edition-0.0.273.bazel} | 2 +- ...70.bazel => BUILD.ra_ap_hir-0.0.273.bazel} | 46 +- ...azel => BUILD.ra_ap_hir_def-0.0.273.bazel} | 54 +- ...l => BUILD.ra_ap_hir_expand-0.0.273.bazel} | 50 +- ...bazel => BUILD.ra_ap_hir_ty-0.0.273.bazel} | 46 +- ...bazel => BUILD.ra_ap_ide_db-0.0.273.bazel} | 45 +- ...bazel => BUILD.ra_ap_intern-0.0.273.bazel} | 2 +- ...l => BUILD.ra_ap_load-cargo-0.0.273.bazel} | 42 +- ...70.bazel => BUILD.ra_ap_mbe-0.0.273.bazel} | 29 +- ...bazel => BUILD.ra_ap_parser-0.0.273.bazel} | 6 +- ....bazel => BUILD.ra_ap_paths-0.0.273.bazel} | 2 +- ... BUILD.ra_ap_proc_macro_api-0.0.273.bazel} | 24 +- ...azel => BUILD.ra_ap_profile-0.0.273.bazel} | 12 +- ...> BUILD.ra_ap_project_model-0.0.273.bazel} | 36 +- ...ILD.ra_ap_query-group-macro-0.0.273.bazel} | 4 +- ...0.bazel => BUILD.ra_ap_span-0.0.273.bazel} | 18 +- ...0.bazel => BUILD.ra_ap_stdx-0.0.273.bazel} | 77 ++- ...bazel => BUILD.ra_ap_syntax-0.0.273.bazel} | 14 +- ...> BUILD.ra_ap_syntax-bridge-0.0.273.bazel} | 27 +- ...el => BUILD.ra_ap_toolchain-0.0.273.bazel} | 2 +- ...270.bazel => BUILD.ra_ap_tt-0.0.273.bazel} | 10 +- ...70.bazel => BUILD.ra_ap_vfs-0.0.273.bazel} | 12 +- ...l => BUILD.ra_ap_vfs-notify-0.0.273.bazel} | 14 +- .../BUILD.redox_syscall-0.5.8.bazel | 2 +- ...stc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel} | 8 +- .../BUILD.salsa-0.19.0.bazel | 2 +- ...1.0.24.bazel => BUILD.semver-1.0.26.bazel} | 6 +- .../BUILD.serde_json-1.0.140.bazel | 2 +- .../BUILD.serde_yaml-0.9.34+deprecated.bazel | 4 +- .../BUILD.syn-2.0.100.bazel | 2 +- .../BUILD.thin-vec-0.2.14.bazel | 87 +++ ....69.bazel => BUILD.thiserror-2.0.12.bazel} | 16 +- ...azel => BUILD.thiserror-impl-2.0.12.bazel} | 2 +- .../BUILD.toml_edit-0.22.24.bazel | 2 +- .../BUILD.tracing-log-0.2.0.bazel | 2 +- ...bazel => BUILD.unicode-ident-1.0.17.bazel} | 2 +- .../BUILD.wasm-bindgen-backend-0.2.99.bazel | 2 +- .../tree_sitter_extractors_deps/defs.bzl | 507 +++++++++--------- rust/ast-generator/Cargo.toml | 2 +- rust/extractor/Cargo.toml | 32 +- 83 files changed, 1134 insertions(+), 1068 deletions(-) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.bitflags-2.8.0.bazel => BUILD.bitflags-2.9.0.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.borsh-1.5.3.bazel => BUILD.borsh-1.5.5.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.cargo_metadata-0.18.1.bazel => BUILD.cargo_metadata-0.19.2.bazel} (96%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.clap-4.5.32.bazel => BUILD.clap-4.5.35.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.clap_builder-4.5.32.bazel => BUILD.clap_builder-4.5.35.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.equivalent-1.0.1.bazel => BUILD.equivalent-1.0.2.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.indexmap-2.7.0.bazel => BUILD.indexmap-2.9.0.bazel} (98%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.itoa-1.0.14.bazel => BUILD.itoa-1.0.15.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.libc-0.2.169.bazel => BUILD.libc-0.2.171.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.log-0.4.25.bazel => BUILD.log-0.4.27.bazel} (99%) delete mode 100644 misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.oorandom-11.1.4.bazel => BUILD.oorandom-11.1.5.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_base_db-0.0.270.bazel => BUILD.ra_ap_base_db-0.0.273.bazel} (80%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_cfg-0.0.270.bazel => BUILD.ra_ap_cfg-0.0.273.bazel} (93%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_edition-0.0.270.bazel => BUILD.ra_ap_edition-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir-0.0.270.bazel => BUILD.ra_ap_hir-0.0.273.bazel} (74%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir_def-0.0.270.bazel => BUILD.ra_ap_hir_def-0.0.273.bazel} (73%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir_expand-0.0.270.bazel => BUILD.ra_ap_hir_expand-0.0.273.bazel} (73%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_hir_ty-0.0.270.bazel => BUILD.ra_ap_hir_ty-0.0.273.bazel} (77%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_ide_db-0.0.270.bazel => BUILD.ra_ap_ide_db-0.0.273.bazel} (76%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_intern-0.0.270.bazel => BUILD.ra_ap_intern-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_load-cargo-0.0.270.bazel => BUILD.ra_ap_load-cargo-0.0.273.bazel} (75%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_mbe-0.0.270.bazel => BUILD.ra_ap_mbe-0.0.273.bazel} (80%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_parser-0.0.270.bazel => BUILD.ra_ap_parser-0.0.273.bazel} (96%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_paths-0.0.270.bazel => BUILD.ra_ap_paths-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_proc_macro_api-0.0.270.bazel => BUILD.ra_ap_proc_macro_api-0.0.273.bazel} (85%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_profile-0.0.270.bazel => BUILD.ra_ap_profile-0.0.273.bazel} (86%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_project_model-0.0.270.bazel => BUILD.ra_ap_project_model-0.0.273.bazel} (79%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_query-group-macro-0.0.270.bazel => BUILD.ra_ap_query-group-macro-0.0.273.bazel} (97%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_span-0.0.270.bazel => BUILD.ra_ap_span-0.0.273.bazel} (89%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_stdx-0.0.270.bazel => BUILD.ra_ap_stdx-0.0.273.bazel} (57%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_syntax-0.0.270.bazel => BUILD.ra_ap_syntax-0.0.273.bazel} (90%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_syntax-bridge-0.0.270.bazel => BUILD.ra_ap_syntax-bridge-0.0.273.bazel} (82%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_toolchain-0.0.270.bazel => BUILD.ra_ap_toolchain-0.0.273.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_tt-0.0.270.bazel => BUILD.ra_ap_tt-0.0.273.bazel} (93%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_vfs-0.0.270.bazel => BUILD.ra_ap_vfs-0.0.273.bazel} (92%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.ra_ap_vfs-notify-0.0.270.bazel => BUILD.ra_ap_vfs-notify-0.0.273.bazel} (91%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel => BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel} (96%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.semver-1.0.24.bazel => BUILD.semver-1.0.26.bazel} (97%) create mode 100644 misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.thiserror-1.0.69.bazel => BUILD.thiserror-2.0.12.bazel} (94%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.thiserror-impl-1.0.69.bazel => BUILD.thiserror-impl-2.0.12.bazel} (99%) rename misc/bazel/3rdparty/tree_sitter_extractors_deps/{BUILD.unicode-ident-1.0.16.bazel => BUILD.unicode-ident-1.0.17.bazel} (99%) diff --git a/Cargo.lock b/Cargo.lock index 7719e26ffd2..cd9023a315f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -154,15 +154,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "borsh" -version = "1.5.3" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" +checksum = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc" dependencies = [ "cfg_aliases", ] @@ -224,9 +224,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.18.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" dependencies = [ "camino", "cargo-platform", @@ -275,7 +275,7 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f114996bda14c0213f014a4ef31a7867dcf5f539a3900477fc6b20138e7a17b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "chalk-derive", ] @@ -301,7 +301,7 @@ dependencies = [ "chalk-derive", "chalk-ir", "ena", - "indexmap 2.7.0", + "indexmap 2.9.0", "itertools 0.12.1", "petgraph", "rustc-hash 1.1.0", @@ -325,9 +325,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -335,9 +335,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -622,7 +622,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ - "log 0.4.25", + "log 0.4.27", ] [[package]] @@ -691,9 +691,9 @@ checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "figment" @@ -781,7 +781,7 @@ checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" dependencies = [ "cfg-if", "libc", - "log 0.4.25", + "log 0.4.27", "rustversion", "windows", ] @@ -812,7 +812,7 @@ checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ "aho-corasick", "bstr", - "log 0.4.25", + "log 0.4.27", "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -918,9 +918,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -939,7 +939,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "inotify-sys", "libc", ] @@ -979,9 +979,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jod-thread" @@ -1033,9 +1033,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libredox" @@ -1043,7 +1043,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "libc", "redox_syscall", ] @@ -1074,14 +1074,14 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" dependencies = [ - "log 0.4.25", + "log 0.4.27", ] [[package]] name = "log" -version = "0.4.25" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "loom" @@ -1096,12 +1096,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "lz4_flex" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" - [[package]] name = "matchers" version = "0.1.0" @@ -1142,7 +1136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "log 0.4.25", + "log 0.4.27", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -1178,13 +1172,13 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "filetime", "fsevent-sys", "inotify", "kqueue", "libc", - "log 0.4.25", + "log 0.4.27", "mio", "notify-types", "walkdir", @@ -1240,9 +1234,9 @@ checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "os_str_bytes" @@ -1331,7 +1325,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.7.0", + "indexmap 2.9.0", ] [[package]] @@ -1398,7 +1392,7 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1651b0f7e8c3eb7c27a88f39d277e69c32bfe58e3be174d286c1a24d6a7a4d8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "ra-ap-rustc_hashes", "ra-ap-rustc_index", "tracing", @@ -1470,18 +1464,16 @@ dependencies = [ [[package]] name = "ra_ap_base_db" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4baa9734d254af14fd603528ad594650dea601b1764492bd39988da38598ae67" +checksum = "8fd761118bbafe29e2b187e694c6b8e800f2c7822bbc1d9d2db4ac21fb8b0365" dependencies = [ "dashmap 5.5.3", "la-arena", - "lz4_flex", "ra_ap_cfg", "ra_ap_intern", "ra_ap_query-group-macro", "ra_ap_span", - "ra_ap_stdx", "ra_ap_syntax", "ra_ap_vfs", "rustc-hash 2.1.1", @@ -1493,9 +1485,9 @@ dependencies = [ [[package]] name = "ra_ap_cfg" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef2ba45636c5e585040c0c4bee640737a6001b08309f1a25ca78cf04abfbf90" +checksum = "5ce74ce1af24afd86d3529dbbf5a849d026948b2d8ba51d199b6ea6db6e345b6" dependencies = [ "ra_ap_intern", "ra_ap_tt", @@ -1505,20 +1497,20 @@ dependencies = [ [[package]] name = "ra_ap_edition" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8955c1484d5e7274f755187788ba0d51eb149f870c69cdf0d87c3b7edea20ea0" +checksum = "f423b9fb19e3920e4c7039120d09d9c79070a26efe8ff9f787c7234b07f518c5" [[package]] name = "ra_ap_hir" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a51d7955beff2212701b149bea36d4cf2dc0f5cd129652c9bcf0cb5c0b021078" +checksum = "dd4aa8a568b80d288b90c4fa5dc8a3cc405914d261bfd33a3761c1ba41be358d" dependencies = [ "arrayvec", "either", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "ra_ap_base_db", "ra_ap_cfg", "ra_ap_hir_def", @@ -1537,23 +1529,20 @@ dependencies = [ [[package]] name = "ra_ap_hir_def" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c97e617e4c585d24b3d4f668861452aedddfbe0262f4c53235dcea77e62f9b" +checksum = "acb18d9378a828a23ccf87b89199db005adb67ba2a05a37d7a3fcad4d1036e66" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.0", "cov-mark", - "dashmap 5.5.3", "drop_bomb", "either", "fst", - "hashbrown 0.14.5", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "la-arena", "ra-ap-rustc_abi", - "ra-ap-rustc_hashes", "ra-ap-rustc_parse_format", "ra_ap_base_db", "ra_ap_cfg", @@ -1570,21 +1559,20 @@ dependencies = [ "salsa", "smallvec", "text-size", + "thin-vec", "tracing", "triomphe", ] [[package]] name = "ra_ap_hir_expand" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57c0d7e3f2180dd8ea584b11447f34060eadc06f0f6d559e2a790f6e91b6c5" +checksum = "094fa79d8f661f52cf3b7fb8b3d91c4be2ad9e71a3967d3dacd25429fa44b37d" dependencies = [ "cov-mark", "either", - "hashbrown 0.14.5", - "itertools 0.12.1", - "la-arena", + "itertools 0.14.0", "ra_ap_base_db", "ra_ap_cfg", "ra_ap_intern", @@ -1605,24 +1593,22 @@ dependencies = [ [[package]] name = "ra_ap_hir_ty" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f260f35748f3035b46a8afcdebda7cb75d95c24750105fad86101d09a9d387c8" +checksum = "093482d200d5db421db5692e7819bbb14fb717cc8cb0f91f93cce9fde85b3df2" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.0", "chalk-derive", "chalk-ir", "chalk-recursive", "chalk-solve", "cov-mark", - "dashmap 5.5.3", "either", "ena", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "la-arena", - "nohash-hasher", "oorandom", "ra-ap-rustc_abi", "ra-ap-rustc_index", @@ -1647,19 +1633,18 @@ dependencies = [ [[package]] name = "ra_ap_ide_db" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0426263be26e27cb55a3b9ef88b120511b66fe7d9b418a2473d6d5f3ac2fe0a6" +checksum = "b655b92dfa9444db8129321b9217d9e4a83a58ee707aa1004a93052acfb43d57" dependencies = [ "arrayvec", - "bitflags 2.8.0", + "bitflags 2.9.0", "cov-mark", "crossbeam-channel", - "dashmap 5.5.3", "either", "fst", - "indexmap 2.7.0", - "itertools 0.12.1", + "indexmap 2.9.0", + "itertools 0.14.0", "line-index", "memchr", "nohash-hasher", @@ -1681,9 +1666,9 @@ dependencies = [ [[package]] name = "ra_ap_intern" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ea8c9615b3b0688cf557e7310dbd9432f43860c8ea766d54f4416cbecf3571" +checksum = "b4e528496b4d4c351806bb073d3d7f6526535741b9e8801776603c924bbec624" dependencies = [ "dashmap 5.5.3", "hashbrown 0.14.5", @@ -1693,17 +1678,16 @@ dependencies = [ [[package]] name = "ra_ap_load-cargo" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570907e16725c13a678bfd8050ce8839af2831da042a0878b75ee8c41b0f7b0c" +checksum = "1a97a5070b2f4b99f56683d91b2687aa0c530d8969cc5252ec2ae5644e428ffe" dependencies = [ "anyhow", "crossbeam-channel", - "itertools 0.12.1", + "itertools 0.14.0", "ra_ap_hir_expand", "ra_ap_ide_db", "ra_ap_intern", - "ra_ap_paths", "ra_ap_proc_macro_api", "ra_ap_project_model", "ra_ap_span", @@ -1715,9 +1699,9 @@ dependencies = [ [[package]] name = "ra_ap_mbe" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e893fe03b04b30c9b5a339ac2bf39ce32ac9c05a8b50121b7d89ce658346e164" +checksum = "b187ee5ee3fa726eeea5142242a0397e2200d77084026986a68324b9599f9046" dependencies = [ "arrayvec", "cov-mark", @@ -1726,19 +1710,17 @@ dependencies = [ "ra_ap_parser", "ra_ap_span", "ra_ap_stdx", - "ra_ap_syntax", "ra_ap_syntax-bridge", "ra_ap_tt", "rustc-hash 2.1.1", "smallvec", - "tracing", ] [[package]] name = "ra_ap_parser" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd9a264120968b14a66b6ba756cd7f99435385b5dbc2f0a611cf3a12221c385" +checksum = "2306e6c051e60483f3b317fac9dec6c883b7792eeb8db24ec6f39dbfa5430159" dependencies = [ "drop_bomb", "ra-ap-rustc_lexer", @@ -1748,20 +1730,20 @@ dependencies = [ [[package]] name = "ra_ap_paths" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f47817351651e36b56ff3afc483b41600053c9cb7e67d945467c0abe93416032" +checksum = "dcedd00499621bdd0f1fe01955c04e4b388197aa826744003afaf6cc2944bc80" dependencies = [ "camino", ] [[package]] name = "ra_ap_proc_macro_api" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96da3b8b9f6b813a98f5357eef303905450741f47ba90adaab8a5371b748416" +checksum = "7a2e49b550015cd4ad152bd78d92d73594497f2e44f61273f9fed3534ad4bbbe" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.9.0", "ra_ap_intern", "ra_ap_paths", "ra_ap_span", @@ -1776,9 +1758,9 @@ dependencies = [ [[package]] name = "ra_ap_profile" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13637377287c84f88a628e40229d271ef0081c0d683956bd99a6c8278a4f8b14" +checksum = "87cdbd27ebe02ec21fdae3df303f194bda036a019ecef80d47e0082646f06c54" dependencies = [ "cfg-if", "libc", @@ -1788,13 +1770,13 @@ dependencies = [ [[package]] name = "ra_ap_project_model" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c5207a638fc7a752c7a454bc952b28b0d02f0bf9f6d7ec785ec809579d8fa" +checksum = "5eaa3406c891a7840d20ce615f8decca32cbc9d3654b82dcbcc3a31257ce90b9" dependencies = [ "anyhow", "cargo_metadata", - "itertools 0.12.1", + "itertools 0.14.0", "la-arena", "ra_ap_base_db", "ra_ap_cfg", @@ -1814,22 +1796,20 @@ dependencies = [ [[package]] name = "ra_ap_query-group-macro" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1a38f07b442e47a234cbe2e8fd1b8a41ff0cc5123cb1cf994c5ce20edb5bd6" +checksum = "1fbc1748e4876a9b0ccfacfc7e2fe254f30e92ef58d98925282b3803e8b004ed" dependencies = [ - "heck", "proc-macro2", "quote", - "salsa", "syn", ] [[package]] name = "ra_ap_span" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8818680c6f7da3b32cb2bb0992940b24264b1aa90203aa94812e09ab34d362d1" +checksum = "ed1d036e738bf32a057d90698df85bcb83ed6263b5fe9fba132c99e8ec3aecaf" dependencies = [ "hashbrown 0.14.5", "la-arena", @@ -1843,12 +1823,12 @@ dependencies = [ [[package]] name = "ra_ap_stdx" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c10bee1b03fc48083862c13cf06bd3ed17760463ecce2734103a2f511e5ed4" +checksum = "6e3775954ab24408f71e97079a97558078a166a4082052e83256ae4c22dae18d" dependencies = [ "crossbeam-channel", - "itertools 0.12.1", + "itertools 0.14.0", "jod-thread", "libc", "miow", @@ -1858,14 +1838,12 @@ dependencies = [ [[package]] name = "ra_ap_syntax" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92bc32f3946fc5fcbdc79e61b7e26a8c2a3a56f3ef6ab27c7d298a9e21a462f2" +checksum = "b49b081f209a764700f688db91820a66c2ecfe5f138895d831361cf84f716691" dependencies = [ - "cov-mark", "either", - "indexmap 2.7.0", - "itertools 0.12.1", + "itertools 0.14.0", "ra-ap-rustc_lexer", "ra_ap_parser", "ra_ap_stdx", @@ -1878,9 +1856,9 @@ dependencies = [ [[package]] name = "ra_ap_syntax-bridge" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42052c44c98c122c37aac476260c8f19d8fec495edc9c05835307c9ae86194d" +checksum = "f2740bbe603d527f2cf0aaf51629de7d072694fbbaaeda8264f7591be1493d1b" dependencies = [ "ra_ap_intern", "ra_ap_parser", @@ -1889,14 +1867,13 @@ dependencies = [ "ra_ap_syntax", "ra_ap_tt", "rustc-hash 2.1.1", - "tracing", ] [[package]] name = "ra_ap_toolchain" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75996e70b3a0c68cd5157ba01f018964c7c6a5d7b209047d449b393139d0b57f" +checksum = "efbff9f26f307ef958586357d1653d000861dcd3acbaf33a009651e024720c7e" dependencies = [ "camino", "home", @@ -1904,9 +1881,9 @@ dependencies = [ [[package]] name = "ra_ap_tt" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4ee31e93bfabe83e6720b7469db88d7ad7ec5c59a1f011efec4aa1327ffc5c" +checksum = "0b1ce3ac14765e414fa6031fda7dc35d3492c74de225aac689ba8b8bf037e1f8" dependencies = [ "arrayvec", "ra-ap-rustc_lexer", @@ -1917,13 +1894,13 @@ dependencies = [ [[package]] name = "ra_ap_vfs" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6aac1e277ac70bb073f40f8a3fc44e4b1bb9e4d4b1d0e0bd2f8269543560f80" +checksum = "29427a7c27ce8ddfefb52d77c952a4588c74d0a7ab064dc627129088a90423ca" dependencies = [ "crossbeam-channel", "fst", - "indexmap 2.7.0", + "indexmap 2.9.0", "nohash-hasher", "ra_ap_paths", "ra_ap_stdx", @@ -1933,9 +1910,9 @@ dependencies = [ [[package]] name = "ra_ap_vfs-notify" -version = "0.0.270" +version = "0.0.273" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd95285146049621ee8f7a512c982a008bf036321fcc9b01a95c1ad7e6aeae57" +checksum = "d5a0e3095b8216ecc131f38b4b0025cac324a646469a95d2670354aee7278078" dependencies = [ "crossbeam-channel", "notify", @@ -2005,7 +1982,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -2093,10 +2070,11 @@ checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1" [[package]] name = "rustc_apfloat" -version = "0.2.1+llvm-462a31f5a5ab" -source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" +version = "0.2.2+llvm-462a31f5a5ab" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.0", "smallvec", ] @@ -2123,7 +2101,7 @@ dependencies = [ "dashmap 6.1.0", "hashbrown 0.15.2", "hashlink", - "indexmap 2.7.0", + "indexmap 2.9.0", "parking_lot", "portable-atomic", "rayon", @@ -2176,9 +2154,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] @@ -2234,7 +2212,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.7.0", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", @@ -2260,7 +2238,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.9.0", "itoa", "ryu", "serde", @@ -2345,19 +2323,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f18aa187839b2bdb1ad2fa35ead8c4c2976b64e4363c386d45ac0f7ee85c9233" [[package]] -name = "thiserror" -version = "1.0.69" +name = "thin-vec" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +checksum = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -2432,7 +2416,7 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", @@ -2488,7 +2472,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "log 0.4.25", + "log 0.4.27", "once_cell", "tracing-core", ] @@ -2603,9 +2587,9 @@ checksum = "a3e5df347f0bf3ec1d670aad6ca5c6a1859cd9ea61d2113125794654ccced68f" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-properties" @@ -2686,7 +2670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", - "log 0.4.25", + "log 0.4.27", "proc-macro2", "quote", "syn", @@ -2995,7 +2979,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -3044,3 +3028,9 @@ dependencies = [ "quote", "syn", ] + +[[patch.unused]] +name = "rustc_apfloat" +version = "0.2.1+llvm-462a31f5a5ab" +source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" + diff --git a/MODULE.bazel b/MODULE.bazel index fe418cd40c6..ae00bca4390 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -75,7 +75,7 @@ use_repo( "vendor_ts__argfile-0.2.1", "vendor_ts__chalk-ir-0.100.0", "vendor_ts__chrono-0.4.40", - "vendor_ts__clap-4.5.32", + "vendor_ts__clap-4.5.35", "vendor_ts__dunce-1.0.5", "vendor_ts__either-1.15.0", "vendor_ts__encoding-0.2.33", @@ -90,22 +90,22 @@ use_repo( "vendor_ts__num_cpus-1.16.0", "vendor_ts__proc-macro2-1.0.94", "vendor_ts__quote-1.0.40", - "vendor_ts__ra_ap_base_db-0.0.270", - "vendor_ts__ra_ap_cfg-0.0.270", - "vendor_ts__ra_ap_hir-0.0.270", - "vendor_ts__ra_ap_hir_def-0.0.270", - "vendor_ts__ra_ap_hir_expand-0.0.270", - "vendor_ts__ra_ap_hir_ty-0.0.270", - "vendor_ts__ra_ap_ide_db-0.0.270", - "vendor_ts__ra_ap_intern-0.0.270", - "vendor_ts__ra_ap_load-cargo-0.0.270", - "vendor_ts__ra_ap_parser-0.0.270", - "vendor_ts__ra_ap_paths-0.0.270", - "vendor_ts__ra_ap_project_model-0.0.270", - "vendor_ts__ra_ap_span-0.0.270", - "vendor_ts__ra_ap_stdx-0.0.270", - "vendor_ts__ra_ap_syntax-0.0.270", - "vendor_ts__ra_ap_vfs-0.0.270", + "vendor_ts__ra_ap_base_db-0.0.273", + "vendor_ts__ra_ap_cfg-0.0.273", + "vendor_ts__ra_ap_hir-0.0.273", + "vendor_ts__ra_ap_hir_def-0.0.273", + "vendor_ts__ra_ap_hir_expand-0.0.273", + "vendor_ts__ra_ap_hir_ty-0.0.273", + "vendor_ts__ra_ap_ide_db-0.0.273", + "vendor_ts__ra_ap_intern-0.0.273", + "vendor_ts__ra_ap_load-cargo-0.0.273", + "vendor_ts__ra_ap_parser-0.0.273", + "vendor_ts__ra_ap_paths-0.0.273", + "vendor_ts__ra_ap_project_model-0.0.273", + "vendor_ts__ra_ap_span-0.0.273", + "vendor_ts__ra_ap_stdx-0.0.273", + "vendor_ts__ra_ap_syntax-0.0.273", + "vendor_ts__ra_ap_vfs-0.0.273", "vendor_ts__rand-0.9.0", "vendor_ts__rayon-1.10.0", "vendor_ts__regex-1.11.1", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel index a6d0823636e..d5999d21366 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.android_system_properties-0.1.5.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.1.5", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel index 31e9ae6079a..1f97bfd967f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel @@ -80,14 +80,14 @@ alias( ) alias( - name = "clap-4.5.32", - actual = "@vendor_ts__clap-4.5.32//:clap", + name = "clap-4.5.35", + actual = "@vendor_ts__clap-4.5.35//:clap", tags = ["manual"], ) alias( name = "clap", - actual = "@vendor_ts__clap-4.5.32//:clap", + actual = "@vendor_ts__clap-4.5.35//:clap", tags = ["manual"], ) @@ -260,200 +260,200 @@ alias( ) alias( - name = "ra_ap_base_db-0.0.270", - actual = "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", + name = "ra_ap_base_db-0.0.273", + actual = "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", tags = ["manual"], ) alias( name = "ra_ap_base_db", - actual = "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", + actual = "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", tags = ["manual"], ) alias( - name = "ra_ap_cfg-0.0.270", - actual = "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", + name = "ra_ap_cfg-0.0.273", + actual = "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", tags = ["manual"], ) alias( name = "ra_ap_cfg", - actual = "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", + actual = "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", tags = ["manual"], ) alias( - name = "ra_ap_hir-0.0.270", - actual = "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir", + name = "ra_ap_hir-0.0.273", + actual = "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir", tags = ["manual"], ) alias( name = "ra_ap_hir", - actual = "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir", + actual = "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir", tags = ["manual"], ) alias( - name = "ra_ap_hir_def-0.0.270", - actual = "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", + name = "ra_ap_hir_def-0.0.273", + actual = "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", tags = ["manual"], ) alias( name = "ra_ap_hir_def", - actual = "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", + actual = "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", tags = ["manual"], ) alias( - name = "ra_ap_hir_expand-0.0.270", - actual = "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", + name = "ra_ap_hir_expand-0.0.273", + actual = "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", tags = ["manual"], ) alias( name = "ra_ap_hir_expand", - actual = "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", + actual = "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", tags = ["manual"], ) alias( - name = "ra_ap_hir_ty-0.0.270", - actual = "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty", + name = "ra_ap_hir_ty-0.0.273", + actual = "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty", tags = ["manual"], ) alias( name = "ra_ap_hir_ty", - actual = "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty", + actual = "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty", tags = ["manual"], ) alias( - name = "ra_ap_ide_db-0.0.270", - actual = "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db", + name = "ra_ap_ide_db-0.0.273", + actual = "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db", tags = ["manual"], ) alias( name = "ra_ap_ide_db", - actual = "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db", + actual = "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db", tags = ["manual"], ) alias( - name = "ra_ap_intern-0.0.270", - actual = "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", + name = "ra_ap_intern-0.0.273", + actual = "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", tags = ["manual"], ) alias( name = "ra_ap_intern", - actual = "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", + actual = "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", tags = ["manual"], ) alias( - name = "ra_ap_load-cargo-0.0.270", - actual = "@vendor_ts__ra_ap_load-cargo-0.0.270//:ra_ap_load_cargo", + name = "ra_ap_load-cargo-0.0.273", + actual = "@vendor_ts__ra_ap_load-cargo-0.0.273//:ra_ap_load_cargo", tags = ["manual"], ) alias( name = "ra_ap_load-cargo", - actual = "@vendor_ts__ra_ap_load-cargo-0.0.270//:ra_ap_load_cargo", + actual = "@vendor_ts__ra_ap_load-cargo-0.0.273//:ra_ap_load_cargo", tags = ["manual"], ) alias( - name = "ra_ap_parser-0.0.270", - actual = "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", + name = "ra_ap_parser-0.0.273", + actual = "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", tags = ["manual"], ) alias( name = "ra_ap_parser", - actual = "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", + actual = "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", tags = ["manual"], ) alias( - name = "ra_ap_paths-0.0.270", - actual = "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", + name = "ra_ap_paths-0.0.273", + actual = "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", tags = ["manual"], ) alias( name = "ra_ap_paths", - actual = "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", + actual = "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", tags = ["manual"], ) alias( - name = "ra_ap_project_model-0.0.270", - actual = "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model", + name = "ra_ap_project_model-0.0.273", + actual = "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model", tags = ["manual"], ) alias( name = "ra_ap_project_model", - actual = "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model", + actual = "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model", tags = ["manual"], ) alias( - name = "ra_ap_span-0.0.270", - actual = "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", + name = "ra_ap_span-0.0.273", + actual = "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", tags = ["manual"], ) alias( name = "ra_ap_span", - actual = "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", + actual = "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", tags = ["manual"], ) alias( - name = "ra_ap_stdx-0.0.270", - actual = "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + name = "ra_ap_stdx-0.0.273", + actual = "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", tags = ["manual"], ) alias( - name = "stdx-0.0.270", - actual = "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + name = "stdx-0.0.273", + actual = "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", tags = ["manual"], ) alias( name = "stdx", - actual = "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + actual = "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", tags = ["manual"], ) alias( - name = "ra_ap_syntax-0.0.270", - actual = "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", + name = "ra_ap_syntax-0.0.273", + actual = "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", tags = ["manual"], ) alias( name = "ra_ap_syntax", - actual = "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", + actual = "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", tags = ["manual"], ) alias( - name = "ra_ap_vfs-0.0.270", - actual = "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + name = "ra_ap_vfs-0.0.273", + actual = "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", tags = ["manual"], ) alias( name = "ra_ap_vfs", - actual = "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + actual = "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", tags = ["manual"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.8.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.9.0.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.8.0.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.9.0.bazel index eb58d610f97..e5f84a9323f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.8.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bitflags-2.9.0.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "2.8.0", + version = "2.9.0", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.5.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.3.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.5.bazel index 09e2ca4092d..062d394288f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.borsh-1.5.5.bazel @@ -80,9 +80,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.5.3", + version = "1.5.5", deps = [ - "@vendor_ts__borsh-1.5.3//:build_script_build", + "@vendor_ts__borsh-1.5.5//:build_script_build", ], ) @@ -131,7 +131,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "1.5.3", + version = "1.5.5", visibility = ["//visibility:private"], deps = [ "@vendor_ts__cfg_aliases-0.2.1//:cfg_aliases", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.18.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.19.2.bazel similarity index 96% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.18.1.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.19.2.bazel index 17cd583761c..5be95a9511f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.18.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.cargo_metadata-0.19.2.bazel @@ -32,7 +32,7 @@ rust_library( "default", ], crate_root = "src/lib.rs", - edition = "2018", + edition = "2021", rustc_flags = [ "--cap-lints=allow", ], @@ -82,13 +82,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.18.1", + version = "0.19.2", deps = [ "@vendor_ts__camino-1.1.9//:camino", "@vendor_ts__cargo-platform-0.1.9//:cargo_platform", - "@vendor_ts__semver-1.0.24//:semver", + "@vendor_ts__semver-1.0.26//:semver", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_json-1.0.140//:serde_json", - "@vendor_ts__thiserror-1.0.69//:thiserror", + "@vendor_ts__thiserror-2.0.12//:thiserror", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel index 9b77e1de102..a15909217db 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-ir-0.100.0.bazel @@ -84,6 +84,6 @@ rust_library( }), version = "0.100.0", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel index 6bea89c9407..1aa7560fbf2 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.chalk-solve-0.100.0.bazel @@ -86,7 +86,7 @@ rust_library( deps = [ "@vendor_ts__chalk-ir-0.100.0//:chalk_ir", "@vendor_ts__ena-0.14.3//:ena", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__itertools-0.12.1//:itertools", "@vendor_ts__petgraph-0.6.5//:petgraph", "@vendor_ts__rustc-hash-1.1.0//:rustc_hash", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.32.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.35.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.32.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.35.bazel index efd3ae52118..c857bb360f3 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.32.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap-4.5.35.bazel @@ -92,8 +92,8 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "4.5.32", + version = "4.5.35", deps = [ - "@vendor_ts__clap_builder-4.5.32//:clap_builder", + "@vendor_ts__clap_builder-4.5.35//:clap_builder", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.32.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.35.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.32.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.35.bazel index d839347dd06..8d2e740ebd9 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.32.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.clap_builder-4.5.35.bazel @@ -87,7 +87,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "4.5.32", + version = "4.5.35", deps = [ "@vendor_ts__anstream-0.6.18//:anstream", "@vendor_ts__anstyle-1.0.10//:anstyle", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel index 0675dd06116..ab0a896ca89 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ena-0.14.3.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.14.3", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.2.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.1.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.2.bazel index 54c391b74bb..2404a962610 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.equivalent-1.0.2.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.1", + version = "1.0.2", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel index afa987bf06c..bcb8fb8a739 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.filetime-0.2.25.bazel @@ -84,85 +84,85 @@ rust_library( "@vendor_ts__cfg-if-1.0.0//:cfg_if", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel index fa1103d4e4a..52e35cc09f6 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.fsevent-sys-4.1.0.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "4.1.0", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel index bf828ac701b..0589aa9e457 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.generator-0.8.4.bazel @@ -84,88 +84,88 @@ rust_library( deps = [ "@vendor_ts__cfg-if-1.0.0//:cfg_if", "@vendor_ts__generator-0.8.4//:build_script_build", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-0.58.0//:windows", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-0.58.0//:windows", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-0.58.0//:windows", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel index ae0fc92ddc7..e4cc7ad397a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.getrandom-0.3.1.bazel @@ -89,79 +89,79 @@ rust_library( "@vendor_ts__getrandom-0.3.1//:build_script_build", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(all(windows, not(target_vendor = "win7"))) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "haiku", target_os = "redox", target_os = "nto", target_os = "aix")) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(all(windows, not(target_vendor = "win7"))) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "macos", target_os = "openbsd", target_os = "vita", target_os = "emscripten")) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos")) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(all(windows, not(target_vendor = "win7"))) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "hurd", target_os = "illumos", all(target_os = "horizon", target_arch = "arm"))) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(any(target_os = "linux", target_os = "android"), not(any(getrandom_backend = "custom", getrandom_backend = "rdrand", getrandom_backend = "rndr")))) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel index c7341c6d1f1..3a2a29d0ae4 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.globset-0.4.15.bazel @@ -87,7 +87,7 @@ rust_library( deps = [ "@vendor_ts__aho-corasick-1.1.3//:aho_corasick", "@vendor_ts__bstr-1.11.3//:bstr", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__regex-automata-0.4.9//:regex_automata", "@vendor_ts__regex-syntax-0.8.5//:regex_syntax", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel index d7d08e46be6..ab42e90e017 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.hashbrown-0.15.2.bazel @@ -90,7 +90,7 @@ rust_library( version = "0.15.2", deps = [ "@vendor_ts__allocator-api2-0.2.21//:allocator_api2", - "@vendor_ts__equivalent-1.0.1//:equivalent", + "@vendor_ts__equivalent-1.0.2//:equivalent", "@vendor_ts__foldhash-0.1.5//:foldhash", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.7.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.9.0.bazel similarity index 98% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.7.0.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.9.0.bazel index 53eacc89ea6..f3d360378d5 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.7.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.indexmap-2.9.0.bazel @@ -84,9 +84,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "2.7.0", + version = "2.9.0", deps = [ - "@vendor_ts__equivalent-1.0.1//:equivalent", + "@vendor_ts__equivalent-1.0.2//:equivalent", "@vendor_ts__hashbrown-0.15.2//:hashbrown", "@vendor_ts__serde-1.0.219//:serde", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel index 8abc71e5811..aff8348d7f0 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-0.11.0.bazel @@ -81,8 +81,8 @@ rust_library( }), version = "0.11.0", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__inotify-sys-0.1.5//:inotify_sys", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel index 3e23ee4dea6..5a3e4beb27b 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.inotify-sys-0.1.5.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.1.5", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.14.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.15.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.14.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.15.bazel index 596b777f685..0ed2975cf78 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.14.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itoa-1.0.15.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.14", + version = "1.0.15", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel index 25390d540e0..9c5a46755fa 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-1.0.8.bazel @@ -82,6 +82,6 @@ rust_library( version = "1.0.8", deps = [ "@vendor_ts__kqueue-sys-1.0.4//:kqueue_sys", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel index e226e4b77c7..ea19f54cb02 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.kqueue-sys-1.0.4.bazel @@ -82,6 +82,6 @@ rust_library( version = "1.0.4", deps = [ "@vendor_ts__bitflags-1.3.2//:bitflags", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.169.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.171.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.169.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.171.bazel index d3cef09f0cd..aedf0e4cfe2 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.169.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libc-0.2.171.bazel @@ -84,9 +84,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.2.169", + version = "0.2.171", deps = [ - "@vendor_ts__libc-0.2.169//:build_script_build", + "@vendor_ts__libc-0.2.171//:build_script_build", ], ) @@ -139,7 +139,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "0.2.169", + version = "0.2.171", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel index 4bbbe82982c..99f49837400 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.libredox-0.1.3.bazel @@ -81,8 +81,8 @@ rust_library( }), version = "0.1.3", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__bitflags-2.9.0//:bitflags", + "@vendor_ts__libc-0.2.171//:libc", "@vendor_ts__redox_syscall-0.5.8//:syscall", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel index c17f4cad96b..7ee9ca3cce2 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.3.9.bazel @@ -85,6 +85,6 @@ rust_library( }), version = "0.3.9", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.25.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.27.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.25.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.27.bazel index a2e0e15b13e..b36cd98285f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.25.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.log-0.4.27.bazel @@ -82,5 +82,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.4.25", + version = "0.4.27", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel deleted file mode 100644 index c2b50d980e1..00000000000 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lz4_flex-0.11.3.bazel +++ /dev/null @@ -1,83 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @@//misc/bazel/3rdparty:vendor_tree_sitter_extractors -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "lz4_flex", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2021", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=lz4_flex", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:aarch64-unknown-uefi": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasip1": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "@rules_rust//rust/platform:x86_64-unknown-uefi": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "0.11.3", -) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel index 617822e3a9c..1c48d01d22f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.mio-1.0.3.bazel @@ -87,92 +87,92 @@ rust_library( }), version = "1.0.3", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.52.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.52.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:wasm32-wasip1": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(target_os = "wasi") + "@vendor_ts__libc-0.2.171//:libc", # cfg(target_os = "wasi") "@vendor_ts__wasi-0.11.0-wasi-snapshot-preview1//:wasi", # cfg(target_os = "wasi") ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.52.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel index 43a411a44ef..1b78caaf894 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.notify-8.0.0.bazel @@ -87,13 +87,13 @@ rust_library( version = "8.0.0", deps = [ "@vendor_ts__filetime-0.2.25//:filetime", - "@vendor_ts__libc-0.2.169//:libc", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__libc-0.2.171//:libc", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__notify-types-2.0.0//:notify_types", "@vendor_ts__walkdir-2.5.0//:walkdir", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__bitflags-2.8.0//:bitflags", # cfg(target_os = "macos") + "@vendor_ts__bitflags-2.9.0//:bitflags", # cfg(target_os = "macos") "@vendor_ts__fsevent-sys-4.1.0//:fsevent_sys", # aarch64-apple-darwin ], "@rules_rust//rust/platform:aarch64-apple-ios": [ @@ -132,7 +132,7 @@ rust_library( "@vendor_ts__mio-1.0.3//:mio", # cfg(any(target_os = "linux", target_os = "android")) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__bitflags-2.8.0//:bitflags", # cfg(target_os = "macos") + "@vendor_ts__bitflags-2.9.0//:bitflags", # cfg(target_os = "macos") "@vendor_ts__fsevent-sys-4.1.0//:fsevent_sys", # i686-apple-darwin ], "@rules_rust//rust/platform:i686-linux-android": [ @@ -159,7 +159,7 @@ rust_library( "@vendor_ts__mio-1.0.3//:mio", # cfg(any(target_os = "linux", target_os = "android")) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__bitflags-2.8.0//:bitflags", # cfg(target_os = "macos") + "@vendor_ts__bitflags-2.9.0//:bitflags", # cfg(target_os = "macos") "@vendor_ts__fsevent-sys-4.1.0//:fsevent_sys", # x86_64-apple-darwin ], "@rules_rust//rust/platform:x86_64-apple-ios": [ diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel index ccbaed88173..057e8dd6c63 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.num_cpus-1.16.0.bazel @@ -82,103 +82,103 @@ rust_library( version = "1.16.0", deps = select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:aarch64-unknown-uefi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:thumbv7em-none-eabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:wasm32-unknown-unknown": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:wasm32-wasip1": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-none": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "@rules_rust//rust/platform:x86_64-unknown-uefi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(not(windows)) + "@vendor_ts__libc-0.2.171//:libc", # cfg(not(windows)) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.4.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.5.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.4.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.5.bazel index 2514e59de67..7fda44d7d5f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.4.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.oorandom-11.1.5.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "11.1.4", + version = "11.1.5", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel index d53c706ee3c..ea6704cb134 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.parking_lot_core-0.9.10.bazel @@ -87,85 +87,85 @@ rust_library( "@vendor_ts__smallvec-1.14.0//:smallvec", ] + select({ "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-linux-android": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-targets-0.52.6//:windows_targets", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@vendor_ts__libc-0.2.169//:libc", # cfg(unix) + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) ], "//conditions:default": [], }), diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel index 5784824a298..4f084775990 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-0.4.7.bazel @@ -81,7 +81,7 @@ rust_library( }), version = "0.4.7", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", "@vendor_ts__perf-event-open-sys-1.0.1//:perf_event_open_sys", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel index 92b15bc5d88..1e4bd90b8ae 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.perf-event-open-sys-1.0.1.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "1.0.1", deps = [ - "@vendor_ts__libc-0.2.169//:libc", + "@vendor_ts__libc-0.2.171//:libc", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel index df987bd453e..ac85fb246bd 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.petgraph-0.6.5.bazel @@ -88,6 +88,6 @@ rust_library( version = "0.6.5", deps = [ "@vendor_ts__fixedbitset-0.4.2//:fixedbitset", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel index c78fa364e8e..c7bacd2430c 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.proc-macro2-1.0.94.bazel @@ -87,7 +87,7 @@ rust_library( version = "1.0.94", deps = [ "@vendor_ts__proc-macro2-1.0.94//:build_script_build", - "@vendor_ts__unicode-ident-1.0.16//:unicode_ident", + "@vendor_ts__unicode-ident-1.0.17//:unicode_ident", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel index f1bf54464e6..cc04b2be07d 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_abi-0.100.0.bazel @@ -85,7 +85,7 @@ rust_library( }), version = "0.100.0", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__ra-ap-rustc_hashes-0.100.0//:ra_ap_rustc_hashes", "@vendor_ts__ra-ap-rustc_index-0.100.0//:ra_ap_rustc_index", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel index dcdff444d8f..3a7ef306f97 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra-ap-rustc_pattern_analysis-0.100.0.bazel @@ -86,7 +86,7 @@ rust_library( deps = [ "@vendor_ts__ra-ap-rustc_index-0.100.0//:ra_ap_rustc_index", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:rustc_apfloat", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:rustc_apfloat", "@vendor_ts__smallvec-1.14.0//:smallvec", "@vendor_ts__tracing-0.1.41//:tracing", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.273.bazel similarity index 80% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.273.bazel index 6e8ab6e20b3..fa7cec0dbb2 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.273.bazel @@ -17,13 +17,12 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -40,7 +39,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -91,20 +90,18 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__lz4_flex-0.11.3//:lz4_flex", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", - "@vendor_ts__semver-1.0.24//:semver", + "@vendor_ts__semver-1.0.26//:semver", "@vendor_ts__tracing-0.1.41//:tracing", "@vendor_ts__triomphe-0.1.14//:triomphe", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.273.bazel similarity index 93% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.273.bazel index c38cc3cdd88..a80bffe20f9 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -86,10 +86,10 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__tracing-0.1.41//:tracing", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.273.bazel index 598826ee263..15381260d65 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.273.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.273.bazel similarity index 74% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.273.bazel index c85c4bbf946..6bf6732bb06 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.273.bazel @@ -17,16 +17,16 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def": "hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty": "hir_ty", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def": "hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty": "hir_ty", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -91,22 +91,22 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", "@vendor_ts__either-1.15.0//:either", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__smallvec-1.14.0//:smallvec", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.273.bazel similarity index 73% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.273.bazel index f0e8fd28561..2e483df01ff 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.273.bazel @@ -17,16 +17,16 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe": "mbe", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe": "mbe", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -43,7 +43,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -94,36 +94,34 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__cov-mark-2.0.0//:cov_mark", - "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__drop_bomb-0.1.5//:drop_bomb", "@vendor_ts__either-1.15.0//:either", "@vendor_ts__fst-0.4.7//:fst", - "@vendor_ts__hashbrown-0.14.5//:hashbrown", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__la-arena-0.3.1//:la_arena", "@vendor_ts__ra-ap-rustc_abi-0.100.0//:ra_ap_rustc_abi", - "@vendor_ts__ra-ap-rustc_hashes-0.100.0//:ra_ap_rustc_hashes", "@vendor_ts__ra-ap-rustc_parse_format-0.100.0//:ra_ap_rustc_parse_format", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:rustc_apfloat", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:rustc_apfloat", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__smallvec-1.14.0//:smallvec", "@vendor_ts__text-size-1.1.1//:text_size", + "@vendor_ts__thin-vec-0.2.14//:thin_vec", "@vendor_ts__tracing-0.1.41//:tracing", "@vendor_ts__triomphe-0.1.14//:triomphe", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.273.bazel similarity index 73% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.273.bazel index 716d660159f..3bd7c5b7cd5 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.273.bazel @@ -17,17 +17,17 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe": "mbe", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge": "syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe": "mbe", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge": "syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -44,7 +44,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -95,23 +95,21 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__either-1.15.0//:either", - "@vendor_ts__hashbrown-0.14.5//:hashbrown", - "@vendor_ts__itertools-0.12.1//:itertools", - "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_mbe-0.0.270//:ra_ap_mbe", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__itertools-0.14.0//:itertools", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_mbe-0.0.273//:ra_ap_mbe", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__smallvec-1.14.0//:smallvec", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.273.bazel similarity index 77% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.273.bazel index 6e1e0740c96..a2488ef3be6 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.273.bazel @@ -17,14 +17,14 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def": "hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def": "hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", }, compile_data = glob( include = ["**"], @@ -42,7 +42,7 @@ rust_library( edition = "2024", proc_macro_deps = [ "@vendor_ts__chalk-derive-0.100.0//:chalk_derive", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -93,34 +93,32 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__chalk-ir-0.100.0//:chalk_ir", "@vendor_ts__chalk-recursive-0.100.0//:chalk_recursive", "@vendor_ts__chalk-solve-0.100.0//:chalk_solve", "@vendor_ts__cov-mark-2.0.0//:cov_mark", - "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__either-1.15.0//:either", "@vendor_ts__ena-0.14.3//:ena", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__nohash-hasher-0.2.0//:nohash_hasher", - "@vendor_ts__oorandom-11.1.4//:oorandom", + "@vendor_ts__oorandom-11.1.5//:oorandom", "@vendor_ts__ra-ap-rustc_abi-0.100.0//:ra_ap_rustc_abi", "@vendor_ts__ra-ap-rustc_index-0.100.0//:ra_ap_rustc_index", "@vendor_ts__ra-ap-rustc_pattern_analysis-0.100.0//:ra_ap_rustc_pattern_analysis", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:rustc_apfloat", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:rustc_apfloat", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__scoped-tls-1.0.1//:scoped_tls", "@vendor_ts__smallvec-1.14.0//:smallvec", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.273.bazel similarity index 76% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.273.bazel index 0c437699408..e3741062022 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.273.bazel @@ -17,15 +17,15 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir": "hir", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_profile-0.0.270//:ra_ap_profile": "profile", - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro": "query_group", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir": "hir", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_profile-0.0.273//:ra_ap_profile": "profile", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro": "query_group", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -42,7 +42,7 @@ rust_library( crate_root = "src/lib.rs", edition = "2024", proc_macro_deps = [ - "@vendor_ts__ra_ap_query-group-macro-0.0.270//:ra_ap_query_group_macro", + "@vendor_ts__ra_ap_query-group-macro-0.0.273//:ra_ap_query_group_macro", ], rustc_flags = [ "--cap-lints=allow", @@ -93,28 +93,27 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", - "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__either-1.15.0//:either", "@vendor_ts__fst-0.4.7//:fst", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__line-index-0.1.2//:line_index", "@vendor_ts__memchr-2.7.4//:memchr", "@vendor_ts__nohash-hasher-0.2.0//:nohash_hasher", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_profile-0.0.270//:ra_ap_profile", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_profile-0.0.273//:ra_ap_profile", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rayon-1.10.0//:rayon", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.273.bazel index 39f87b8bcdc..72e7580e416 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.273.bazel @@ -79,7 +79,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__dashmap-5.5.3//:dashmap", "@vendor_ts__hashbrown-0.14.5//:hashbrown", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.273.bazel similarity index 75% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.273.bazel index 30a635ef821..c9b5273ee2b 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.273.bazel @@ -17,16 +17,15 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand": "hir_expand", - "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db": "ide_db", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_proc_macro_api-0.0.270//:ra_ap_proc_macro_api": "proc_macro_api", - "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model": "project_model", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", - "@vendor_ts__ra_ap_vfs-notify-0.0.270//:ra_ap_vfs_notify": "vfs_notify", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand": "hir_expand", + "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db": "ide_db", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_proc_macro_api-0.0.273//:ra_ap_proc_macro_api": "proc_macro_api", + "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model": "project_model", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_vfs-notify-0.0.273//:ra_ap_vfs_notify": "vfs_notify", }, compile_data = glob( include = ["**"], @@ -91,21 +90,20 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__anyhow-1.0.97//:anyhow", "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", - "@vendor_ts__itertools-0.12.1//:itertools", - "@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand", - "@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_proc_macro_api-0.0.270//:ra_ap_proc_macro_api", - "@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", - "@vendor_ts__ra_ap_vfs-notify-0.0.270//:ra_ap_vfs_notify", + "@vendor_ts__itertools-0.14.0//:itertools", + "@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand", + "@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_proc_macro_api-0.0.273//:ra_ap_proc_macro_api", + "@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", + "@vendor_ts__ra_ap_vfs-notify-0.0.273//:ra_ap_vfs_notify", "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.273.bazel similarity index 80% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.273.bazel index be98a1794d8..635c79e43f3 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.273.bazel @@ -17,13 +17,12 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge": "syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge": "syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -88,20 +87,18 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_syntax-bridge-0.0.270//:ra_ap_syntax_bridge", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-bridge-0.0.273//:ra_ap_syntax_bridge", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__smallvec-1.14.0//:smallvec", - "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.273.bazel similarity index 96% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.273.bazel index abd94f21b0c..0c1ca867e3d 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.273.bazel @@ -17,7 +17,7 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_edition-0.0.270//:ra_ap_edition": "edition", + "@vendor_ts__ra_ap_edition-0.0.273//:ra_ap_edition": "edition", }, compile_data = glob( include = ["**"], @@ -86,11 +86,11 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__drop_bomb-0.1.5//:drop_bomb", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_edition-0.0.270//:ra_ap_edition", + "@vendor_ts__ra_ap_edition-0.0.273//:ra_ap_edition", "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.273.bazel index 582fc319674..fb0f90b4248 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.273.bazel @@ -82,7 +82,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__camino-1.1.9//:camino", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.273.bazel similarity index 85% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.273.bazel index e8379df9f54..bdb33ce1a79 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.273.bazel @@ -17,11 +17,11 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -89,14 +89,14 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_json-1.0.140//:serde_json", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.273.bazel similarity index 86% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.273.bazel index 2a4bffbc5c8..6e1af1c0010 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.273.bazel @@ -79,45 +79,53 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__cfg-if-1.0.0//:cfg_if", - "@vendor_ts__libc-0.2.169//:libc", ] + select({ "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(all(target_os = "linux", target_env = "gnu")) "@vendor_ts__perf-event-0.4.7//:perf_event", # cfg(all(target_os = "linux", not(target_env = "ohos"))) ], "//conditions:default": [], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.273.bazel similarity index 79% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.273.bazel index bac3ea62b1c..cb1f3a56a14 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.273.bazel @@ -17,13 +17,13 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db": "base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg": "cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_toolchain-0.0.270//:ra_ap_toolchain": "toolchain", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db": "base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg": "cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_toolchain-0.0.273//:ra_ap_toolchain": "toolchain", }, compile_data = glob( include = ["**"], @@ -91,21 +91,21 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__anyhow-1.0.97//:anyhow", - "@vendor_ts__cargo_metadata-0.18.1//:cargo_metadata", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__cargo_metadata-0.19.2//:cargo_metadata", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db", - "@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_toolchain-0.0.270//:ra_ap_toolchain", + "@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db", + "@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_toolchain-0.0.273//:ra_ap_toolchain", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__semver-1.0.24//:semver", + "@vendor_ts__semver-1.0.26//:semver", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_json-1.0.140//:serde_json", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.273.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.273.bazel index 66b54f0975e..394f5e421ac 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_query-group-macro-0.0.273.bazel @@ -79,12 +79,10 @@ rust_proc_macro( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__heck-0.5.0//:heck", "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", - "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__syn-2.0.100//:syn", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.273.bazel similarity index 89% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.273.bazel index fcace1b1b05..15f74141c03 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.273.bazel @@ -17,9 +17,9 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -33,6 +33,10 @@ rust_library( "WORKSPACE.bazel", ], ), + crate_features = [ + "default", + "salsa", + ], crate_root = "src/lib.rs", edition = "2024", rustc_flags = [ @@ -84,13 +88,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__hashbrown-0.14.5//:hashbrown", "@vendor_ts__la-arena-0.3.1//:la_arena", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__salsa-0.19.0//:salsa", "@vendor_ts__text-size-1.1.1//:text_size", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.273.bazel similarity index 57% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.273.bazel index 9a96045450a..baf4d1942a4 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.273.bazel @@ -79,26 +79,97 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__jod-thread-0.1.2//:jod_thread", - "@vendor_ts__libc-0.2.169//:libc", "@vendor_ts__tracing-0.1.41//:tracing", ] + select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-linux-android": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ "@vendor_ts__miow-0.6.0//:miow", # cfg(windows) "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], + "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-linux-androideabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-apple-darwin": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-linux-android": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:i686-pc-windows-msvc": [ "@vendor_ts__miow-0.6.0//:miow", # cfg(windows) "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], + "@rules_rust//rust/platform:i686-unknown-freebsd": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-darwin": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-apple-ios": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-linux-android": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ "@vendor_ts__miow-0.6.0//:miow", # cfg(windows) "@vendor_ts__windows-sys-0.59.0//:windows_sys", # cfg(windows) ], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ + "@vendor_ts__libc-0.2.171//:libc", # cfg(unix) + ], "//conditions:default": [], }), ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.273.bazel similarity index 90% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.273.bazel index adfba58214c..8555bc6b119 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", }, compile_data = glob( include = ["**"], @@ -83,15 +83,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__cov-mark-2.0.0//:cov_mark", "@vendor_ts__either-1.15.0//:either", - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itertools-0.12.1//:itertools", + "@vendor_ts__itertools-0.14.0//:itertools", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", "@vendor_ts__rowan-0.15.15//:rowan", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__smol_str-0.3.2//:smol_str", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.273.bazel similarity index 82% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.273.bazel index 5402358378f..959cd8c4734 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.273.bazel @@ -17,12 +17,12 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser": "parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span": "span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax": "syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt": "tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser": "parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span": "span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax": "syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt": "tt", }, compile_data = glob( include = ["**"], @@ -87,15 +87,14 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser", - "@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax", - "@vendor_ts__ra_ap_tt-0.0.270//:ra_ap_tt", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser", + "@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax", + "@vendor_ts__ra_ap_tt-0.0.273//:ra_ap_tt", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", - "@vendor_ts__tracing-0.1.41//:tracing", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.273.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.273.bazel index a9f5509b306..211a787f67f 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.273.bazel @@ -79,7 +79,7 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__camino-1.1.9//:camino", "@vendor_ts__home-0.5.11//:home", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.273.bazel similarity index 93% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.273.bazel index 946e9862a99..1059e91496c 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern": "intern", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern": "intern", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", }, compile_data = glob( include = ["**"], @@ -83,12 +83,12 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__arrayvec-0.7.6//:arrayvec", "@vendor_ts__ra-ap-rustc_lexer-0.100.0//:ra_ap_rustc_lexer", - "@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + "@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", "@vendor_ts__text-size-1.1.1//:text_size", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.273.bazel similarity index 92% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.273.bazel index 3990da07910..7213c9199cd 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.273.bazel @@ -17,8 +17,8 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", }, compile_data = glob( include = ["**"], @@ -83,14 +83,14 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", "@vendor_ts__fst-0.4.7//:fst", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__nohash-hasher-0.2.0//:nohash_hasher", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__tracing-0.1.41//:tracing", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.270.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.273.bazel similarity index 91% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.270.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.273.bazel index 494979d3952..33a5d195f84 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.270.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.273.bazel @@ -17,9 +17,9 @@ rust_library( allow_empty = True, ), aliases = { - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths": "paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx": "stdx", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs": "vfs", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths": "paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx": "stdx", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs": "vfs", }, compile_data = glob( include = ["**"], @@ -84,13 +84,13 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.0.270", + version = "0.0.273", deps = [ "@vendor_ts__crossbeam-channel-0.5.14//:crossbeam_channel", "@vendor_ts__notify-8.0.0//:notify", - "@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths", - "@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx", - "@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs", + "@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths", + "@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx", + "@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs", "@vendor_ts__rayon-1.10.0//:rayon", "@vendor_ts__rustc-hash-2.1.1//:rustc_hash", "@vendor_ts__tracing-0.1.41//:tracing", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel index adc812c3df5..db9267bd12e 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.redox_syscall-0.5.8.bazel @@ -81,6 +81,6 @@ rust_library( }), version = "0.5.8", deps = [ - "@vendor_ts__bitflags-2.8.0//:bitflags", + "@vendor_ts__bitflags-2.9.0//:bitflags", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel similarity index 96% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel index 00e80306ea4..feeb8d3cda4 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel @@ -80,10 +80,10 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.2.1+llvm-462a31f5a5ab", + version = "0.2.2+llvm-462a31f5a5ab", deps = [ - "@vendor_ts__bitflags-1.3.2//:bitflags", - "@vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab//:build_script_build", + "@vendor_ts__bitflags-2.9.0//:bitflags", + "@vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab//:build_script_build", "@vendor_ts__smallvec-1.14.0//:smallvec", ], ) @@ -133,7 +133,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "0.2.1+llvm-462a31f5a5ab", + version = "0.2.2+llvm-462a31f5a5ab", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel index f732cb64f0f..6018cc9f491 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.19.0.bazel @@ -95,7 +95,7 @@ rust_library( "@vendor_ts__dashmap-6.1.0//:dashmap", "@vendor_ts__hashbrown-0.15.2//:hashbrown", "@vendor_ts__hashlink-0.10.0//:hashlink", - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__parking_lot-0.12.3//:parking_lot", "@vendor_ts__portable-atomic-1.11.0//:portable_atomic", "@vendor_ts__rayon-1.10.0//:rayon", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.24.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.26.bazel similarity index 97% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.24.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.26.bazel index 004fe29bbd7..807edeb3644 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.24.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.semver-1.0.26.bazel @@ -85,9 +85,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.24", + version = "1.0.26", deps = [ - "@vendor_ts__semver-1.0.24//:build_script_build", + "@vendor_ts__semver-1.0.26//:build_script_build", "@vendor_ts__serde-1.0.219//:serde", ], ) @@ -142,7 +142,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "1.0.24", + version = "1.0.26", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel index 3f7d00505fb..82dde7080ad 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_json-1.0.140.bazel @@ -87,7 +87,7 @@ rust_library( }), version = "1.0.140", deps = [ - "@vendor_ts__itoa-1.0.14//:itoa", + "@vendor_ts__itoa-1.0.15//:itoa", "@vendor_ts__memchr-2.7.4//:memchr", "@vendor_ts__ryu-1.0.19//:ryu", "@vendor_ts__serde-1.0.219//:serde", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel index 78a3a8caae5..9ec28ca4440 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_yaml-0.9.34+deprecated.bazel @@ -81,8 +81,8 @@ rust_library( }), version = "0.9.34+deprecated", deps = [ - "@vendor_ts__indexmap-2.7.0//:indexmap", - "@vendor_ts__itoa-1.0.14//:itoa", + "@vendor_ts__indexmap-2.9.0//:indexmap", + "@vendor_ts__itoa-1.0.15//:itoa", "@vendor_ts__ryu-1.0.19//:ryu", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__unsafe-libyaml-0.2.11//:unsafe_libyaml", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel index 36eda052e06..052bbecfe4d 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.syn-2.0.100.bazel @@ -95,6 +95,6 @@ rust_library( deps = [ "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", - "@vendor_ts__unicode-ident-1.0.16//:unicode_ident", + "@vendor_ts__unicode-ident-1.0.17//:unicode_ident", ], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel new file mode 100644 index 00000000000..aff81c59413 --- /dev/null +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thin-vec-0.2.14.bazel @@ -0,0 +1,87 @@ +############################################################################### +# @generated +# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To +# regenerate this file, run the following: +# +# bazel run @@//misc/bazel/3rdparty:vendor_tree_sitter_extractors +############################################################################### + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "thin_vec", + srcs = glob( + include = ["**/*.rs"], + allow_empty = True, + ), + compile_data = glob( + include = ["**"], + allow_empty = True, + exclude = [ + "**/* *", + ".tmp_git_root/**/*", + "BUILD", + "BUILD.bazel", + "WORKSPACE", + "WORKSPACE.bazel", + ], + ), + crate_features = [ + "default", + "std", + ], + crate_root = "src/lib.rs", + edition = "2018", + rustc_flags = [ + "--cap-lints=allow", + ], + tags = [ + "cargo-bazel", + "crate-name=thin-vec", + "manual", + "noclippy", + "norustfmt", + ], + target_compatible_with = select({ + "@rules_rust//rust/platform:aarch64-apple-darwin": [], + "@rules_rust//rust/platform:aarch64-apple-ios": [], + "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], + "@rules_rust//rust/platform:aarch64-linux-android": [], + "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], + "@rules_rust//rust/platform:aarch64-unknown-fuchsia": [], + "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], + "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], + "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], + "@rules_rust//rust/platform:aarch64-unknown-uefi": [], + "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], + "@rules_rust//rust/platform:armv7-linux-androideabi": [], + "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], + "@rules_rust//rust/platform:i686-apple-darwin": [], + "@rules_rust//rust/platform:i686-linux-android": [], + "@rules_rust//rust/platform:i686-pc-windows-msvc": [], + "@rules_rust//rust/platform:i686-unknown-freebsd": [], + "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], + "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], + "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], + "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], + "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], + "@rules_rust//rust/platform:thumbv7em-none-eabi": [], + "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], + "@rules_rust//rust/platform:wasm32-unknown-unknown": [], + "@rules_rust//rust/platform:wasm32-wasip1": [], + "@rules_rust//rust/platform:x86_64-apple-darwin": [], + "@rules_rust//rust/platform:x86_64-apple-ios": [], + "@rules_rust//rust/platform:x86_64-linux-android": [], + "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], + "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], + "@rules_rust//rust/platform:x86_64-unknown-fuchsia": [], + "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], + "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], + "@rules_rust//rust/platform:x86_64-unknown-none": [], + "@rules_rust//rust/platform:x86_64-unknown-uefi": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + version = "0.2.14", +) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-1.0.69.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-2.0.12.bazel similarity index 94% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-1.0.69.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-2.0.12.bazel index a79c49f5eea..2b685a2cd3a 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-1.0.69.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-2.0.12.bazel @@ -29,10 +29,14 @@ rust_library( "WORKSPACE.bazel", ], ), + crate_features = [ + "default", + "std", + ], crate_root = "src/lib.rs", edition = "2021", proc_macro_deps = [ - "@vendor_ts__thiserror-impl-1.0.69//:thiserror_impl", + "@vendor_ts__thiserror-impl-2.0.12//:thiserror_impl", ], rustc_flags = [ "--cap-lints=allow", @@ -83,9 +87,9 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.69", + version = "2.0.12", deps = [ - "@vendor_ts__thiserror-1.0.69//:build_script_build", + "@vendor_ts__thiserror-2.0.12//:build_script_build", ], ) @@ -108,6 +112,10 @@ cargo_build_script( "WORKSPACE.bazel", ], ), + crate_features = [ + "default", + "std", + ], crate_name = "build_script_build", crate_root = "build.rs", data = glob( @@ -134,7 +142,7 @@ cargo_build_script( "noclippy", "norustfmt", ], - version = "1.0.69", + version = "2.0.12", visibility = ["//visibility:private"], ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-1.0.69.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-2.0.12.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-1.0.69.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-2.0.12.bazel index c5c8a699bee..4bae5674a88 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-1.0.69.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.thiserror-impl-2.0.12.bazel @@ -79,7 +79,7 @@ rust_proc_macro( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.69", + version = "2.0.12", deps = [ "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel index c539ad29ce8..ee4b912ba31 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.toml_edit-0.22.24.bazel @@ -86,7 +86,7 @@ rust_library( }), version = "0.22.24", deps = [ - "@vendor_ts__indexmap-2.7.0//:indexmap", + "@vendor_ts__indexmap-2.9.0//:indexmap", "@vendor_ts__serde-1.0.219//:serde", "@vendor_ts__serde_spanned-0.6.8//:serde_spanned", "@vendor_ts__toml_datetime-0.6.8//:toml_datetime", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel index da7b8a8bfc0..b4f1a8d3ab5 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-log-0.2.0.bazel @@ -85,7 +85,7 @@ rust_library( }), version = "0.2.0", deps = [ - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__once_cell-1.20.3//:once_cell", "@vendor_ts__tracing-core-0.1.33//:tracing_core", ], diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.16.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.17.bazel similarity index 99% rename from misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.16.bazel rename to misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.17.bazel index f1e1eea9fb4..6d4b21156f9 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.16.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.unicode-ident-1.0.17.bazel @@ -79,5 +79,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-uefi": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.16", + version = "1.0.17", ) diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel index 35041989b3d..2b5e035e409 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.wasm-bindgen-backend-0.2.99.bazel @@ -86,7 +86,7 @@ rust_library( version = "0.2.99", deps = [ "@vendor_ts__bumpalo-3.16.0//:bumpalo", - "@vendor_ts__log-0.4.25//:log", + "@vendor_ts__log-0.4.27//:log", "@vendor_ts__proc-macro2-1.0.94//:proc_macro2", "@vendor_ts__quote-1.0.40//:quote", "@vendor_ts__syn-2.0.100//:syn", diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl index b011a2c9800..b2db5d16f58 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl @@ -16,7 +16,6 @@ """ load("@bazel_skylib//lib:selects.bzl", "selects") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") @@ -296,7 +295,7 @@ def aliases( _NORMAL_DEPENDENCIES = { "ruby/extractor": { _COMMON_CONDITION: { - "clap": Label("@vendor_ts__clap-4.5.32//:clap"), + "clap": Label("@vendor_ts__clap-4.5.35//:clap"), "encoding": Label("@vendor_ts__encoding-0.2.33//:encoding"), "lazy_static": Label("@vendor_ts__lazy_static-1.5.0//:lazy_static"), "rayon": Label("@vendor_ts__rayon-1.10.0//:rayon"), @@ -317,7 +316,7 @@ _NORMAL_DEPENDENCIES = { "proc-macro2": Label("@vendor_ts__proc-macro2-1.0.94//:proc_macro2"), "quote": Label("@vendor_ts__quote-1.0.40//:quote"), "serde": Label("@vendor_ts__serde-1.0.219//:serde"), - "stdx": Label("@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx"), + "stdx": Label("@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx"), "ungrammar": Label("@vendor_ts__ungrammar-1.16.1//:ungrammar"), }, }, @@ -329,27 +328,27 @@ _NORMAL_DEPENDENCIES = { "argfile": Label("@vendor_ts__argfile-0.2.1//:argfile"), "chalk-ir": Label("@vendor_ts__chalk-ir-0.100.0//:chalk_ir"), "chrono": Label("@vendor_ts__chrono-0.4.40//:chrono"), - "clap": Label("@vendor_ts__clap-4.5.32//:clap"), + "clap": Label("@vendor_ts__clap-4.5.35//:clap"), "dunce": Label("@vendor_ts__dunce-1.0.5//:dunce"), "figment": Label("@vendor_ts__figment-0.10.19//:figment"), "glob": Label("@vendor_ts__glob-0.3.2//:glob"), "itertools": Label("@vendor_ts__itertools-0.14.0//:itertools"), "num-traits": Label("@vendor_ts__num-traits-0.2.19//:num_traits"), - "ra_ap_base_db": Label("@vendor_ts__ra_ap_base_db-0.0.270//:ra_ap_base_db"), - "ra_ap_cfg": Label("@vendor_ts__ra_ap_cfg-0.0.270//:ra_ap_cfg"), - "ra_ap_hir": Label("@vendor_ts__ra_ap_hir-0.0.270//:ra_ap_hir"), - "ra_ap_hir_def": Label("@vendor_ts__ra_ap_hir_def-0.0.270//:ra_ap_hir_def"), - "ra_ap_hir_expand": Label("@vendor_ts__ra_ap_hir_expand-0.0.270//:ra_ap_hir_expand"), - "ra_ap_hir_ty": Label("@vendor_ts__ra_ap_hir_ty-0.0.270//:ra_ap_hir_ty"), - "ra_ap_ide_db": Label("@vendor_ts__ra_ap_ide_db-0.0.270//:ra_ap_ide_db"), - "ra_ap_intern": Label("@vendor_ts__ra_ap_intern-0.0.270//:ra_ap_intern"), - "ra_ap_load-cargo": Label("@vendor_ts__ra_ap_load-cargo-0.0.270//:ra_ap_load_cargo"), - "ra_ap_parser": Label("@vendor_ts__ra_ap_parser-0.0.270//:ra_ap_parser"), - "ra_ap_paths": Label("@vendor_ts__ra_ap_paths-0.0.270//:ra_ap_paths"), - "ra_ap_project_model": Label("@vendor_ts__ra_ap_project_model-0.0.270//:ra_ap_project_model"), - "ra_ap_span": Label("@vendor_ts__ra_ap_span-0.0.270//:ra_ap_span"), - "ra_ap_syntax": Label("@vendor_ts__ra_ap_syntax-0.0.270//:ra_ap_syntax"), - "ra_ap_vfs": Label("@vendor_ts__ra_ap_vfs-0.0.270//:ra_ap_vfs"), + "ra_ap_base_db": Label("@vendor_ts__ra_ap_base_db-0.0.273//:ra_ap_base_db"), + "ra_ap_cfg": Label("@vendor_ts__ra_ap_cfg-0.0.273//:ra_ap_cfg"), + "ra_ap_hir": Label("@vendor_ts__ra_ap_hir-0.0.273//:ra_ap_hir"), + "ra_ap_hir_def": Label("@vendor_ts__ra_ap_hir_def-0.0.273//:ra_ap_hir_def"), + "ra_ap_hir_expand": Label("@vendor_ts__ra_ap_hir_expand-0.0.273//:ra_ap_hir_expand"), + "ra_ap_hir_ty": Label("@vendor_ts__ra_ap_hir_ty-0.0.273//:ra_ap_hir_ty"), + "ra_ap_ide_db": Label("@vendor_ts__ra_ap_ide_db-0.0.273//:ra_ap_ide_db"), + "ra_ap_intern": Label("@vendor_ts__ra_ap_intern-0.0.273//:ra_ap_intern"), + "ra_ap_load-cargo": Label("@vendor_ts__ra_ap_load-cargo-0.0.273//:ra_ap_load_cargo"), + "ra_ap_parser": Label("@vendor_ts__ra_ap_parser-0.0.273//:ra_ap_parser"), + "ra_ap_paths": Label("@vendor_ts__ra_ap_paths-0.0.273//:ra_ap_paths"), + "ra_ap_project_model": Label("@vendor_ts__ra_ap_project_model-0.0.273//:ra_ap_project_model"), + "ra_ap_span": Label("@vendor_ts__ra_ap_span-0.0.273//:ra_ap_span"), + "ra_ap_syntax": Label("@vendor_ts__ra_ap_syntax-0.0.273//:ra_ap_syntax"), + "ra_ap_vfs": Label("@vendor_ts__ra_ap_vfs-0.0.273//:ra_ap_vfs"), "serde": Label("@vendor_ts__serde-1.0.219//:serde"), "serde_json": Label("@vendor_ts__serde_json-1.0.140//:serde_json"), "serde_with": Label("@vendor_ts__serde_with-3.12.0//:serde_with"), @@ -392,7 +391,7 @@ _NORMAL_ALIASES = { }, "rust/ast-generator": { _COMMON_CONDITION: { - Label("@vendor_ts__ra_ap_stdx-0.0.270//:ra_ap_stdx"): "stdx", + Label("@vendor_ts__ra_ap_stdx-0.0.273//:ra_ap_stdx"): "stdx", }, }, "rust/autobuild": { @@ -596,6 +595,7 @@ _CONDITIONS = { "cfg(all(target_arch = \"x86_64\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": ["@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], "cfg(all(target_arch = \"x86_64\", target_env = \"msvc\", not(windows_raw_dylib)))": ["@rules_rust//rust/platform:x86_64-pc-windows-msvc"], "cfg(all(target_os = \"linux\", not(target_env = \"ohos\")))": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], + "cfg(all(target_os = \"linux\", target_env = \"gnu\"))": ["@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu"], "cfg(all(windows, not(target_vendor = \"win7\")))": ["@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-pc-windows-msvc"], "cfg(any())": [], "cfg(any(target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"hurd\", target_os = \"illumos\", all(target_os = \"horizon\", target_arch = \"arm\")))": ["@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-freebsd"], @@ -829,22 +829,22 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__bitflags-2.8.0", - sha256 = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36", + name = "vendor_ts__bitflags-2.9.0", + sha256 = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd", type = "tar.gz", - urls = ["https://static.crates.io/crates/bitflags/2.8.0/download"], - strip_prefix = "bitflags-2.8.0", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.bitflags-2.8.0.bazel"), + urls = ["https://static.crates.io/crates/bitflags/2.9.0/download"], + strip_prefix = "bitflags-2.9.0", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.bitflags-2.9.0.bazel"), ) maybe( http_archive, - name = "vendor_ts__borsh-1.5.3", - sha256 = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03", + name = "vendor_ts__borsh-1.5.5", + sha256 = "5430e3be710b68d984d1391c854eb431a9d548640711faa54eecb1df93db91cc", type = "tar.gz", - urls = ["https://static.crates.io/crates/borsh/1.5.3/download"], - strip_prefix = "borsh-1.5.3", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.borsh-1.5.3.bazel"), + urls = ["https://static.crates.io/crates/borsh/1.5.5/download"], + strip_prefix = "borsh-1.5.5", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.borsh-1.5.5.bazel"), ) maybe( @@ -919,12 +919,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__cargo_metadata-0.18.1", - sha256 = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037", + name = "vendor_ts__cargo_metadata-0.19.2", + sha256 = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba", type = "tar.gz", - urls = ["https://static.crates.io/crates/cargo_metadata/0.18.1/download"], - strip_prefix = "cargo_metadata-0.18.1", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.cargo_metadata-0.18.1.bazel"), + urls = ["https://static.crates.io/crates/cargo_metadata/0.19.2/download"], + strip_prefix = "cargo_metadata-0.19.2", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.cargo_metadata-0.19.2.bazel"), ) maybe( @@ -1009,22 +1009,22 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__clap-4.5.32", - sha256 = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83", + name = "vendor_ts__clap-4.5.35", + sha256 = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944", type = "tar.gz", - urls = ["https://static.crates.io/crates/clap/4.5.32/download"], - strip_prefix = "clap-4.5.32", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap-4.5.32.bazel"), + urls = ["https://static.crates.io/crates/clap/4.5.35/download"], + strip_prefix = "clap-4.5.35", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap-4.5.35.bazel"), ) maybe( http_archive, - name = "vendor_ts__clap_builder-4.5.32", - sha256 = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8", + name = "vendor_ts__clap_builder-4.5.35", + sha256 = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9", type = "tar.gz", - urls = ["https://static.crates.io/crates/clap_builder/4.5.32/download"], - strip_prefix = "clap_builder-4.5.32", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap_builder-4.5.32.bazel"), + urls = ["https://static.crates.io/crates/clap_builder/4.5.35/download"], + strip_prefix = "clap_builder-4.5.35", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.clap_builder-4.5.35.bazel"), ) maybe( @@ -1319,12 +1319,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__equivalent-1.0.1", - sha256 = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5", + name = "vendor_ts__equivalent-1.0.2", + sha256 = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f", type = "tar.gz", - urls = ["https://static.crates.io/crates/equivalent/1.0.1/download"], - strip_prefix = "equivalent-1.0.1", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.equivalent-1.0.1.bazel"), + urls = ["https://static.crates.io/crates/equivalent/1.0.2/download"], + strip_prefix = "equivalent-1.0.2", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.equivalent-1.0.2.bazel"), ) maybe( @@ -1579,12 +1579,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__indexmap-2.7.0", - sha256 = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f", + name = "vendor_ts__indexmap-2.9.0", + sha256 = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e", type = "tar.gz", - urls = ["https://static.crates.io/crates/indexmap/2.7.0/download"], - strip_prefix = "indexmap-2.7.0", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.indexmap-2.7.0.bazel"), + urls = ["https://static.crates.io/crates/indexmap/2.9.0/download"], + strip_prefix = "indexmap-2.9.0", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.indexmap-2.9.0.bazel"), ) maybe( @@ -1649,12 +1649,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__itoa-1.0.14", - sha256 = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674", + name = "vendor_ts__itoa-1.0.15", + sha256 = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c", type = "tar.gz", - urls = ["https://static.crates.io/crates/itoa/1.0.14/download"], - strip_prefix = "itoa-1.0.14", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.itoa-1.0.14.bazel"), + urls = ["https://static.crates.io/crates/itoa/1.0.15/download"], + strip_prefix = "itoa-1.0.15", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.itoa-1.0.15.bazel"), ) maybe( @@ -1719,12 +1719,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__libc-0.2.169", - sha256 = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a", + name = "vendor_ts__libc-0.2.171", + sha256 = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6", type = "tar.gz", - urls = ["https://static.crates.io/crates/libc/0.2.169/download"], - strip_prefix = "libc-0.2.169", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.libc-0.2.169.bazel"), + urls = ["https://static.crates.io/crates/libc/0.2.171/download"], + strip_prefix = "libc-0.2.171", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.libc-0.2.171.bazel"), ) maybe( @@ -1769,12 +1769,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__log-0.4.25", - sha256 = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f", + name = "vendor_ts__log-0.4.27", + sha256 = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94", type = "tar.gz", - urls = ["https://static.crates.io/crates/log/0.4.25/download"], - strip_prefix = "log-0.4.25", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.log-0.4.25.bazel"), + urls = ["https://static.crates.io/crates/log/0.4.27/download"], + strip_prefix = "log-0.4.27", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.log-0.4.27.bazel"), ) maybe( @@ -1787,16 +1787,6 @@ def crate_repositories(): build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.loom-0.7.2.bazel"), ) - maybe( - http_archive, - name = "vendor_ts__lz4_flex-0.11.3", - sha256 = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5", - type = "tar.gz", - urls = ["https://static.crates.io/crates/lz4_flex/0.11.3/download"], - strip_prefix = "lz4_flex-0.11.3", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.lz4_flex-0.11.3.bazel"), - ) - maybe( http_archive, name = "vendor_ts__matchers-0.1.0", @@ -1949,12 +1939,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__oorandom-11.1.4", - sha256 = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9", + name = "vendor_ts__oorandom-11.1.5", + sha256 = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e", type = "tar.gz", - urls = ["https://static.crates.io/crates/oorandom/11.1.4/download"], - strip_prefix = "oorandom-11.1.4", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.oorandom-11.1.4.bazel"), + urls = ["https://static.crates.io/crates/oorandom/11.1.5/download"], + strip_prefix = "oorandom-11.1.5", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.oorandom-11.1.5.bazel"), ) maybe( @@ -2189,252 +2179,252 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__ra_ap_base_db-0.0.270", - sha256 = "4baa9734d254af14fd603528ad594650dea601b1764492bd39988da38598ae67", + name = "vendor_ts__ra_ap_base_db-0.0.273", + sha256 = "8fd761118bbafe29e2b187e694c6b8e800f2c7822bbc1d9d2db4ac21fb8b0365", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_base_db/0.0.270/download"], - strip_prefix = "ra_ap_base_db-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_base_db-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_base_db/0.0.273/download"], + strip_prefix = "ra_ap_base_db-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_base_db-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_cfg-0.0.270", - sha256 = "0ef2ba45636c5e585040c0c4bee640737a6001b08309f1a25ca78cf04abfbf90", + name = "vendor_ts__ra_ap_cfg-0.0.273", + sha256 = "5ce74ce1af24afd86d3529dbbf5a849d026948b2d8ba51d199b6ea6db6e345b6", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_cfg/0.0.270/download"], - strip_prefix = "ra_ap_cfg-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_cfg-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_cfg/0.0.273/download"], + strip_prefix = "ra_ap_cfg-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_cfg-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_edition-0.0.270", - sha256 = "8955c1484d5e7274f755187788ba0d51eb149f870c69cdf0d87c3b7edea20ea0", + name = "vendor_ts__ra_ap_edition-0.0.273", + sha256 = "f423b9fb19e3920e4c7039120d09d9c79070a26efe8ff9f787c7234b07f518c5", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_edition/0.0.270/download"], - strip_prefix = "ra_ap_edition-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_edition-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_edition/0.0.273/download"], + strip_prefix = "ra_ap_edition-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_edition-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir-0.0.270", - sha256 = "a51d7955beff2212701b149bea36d4cf2dc0f5cd129652c9bcf0cb5c0b021078", + name = "vendor_ts__ra_ap_hir-0.0.273", + sha256 = "dd4aa8a568b80d288b90c4fa5dc8a3cc405914d261bfd33a3761c1ba41be358d", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir/0.0.270/download"], - strip_prefix = "ra_ap_hir-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir/0.0.273/download"], + strip_prefix = "ra_ap_hir-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir_def-0.0.270", - sha256 = "e5c97e617e4c585d24b3d4f668861452aedddfbe0262f4c53235dcea77e62f9b", + name = "vendor_ts__ra_ap_hir_def-0.0.273", + sha256 = "acb18d9378a828a23ccf87b89199db005adb67ba2a05a37d7a3fcad4d1036e66", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir_def/0.0.270/download"], - strip_prefix = "ra_ap_hir_def-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_def-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir_def/0.0.273/download"], + strip_prefix = "ra_ap_hir_def-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_def-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir_expand-0.0.270", - sha256 = "be57c0d7e3f2180dd8ea584b11447f34060eadc06f0f6d559e2a790f6e91b6c5", + name = "vendor_ts__ra_ap_hir_expand-0.0.273", + sha256 = "094fa79d8f661f52cf3b7fb8b3d91c4be2ad9e71a3967d3dacd25429fa44b37d", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir_expand/0.0.270/download"], - strip_prefix = "ra_ap_hir_expand-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_expand-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir_expand/0.0.273/download"], + strip_prefix = "ra_ap_hir_expand-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_expand-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_hir_ty-0.0.270", - sha256 = "f260f35748f3035b46a8afcdebda7cb75d95c24750105fad86101d09a9d387c8", + name = "vendor_ts__ra_ap_hir_ty-0.0.273", + sha256 = "093482d200d5db421db5692e7819bbb14fb717cc8cb0f91f93cce9fde85b3df2", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_hir_ty/0.0.270/download"], - strip_prefix = "ra_ap_hir_ty-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_ty-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_hir_ty/0.0.273/download"], + strip_prefix = "ra_ap_hir_ty-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_hir_ty-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_ide_db-0.0.270", - sha256 = "0426263be26e27cb55a3b9ef88b120511b66fe7d9b418a2473d6d5f3ac2fe0a6", + name = "vendor_ts__ra_ap_ide_db-0.0.273", + sha256 = "b655b92dfa9444db8129321b9217d9e4a83a58ee707aa1004a93052acfb43d57", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_ide_db/0.0.270/download"], - strip_prefix = "ra_ap_ide_db-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_ide_db-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_ide_db/0.0.273/download"], + strip_prefix = "ra_ap_ide_db-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_ide_db-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_intern-0.0.270", - sha256 = "f6ea8c9615b3b0688cf557e7310dbd9432f43860c8ea766d54f4416cbecf3571", + name = "vendor_ts__ra_ap_intern-0.0.273", + sha256 = "b4e528496b4d4c351806bb073d3d7f6526535741b9e8801776603c924bbec624", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_intern/0.0.270/download"], - strip_prefix = "ra_ap_intern-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_intern-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_intern/0.0.273/download"], + strip_prefix = "ra_ap_intern-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_intern-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_load-cargo-0.0.270", - sha256 = "570907e16725c13a678bfd8050ce8839af2831da042a0878b75ee8c41b0f7b0c", + name = "vendor_ts__ra_ap_load-cargo-0.0.273", + sha256 = "1a97a5070b2f4b99f56683d91b2687aa0c530d8969cc5252ec2ae5644e428ffe", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_load-cargo/0.0.270/download"], - strip_prefix = "ra_ap_load-cargo-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_load-cargo-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_load-cargo/0.0.273/download"], + strip_prefix = "ra_ap_load-cargo-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_load-cargo-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_mbe-0.0.270", - sha256 = "e893fe03b04b30c9b5a339ac2bf39ce32ac9c05a8b50121b7d89ce658346e164", + name = "vendor_ts__ra_ap_mbe-0.0.273", + sha256 = "b187ee5ee3fa726eeea5142242a0397e2200d77084026986a68324b9599f9046", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_mbe/0.0.270/download"], - strip_prefix = "ra_ap_mbe-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_mbe-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_mbe/0.0.273/download"], + strip_prefix = "ra_ap_mbe-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_mbe-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_parser-0.0.270", - sha256 = "6fd9a264120968b14a66b6ba756cd7f99435385b5dbc2f0a611cf3a12221c385", + name = "vendor_ts__ra_ap_parser-0.0.273", + sha256 = "2306e6c051e60483f3b317fac9dec6c883b7792eeb8db24ec6f39dbfa5430159", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_parser/0.0.270/download"], - strip_prefix = "ra_ap_parser-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_parser-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_parser/0.0.273/download"], + strip_prefix = "ra_ap_parser-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_parser-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_paths-0.0.270", - sha256 = "f47817351651e36b56ff3afc483b41600053c9cb7e67d945467c0abe93416032", + name = "vendor_ts__ra_ap_paths-0.0.273", + sha256 = "dcedd00499621bdd0f1fe01955c04e4b388197aa826744003afaf6cc2944bc80", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_paths/0.0.270/download"], - strip_prefix = "ra_ap_paths-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_paths-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_paths/0.0.273/download"], + strip_prefix = "ra_ap_paths-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_paths-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_proc_macro_api-0.0.270", - sha256 = "d96da3b8b9f6b813a98f5357eef303905450741f47ba90adaab8a5371b748416", + name = "vendor_ts__ra_ap_proc_macro_api-0.0.273", + sha256 = "7a2e49b550015cd4ad152bd78d92d73594497f2e44f61273f9fed3534ad4bbbe", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_proc_macro_api/0.0.270/download"], - strip_prefix = "ra_ap_proc_macro_api-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_proc_macro_api-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_proc_macro_api/0.0.273/download"], + strip_prefix = "ra_ap_proc_macro_api-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_proc_macro_api-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_profile-0.0.270", - sha256 = "13637377287c84f88a628e40229d271ef0081c0d683956bd99a6c8278a4f8b14", + name = "vendor_ts__ra_ap_profile-0.0.273", + sha256 = "87cdbd27ebe02ec21fdae3df303f194bda036a019ecef80d47e0082646f06c54", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_profile/0.0.270/download"], - strip_prefix = "ra_ap_profile-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_profile-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_profile/0.0.273/download"], + strip_prefix = "ra_ap_profile-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_profile-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_project_model-0.0.270", - sha256 = "053c5207a638fc7a752c7a454bc952b28b0d02f0bf9f6d7ec785ec809579d8fa", + name = "vendor_ts__ra_ap_project_model-0.0.273", + sha256 = "5eaa3406c891a7840d20ce615f8decca32cbc9d3654b82dcbcc3a31257ce90b9", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_project_model/0.0.270/download"], - strip_prefix = "ra_ap_project_model-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_project_model-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_project_model/0.0.273/download"], + strip_prefix = "ra_ap_project_model-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_project_model-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_query-group-macro-0.0.270", - sha256 = "0f1a38f07b442e47a234cbe2e8fd1b8a41ff0cc5123cb1cf994c5ce20edb5bd6", + name = "vendor_ts__ra_ap_query-group-macro-0.0.273", + sha256 = "1fbc1748e4876a9b0ccfacfc7e2fe254f30e92ef58d98925282b3803e8b004ed", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_query-group-macro/0.0.270/download"], - strip_prefix = "ra_ap_query-group-macro-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_query-group-macro-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_query-group-macro/0.0.273/download"], + strip_prefix = "ra_ap_query-group-macro-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_query-group-macro-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_span-0.0.270", - sha256 = "8818680c6f7da3b32cb2bb0992940b24264b1aa90203aa94812e09ab34d362d1", + name = "vendor_ts__ra_ap_span-0.0.273", + sha256 = "ed1d036e738bf32a057d90698df85bcb83ed6263b5fe9fba132c99e8ec3aecaf", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_span/0.0.270/download"], - strip_prefix = "ra_ap_span-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_span-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_span/0.0.273/download"], + strip_prefix = "ra_ap_span-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_span-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_stdx-0.0.270", - sha256 = "f1c10bee1b03fc48083862c13cf06bd3ed17760463ecce2734103a2f511e5ed4", + name = "vendor_ts__ra_ap_stdx-0.0.273", + sha256 = "6e3775954ab24408f71e97079a97558078a166a4082052e83256ae4c22dae18d", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_stdx/0.0.270/download"], - strip_prefix = "ra_ap_stdx-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_stdx-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_stdx/0.0.273/download"], + strip_prefix = "ra_ap_stdx-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_stdx-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_syntax-0.0.270", - sha256 = "92bc32f3946fc5fcbdc79e61b7e26a8c2a3a56f3ef6ab27c7d298a9e21a462f2", + name = "vendor_ts__ra_ap_syntax-0.0.273", + sha256 = "b49b081f209a764700f688db91820a66c2ecfe5f138895d831361cf84f716691", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_syntax/0.0.270/download"], - strip_prefix = "ra_ap_syntax-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_syntax/0.0.273/download"], + strip_prefix = "ra_ap_syntax-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_syntax-bridge-0.0.270", - sha256 = "a42052c44c98c122c37aac476260c8f19d8fec495edc9c05835307c9ae86194d", + name = "vendor_ts__ra_ap_syntax-bridge-0.0.273", + sha256 = "f2740bbe603d527f2cf0aaf51629de7d072694fbbaaeda8264f7591be1493d1b", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_syntax-bridge/0.0.270/download"], - strip_prefix = "ra_ap_syntax-bridge-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-bridge-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_syntax-bridge/0.0.273/download"], + strip_prefix = "ra_ap_syntax-bridge-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_syntax-bridge-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_toolchain-0.0.270", - sha256 = "75996e70b3a0c68cd5157ba01f018964c7c6a5d7b209047d449b393139d0b57f", + name = "vendor_ts__ra_ap_toolchain-0.0.273", + sha256 = "efbff9f26f307ef958586357d1653d000861dcd3acbaf33a009651e024720c7e", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_toolchain/0.0.270/download"], - strip_prefix = "ra_ap_toolchain-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_toolchain-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_toolchain/0.0.273/download"], + strip_prefix = "ra_ap_toolchain-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_toolchain-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_tt-0.0.270", - sha256 = "0e4ee31e93bfabe83e6720b7469db88d7ad7ec5c59a1f011efec4aa1327ffc5c", + name = "vendor_ts__ra_ap_tt-0.0.273", + sha256 = "0b1ce3ac14765e414fa6031fda7dc35d3492c74de225aac689ba8b8bf037e1f8", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_tt/0.0.270/download"], - strip_prefix = "ra_ap_tt-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_tt-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_tt/0.0.273/download"], + strip_prefix = "ra_ap_tt-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_tt-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_vfs-0.0.270", - sha256 = "f6aac1e277ac70bb073f40f8a3fc44e4b1bb9e4d4b1d0e0bd2f8269543560f80", + name = "vendor_ts__ra_ap_vfs-0.0.273", + sha256 = "29427a7c27ce8ddfefb52d77c952a4588c74d0a7ab064dc627129088a90423ca", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_vfs/0.0.270/download"], - strip_prefix = "ra_ap_vfs-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_vfs/0.0.273/download"], + strip_prefix = "ra_ap_vfs-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-0.0.273.bazel"), ) maybe( http_archive, - name = "vendor_ts__ra_ap_vfs-notify-0.0.270", - sha256 = "cd95285146049621ee8f7a512c982a008bf036321fcc9b01a95c1ad7e6aeae57", + name = "vendor_ts__ra_ap_vfs-notify-0.0.273", + sha256 = "d5a0e3095b8216ecc131f38b4b0025cac324a646469a95d2670354aee7278078", type = "tar.gz", - urls = ["https://static.crates.io/crates/ra_ap_vfs-notify/0.0.270/download"], - strip_prefix = "ra_ap_vfs-notify-0.0.270", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-notify-0.0.270.bazel"), + urls = ["https://static.crates.io/crates/ra_ap_vfs-notify/0.0.273/download"], + strip_prefix = "ra_ap_vfs-notify-0.0.273", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.ra_ap_vfs-notify-0.0.273.bazel"), ) maybe( @@ -2588,12 +2578,13 @@ def crate_repositories(): ) maybe( - new_git_repository, - name = "vendor_ts__rustc_apfloat-0.2.1-llvm-462a31f5a5ab", - commit = "096d585100636bc2e9f09d7eefec38c5b334d47b", - init_submodules = True, - remote = "https://github.com/redsun82/rustc_apfloat.git", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.rustc_apfloat-0.2.1+llvm-462a31f5a5ab.bazel"), + http_archive, + name = "vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab", + sha256 = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f", + type = "tar.gz", + urls = ["https://static.crates.io/crates/rustc_apfloat/0.2.2+llvm-462a31f5a5ab/download"], + strip_prefix = "rustc_apfloat-0.2.2+llvm-462a31f5a5ab", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel"), ) maybe( @@ -2678,12 +2669,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__semver-1.0.24", - sha256 = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba", + name = "vendor_ts__semver-1.0.26", + sha256 = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0", type = "tar.gz", - urls = ["https://static.crates.io/crates/semver/1.0.24/download"], - strip_prefix = "semver-1.0.24", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.semver-1.0.24.bazel"), + urls = ["https://static.crates.io/crates/semver/1.0.26/download"], + strip_prefix = "semver-1.0.26", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.semver-1.0.26.bazel"), ) maybe( @@ -2858,22 +2849,32 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__thiserror-1.0.69", - sha256 = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52", + name = "vendor_ts__thin-vec-0.2.14", + sha256 = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d", type = "tar.gz", - urls = ["https://static.crates.io/crates/thiserror/1.0.69/download"], - strip_prefix = "thiserror-1.0.69", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-1.0.69.bazel"), + urls = ["https://static.crates.io/crates/thin-vec/0.2.14/download"], + strip_prefix = "thin-vec-0.2.14", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thin-vec-0.2.14.bazel"), ) maybe( http_archive, - name = "vendor_ts__thiserror-impl-1.0.69", - sha256 = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1", + name = "vendor_ts__thiserror-2.0.12", + sha256 = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708", type = "tar.gz", - urls = ["https://static.crates.io/crates/thiserror-impl/1.0.69/download"], - strip_prefix = "thiserror-impl-1.0.69", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-impl-1.0.69.bazel"), + urls = ["https://static.crates.io/crates/thiserror/2.0.12/download"], + strip_prefix = "thiserror-2.0.12", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-2.0.12.bazel"), + ) + + maybe( + http_archive, + name = "vendor_ts__thiserror-impl-2.0.12", + sha256 = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d", + type = "tar.gz", + urls = ["https://static.crates.io/crates/thiserror-impl/2.0.12/download"], + strip_prefix = "thiserror-impl-2.0.12", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.thiserror-impl-2.0.12.bazel"), ) maybe( @@ -3108,12 +3109,12 @@ def crate_repositories(): maybe( http_archive, - name = "vendor_ts__unicode-ident-1.0.16", - sha256 = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034", + name = "vendor_ts__unicode-ident-1.0.17", + sha256 = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe", type = "tar.gz", - urls = ["https://static.crates.io/crates/unicode-ident/1.0.16/download"], - strip_prefix = "unicode-ident-1.0.16", - build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.unicode-ident-1.0.16.bazel"), + urls = ["https://static.crates.io/crates/unicode-ident/1.0.17/download"], + strip_prefix = "unicode-ident-1.0.17", + build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.unicode-ident-1.0.17.bazel"), ) maybe( @@ -3651,7 +3652,7 @@ def crate_repositories(): struct(repo = "vendor_ts__argfile-0.2.1", is_dev_dep = False), struct(repo = "vendor_ts__chalk-ir-0.100.0", is_dev_dep = False), struct(repo = "vendor_ts__chrono-0.4.40", is_dev_dep = False), - struct(repo = "vendor_ts__clap-4.5.32", is_dev_dep = False), + struct(repo = "vendor_ts__clap-4.5.35", is_dev_dep = False), struct(repo = "vendor_ts__dunce-1.0.5", is_dev_dep = False), struct(repo = "vendor_ts__either-1.15.0", is_dev_dep = False), struct(repo = "vendor_ts__encoding-0.2.33", is_dev_dep = False), @@ -3666,22 +3667,22 @@ def crate_repositories(): struct(repo = "vendor_ts__num_cpus-1.16.0", is_dev_dep = False), struct(repo = "vendor_ts__proc-macro2-1.0.94", is_dev_dep = False), struct(repo = "vendor_ts__quote-1.0.40", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_base_db-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_cfg-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir_def-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir_expand-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_hir_ty-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_ide_db-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_intern-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_load-cargo-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_parser-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_paths-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_project_model-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_span-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_stdx-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_syntax-0.0.270", is_dev_dep = False), - struct(repo = "vendor_ts__ra_ap_vfs-0.0.270", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_base_db-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_cfg-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir_def-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir_expand-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_hir_ty-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_ide_db-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_intern-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_load-cargo-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_parser-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_paths-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_project_model-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_span-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_stdx-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_syntax-0.0.273", is_dev_dep = False), + struct(repo = "vendor_ts__ra_ap_vfs-0.0.273", is_dev_dep = False), struct(repo = "vendor_ts__rayon-1.10.0", is_dev_dep = False), struct(repo = "vendor_ts__regex-1.11.1", is_dev_dep = False), struct(repo = "vendor_ts__serde-1.0.219", is_dev_dep = False), diff --git a/rust/ast-generator/Cargo.toml b/rust/ast-generator/Cargo.toml index 23b2ab8cb15..233a380b2f7 100644 --- a/rust/ast-generator/Cargo.toml +++ b/rust/ast-generator/Cargo.toml @@ -10,7 +10,7 @@ ungrammar = "1.16.1" proc-macro2 = "1.0.94" quote = "1.0.40" either = "1.15.0" -stdx = {package = "ra_ap_stdx", version = "0.0.270"} +stdx = {package = "ra_ap_stdx", version = "0.0.273"} itertools = "0.14.0" mustache = "0.9.0" serde = { version = "1.0.219", features = ["derive"] } diff --git a/rust/extractor/Cargo.toml b/rust/extractor/Cargo.toml index d4f6a177074..bdbe7c969ee 100644 --- a/rust/extractor/Cargo.toml +++ b/rust/extractor/Cargo.toml @@ -7,24 +7,24 @@ license = "MIT" # When updating these dependencies, run `rust/update_cargo_deps.sh` [dependencies] anyhow = "1.0.97" -clap = { version = "4.5.32", features = ["derive"] } +clap = { version = "4.5.35", features = ["derive"] } figment = { version = "0.10.19", features = ["env", "yaml"] } num-traits = "0.2.19" -ra_ap_base_db = "0.0.270" -ra_ap_hir = "0.0.270" -ra_ap_hir_def = "0.0.270" -ra_ap_ide_db = "0.0.270" -ra_ap_hir_ty = "0.0.270" -ra_ap_hir_expand = "0.0.270" -ra_ap_load-cargo = "0.0.270" -ra_ap_paths = "0.0.270" -ra_ap_project_model = "0.0.270" -ra_ap_syntax = "0.0.270" -ra_ap_vfs = "0.0.270" -ra_ap_parser = "0.0.270" -ra_ap_span = "0.0.270" -ra_ap_cfg = "0.0.270" -ra_ap_intern = "0.0.270" +ra_ap_base_db = "0.0.273" +ra_ap_hir = "0.0.273" +ra_ap_hir_def = "0.0.273" +ra_ap_ide_db = "0.0.273" +ra_ap_hir_ty = "0.0.273" +ra_ap_hir_expand = "0.0.273" +ra_ap_load-cargo = "0.0.273" +ra_ap_paths = "0.0.273" +ra_ap_project_model = "0.0.273" +ra_ap_syntax = "0.0.273" +ra_ap_vfs = "0.0.273" +ra_ap_parser = "0.0.273" +ra_ap_span = "0.0.273" +ra_ap_cfg = "0.0.273" +ra_ap_intern = "0.0.273" serde = "1.0.219" serde_with = "3.12.0" triomphe = "0.1.14" From afb97d27977a9238a357e9ba305306bbc5f0859b Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 14:34:33 +0200 Subject: [PATCH 091/372] Rust: regenerate schema --- Cargo.lock | 1 - rust/extractor/src/generated/.generated.list | 2 +- rust/extractor/src/generated/top.rs | 4 ++++ rust/extractor/src/translate/generated.rs | 2 ++ rust/ql/.generated.list | 8 ++++---- .../lib/codeql/rust/elements/internal/generated/Raw.qll | 5 +++++ .../rust/elements/internal/generated/StructField.qll | 5 +++++ rust/ql/lib/rust.dbscheme | 5 +++++ .../extractor-tests/generated/StructField/StructField.ql | 9 +++++---- rust/schema/ast.py | 1 + 10 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd9023a315f..3852eeba6bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3033,4 +3033,3 @@ dependencies = [ name = "rustc_apfloat" version = "0.2.1+llvm-462a31f5a5ab" source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" - diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index 56c8762bcdd..82b6665615b 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs 50fa90457102611ea7892153e4beb7512d3704a1c78d9bb8e75eb96b98b31740 50fa90457102611ea7892153e4beb7512d3704a1c78d9bb8e75eb96b98b31740 +top.rs 060225ccbae440eef117e2ef0a82f3deba29e6ba2d35f00281f9c0e6a945e692 060225ccbae440eef117e2ef0a82f3deba29e6ba2d35f00281f9c0e6a945e692 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index b65cec68264..caeeb7552a7 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -2612,6 +2612,7 @@ pub struct StructField { pub id: trap::TrapId, pub attrs: Vec>, pub default: Option>, + pub is_unsafe: bool, pub name: Option>, pub type_repr: Option>, pub visibility: Option>, @@ -2630,6 +2631,9 @@ impl trap::TrapEntry for StructField { if let Some(v) = self.default { out.add_tuple("struct_field_defaults", vec![id.into(), v.into()]); } + if self.is_unsafe { + out.add_tuple("struct_field_is_unsafe", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("struct_field_names", vec![id.into(), v.into()]); } diff --git a/rust/extractor/src/translate/generated.rs b/rust/extractor/src/translate/generated.rs index 9f8e52e0a45..32b9c2367a6 100644 --- a/rust/extractor/src/translate/generated.rs +++ b/rust/extractor/src/translate/generated.rs @@ -1850,6 +1850,7 @@ impl Translator<'_> { if self.should_be_excluded(&node) { return None; } let attrs = node.attrs().filter_map(|x| self.emit_attr(x)).collect(); let default = node.expr().and_then(|x| self.emit_expr(x)); + let is_unsafe = node.unsafe_token().is_some(); let name = node.name().and_then(|x| self.emit_name(x)); let type_repr = node.ty().and_then(|x| self.emit_type(x)); let visibility = node.visibility().and_then(|x| self.emit_visibility(x)); @@ -1857,6 +1858,7 @@ impl Translator<'_> { id: TrapId::Star, attrs, default, + is_unsafe, name, type_repr, visibility, diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index 0bd2931256e..0ff3e721e23 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -579,7 +579,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60 lib/codeql/rust/elements/internal/generated/ParenPat.qll 4f168ef5d5bb87a903251cc31b2e44a759b099ec69c90af31783fbb15778c940 0e34f94a45a13396fd57d94c245dc64d1adde2ab0e22b56946f7e94c04e297fc lib/codeql/rust/elements/internal/generated/ParenTypeRepr.qll 40ab5c592e7699c621787793743e33988de71ff42ca27599f5ab3ddb70e3f7d8 12c0a6eed2202ee3e892f61da3b3ce77ac3190854cdf3097e8d2be98aa3cb91d -lib/codeql/rust/elements/internal/generated/ParentChild.qll 3a9dd595f34bc5841d21f91882b01f2882b18b70e8c718e81d491b4b33bad82b fb40a76aff319ec5f7dae9a05da083b337887b0918b3702641b39342213ddf6f +lib/codeql/rust/elements/internal/generated/ParentChild.qll d1770632e8d0c649ebcbcab9cbc653531ecf521bbf5d891941db8c0927ae6796 fb40a76aff319ec5f7dae9a05da083b337887b0918b3702641b39342213ddf6f lib/codeql/rust/elements/internal/generated/ParenthesizedArgList.qll c5fa328ea60d3a3333d7c7bb3480969c1873166c7ac8ebb9d0afad7a8099d1a8 2dbbb6200d96f7db7dea4a55bdeab8d67b14d39a43e0bd54ada019f7e466f163 lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 9b12afb46fc5a9ad3a811b05472621bbecccb900c47504feb7f29d96b28421ca bcacbffc36fb3e0c9b26523b5963af0ffa9fd6b19f00a2a31bdb2316071546bd @@ -594,7 +594,7 @@ lib/codeql/rust/elements/internal/generated/PtrTypeRepr.qll 51d1e9e683fc79dddbff lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f e5b8e69519012bbaae29dcb82d53f7f7ecce368c0358ec27ef6180b228a0057f lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll 80826a6a6868a803aa2372e31c52a03e1811a3f1f2abdb469f91ca0bfdd9ecb6 34ee1e208c1690cba505dff2c588837c0cd91e185e2a87d1fe673191962276a9 -lib/codeql/rust/elements/internal/generated/Raw.qll 4a73b51a4e7c995c42d68cf64ff8aff351d898f306ceedf70a009bf86bbf7d84 f7ccdbc4841d87dae7bbf6f58556901176c930a9a797a59dbc04269ca3b516ce +lib/codeql/rust/elements/internal/generated/Raw.qll 6e33d9fa21ee3287a0ebc27856a09f4fdc4d587b5a31ff1c4337106de7ca1a2e eece38e6accb6b9d8838fd05edd7cbaf6f7ee37190adbef2b023ad91064d1622 lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 lib/codeql/rust/elements/internal/generated/RefPat.qll 456ede39837463ee22a630ec7ab6c8630d3664a8ea206fcc6e4f199e92fa564c 5622062765f32930465ba6b170e986706f159f6070f48adee3c20e24e8df4e05 lib/codeql/rust/elements/internal/generated/RefTypeRepr.qll 3d8c0bd296d33b91a81633f697a43269a6538df06d277262d3990d3f6880ef57 13680f39e89bcd8299c218aba396f3deec804597e6f7cb7d4a7e7c748b6faa77 @@ -615,7 +615,7 @@ lib/codeql/rust/elements/internal/generated/Struct.qll b54a48c32d99345f22f189da8 lib/codeql/rust/elements/internal/generated/StructExpr.qll c6d861eaa0123b103fd9ffd2485423419ef9b7e0b4af9ed2a2090d8ec534f65d 50da99ee44771e1239ed8919f711991dd3ec98589fbe49b49b68c88074a07d74 lib/codeql/rust/elements/internal/generated/StructExprField.qll 6bdc52ed325fd014495410c619536079b8c404e2247bd2435aa7685dd56c3833 501a30650cf813176ff325a1553da6030f78d14be3f84fea6d38032f4262c6b0 lib/codeql/rust/elements/internal/generated/StructExprFieldList.qll b19b6869a6828c7a39a7312539eb29fd21734ff47dfd02281de74194fd565d7e 3cadebffaa937e367a5e1da6741e4e9e5c9a9c7f7555e28cfa70639afd19db7c -lib/codeql/rust/elements/internal/generated/StructField.qll bcbaa836d9b9889c87ba57c6ea733cdc85425168d9df05aca5cfd051851d8cd1 a17034896bc7fa25c84e40b460109d122ca1e85632cf8ac620f66f3eb0ff81b5 +lib/codeql/rust/elements/internal/generated/StructField.qll 18b62eb2ea7d3fe109308540cb219763e968b866c8600226b44f81159d3c549b 1acfc0da7ae1d8d4b3fa2cdcc440cc1423c5cd885da03c0e8b2c81a2b089cbbb lib/codeql/rust/elements/internal/generated/StructFieldList.qll 8911a44217d091b05f488da4e012cb026aed0630caa84ca301bbcbd054c9a28c a433383fea7e42f20750aa43e6070c23baad761a4264be99257541c1004ead31 lib/codeql/rust/elements/internal/generated/StructPat.qll c76fa005c2fd0448a8803233e1e8818c4123301eb66ac5cf69d0b9eaafc61e98 6e0dffccdce24bca20e87d5ba0f0995c9a1ae8983283e71e7dbfcf6fffc67a58 lib/codeql/rust/elements/internal/generated/StructPatField.qll 5b5c7302dbc4a902ca8e69ff31875c867e295a16a626ba3cef29cd0aa248f179 4e192a0df79947f5cb0d47fdbbba7986137a6a40a1be92ae119873e2fad67edf @@ -1087,7 +1087,7 @@ test/extractor-tests/generated/StructExprFieldList/StructExprFieldList.ql 33dc3f test/extractor-tests/generated/StructExprFieldList/StructExprFieldList_getAttr.ql cd7f5236f6b660fc064f3a04f3a58d720ed4e81916cbd1a049c1fac7171108ed 61317928d0833f7bb55255a5045bedc0913db1266e963ede97d597ee43e3ddd9 test/extractor-tests/generated/StructExprFieldList/StructExprFieldList_getField.ql 1292aec1141bdb75fd8e0993f683035f396a0e6c841b76ee86a0a1d3dce0dbc4 450eccbd07cc0aa81cef698f43d60aeb55f8952a573eaf84a389a6449c3d63a7 test/extractor-tests/generated/StructExprFieldList/StructExprFieldList_getSpread.ql d0470b9846323d0408e0f26444cdc5322d78ce1ac203073ff4f556dac5343be7 280712a0b3714256aff4c2a4370fd43e70c418f526e383ed7100d61cdf790c36 -test/extractor-tests/generated/StructField/StructField.ql 7943d00e32171da93fae8215456c79b2df590cffa7241f4c0e78b0d7d525b1b2 6d5e3825075d2cb4438adf699a5a92ce22301ea58888d63ea336118bf29c0205 +test/extractor-tests/generated/StructField/StructField.ql 5ec75ec3c1a18299259dfa041790e9b4a791ceb1706aadea3537d0a67e7e65bb cba580a8678547dc88a736bd639cc4d8e84ec32a9ad1095e50f7e03047c37f1c test/extractor-tests/generated/StructField/StructField_getAttr.ql a01715bc688d5fa48c9dd4bfab21d0909169f851a290895c13a181f22c0e73a9 fa6ffcf007492d9e1b7f90d571b9747bd47b2dc29e558a8e1c3013c5949dcdb7 test/extractor-tests/generated/StructField/StructField_getDefault.ql deccc63b81892cd1b293d8b328ad5b3efdf32892efc8b161dfcd89330ca6b5a2 9a9f306f63208ce30d26f91dd15b94867a7d9affd31a0f51a3d1d2ce50786abc test/extractor-tests/generated/StructField/StructField_getName.ql 4c5a7e00b758a744a719bff63d493ee7d31ff8b3010e00c1d1449034d00130ec 9b284d848e5c86eac089f33deca7586441a89d927e7703cb4f98bb7c65a7238c diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 34d29ba230e..3bd57ae9862 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -955,6 +955,11 @@ module Raw { */ Expr getDefault() { struct_field_defaults(this, result) } + /** + * Holds if this struct field is unsafe. + */ + predicate isUnsafe() { struct_field_is_unsafe(this) } + /** * Gets the name of this struct field, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll index c5525b86dba..cd392811e19 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/StructField.qll @@ -64,6 +64,11 @@ module Generated { */ final predicate hasDefault() { exists(this.getDefault()) } + /** + * Holds if this struct field is unsafe. + */ + predicate isUnsafe() { Synth::convertStructFieldToRaw(this).(Raw::StructField).isUnsafe() } + /** * Gets the name of this struct field, if it exists. */ diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index 256e80c2dce..e8707b675dc 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -976,6 +976,11 @@ struct_field_defaults( int default: @expr ref ); +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + #keyset[id] struct_field_names( int id: @struct_field ref, diff --git a/rust/ql/test/extractor-tests/generated/StructField/StructField.ql b/rust/ql/test/extractor-tests/generated/StructField/StructField.ql index dfd4327e74c..cf7b3d995e1 100644 --- a/rust/ql/test/extractor-tests/generated/StructField/StructField.ql +++ b/rust/ql/test/extractor-tests/generated/StructField/StructField.ql @@ -3,15 +3,16 @@ import codeql.rust.elements import TestUtils from - StructField x, int getNumberOfAttrs, string hasDefault, string hasName, string hasTypeRepr, - string hasVisibility + StructField x, int getNumberOfAttrs, string hasDefault, string isUnsafe, string hasName, + string hasTypeRepr, string hasVisibility where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasDefault() then hasDefault = "yes" else hasDefault = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasTypeRepr() then hasTypeRepr = "yes" else hasTypeRepr = "no") and if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasDefault:", hasDefault, "hasName:", hasName, - "hasTypeRepr:", hasTypeRepr, "hasVisibility:", hasVisibility +select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasDefault:", hasDefault, "isUnsafe:", isUnsafe, + "hasName:", hasName, "hasTypeRepr:", hasTypeRepr, "hasVisibility:", hasVisibility diff --git a/rust/schema/ast.py b/rust/schema/ast.py index e5be9e1a0a0..dabe1be807a 100644 --- a/rust/schema/ast.py +++ b/rust/schema/ast.py @@ -539,6 +539,7 @@ class StructExprFieldList(AstNode, ): class StructField(AstNode, ): attrs: list["Attr"] | child default: optional["Expr"] | child + is_unsafe: predicate name: optional["Name"] | child type_repr: optional["TypeRepr"] | child visibility: optional["Visibility"] | child From 132632b2a1dbd6049168c5d47287ad7aaa3f97f0 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 14:45:55 +0200 Subject: [PATCH 092/372] Cargo: update `rustc_apfloat` patched revision --- Cargo.lock | 8 +------- Cargo.toml | 2 +- .../3rdparty/tree_sitter_extractors_deps/defs.bzl | 10 +++++----- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3852eeba6bb..f425373ceea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2071,8 +2071,7 @@ checksum = "2febf9acc5ee5e99d1ad0afcdbccc02d87aa3f857a1f01f825b80eacf8edfcd1" [[package]] name = "rustc_apfloat" version = "0.2.2+llvm-462a31f5a5ab" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f" +source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=32968f16ef1b082243f9bf43a3fbd65c381b3e27#32968f16ef1b082243f9bf43a3fbd65c381b3e27" dependencies = [ "bitflags 2.9.0", "smallvec", @@ -3028,8 +3027,3 @@ dependencies = [ "quote", "syn", ] - -[[patch.unused]] -name = "rustc_apfloat" -version = "0.2.1+llvm-462a31f5a5ab" -source = "git+https://github.com/redsun82/rustc_apfloat.git?rev=096d585100636bc2e9f09d7eefec38c5b334d47b#096d585100636bc2e9f09d7eefec38c5b334d47b" diff --git a/Cargo.toml b/Cargo.toml index b20cf6dd0ed..d7406677248 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,4 +14,4 @@ members = [ [patch.crates-io] # patch for build script bug preventing bazel build # see https://github.com/rust-lang/rustc_apfloat/pull/17 -rustc_apfloat = { git = "https://github.com/redsun82/rustc_apfloat.git", rev = "096d585100636bc2e9f09d7eefec38c5b334d47b" } +rustc_apfloat = { git = "https://github.com/redsun82/rustc_apfloat.git", rev = "32968f16ef1b082243f9bf43a3fbd65c381b3e27" } diff --git a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl index b2db5d16f58..ee2044468e7 100644 --- a/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl +++ b/misc/bazel/3rdparty/tree_sitter_extractors_deps/defs.bzl @@ -16,6 +16,7 @@ """ load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") @@ -2578,12 +2579,11 @@ def crate_repositories(): ) maybe( - http_archive, + new_git_repository, name = "vendor_ts__rustc_apfloat-0.2.2-llvm-462a31f5a5ab", - sha256 = "121e2195ff969977a4e2b5c9965ea867fce7e4cb5aee5b09dee698a7932d574f", - type = "tar.gz", - urls = ["https://static.crates.io/crates/rustc_apfloat/0.2.2+llvm-462a31f5a5ab/download"], - strip_prefix = "rustc_apfloat-0.2.2+llvm-462a31f5a5ab", + commit = "32968f16ef1b082243f9bf43a3fbd65c381b3e27", + init_submodules = True, + remote = "https://github.com/redsun82/rustc_apfloat.git", build_file = Label("//misc/bazel/3rdparty/tree_sitter_extractors_deps:BUILD.rustc_apfloat-0.2.2+llvm-462a31f5a5ab.bazel"), ) From ffcf6d6e581185d22f499cd7735d33e429c30b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Vajk?= Date: Mon, 7 Apr 2025 14:31:24 +0200 Subject: [PATCH 093/372] Apply suggestions from code review Co-authored-by: Paolo Tranquilli Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../java-code-quality.qls.expected | 22 +- .../java-code-scanning.qls.expected | 158 +++--- .../java-security-and-quality.qls.expected | 486 +++++++++--------- .../java-security-extended.qls.expected | 246 ++++----- .../java/query-suite/test.py | 14 +- 5 files changed, 462 insertions(+), 464 deletions(-) diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected index 1b231590e6a..6f396573aa1 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -1,11 +1,11 @@ -/ql/java/ql/src/Language Abuse/TypeVariableHidesType.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql -/ql/java/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql -/ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql -/ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql -/ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql -/ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql -/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql -/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql +ql/java/ql/src/Language Abuse/TypeVariableHidesType.ql +ql/java/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql +ql/java/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql +ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql +ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql +ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql +ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql +ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql +ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql +ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql +ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql diff --git a/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected index 9f22d395c39..a8ce00aca6c 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-scanning.qls.expected @@ -1,79 +1,79 @@ -/ql/java/ql/src/Diagnostics/ExtractionErrors.ql -/ql/java/ql/src/Diagnostics/ExtractionWarnings.ql -/ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql -/ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql -/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql -/ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql -/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql -/ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql -/ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql -/ql/java/ql/src/Security/CWE/CWE-079/XSS.ql -/ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql -/ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql -/ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql -/ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql -/ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql -/ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql -/ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql -/ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql -/ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql -/ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql -/ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql -/ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql -/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql -/ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql -/ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql -/ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql -/ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql -/ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql -/ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql -/ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql -/ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql -/ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql -/ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql -/ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql -/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql -/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql -/ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql -/ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql -/ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql -/ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql -/ql/java/ql/src/Security/CWE/CWE-611/XXE.ql -/ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql -/ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql -/ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql -/ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql -/ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql -/ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql -/ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql -/ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql -/ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql -/ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql -/ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql -/ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql -/ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql -/ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql -/ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql -/ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql -/ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql -/ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql -/ql/java/ql/src/Telemetry/ExtractorInformation.ql -/ql/java/ql/src/Telemetry/SupportedExternalApis.ql -/ql/java/ql/src/Telemetry/SupportedExternalSinks.ql -/ql/java/ql/src/Telemetry/SupportedExternalSources.ql -/ql/java/ql/src/Telemetry/SupportedExternalTaint.ql -/ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql +ql/java/ql/src/Diagnostics/ExtractionErrors.ql +ql/java/ql/src/Diagnostics/ExtractionWarnings.ql +ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql +ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql +ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql +ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql +ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql +ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql +ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql +ql/java/ql/src/Security/CWE/CWE-079/XSS.ql +ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql +ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql +ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql +ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql +ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql +ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql +ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql +ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql +ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql +ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql +ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql +ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql +ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql +ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql +ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql +ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql +ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql +ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql +ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql +ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql +ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql +ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql +ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql +ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql +ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql +ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql +ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql +ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql +ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql +ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql +ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql +ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql +ql/java/ql/src/Security/CWE/CWE-611/XXE.ql +ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql +ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql +ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql +ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql +ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql +ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql +ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql +ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql +ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql +ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql +ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql +ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql +ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql +ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql +ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql +ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql +ql/java/ql/src/Telemetry/ExtractorInformation.ql +ql/java/ql/src/Telemetry/SupportedExternalApis.ql +ql/java/ql/src/Telemetry/SupportedExternalSinks.ql +ql/java/ql/src/Telemetry/SupportedExternalSources.ql +ql/java/ql/src/Telemetry/SupportedExternalTaint.ql +ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql diff --git a/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected index 7da7bc5119e..85d7e7d0960 100644 --- a/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-security-and-quality.qls.expected @@ -1,243 +1,243 @@ -/ql/java/ql/src/Advisory/Declarations/MissingOverrideAnnotation.ql -/ql/java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.ql -/ql/java/ql/src/Advisory/Documentation/ImpossibleJavadocThrows.ql -/ql/java/ql/src/Advisory/Documentation/SpuriousJavadocParam.ql -/ql/java/ql/src/Compatibility/JDK9/JdkInternalAccess.ql -/ql/java/ql/src/Compatibility/JDK9/UnderscoreIdentifier.ql -/ql/java/ql/src/DeadCode/UselessParameter.ql -/ql/java/ql/src/Diagnostics/ExtractionErrors.ql -/ql/java/ql/src/Diagnostics/ExtractionWarnings.ql -/ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql -/ql/java/ql/src/Language Abuse/ChainedInstanceof.ql -/ql/java/ql/src/Language Abuse/IterableIterator.ql -/ql/java/ql/src/Language Abuse/OverridePackagePrivate.ql -/ql/java/ql/src/Language Abuse/TypeVarExtendsFinalType.ql -/ql/java/ql/src/Language Abuse/TypeVariableHidesType.ql -/ql/java/ql/src/Language Abuse/UselessNullCheck.ql -/ql/java/ql/src/Language Abuse/UselessTypeTest.ql -/ql/java/ql/src/Language Abuse/WrappedIterator.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/BadAbsOfRandom.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/LShiftLargerThanTypeWidth.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/MultiplyRemainder.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/RandomUsedOnce.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql -/ql/java/ql/src/Likely Bugs/Cloning/MissingCallToSuperClone.ql -/ql/java/ql/src/Likely Bugs/Cloning/MissingMethodClone.ql -/ql/java/ql/src/Likely Bugs/Collections/ArrayIndexOutOfBounds.ql -/ql/java/ql/src/Likely Bugs/Collections/ContainsTypeMismatch.ql -/ql/java/ql/src/Likely Bugs/Collections/IteratorRemoveMayFail.ql -/ql/java/ql/src/Likely Bugs/Collections/ReadOnlyContainer.ql -/ql/java/ql/src/Likely Bugs/Collections/RemoveTypeMismatch.ql -/ql/java/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql -/ql/java/ql/src/Likely Bugs/Comparison/CompareIdenticalValues.ql -/ql/java/ql/src/Likely Bugs/Comparison/CovariantCompareTo.ql -/ql/java/ql/src/Likely Bugs/Comparison/CovariantEquals.ql -/ql/java/ql/src/Likely Bugs/Comparison/EqualsArray.ql -/ql/java/ql/src/Likely Bugs/Comparison/HashedButNoHash.ql -/ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql -/ql/java/ql/src/Likely Bugs/Comparison/InconsistentCompareTo.ql -/ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql -/ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql -/ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql -/ql/java/ql/src/Likely Bugs/Comparison/StringComparison.ql -/ql/java/ql/src/Likely Bugs/Comparison/UselessComparisonTest.ql -/ql/java/ql/src/Likely Bugs/Comparison/WrongNanComparison.ql -/ql/java/ql/src/Likely Bugs/Concurrency/CallsToConditionWait.ql -/ql/java/ql/src/Likely Bugs/Concurrency/CallsToRunnableRun.ql -/ql/java/ql/src/Likely Bugs/Concurrency/DateFormatThreadUnsafe.ql -/ql/java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLocking.ql -/ql/java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLockingWithInitRace.ql -/ql/java/ql/src/Likely Bugs/Concurrency/FutileSynchOnField.ql -/ql/java/ql/src/Likely Bugs/Concurrency/NonSynchronizedOverride.ql -/ql/java/ql/src/Likely Bugs/Concurrency/NotifyNotNotifyAll.ql -/ql/java/ql/src/Likely Bugs/Concurrency/SleepWithLock.ql -/ql/java/ql/src/Likely Bugs/Concurrency/StartInConstructor.ql -/ql/java/ql/src/Likely Bugs/Concurrency/SynchOnBoxedType.ql -/ql/java/ql/src/Likely Bugs/Concurrency/SynchSetUnsynchGet.ql -/ql/java/ql/src/Likely Bugs/Concurrency/SynchWriteObject.ql -/ql/java/ql/src/Likely Bugs/Concurrency/UnreleasedLock.ql -/ql/java/ql/src/Likely Bugs/Finalization/NullifiedSuperFinalize.ql -/ql/java/ql/src/Likely Bugs/Frameworks/JUnit/BadSuiteMethod.ql -/ql/java/ql/src/Likely Bugs/Frameworks/Swing/BadlyOverriddenAdapter.ql -/ql/java/ql/src/Likely Bugs/Inheritance/NoNonFinalInConstructor.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/ContainerSizeCmpZero.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/DangerousNonCircuitLogic.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/EqualsTypo.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/HashCodeTypo.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/MissingFormatArg.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/MissingSpaceTypo.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/SelfAssignment.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/StringBufferCharInit.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/ToStringTypo.ql -/ql/java/ql/src/Likely Bugs/Likely Typos/UnusedFormatArg.ql -/ql/java/ql/src/Likely Bugs/Nullness/NullAlways.ql -/ql/java/ql/src/Likely Bugs/Nullness/NullExprDeref.ql -/ql/java/ql/src/Likely Bugs/Nullness/NullMaybe.ql -/ql/java/ql/src/Likely Bugs/Reflection/AnnotationPresentCheck.ql -/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql -/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseSql.ql -/ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql -/ql/java/ql/src/Likely Bugs/Serialization/IncorrectSerialVersionUID.ql -/ql/java/ql/src/Likely Bugs/Serialization/IncorrectSerializableMethods.ql -/ql/java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorOnExternalizable.ql -/ql/java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorsOnSerializable.ql -/ql/java/ql/src/Likely Bugs/Serialization/NonSerializableInnerClass.ql -/ql/java/ql/src/Likely Bugs/Serialization/ReadResolveObject.ql -/ql/java/ql/src/Likely Bugs/Statements/ContinueInFalseLoop.ql -/ql/java/ql/src/Likely Bugs/Statements/MissingEnumInSwitch.ql -/ql/java/ql/src/Likely Bugs/Statements/PartiallyMaskedCatch.ql -/ql/java/ql/src/Likely Bugs/Statements/UseBraces.ql -/ql/java/ql/src/Likely Bugs/Termination/ConstantLoopCondition.ql -/ql/java/ql/src/Likely Bugs/Termination/SpinOnField.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql -/ql/java/ql/src/Performance/InefficientEmptyStringTest.ql -/ql/java/ql/src/Performance/InefficientKeySetIterator.ql -/ql/java/ql/src/Performance/InefficientOutputStream.ql -/ql/java/ql/src/Performance/InefficientPrimConstructor.ql -/ql/java/ql/src/Performance/InnerClassCouldBeStatic.ql -/ql/java/ql/src/Performance/NewStringString.ql -/ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql -/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql -/ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql -/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql -/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql -/ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql -/ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecRelative.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql -/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewAddJavascriptInterface.ql -/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql -/ql/java/ql/src/Security/CWE/CWE-079/XSS.ql -/ql/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql -/ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql -/ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/ArbitraryApkInstallation.ql -/ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql -/ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql -/ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql -/ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql -/ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql -/ql/java/ql/src/Security/CWE/CWE-117/LogInjection.ql -/ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql -/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql -/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql -/ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql -/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql -/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql -/ql/java/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveNotifications.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveTextField.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsAllowsContentAccess.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql -/ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql -/ql/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql -/ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql -/ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql -/ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql -/ql/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql -/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql -/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql -/ql/java/ql/src/Security/CWE/CWE-295/AndroidMissingCertificatePinning.ql -/ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql -/ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql -/ql/java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql -/ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql -/ql/java/ql/src/Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageProperties.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.ql -/ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql -/ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql -/ql/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql -/ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql -/ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql -/ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql -/ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql -/ql/java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.ql -/ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql -/ql/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql -/ql/java/ql/src/Security/CWE/CWE-421/SocketAuthRace.ql -/ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql -/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql -/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql -/ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql -/ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql -/ql/java/ql/src/Security/CWE/CWE-522/InsecureBasicAuth.ql -/ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql -/ql/java/ql/src/Security/CWE/CWE-524/SensitiveKeyboardCache.ql -/ql/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql -/ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql -/ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql -/ql/java/ql/src/Security/CWE/CWE-611/XXE.ql -/ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql -/ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql -/ql/java/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql -/ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql -/ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql -/ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql -/ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql -/ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql -/ql/java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql -/ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql -/ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql -/ql/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql -/ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql -/ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql -/ql/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql -/ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql -/ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql -/ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql -/ql/java/ql/src/Security/CWE/CWE-926/ContentProviderIncompletePermissions.ql -/ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql -/ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql -/ql/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql -/ql/java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql -/ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql -/ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql -/ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql -/ql/java/ql/src/Telemetry/ExtractorInformation.ql -/ql/java/ql/src/Telemetry/SupportedExternalApis.ql -/ql/java/ql/src/Telemetry/SupportedExternalSinks.ql -/ql/java/ql/src/Telemetry/SupportedExternalSources.ql -/ql/java/ql/src/Telemetry/SupportedExternalTaint.ql -/ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql -/ql/java/ql/src/Violations of Best Practice/Boxed Types/BoxedVariable.ql -/ql/java/ql/src/Violations of Best Practice/Dead Code/CreatesEmptyZip.ql -/ql/java/ql/src/Violations of Best Practice/Dead Code/DeadRefTypes.ql -/ql/java/ql/src/Violations of Best Practice/Dead Code/InterfaceCannotBeImplemented.ql -/ql/java/ql/src/Violations of Best Practice/Dead Code/UnreadLocal.ql -/ql/java/ql/src/Violations of Best Practice/Dead Code/UnusedLabel.ql -/ql/java/ql/src/Violations of Best Practice/Declarations/NoConstantsOnly.ql -/ql/java/ql/src/Violations of Best Practice/Exception Handling/IgnoreExceptionalReturn.ql -/ql/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql -/ql/java/ql/src/Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql -/ql/java/ql/src/Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql -/ql/java/ql/src/Violations of Best Practice/Implementation Hiding/GetClassGetResource.ql -/ql/java/ql/src/Violations of Best Practice/Naming Conventions/AmbiguousOuterSuper.ql -/ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingMethodNames.ql -/ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql -/ql/java/ql/src/Violations of Best Practice/Naming Conventions/FieldMasksSuperField.ql -/ql/java/ql/src/Violations of Best Practice/Naming Conventions/LocalShadowsFieldConfusing.ql -/ql/java/ql/src/Violations of Best Practice/Naming Conventions/SameNameAsSuper.ql -/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToRunFinalizersOnExit.ql -/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToStringToString.ql -/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/DefaultToString.ql -/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/NextFromIterator.ql -/ql/java/ql/src/Violations of Best Practice/Undesirable Calls/PrintLnArray.ql +ql/java/ql/src/Advisory/Declarations/MissingOverrideAnnotation.ql +ql/java/ql/src/Advisory/Deprecated Code/AvoidDeprecatedCallableAccess.ql +ql/java/ql/src/Advisory/Documentation/ImpossibleJavadocThrows.ql +ql/java/ql/src/Advisory/Documentation/SpuriousJavadocParam.ql +ql/java/ql/src/Compatibility/JDK9/JdkInternalAccess.ql +ql/java/ql/src/Compatibility/JDK9/UnderscoreIdentifier.ql +ql/java/ql/src/DeadCode/UselessParameter.ql +ql/java/ql/src/Diagnostics/ExtractionErrors.ql +ql/java/ql/src/Diagnostics/ExtractionWarnings.ql +ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +ql/java/ql/src/Language Abuse/ChainedInstanceof.ql +ql/java/ql/src/Language Abuse/IterableIterator.ql +ql/java/ql/src/Language Abuse/OverridePackagePrivate.ql +ql/java/ql/src/Language Abuse/TypeVarExtendsFinalType.ql +ql/java/ql/src/Language Abuse/TypeVariableHidesType.ql +ql/java/ql/src/Language Abuse/UselessNullCheck.ql +ql/java/ql/src/Language Abuse/UselessTypeTest.ql +ql/java/ql/src/Language Abuse/WrappedIterator.ql +ql/java/ql/src/Likely Bugs/Arithmetic/BadAbsOfRandom.ql +ql/java/ql/src/Likely Bugs/Arithmetic/ConstantExpAppearsNonConstant.ql +ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql +ql/java/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql +ql/java/ql/src/Likely Bugs/Arithmetic/LShiftLargerThanTypeWidth.ql +ql/java/ql/src/Likely Bugs/Arithmetic/MultiplyRemainder.ql +ql/java/ql/src/Likely Bugs/Arithmetic/RandomUsedOnce.ql +ql/java/ql/src/Likely Bugs/Arithmetic/WhitespaceContradictsPrecedence.ql +ql/java/ql/src/Likely Bugs/Cloning/MissingCallToSuperClone.ql +ql/java/ql/src/Likely Bugs/Cloning/MissingMethodClone.ql +ql/java/ql/src/Likely Bugs/Collections/ArrayIndexOutOfBounds.ql +ql/java/ql/src/Likely Bugs/Collections/ContainsTypeMismatch.ql +ql/java/ql/src/Likely Bugs/Collections/IteratorRemoveMayFail.ql +ql/java/ql/src/Likely Bugs/Collections/ReadOnlyContainer.ql +ql/java/ql/src/Likely Bugs/Collections/RemoveTypeMismatch.ql +ql/java/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql +ql/java/ql/src/Likely Bugs/Comparison/CompareIdenticalValues.ql +ql/java/ql/src/Likely Bugs/Comparison/CovariantCompareTo.ql +ql/java/ql/src/Likely Bugs/Comparison/CovariantEquals.ql +ql/java/ql/src/Likely Bugs/Comparison/EqualsArray.ql +ql/java/ql/src/Likely Bugs/Comparison/HashedButNoHash.ql +ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql +ql/java/ql/src/Likely Bugs/Comparison/InconsistentCompareTo.ql +ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql +ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql +ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql +ql/java/ql/src/Likely Bugs/Comparison/StringComparison.ql +ql/java/ql/src/Likely Bugs/Comparison/UselessComparisonTest.ql +ql/java/ql/src/Likely Bugs/Comparison/WrongNanComparison.ql +ql/java/ql/src/Likely Bugs/Concurrency/CallsToConditionWait.ql +ql/java/ql/src/Likely Bugs/Concurrency/CallsToRunnableRun.ql +ql/java/ql/src/Likely Bugs/Concurrency/DateFormatThreadUnsafe.ql +ql/java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLocking.ql +ql/java/ql/src/Likely Bugs/Concurrency/DoubleCheckedLockingWithInitRace.ql +ql/java/ql/src/Likely Bugs/Concurrency/FutileSynchOnField.ql +ql/java/ql/src/Likely Bugs/Concurrency/NonSynchronizedOverride.ql +ql/java/ql/src/Likely Bugs/Concurrency/NotifyNotNotifyAll.ql +ql/java/ql/src/Likely Bugs/Concurrency/SleepWithLock.ql +ql/java/ql/src/Likely Bugs/Concurrency/StartInConstructor.ql +ql/java/ql/src/Likely Bugs/Concurrency/SynchOnBoxedType.ql +ql/java/ql/src/Likely Bugs/Concurrency/SynchSetUnsynchGet.ql +ql/java/ql/src/Likely Bugs/Concurrency/SynchWriteObject.ql +ql/java/ql/src/Likely Bugs/Concurrency/UnreleasedLock.ql +ql/java/ql/src/Likely Bugs/Finalization/NullifiedSuperFinalize.ql +ql/java/ql/src/Likely Bugs/Frameworks/JUnit/BadSuiteMethod.ql +ql/java/ql/src/Likely Bugs/Frameworks/Swing/BadlyOverriddenAdapter.ql +ql/java/ql/src/Likely Bugs/Inheritance/NoNonFinalInConstructor.ql +ql/java/ql/src/Likely Bugs/Likely Typos/ContainerSizeCmpZero.ql +ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql +ql/java/ql/src/Likely Bugs/Likely Typos/DangerousNonCircuitLogic.ql +ql/java/ql/src/Likely Bugs/Likely Typos/EqualsTypo.ql +ql/java/ql/src/Likely Bugs/Likely Typos/HashCodeTypo.ql +ql/java/ql/src/Likely Bugs/Likely Typos/MissingFormatArg.ql +ql/java/ql/src/Likely Bugs/Likely Typos/MissingSpaceTypo.ql +ql/java/ql/src/Likely Bugs/Likely Typos/SelfAssignment.ql +ql/java/ql/src/Likely Bugs/Likely Typos/StringBufferCharInit.ql +ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql +ql/java/ql/src/Likely Bugs/Likely Typos/ToStringTypo.ql +ql/java/ql/src/Likely Bugs/Likely Typos/UnusedFormatArg.ql +ql/java/ql/src/Likely Bugs/Nullness/NullAlways.ql +ql/java/ql/src/Likely Bugs/Nullness/NullExprDeref.ql +ql/java/ql/src/Likely Bugs/Nullness/NullMaybe.ql +ql/java/ql/src/Likely Bugs/Reflection/AnnotationPresentCheck.ql +ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql +ql/java/ql/src/Likely Bugs/Resource Leaks/CloseSql.ql +ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql +ql/java/ql/src/Likely Bugs/Serialization/IncorrectSerialVersionUID.ql +ql/java/ql/src/Likely Bugs/Serialization/IncorrectSerializableMethods.ql +ql/java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorOnExternalizable.ql +ql/java/ql/src/Likely Bugs/Serialization/MissingVoidConstructorsOnSerializable.ql +ql/java/ql/src/Likely Bugs/Serialization/NonSerializableInnerClass.ql +ql/java/ql/src/Likely Bugs/Serialization/ReadResolveObject.ql +ql/java/ql/src/Likely Bugs/Statements/ContinueInFalseLoop.ql +ql/java/ql/src/Likely Bugs/Statements/MissingEnumInSwitch.ql +ql/java/ql/src/Likely Bugs/Statements/PartiallyMaskedCatch.ql +ql/java/ql/src/Likely Bugs/Statements/UseBraces.ql +ql/java/ql/src/Likely Bugs/Termination/ConstantLoopCondition.ql +ql/java/ql/src/Likely Bugs/Termination/SpinOnField.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql +ql/java/ql/src/Performance/InefficientEmptyStringTest.ql +ql/java/ql/src/Performance/InefficientKeySetIterator.ql +ql/java/ql/src/Performance/InefficientOutputStream.ql +ql/java/ql/src/Performance/InefficientPrimConstructor.ql +ql/java/ql/src/Performance/InnerClassCouldBeStatic.ql +ql/java/ql/src/Performance/NewStringString.ql +ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql +ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql +ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql +ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql +ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql +ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql +ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecRelative.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql +ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewAddJavascriptInterface.ql +ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql +ql/java/ql/src/Security/CWE/CWE-079/XSS.ql +ql/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql +ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql +ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/ArbitraryApkInstallation.ql +ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql +ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql +ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql +ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql +ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql +ql/java/ql/src/Security/CWE/CWE-117/LogInjection.ql +ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql +ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql +ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql +ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql +ql/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql +ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql +ql/java/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveNotifications.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveTextField.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsAllowsContentAccess.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql +ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql +ql/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql +ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql +ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql +ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql +ql/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql +ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql +ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql +ql/java/ql/src/Security/CWE/CWE-295/AndroidMissingCertificatePinning.ql +ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql +ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql +ql/java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql +ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql +ql/java/ql/src/Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageProperties.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.ql +ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql +ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql +ql/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql +ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql +ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql +ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql +ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql +ql/java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.ql +ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql +ql/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql +ql/java/ql/src/Security/CWE/CWE-421/SocketAuthRace.ql +ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql +ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql +ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql +ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql +ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql +ql/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql +ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql +ql/java/ql/src/Security/CWE/CWE-522/InsecureBasicAuth.ql +ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql +ql/java/ql/src/Security/CWE/CWE-524/SensitiveKeyboardCache.ql +ql/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql +ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql +ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql +ql/java/ql/src/Security/CWE/CWE-611/XXE.ql +ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql +ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql +ql/java/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql +ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql +ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql +ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql +ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql +ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql +ql/java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql +ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql +ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql +ql/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql +ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql +ql/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql +ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql +ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql +ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql +ql/java/ql/src/Security/CWE/CWE-926/ContentProviderIncompletePermissions.ql +ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql +ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql +ql/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql +ql/java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql +ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql +ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql +ql/java/ql/src/Telemetry/ExtractorInformation.ql +ql/java/ql/src/Telemetry/SupportedExternalApis.ql +ql/java/ql/src/Telemetry/SupportedExternalSinks.ql +ql/java/ql/src/Telemetry/SupportedExternalSources.ql +ql/java/ql/src/Telemetry/SupportedExternalTaint.ql +ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql +ql/java/ql/src/Violations of Best Practice/Boxed Types/BoxedVariable.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/CreatesEmptyZip.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/DeadRefTypes.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/InterfaceCannotBeImplemented.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/UnreadLocal.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/UnusedLabel.ql +ql/java/ql/src/Violations of Best Practice/Declarations/NoConstantsOnly.ql +ql/java/ql/src/Violations of Best Practice/Exception Handling/IgnoreExceptionalReturn.ql +ql/java/ql/src/Violations of Best Practice/Exception Handling/NumberFormatException.ql +ql/java/ql/src/Violations of Best Practice/Implementation Hiding/AbstractToConcreteCollection.ql +ql/java/ql/src/Violations of Best Practice/Implementation Hiding/ExposeRepresentation.ql +ql/java/ql/src/Violations of Best Practice/Implementation Hiding/GetClassGetResource.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/AmbiguousOuterSuper.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingMethodNames.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/FieldMasksSuperField.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/LocalShadowsFieldConfusing.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/SameNameAsSuper.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToRunFinalizersOnExit.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToStringToString.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/DefaultToString.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/NextFromIterator.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/PrintLnArray.ql diff --git a/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected b/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected index adcdc17c6c1..d5f4cbf1ccc 100644 --- a/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-security-extended.qls.expected @@ -1,123 +1,123 @@ -/ql/java/ql/src/Diagnostics/ExtractionErrors.ql -/ql/java/ql/src/Diagnostics/ExtractionWarnings.ql -/ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql -/ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql -/ql/java/ql/src/Likely Bugs/Concurrency/UnreleasedLock.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql -/ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql -/ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql -/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql -/ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql -/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql -/ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql -/ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql -/ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecRelative.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql -/ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql -/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewAddJavascriptInterface.ql -/ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql -/ql/java/ql/src/Security/CWE/CWE-079/XSS.ql -/ql/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql -/ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql -/ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/ArbitraryApkInstallation.ql -/ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql -/ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql -/ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql -/ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql -/ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql -/ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql -/ql/java/ql/src/Security/CWE/CWE-117/LogInjection.ql -/ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql -/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql -/ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql -/ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql -/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql -/ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql -/ql/java/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveNotifications.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveTextField.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsAllowsContentAccess.ql -/ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql -/ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql -/ql/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql -/ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql -/ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql -/ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql -/ql/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql -/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql -/ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql -/ql/java/ql/src/Security/CWE/CWE-295/AndroidMissingCertificatePinning.ql -/ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql -/ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql -/ql/java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql -/ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql -/ql/java/ql/src/Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageProperties.ql -/ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.ql -/ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql -/ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql -/ql/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql -/ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql -/ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql -/ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql -/ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql -/ql/java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.ql -/ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql -/ql/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql -/ql/java/ql/src/Security/CWE/CWE-421/SocketAuthRace.ql -/ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql -/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql -/ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql -/ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql -/ql/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql -/ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql -/ql/java/ql/src/Security/CWE/CWE-522/InsecureBasicAuth.ql -/ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql -/ql/java/ql/src/Security/CWE/CWE-524/SensitiveKeyboardCache.ql -/ql/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql -/ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql -/ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql -/ql/java/ql/src/Security/CWE/CWE-611/XXE.ql -/ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql -/ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql -/ql/java/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql -/ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql -/ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql -/ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql -/ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql -/ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql -/ql/java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql -/ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql -/ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql -/ql/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql -/ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql -/ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql -/ql/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql -/ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql -/ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql -/ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql -/ql/java/ql/src/Security/CWE/CWE-926/ContentProviderIncompletePermissions.ql -/ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql -/ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql -/ql/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql -/ql/java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql -/ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql -/ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql -/ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql -/ql/java/ql/src/Telemetry/ExtractorInformation.ql -/ql/java/ql/src/Telemetry/SupportedExternalApis.ql -/ql/java/ql/src/Telemetry/SupportedExternalSinks.ql -/ql/java/ql/src/Telemetry/SupportedExternalSources.ql -/ql/java/ql/src/Telemetry/SupportedExternalTaint.ql -/ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql +ql/java/ql/src/Diagnostics/ExtractionErrors.ql +ql/java/ql/src/Diagnostics/ExtractionWarnings.ql +ql/java/ql/src/Diagnostics/SuccessfullyExtractedFiles.ql +ql/java/ql/src/Likely Bugs/Arithmetic/InformationLoss.ql +ql/java/ql/src/Likely Bugs/Concurrency/UnreleasedLock.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCode.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCodeJava.ql +ql/java/ql/src/Metrics/Summaries/LinesOfCodeKotlin.ql +ql/java/ql/src/Security/CWE/CWE-020/OverlyLargeRange.ql +ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql +ql/java/ql/src/Security/CWE/CWE-022/ZipSlip.ql +ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql +ql/java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql +ql/java/ql/src/Security/CWE/CWE-074/JndiInjection.ql +ql/java/ql/src/Security/CWE/CWE-074/XsltInjection.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecRelative.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecTainted.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecTaintedEnvironment.ql +ql/java/ql/src/Security/CWE/CWE-078/ExecUnescaped.ql +ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewAddJavascriptInterface.ql +ql/java/ql/src/Security/CWE/CWE-079/AndroidWebViewSettingsEnabledJavaScript.ql +ql/java/ql/src/Security/CWE/CWE-079/XSS.ql +ql/java/ql/src/Security/CWE/CWE-089/SqlConcatenated.ql +ql/java/ql/src/Security/CWE/CWE-089/SqlTainted.ql +ql/java/ql/src/Security/CWE/CWE-090/LdapInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/ArbitraryApkInstallation.ql +ql/java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql +ql/java/ql/src/Security/CWE/CWE-094/JexlInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/MvelInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/SpelInjection.ql +ql/java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql +ql/java/ql/src/Security/CWE/CWE-1104/MavenPomDependsOnBintray.ql +ql/java/ql/src/Security/CWE/CWE-113/NettyResponseSplitting.ql +ql/java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql +ql/java/ql/src/Security/CWE/CWE-117/LogInjection.ql +ql/java/ql/src/Security/CWE/CWE-1204/StaticInitializationVector.ql +ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql +ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql +ql/java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql +ql/java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql +ql/java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql +ql/java/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveNotifications.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidSensitiveTextField.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsAllowsContentAccess.ql +ql/java/ql/src/Security/CWE/CWE-200/AndroidWebViewSettingsFileAccess.ql +ql/java/ql/src/Security/CWE/CWE-200/SpringBootActuators.ql +ql/java/ql/src/Security/CWE/CWE-200/TempDirLocalInformationDisclosure.ql +ql/java/ql/src/Security/CWE/CWE-209/SensitiveDataExposureThroughErrorMessage.ql +ql/java/ql/src/Security/CWE/CWE-209/StackTraceExposure.ql +ql/java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql +ql/java/ql/src/Security/CWE/CWE-273/UnsafeCertTrust.ql +ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureKeys.ql +ql/java/ql/src/Security/CWE/CWE-287/AndroidInsecureLocalAuthentication.ql +ql/java/ql/src/Security/CWE/CWE-295/AndroidMissingCertificatePinning.ql +ql/java/ql/src/Security/CWE/CWE-295/ImproperWebViewCertificateValidation.ql +ql/java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql +ql/java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql +ql/java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql +ql/java/ql/src/Security/CWE/CWE-312/AllowBackupAttributeEnabled.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageCookie.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageProperties.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.ql +ql/java/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql +ql/java/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql +ql/java/ql/src/Security/CWE/CWE-327/MaybeBrokenCryptoAlgorithm.ql +ql/java/ql/src/Security/CWE/CWE-330/InsecureRandomness.ql +ql/java/ql/src/Security/CWE/CWE-335/PredictableSeed.ql +ql/java/ql/src/Security/CWE/CWE-338/JHipsterGeneratedPRNG.ql +ql/java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql +ql/java/ql/src/Security/CWE/CWE-352/CsrfUnprotectedRequestType.ql +ql/java/ql/src/Security/CWE/CWE-352/SpringCSRFProtection.ql +ql/java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql +ql/java/ql/src/Security/CWE/CWE-421/SocketAuthRace.ql +ql/java/ql/src/Security/CWE/CWE-441/UnsafeContentUriResolution.ql +ql/java/ql/src/Security/CWE/CWE-470/FragmentInjection.ql +ql/java/ql/src/Security/CWE/CWE-470/FragmentInjectionInPreferenceActivity.ql +ql/java/ql/src/Security/CWE/CWE-489/DebuggableAttributeEnabled.ql +ql/java/ql/src/Security/CWE/CWE-489/WebviewDebuggingEnabled.ql +ql/java/ql/src/Security/CWE/CWE-501/TrustBoundaryViolation.ql +ql/java/ql/src/Security/CWE/CWE-502/UnsafeDeserialization.ql +ql/java/ql/src/Security/CWE/CWE-522/InsecureBasicAuth.ql +ql/java/ql/src/Security/CWE/CWE-522/InsecureLdapAuth.ql +ql/java/ql/src/Security/CWE/CWE-524/SensitiveKeyboardCache.ql +ql/java/ql/src/Security/CWE/CWE-532/SensitiveInfoLog.ql +ql/java/ql/src/Security/CWE/CWE-552/UrlForward.ql +ql/java/ql/src/Security/CWE/CWE-601/UrlRedirect.ql +ql/java/ql/src/Security/CWE/CWE-611/XXE.ql +ql/java/ql/src/Security/CWE/CWE-614/InsecureCookie.ql +ql/java/ql/src/Security/CWE/CWE-643/XPathInjection.ql +ql/java/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql +ql/java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql +ql/java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.ql +ql/java/ql/src/Security/CWE/CWE-730/ReDoS.ql +ql/java/ql/src/Security/CWE/CWE-730/RegexInjection.ql +ql/java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql +ql/java/ql/src/Security/CWE/CWE-749/UnsafeAndroidAccess.ql +ql/java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql +ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsApiCall.ql +ql/java/ql/src/Security/CWE/CWE-807/ConditionalBypass.ql +ql/java/ql/src/Security/CWE/CWE-807/TaintedPermissionsCheck.ql +ql/java/ql/src/Security/CWE/CWE-829/InsecureDependencyResolution.ql +ql/java/ql/src/Security/CWE/CWE-835/InfiniteLoop.ql +ql/java/ql/src/Security/CWE/CWE-917/OgnlInjection.ql +ql/java/ql/src/Security/CWE/CWE-918/RequestForgery.ql +ql/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql +ql/java/ql/src/Security/CWE/CWE-926/ContentProviderIncompletePermissions.ql +ql/java/ql/src/Security/CWE/CWE-926/ImplicitlyExportedAndroidComponent.ql +ql/java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql +ql/java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.ql +ql/java/ql/src/Security/CWE/CWE-927/SensitiveResultReceiver.ql +ql/java/ql/src/Security/CWE/CWE-940/AndroidIntentRedirection.ql +ql/java/ql/src/Telemetry/DatabaseQualityDiagnostics.ql +ql/java/ql/src/Telemetry/ExternalLibraryUsage.ql +ql/java/ql/src/Telemetry/ExtractorInformation.ql +ql/java/ql/src/Telemetry/SupportedExternalApis.ql +ql/java/ql/src/Telemetry/SupportedExternalSinks.ql +ql/java/ql/src/Telemetry/SupportedExternalSources.ql +ql/java/ql/src/Telemetry/SupportedExternalTaint.ql +ql/java/ql/src/Telemetry/UnsupportedExternalAPIs.ql diff --git a/java/ql/integration-tests/java/query-suite/test.py b/java/ql/integration-tests/java/query-suite/test.py index 9a95a808998..c829eb9ffa0 100644 --- a/java/ql/integration-tests/java/query-suite/test.py +++ b/java/ql/integration-tests/java/query-suite/test.py @@ -1,15 +1,13 @@ +import os import runs_on +import pytest @runs_on.linux -def test(codeql, java, cwd, expected_files, semmle_code_dir): - query_suites = ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls'] - - for query_suite in query_suites: +@pytest.mark.parametrize("query_suite", ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls']) +def test(codeql, java, cwd, expected_files, semmle_code_dir, query_suite): actual = codeql.resolve.queries(query_suite, _capture=True).strip() - actual = sorted(actual.split('\n')) - print(semmle_code_dir) - index = len(str(semmle_code_dir)) - actual = [line[index:] for line in actual] + actual = sorted(actual.splitlines()) + actual = [os.path.relpath(q, semmle_code_dir) for q in actual] actual_file_name = query_suite + '.actual' expected_files.add(actual_file_name) (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') From e23ff9cf3eeca835094d64da502ace1b63403b2a Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 12:55:58 +0200 Subject: [PATCH 094/372] Add TypedArrays flow summaries for `Uint8Array` and buffer property --- .../flow_summaries/AllFlowSummaries.qll | 1 + .../internal/flow_summaries/TypedArrays.qll | 38 +++++++++++++++++++ .../TaintTracking/BasicTaintTracking.expected | 9 +++-- .../DecompressionBombs.expected | 5 +++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll index 940180d80cb..20247b7e268 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll @@ -12,3 +12,4 @@ private import Sets private import Strings private import DynamicImportStep private import UrlSearchParams +private import TypedArrays diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll new file mode 100644 index 00000000000..788992d7c1c --- /dev/null +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll @@ -0,0 +1,38 @@ +private import javascript +private import semmle.javascript.dataflow.FlowSummary +private import semmle.javascript.dataflow.InferredTypes +private import semmle.javascript.dataflow.internal.DataFlowPrivate as Private +private import FlowSummaryUtil + +private class TypedArrayEntryPoint extends API::EntryPoint { + TypedArrayEntryPoint() { this = "global.Uint8Array" } + + override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("Uint8Array") } +} + +pragma[nomagic] +API::Node typedArrayConstructorRef() { result = any(TypedArrayEntryPoint e).getANode() } + +class TypedArrayConstructorSummary extends SummarizedCallable { + TypedArrayConstructorSummary() { this = "TypedArray constructor" } + + override DataFlow::InvokeNode getACall() { + result = typedArrayConstructorRef().getAnInstantiation() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[0].ArrayElement" and + output = "ReturnValue.ArrayElement" + } +} + +class BufferTypedArray extends DataFlow::AdditionalFlowStep { + override predicate step(DataFlow::Node pred, DataFlow::Node succ) { + exists(DataFlow::PropRead p | + p = typedArrayConstructorRef().getInstance().getMember("buffer").asSource() and + pred = p.getBase() and + succ = p + ) + } +} diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index b16953795b1..14ae297b4fd 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -35,14 +35,14 @@ legacyDataFlowDifference | spread.js:4:15:4:22 | source() | spread.js:18:8:18:8 | y | only flow with NEW data flow library | | spread.js:4:15:4:22 | source() | spread.js:24:8:24:8 | y | only flow with NEW data flow library | | tst.js:2:13:2:20 | source() | tst.js:17:10:17:10 | a | only flow with OLD data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:5:10:5:10 | y | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:7:10:7:17 | y.buffer | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:5 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:7 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:11 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -328,6 +328,9 @@ flow | tst.js:87:22:87:29 | source() | tst.js:90:14:90:25 | taintedValue | | tst.js:93:22:93:29 | source() | tst.js:96:14:96:25 | taintedValue | | tst.js:93:22:93:29 | source() | tst.js:97:14:97:26 | map.get(true) | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:5:10:5:10 | y | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:7:10:7:17 | y.buffer | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | | xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text | diff --git a/javascript/ql/test/query-tests/Security/CWE-522-DecompressionBombs/DecompressionBombs.expected b/javascript/ql/test/query-tests/Security/CWE-522-DecompressionBombs/DecompressionBombs.expected index 56acd539012..11c63c257e8 100644 --- a/javascript/ql/test/query-tests/Security/CWE-522-DecompressionBombs/DecompressionBombs.expected +++ b/javascript/ql/test/query-tests/Security/CWE-522-DecompressionBombs/DecompressionBombs.expected @@ -81,9 +81,12 @@ edges | pako.js:18:48:18:66 | zipFile.data.buffer | pako.js:18:33:18:67 | new Uin ... buffer) | provenance | Config | | pako.js:28:19:28:25 | zipFile | pako.js:29:36:29:42 | zipFile | provenance | | | pako.js:29:11:29:62 | myArray | pako.js:32:31:32:37 | myArray | provenance | | +| pako.js:29:11:29:62 | myArray [ArrayElement] | pako.js:32:31:32:37 | myArray | provenance | | | pako.js:29:21:29:55 | new Uin ... buffer) | pako.js:29:11:29:62 | myArray | provenance | | +| pako.js:29:21:29:55 | new Uin ... buffer) [ArrayElement] | pako.js:29:11:29:62 | myArray [ArrayElement] | provenance | | | pako.js:29:36:29:42 | zipFile | pako.js:29:36:29:54 | zipFile.data.buffer | provenance | | | pako.js:29:36:29:54 | zipFile.data.buffer | pako.js:29:21:29:55 | new Uin ... buffer) | provenance | Config | +| pako.js:29:36:29:54 | zipFile.data.buffer | pako.js:29:21:29:55 | new Uin ... buffer) [ArrayElement] | provenance | | | unbzip2.js:12:5:12:43 | fs.crea ... lePath) | unbzip2.js:12:50:12:54 | bz2() | provenance | Config | | unbzip2.js:12:25:12:42 | req.query.FilePath | unbzip2.js:12:5:12:43 | fs.crea ... lePath) | provenance | Config | | unzipper.js:13:26:13:62 | Readabl ... e.data) | unzipper.js:16:23:16:63 | unzippe ... ath' }) | provenance | Config | @@ -183,7 +186,9 @@ nodes | pako.js:21:31:21:37 | myArray | semmle.label | myArray | | pako.js:28:19:28:25 | zipFile | semmle.label | zipFile | | pako.js:29:11:29:62 | myArray | semmle.label | myArray | +| pako.js:29:11:29:62 | myArray [ArrayElement] | semmle.label | myArray [ArrayElement] | | pako.js:29:21:29:55 | new Uin ... buffer) | semmle.label | new Uin ... buffer) | +| pako.js:29:21:29:55 | new Uin ... buffer) [ArrayElement] | semmle.label | new Uin ... buffer) [ArrayElement] | | pako.js:29:36:29:42 | zipFile | semmle.label | zipFile | | pako.js:29:36:29:54 | zipFile.data.buffer | semmle.label | zipFile.data.buffer | | pako.js:32:31:32:37 | myArray | semmle.label | myArray | From d689a55229615798a3a03d2c067dc659cf44e9fa Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 13:12:00 +0200 Subject: [PATCH 095/372] Added test cases for `TypedArray` methods --- .../TaintTracking/BasicTaintTracking.expected | 3 +++ .../test/library-tests/TaintTracking/typed-arrays.js | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index 14ae297b4fd..3856dfe15f8 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -43,6 +43,9 @@ consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:15 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:18 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:22 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js index c29c7bef954..4ccf64131b6 100644 --- a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -9,4 +9,15 @@ function test() { var arr = new Uint8Array(y.buffer, y.byteOffset, y.byteLength); sink(arr); // NOT OK + + const z = new Uint8Array([1, 2, 3]); + z.set(y, 3); + sink(z); // NOT OK + + const sub = y.subarray(1, 3) + sink(sub); // NOT OK + + const clone = new y.constructor(y.length); + clone.set(y); + sink(clone); // NOT OK } From edb7aaabab1d5166b207c6a548d8e2e9c6a68e6a Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 4 Apr 2025 10:50:54 +0200 Subject: [PATCH 096/372] Rust: Add path attribute test --- rust/ql/test/library-tests/path-resolution/my2/mod.rs | 5 +++++ rust/ql/test/library-tests/path-resolution/my2/renamed.rs | 1 + .../library-tests/path-resolution/path-resolution.expected | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 rust/ql/test/library-tests/path-resolution/my2/renamed.rs diff --git a/rust/ql/test/library-tests/path-resolution/my2/mod.rs b/rust/ql/test/library-tests/path-resolution/my2/mod.rs index 64291a53af5..27969db97c0 100644 --- a/rust/ql/test/library-tests/path-resolution/my2/mod.rs +++ b/rust/ql/test/library-tests/path-resolution/my2/mod.rs @@ -10,3 +10,8 @@ pub use nested2::nested5::*; // $ item=I114 pub use nested2::nested7::nested8::{self}; // $ item=I118 pub mod my3; + +#[path = "renamed.rs"] +mod mymod; + +use mymod::f; // $ MISSING: item=I1001 diff --git a/rust/ql/test/library-tests/path-resolution/my2/renamed.rs b/rust/ql/test/library-tests/path-resolution/my2/renamed.rs new file mode 100644 index 00000000000..fa37691c136 --- /dev/null +++ b/rust/ql/test/library-tests/path-resolution/my2/renamed.rs @@ -0,0 +1 @@ +pub fn f() {} // I1001 diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 1d480f2f5ad..85a56c3384c 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -30,6 +30,7 @@ mod | main.rs:523:1:548:1 | mod m23 | | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:12:1:12:12 | mod my3 | +| my2/mod.rs:14:1:15:10 | mod mymod | | my2/nested2.rs:1:1:11:1 | mod nested3 | | my2/nested2.rs:2:5:10:5 | mod nested4 | | my2/nested2.rs:13:1:19:1 | mod nested5 | @@ -306,12 +307,13 @@ resolvePath | my2/mod.rs:10:9:10:24 | ...::nested7 | my2/nested2.rs:21:1:27:1 | mod nested7 | | my2/mod.rs:10:9:10:33 | ...::nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | | my2/mod.rs:10:37:10:40 | self | my2/nested2.rs:22:5:26:5 | mod nested8 | +| my2/mod.rs:17:5:17:9 | mymod | my2/mod.rs:14:1:15:10 | mod mymod | | my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g | | my2/my3/mod.rs:4:5:4:5 | h | main.rs:50:1:69:1 | fn h | -| my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:12:13 | SourceFile | +| my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:17:39 | SourceFile | | my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:578:2 | SourceFile | | my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:50:1:69:1 | fn h | -| my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:12:13 | SourceFile | +| my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:17:39 | SourceFile | | my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g | | my.rs:3:5:3:10 | nested | my.rs:1:1:1:15 | mod nested | | my.rs:3:5:3:13 | ...::g | my/nested.rs:19:1:22:1 | fn g | From 13f4a6afa6426b9b2e708cb23901333c686704f6 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 4 Apr 2025 10:51:35 +0200 Subject: [PATCH 097/372] Rust: Handle path attributes in path resolution --- rust/ql/lib/codeql/files/FileSystem.qll | 2 + .../codeql/rust/internal/PathResolution.qll | 27 ++++++++--- .../library-tests/path-resolution/my2/mod.rs | 2 +- .../path-resolution/path-resolution.expected | 5 +- shared/util/codeql/util/FileSystem.qll | 47 +++++++++++++++++++ 5 files changed, 74 insertions(+), 9 deletions(-) diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index 175f50c7c9e..5a60d28418e 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -34,6 +34,8 @@ class Container = Impl::Container; class Folder = Impl::Folder; +module Folder = Impl::Folder; + /** A file. */ class File extends Container, Impl::File { /** Holds if this file was extracted from ordinary source code. */ diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c..ad64e50d009 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -655,6 +655,11 @@ private predicate fileModule(SourceFile f, string name, Folder folder) { ) } +private Meta getPathAttrMeta(Module m) { + result = m.getAnAttr().getMeta() and + result.getPath().getText() = "path" +} + /** * Holds if `m` is a `mod name;` module declaration, where the corresponding * module file needs to be looked up in `lookup` or one of its descandants. @@ -663,12 +668,7 @@ private predicate modImport0(Module m, string name, Folder lookup) { exists(File f, Folder parent, string fileName | f = m.getFile() and not m.hasItemList() and - // TODO: handle - // ``` - // #[path = "foo.rs"] - // mod bar; - // ``` - not m.getAnAttr().getMeta().getPath().getText() = "path" and + not exists(getPathAttrMeta(m)) and name = m.getName().getText() and parent = f.getParentContainer() and fileName = f.getStem() @@ -717,6 +717,16 @@ private predicate modImportNestedLookup(Module m, ModuleItemNode ancestor, Folde ) } +private predicate pathAttrImport(Folder f, Module m, string relativePath) { + exists(Meta meta | + f = m.getFile().getParentContainer() and + meta = getPathAttrMeta(m) and + relativePath = meta.getExpr().(LiteralExpr).getTextValue().regexpCapture("\"(.+)\"", 1) + ) +} + +private predicate append(Folder f, string relativePath) { pathAttrImport(f, _, relativePath) } + /** Holds if `m` is a `mod name;` item importing file `f`. */ private predicate fileImport(Module m, SourceFile f) { exists(string name, Folder parent | @@ -730,6 +740,11 @@ private predicate fileImport(Module m, SourceFile f) { // `m` is inside a nested module modImportNestedLookup(m, m, parent) ) + or + exists(Folder folder, string relativePath | + pathAttrImport(folder, m, relativePath) and + f.getFile() = Folder::Append::append(folder, relativePath) + ) } /** diff --git a/rust/ql/test/library-tests/path-resolution/my2/mod.rs b/rust/ql/test/library-tests/path-resolution/my2/mod.rs index 27969db97c0..43c1a05e91f 100644 --- a/rust/ql/test/library-tests/path-resolution/my2/mod.rs +++ b/rust/ql/test/library-tests/path-resolution/my2/mod.rs @@ -14,4 +14,4 @@ pub mod my3; #[path = "renamed.rs"] mod mymod; -use mymod::f; // $ MISSING: item=I1001 +use mymod::f; // $ item=I1001 diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 85a56c3384c..7fbbca66c39 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -308,12 +308,13 @@ resolvePath | my2/mod.rs:10:9:10:33 | ...::nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | | my2/mod.rs:10:37:10:40 | self | my2/nested2.rs:22:5:26:5 | mod nested8 | | my2/mod.rs:17:5:17:9 | mymod | my2/mod.rs:14:1:15:10 | mod mymod | +| my2/mod.rs:17:5:17:12 | ...::f | my2/renamed.rs:1:1:1:13 | fn f | | my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g | | my2/my3/mod.rs:4:5:4:5 | h | main.rs:50:1:69:1 | fn h | -| my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:17:39 | SourceFile | +| my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:17:30 | SourceFile | | my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:578:2 | SourceFile | | my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:50:1:69:1 | fn h | -| my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:17:39 | SourceFile | +| my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:17:30 | SourceFile | | my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g | | my.rs:3:5:3:10 | nested | my.rs:1:1:1:15 | mod nested | | my.rs:3:5:3:13 | ...::g | my/nested.rs:19:1:22:1 | fn g | diff --git a/shared/util/codeql/util/FileSystem.qll b/shared/util/codeql/util/FileSystem.qll index a9eb21279b6..261139dcf41 100644 --- a/shared/util/codeql/util/FileSystem.qll +++ b/shared/util/codeql/util/FileSystem.qll @@ -218,6 +218,53 @@ module Make { /** Gets the URL of this file. */ override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" } } + + /** Provides logic related to `Folder`s. */ + module Folder { + /** Holds if `relativePath` needs to be appended to `f`. */ + signature predicate appendSig(Folder f, string relativePath); + + /** Provides the `append` predicate for appending a relative path onto a folder. */ + module Append { + pragma[nomagic] + private string getComponent(string relativePath, int i) { + app(_, relativePath) and + result = relativePath.replaceAll("\\", "/").regexpFind("[^/]+", i, _) + } + + pragma[nomagic] + private Container appendStep(Folder f, string relativePath, int i) { + i = -1 and + app(f, relativePath) and + result = f + or + exists(Container mid, string comp | + mid = appendStep(f, relativePath, i - 1) and + comp = getComponent(relativePath, i) and + if comp = ".." + then result = mid.getParentContainer() + else + if comp = "." + then result = mid + else ( + result = mid.getAChildContainer() and + result.getBaseName() = comp + ) + ) + } + + /** + * Gets the file or folder obtained by appending `relativePath` onto `f`. + */ + pragma[nomagic] + Container append(Folder f, string relativePath) { + exists(int components | + components = (-1).maximum(max(int comp | exists(getComponent(relativePath, comp)) | comp)) and + result = appendStep(f, relativePath, components) + ) + } + } + } } /** A file. */ From 260322b669e436f5f7776869b363489b202459d2 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 15:25:19 +0200 Subject: [PATCH 098/372] Rust: fix compilation errors --- rust/extractor/src/crate_graph.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index bc0389e8ce5..88802e6239b 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -18,15 +18,18 @@ use ra_ap_hir_def::{ }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; -use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; use ra_ap_hir_ty::WhereClause; use ra_ap_hir_ty::{Binders, FnPointer}; use ra_ap_hir_ty::{Interner, ProjectionTy}; +use ra_ap_hir_ty::{TraitRefExt, from_assoc_type_id}; use ra_ap_ide_db::RootDatabase; use ra_ap_vfs::{Vfs, VfsPath}; +use ra_ap_hir_def::data::ConstFlags; +use ra_ap_hir_def::item_tree::StaticFlags; +use ra_ap_hir_ty::db::InternedCallableDefId; use std::hash::Hasher; use std::{cmp::Ordering, collections::HashMap, path::PathBuf}; use std::{hash::Hash, vec}; @@ -374,7 +377,7 @@ fn emit_const( attrs: vec![], body: None, is_const: true, - is_default: konst.has_body, + is_default: konst.flags.contains(ConstFlags::HAS_BODY), type_repr, visibility, }) @@ -407,9 +410,9 @@ fn emit_static( body: None, type_repr, visibility, - is_mut: statik.mutable, + is_mut: statik.flags.contains(StaticFlags::MUTABLE), is_static: true, - is_unsafe: statik.has_unsafe_kw, + is_unsafe: statik.flags.contains(StaticFlags::HAS_UNSAFE_KW), }) .into(), ); @@ -774,7 +777,9 @@ fn const_or_function( let type_: &chalk_ir::Ty = type_.skip_binders(); match type_.kind(ra_ap_hir_ty::Interner) { chalk_ir::TyKind::FnDef(fn_def_id, parameters) => { - let data = db.fn_def_datum(*fn_def_id); + let callable_def_id = + db.lookup_intern_callable_def(InternedCallableDefId::from(*fn_def_id)); + let data = db.fn_def_datum(callable_def_id); let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); let params = sig @@ -1200,7 +1205,7 @@ fn emit_hir_ty( substitution: _, })) | chalk_ir::TyKind::AssociatedType(associated_ty_id, _) => { - let assoc_ty_data = db.associated_ty_data(*associated_ty_id); + let assoc_ty_data = db.associated_ty_data(from_assoc_type_id(*associated_ty_id)); let _name = db .type_alias_data(assoc_ty_data.name) @@ -1302,6 +1307,7 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari trap.emit(generated::StructField { id: trap::TrapId::Star, attrs: vec![], + is_unsafe: false, name, type_repr, visibility, From dad85854cddf8969136f88788294fa1227b50e89 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:27:12 +0100 Subject: [PATCH 099/372] Apply suggestions from code review Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../CWE-770/UncontrolledAllocationSize.qhelp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp index 936c2761976..fe5a2582e30 100644 --- a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.qhelp @@ -5,11 +5,11 @@

    Allocating memory with a size based on user input may allow arbitrary amounts of memory to be -allocated, leading to a crash or denial of service incident.

    +allocated, leading to a crash or a denial-of-service (DoS) attack.

    If the user input is multiplied by a constant, such as the size of a type, the result may -overflow. In a build with the --release flag Rust performs two's complement wrapping, -with the result that less memory may be allocated than expected. This can lead to buffer overflow +overflow. In a build with the --release flag, Rust performs two's complement wrapping, +with the result that less memory than expected may be allocated. This can lead to buffer overflow incidents.

    @@ -24,12 +24,12 @@ does not wrap around.

    In the following example, an arbitrary amount of memory is allocated based on user input. In -addition, due to the multiplication operation the result may overflow if a very large value is -provided, leading to less memory being allocated than other parts of the program expect.

    +addition, due to the multiplication operation, the result may overflow if a very large value is +provided. This may lead to less memory being allocated than expected by other parts of the program.

    -

    In the fixed example, the user input is checked against a maximum value. If the check fails an -error is returned, and both the multiplication and alloaction do not take place.

    +

    In the fixed example, the user input is checked against a maximum value. If the check fails, an +error is returned, and both the multiplication and allocation do not take place.

    From 41f54d836eaa9c6e81aa536385a709e9852fe843 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 7 Apr 2025 14:29:32 +0100 Subject: [PATCH 100/372] Rust: Tweak query description. --- .../src/queries/security/CWE-770/UncontrolledAllocationSize.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql index bbaaaf06a02..c4125774315 100644 --- a/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql +++ b/rust/ql/src/queries/security/CWE-770/UncontrolledAllocationSize.ql @@ -1,7 +1,8 @@ /** * @name Uncontrolled allocation size * @description Allocating memory with a size controlled by an external user can result in - * arbitrary amounts of memory being allocated. + * arbitrary amounts of memory being allocated, leading to a crash or a + * denial-of-service (DoS) attack. * @kind path-problem * @problem.severity recommendation * @security-severity 7.5 From 1f9455c434bab9988e8d5312b0219170d7b9f297 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 15:39:14 +0200 Subject: [PATCH 101/372] Rust: add upgrade/downgrade scripts for `struct_field_is_unsafe` --- .../old.dbscheme | 3606 +++++++++++++++++ .../rust.dbscheme | 3601 ++++++++++++++++ .../upgrade.properties | 4 + .../old.dbscheme | 3601 ++++++++++++++++ .../rust.dbscheme | 3606 +++++++++++++++++ .../upgrade.properties | 2 + 6 files changed, 14420 insertions(+) create mode 100644 rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme create mode 100644 rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme create mode 100644 rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties create mode 100644 rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme create mode 100644 rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme create mode 100644 rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties diff --git a/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme new file mode 100644 index 00000000000..e8707b675dc --- /dev/null +++ b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/old.dbscheme @@ -0,0 +1,3606 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +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 +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +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_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme new file mode 100644 index 00000000000..256e80c2dce --- /dev/null +++ b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/rust.dbscheme @@ -0,0 +1,3601 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +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 +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +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_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties new file mode 100644 index 00000000000..589e2d2682a --- /dev/null +++ b/rust/downgrades/e8707b675dc574aca9863eabcc09ac76f15bb9c2/upgrade.properties @@ -0,0 +1,4 @@ +description: Remove `struct_field_is_unsafe` table +compatibility: backwards + +struct_field_is_unsafe.rel: delete diff --git a/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme new file mode 100644 index 00000000000..256e80c2dce --- /dev/null +++ b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/old.dbscheme @@ -0,0 +1,3601 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +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 +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +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_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme new file mode 100644 index 00000000000..e8707b675dc --- /dev/null +++ b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/rust.dbscheme @@ -0,0 +1,3606 @@ +// generated by codegen, do not edit + +// from ../shared/tree-sitter-extractor/src/generator/prefix.dbscheme +/*- Files and folders -*/ + +/** + * The location of an element. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +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 +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @file | @folder + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/*- Empty location -*/ + +empty_location( + int location: @location_default ref +); + +/*- Source location prefix -*/ + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/*- Diagnostic messages -*/ + +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_default ref +); + +/*- Diagnostic messages: severity -*/ + +case @diagnostic.severity of + 10 = @diagnostic_debug +| 20 = @diagnostic_info +| 30 = @diagnostic_warning +| 40 = @diagnostic_error +; + +/*- YAML -*/ + +#keyset[parent, idx] +yaml (unique int id: @yaml_node, + int kind: int ref, + int parent: @yaml_node_parent ref, + int idx: int ref, + string tag: string ref, + string tostring: string ref); + +case @yaml_node.kind of + 0 = @yaml_scalar_node +| 1 = @yaml_mapping_node +| 2 = @yaml_sequence_node +| 3 = @yaml_alias_node +; + +@yaml_collection_node = @yaml_mapping_node | @yaml_sequence_node; + +@yaml_node_parent = @yaml_collection_node | @file; + +yaml_anchors (unique int node: @yaml_node ref, + string anchor: string ref); + +yaml_aliases (unique int alias: @yaml_alias_node ref, + string target: string ref); + +yaml_scalars (unique int scalar: @yaml_scalar_node ref, + int style: int ref, + string value: string ref); + +yaml_errors (unique int id: @yaml_error, + string message: string ref); + +yaml_locations(unique int locatable: @yaml_locatable ref, + int location: @location_default ref); + +@yaml_locatable = @yaml_node | @yaml_error; + + +// from prefix.dbscheme +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_default ref +); + + +// from schema + +@element = + @extractor_step +| @locatable +| @named_crate +| @unextracted +; + +extractor_steps( + unique int id: @extractor_step, + string action: string ref, + int duration_ms: int ref +); + +#keyset[id] +extractor_step_files( + int id: @extractor_step ref, + int file: @file ref +); + +@locatable = + @ast_node +| @crate +; + +named_crates( + unique int id: @named_crate, + string name: string ref, + int crate: @crate ref +); + +@unextracted = + @missing +| @unimplemented +; + +@ast_node = + @abi +| @addressable +| @arg_list +| @asm_dir_spec +| @asm_operand +| @asm_operand_expr +| @asm_option +| @asm_piece +| @asm_reg_spec +| @assoc_item +| @assoc_item_list +| @attr +| @callable +| @closure_binder +| @expr +| @extern_item +| @extern_item_list +| @field_list +| @format_args_arg +| @generic_arg +| @generic_arg_list +| @generic_param +| @generic_param_list +| @item_list +| @label +| @let_else +| @macro_items +| @macro_stmts +| @match_arm +| @match_arm_list +| @match_guard +| @meta +| @name +| @param_base +| @param_list +| @parenthesized_arg_list +| @pat +| @path +| @path_segment +| @rename +| @resolvable +| @ret_type_repr +| @return_type_syntax +| @source_file +| @stmt +| @stmt_list +| @struct_expr_field +| @struct_expr_field_list +| @struct_field +| @struct_pat_field +| @struct_pat_field_list +| @token +| @token_tree +| @tuple_field +| @type_bound +| @type_bound_list +| @type_repr +| @use_bound_generic_arg +| @use_bound_generic_args +| @use_tree +| @use_tree_list +| @variant_def +| @variant_list +| @visibility +| @where_clause +| @where_pred +; + +crates( + unique int id: @crate +); + +#keyset[id] +crate_names( + int id: @crate ref, + string name: string ref +); + +#keyset[id] +crate_versions( + int id: @crate ref, + string version: string ref +); + +#keyset[id] +crate_modules( + int id: @crate ref, + int module: @module ref +); + +#keyset[id, index] +crate_cfg_options( + int id: @crate ref, + int index: int ref, + string cfg_option: string ref +); + +#keyset[id, index] +crate_named_dependencies( + int id: @crate ref, + int index: int ref, + int named_dependency: @named_crate ref +); + +missings( + unique int id: @missing +); + +unimplementeds( + unique int id: @unimplemented +); + +abis( + unique int id: @abi +); + +#keyset[id] +abi_abi_strings( + int id: @abi ref, + string abi_string: string ref +); + +@addressable = + @item +| @variant +; + +#keyset[id] +addressable_extended_canonical_paths( + int id: @addressable ref, + string extended_canonical_path: string ref +); + +#keyset[id] +addressable_crate_origins( + int id: @addressable ref, + string crate_origin: string ref +); + +arg_lists( + unique int id: @arg_list +); + +#keyset[id, index] +arg_list_args( + int id: @arg_list ref, + int index: int ref, + int arg: @expr ref +); + +asm_dir_specs( + unique int id: @asm_dir_spec +); + +@asm_operand = + @asm_const +| @asm_label +| @asm_reg_operand +| @asm_sym +; + +asm_operand_exprs( + unique int id: @asm_operand_expr +); + +#keyset[id] +asm_operand_expr_in_exprs( + int id: @asm_operand_expr ref, + int in_expr: @expr ref +); + +#keyset[id] +asm_operand_expr_out_exprs( + int id: @asm_operand_expr ref, + int out_expr: @expr ref +); + +asm_options( + unique int id: @asm_option +); + +#keyset[id] +asm_option_is_raw( + int id: @asm_option ref +); + +@asm_piece = + @asm_clobber_abi +| @asm_operand_named +| @asm_options_list +; + +asm_reg_specs( + unique int id: @asm_reg_spec +); + +#keyset[id] +asm_reg_spec_identifiers( + int id: @asm_reg_spec ref, + int identifier: @name_ref ref +); + +@assoc_item = + @const +| @function +| @macro_call +| @type_alias +; + +assoc_item_lists( + unique int id: @assoc_item_list +); + +#keyset[id, index] +assoc_item_list_assoc_items( + int id: @assoc_item_list ref, + int index: int ref, + int assoc_item: @assoc_item ref +); + +#keyset[id, index] +assoc_item_list_attrs( + int id: @assoc_item_list ref, + int index: int ref, + int attr: @attr ref +); + +attrs( + unique int id: @attr +); + +#keyset[id] +attr_meta( + int id: @attr ref, + int meta: @meta ref +); + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_param_lists( + int id: @callable ref, + int param_list: @param_list ref +); + +#keyset[id, index] +callable_attrs( + int id: @callable ref, + int index: int ref, + int attr: @attr ref +); + +closure_binders( + unique int id: @closure_binder +); + +#keyset[id] +closure_binder_generic_param_lists( + int id: @closure_binder ref, + int generic_param_list: @generic_param_list ref +); + +@expr = + @array_expr_internal +| @asm_expr +| @await_expr +| @become_expr +| @binary_expr +| @break_expr +| @call_expr_base +| @cast_expr +| @closure_expr +| @continue_expr +| @field_expr +| @format_args_expr +| @if_expr +| @index_expr +| @labelable_expr +| @let_expr +| @literal_expr +| @macro_expr +| @match_expr +| @offset_of_expr +| @paren_expr +| @path_expr_base +| @prefix_expr +| @range_expr +| @ref_expr +| @return_expr +| @struct_expr +| @try_expr +| @tuple_expr +| @underscore_expr +| @yeet_expr +| @yield_expr +; + +@extern_item = + @function +| @macro_call +| @static +| @type_alias +; + +extern_item_lists( + unique int id: @extern_item_list +); + +#keyset[id, index] +extern_item_list_attrs( + int id: @extern_item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +extern_item_list_extern_items( + int id: @extern_item_list ref, + int index: int ref, + int extern_item: @extern_item ref +); + +@field_list = + @struct_field_list +| @tuple_field_list +; + +format_args_args( + unique int id: @format_args_arg +); + +#keyset[id] +format_args_arg_exprs( + int id: @format_args_arg ref, + int expr: @expr ref +); + +#keyset[id] +format_args_arg_names( + int id: @format_args_arg ref, + int name: @name ref +); + +@generic_arg = + @assoc_type_arg +| @const_arg +| @lifetime_arg +| @type_arg +; + +generic_arg_lists( + unique int id: @generic_arg_list +); + +#keyset[id, index] +generic_arg_list_generic_args( + int id: @generic_arg_list ref, + int index: int ref, + int generic_arg: @generic_arg ref +); + +@generic_param = + @const_param +| @lifetime_param +| @type_param +; + +generic_param_lists( + unique int id: @generic_param_list +); + +#keyset[id, index] +generic_param_list_generic_params( + int id: @generic_param_list ref, + int index: int ref, + int generic_param: @generic_param ref +); + +item_lists( + unique int id: @item_list +); + +#keyset[id, index] +item_list_attrs( + int id: @item_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +item_list_items( + int id: @item_list ref, + int index: int ref, + int item: @item ref +); + +labels( + unique int id: @label +); + +#keyset[id] +label_lifetimes( + int id: @label ref, + int lifetime: @lifetime ref +); + +let_elses( + unique int id: @let_else +); + +#keyset[id] +let_else_block_exprs( + int id: @let_else ref, + int block_expr: @block_expr ref +); + +macro_items( + unique int id: @macro_items +); + +#keyset[id, index] +macro_items_items( + int id: @macro_items ref, + int index: int ref, + int item: @item ref +); + +macro_stmts( + unique int id: @macro_stmts +); + +#keyset[id] +macro_stmts_exprs( + int id: @macro_stmts ref, + int expr: @expr ref +); + +#keyset[id, index] +macro_stmts_statements( + int id: @macro_stmts ref, + int index: int ref, + int statement: @stmt ref +); + +match_arms( + unique int id: @match_arm +); + +#keyset[id, index] +match_arm_attrs( + int id: @match_arm ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_arm_exprs( + int id: @match_arm ref, + int expr: @expr ref +); + +#keyset[id] +match_arm_guards( + int id: @match_arm ref, + int guard: @match_guard ref +); + +#keyset[id] +match_arm_pats( + int id: @match_arm ref, + int pat: @pat ref +); + +match_arm_lists( + unique int id: @match_arm_list +); + +#keyset[id, index] +match_arm_list_arms( + int id: @match_arm_list ref, + int index: int ref, + int arm: @match_arm ref +); + +#keyset[id, index] +match_arm_list_attrs( + int id: @match_arm_list ref, + int index: int ref, + int attr: @attr ref +); + +match_guards( + unique int id: @match_guard +); + +#keyset[id] +match_guard_conditions( + int id: @match_guard ref, + int condition: @expr ref +); + +meta( + unique int id: @meta +); + +#keyset[id] +meta_exprs( + int id: @meta ref, + int expr: @expr ref +); + +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + +#keyset[id] +meta_paths( + int id: @meta ref, + int path: @path ref +); + +#keyset[id] +meta_token_trees( + int id: @meta ref, + int token_tree: @token_tree ref +); + +names( + unique int id: @name +); + +#keyset[id] +name_texts( + int id: @name ref, + string text: string ref +); + +@param_base = + @param +| @self_param +; + +#keyset[id, index] +param_base_attrs( + int id: @param_base ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +param_base_type_reprs( + int id: @param_base ref, + int type_repr: @type_repr ref +); + +param_lists( + unique int id: @param_list +); + +#keyset[id, index] +param_list_params( + int id: @param_list ref, + int index: int ref, + int param: @param ref +); + +#keyset[id] +param_list_self_params( + int id: @param_list ref, + int self_param: @self_param ref +); + +parenthesized_arg_lists( + unique int id: @parenthesized_arg_list +); + +#keyset[id, index] +parenthesized_arg_list_type_args( + int id: @parenthesized_arg_list ref, + int index: int ref, + int type_arg: @type_arg ref +); + +@pat = + @box_pat +| @const_block_pat +| @ident_pat +| @literal_pat +| @macro_pat +| @or_pat +| @paren_pat +| @path_pat +| @range_pat +| @ref_pat +| @rest_pat +| @slice_pat +| @struct_pat +| @tuple_pat +| @tuple_struct_pat +| @wildcard_pat +; + +paths( + unique int id: @path +); + +#keyset[id] +path_qualifiers( + int id: @path ref, + int qualifier: @path ref +); + +#keyset[id] +path_segments_( + int id: @path ref, + int segment: @path_segment ref +); + +path_segments( + unique int id: @path_segment +); + +#keyset[id] +path_segment_generic_arg_lists( + int id: @path_segment ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +path_segment_identifiers( + int id: @path_segment ref, + int identifier: @name_ref ref +); + +#keyset[id] +path_segment_parenthesized_arg_lists( + int id: @path_segment ref, + int parenthesized_arg_list: @parenthesized_arg_list ref +); + +#keyset[id] +path_segment_ret_types( + int id: @path_segment ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +path_segment_return_type_syntaxes( + int id: @path_segment ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +path_segment_type_reprs( + int id: @path_segment ref, + int type_repr: @type_repr ref +); + +#keyset[id] +path_segment_trait_type_reprs( + int id: @path_segment ref, + int trait_type_repr: @path_type_repr ref +); + +renames( + unique int id: @rename +); + +#keyset[id] +rename_names( + int id: @rename ref, + int name: @name ref +); + +@resolvable = + @method_call_expr +| @path_ast_node +; + +#keyset[id] +resolvable_resolved_paths( + int id: @resolvable ref, + string resolved_path: string ref +); + +#keyset[id] +resolvable_resolved_crate_origins( + int id: @resolvable ref, + string resolved_crate_origin: string ref +); + +ret_type_reprs( + unique int id: @ret_type_repr +); + +#keyset[id] +ret_type_repr_type_reprs( + int id: @ret_type_repr ref, + int type_repr: @type_repr ref +); + +return_type_syntaxes( + unique int id: @return_type_syntax +); + +source_files( + unique int id: @source_file +); + +#keyset[id, index] +source_file_attrs( + int id: @source_file ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +source_file_items( + int id: @source_file ref, + int index: int ref, + int item: @item ref +); + +@stmt = + @expr_stmt +| @item +| @let_stmt +; + +stmt_lists( + unique int id: @stmt_list +); + +#keyset[id, index] +stmt_list_attrs( + int id: @stmt_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +stmt_list_statements( + int id: @stmt_list ref, + int index: int ref, + int statement: @stmt ref +); + +#keyset[id] +stmt_list_tail_exprs( + int id: @stmt_list ref, + int tail_expr: @expr ref +); + +struct_expr_fields( + unique int id: @struct_expr_field +); + +#keyset[id, index] +struct_expr_field_attrs( + int id: @struct_expr_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_expr_field_exprs( + int id: @struct_expr_field ref, + int expr: @expr ref +); + +#keyset[id] +struct_expr_field_identifiers( + int id: @struct_expr_field ref, + int identifier: @name_ref ref +); + +struct_expr_field_lists( + unique int id: @struct_expr_field_list +); + +#keyset[id, index] +struct_expr_field_list_attrs( + int id: @struct_expr_field_list ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +struct_expr_field_list_fields( + int id: @struct_expr_field_list ref, + int index: int ref, + int field: @struct_expr_field ref +); + +#keyset[id] +struct_expr_field_list_spreads( + int id: @struct_expr_field_list ref, + int spread: @expr ref +); + +struct_fields( + unique int id: @struct_field +); + +#keyset[id, index] +struct_field_attrs( + int id: @struct_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_defaults( + int id: @struct_field ref, + int default: @expr ref +); + +#keyset[id] +struct_field_is_unsafe( + int id: @struct_field ref +); + +#keyset[id] +struct_field_names( + int id: @struct_field ref, + int name: @name ref +); + +#keyset[id] +struct_field_type_reprs( + int id: @struct_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +struct_field_visibilities( + int id: @struct_field ref, + int visibility: @visibility ref +); + +struct_pat_fields( + unique int id: @struct_pat_field +); + +#keyset[id, index] +struct_pat_field_attrs( + int id: @struct_pat_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_pat_field_identifiers( + int id: @struct_pat_field ref, + int identifier: @name_ref ref +); + +#keyset[id] +struct_pat_field_pats( + int id: @struct_pat_field ref, + int pat: @pat ref +); + +struct_pat_field_lists( + unique int id: @struct_pat_field_list +); + +#keyset[id, index] +struct_pat_field_list_fields( + int id: @struct_pat_field_list ref, + int index: int ref, + int field: @struct_pat_field ref +); + +#keyset[id] +struct_pat_field_list_rest_pats( + int id: @struct_pat_field_list ref, + int rest_pat: @rest_pat ref +); + +@token = + @comment +; + +token_trees( + unique int id: @token_tree +); + +tuple_fields( + unique int id: @tuple_field +); + +#keyset[id, index] +tuple_field_attrs( + int id: @tuple_field ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +tuple_field_type_reprs( + int id: @tuple_field ref, + int type_repr: @type_repr ref +); + +#keyset[id] +tuple_field_visibilities( + int id: @tuple_field ref, + int visibility: @visibility ref +); + +type_bounds( + unique int id: @type_bound +); + +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + +#keyset[id] +type_bound_lifetimes( + int id: @type_bound ref, + int lifetime: @lifetime ref +); + +#keyset[id] +type_bound_type_reprs( + int id: @type_bound ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_bound_use_bound_generic_args( + int id: @type_bound ref, + int use_bound_generic_args: @use_bound_generic_args ref +); + +type_bound_lists( + unique int id: @type_bound_list +); + +#keyset[id, index] +type_bound_list_bounds( + int id: @type_bound_list ref, + int index: int ref, + int bound: @type_bound ref +); + +@type_repr = + @array_type_repr +| @dyn_trait_type_repr +| @fn_ptr_type_repr +| @for_type_repr +| @impl_trait_type_repr +| @infer_type_repr +| @macro_type_repr +| @never_type_repr +| @paren_type_repr +| @path_type_repr +| @ptr_type_repr +| @ref_type_repr +| @slice_type_repr +| @tuple_type_repr +; + +@use_bound_generic_arg = + @lifetime +| @name_ref +; + +use_bound_generic_args( + unique int id: @use_bound_generic_args +); + +#keyset[id, index] +use_bound_generic_args_use_bound_generic_args( + int id: @use_bound_generic_args ref, + int index: int ref, + int use_bound_generic_arg: @use_bound_generic_arg ref +); + +use_trees( + unique int id: @use_tree +); + +#keyset[id] +use_tree_is_glob( + int id: @use_tree ref +); + +#keyset[id] +use_tree_paths( + int id: @use_tree ref, + int path: @path ref +); + +#keyset[id] +use_tree_renames( + int id: @use_tree ref, + int rename: @rename ref +); + +#keyset[id] +use_tree_use_tree_lists( + int id: @use_tree ref, + int use_tree_list: @use_tree_list ref +); + +use_tree_lists( + unique int id: @use_tree_list +); + +#keyset[id, index] +use_tree_list_use_trees( + int id: @use_tree_list ref, + int index: int ref, + int use_tree: @use_tree ref +); + +@variant_def = + @struct +| @union +| @variant +; + +variant_lists( + unique int id: @variant_list +); + +#keyset[id, index] +variant_list_variants( + int id: @variant_list ref, + int index: int ref, + int variant: @variant ref +); + +visibilities( + unique int id: @visibility +); + +#keyset[id] +visibility_paths( + int id: @visibility ref, + int path: @path ref +); + +where_clauses( + unique int id: @where_clause +); + +#keyset[id, index] +where_clause_predicates( + int id: @where_clause ref, + int index: int ref, + int predicate: @where_pred ref +); + +where_preds( + unique int id: @where_pred +); + +#keyset[id] +where_pred_generic_param_lists( + int id: @where_pred ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +where_pred_lifetimes( + int id: @where_pred ref, + int lifetime: @lifetime ref +); + +#keyset[id] +where_pred_type_reprs( + int id: @where_pred ref, + int type_repr: @type_repr ref +); + +#keyset[id] +where_pred_type_bound_lists( + int id: @where_pred ref, + int type_bound_list: @type_bound_list ref +); + +array_expr_internals( + unique int id: @array_expr_internal +); + +#keyset[id, index] +array_expr_internal_attrs( + int id: @array_expr_internal ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +array_expr_internal_exprs( + int id: @array_expr_internal ref, + int index: int ref, + int expr: @expr ref +); + +#keyset[id] +array_expr_internal_is_semicolon( + int id: @array_expr_internal ref +); + +array_type_reprs( + unique int id: @array_type_repr +); + +#keyset[id] +array_type_repr_const_args( + int id: @array_type_repr ref, + int const_arg: @const_arg ref +); + +#keyset[id] +array_type_repr_element_type_reprs( + int id: @array_type_repr ref, + int element_type_repr: @type_repr ref +); + +asm_clobber_abis( + unique int id: @asm_clobber_abi +); + +asm_consts( + unique int id: @asm_const +); + +#keyset[id] +asm_const_exprs( + int id: @asm_const ref, + int expr: @expr ref +); + +#keyset[id] +asm_const_is_const( + int id: @asm_const ref +); + +asm_exprs( + unique int id: @asm_expr +); + +#keyset[id, index] +asm_expr_asm_pieces( + int id: @asm_expr ref, + int index: int ref, + int asm_piece: @asm_piece ref +); + +#keyset[id, index] +asm_expr_attrs( + int id: @asm_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +asm_expr_templates( + int id: @asm_expr ref, + int index: int ref, + int template: @expr ref +); + +asm_labels( + unique int id: @asm_label +); + +#keyset[id] +asm_label_block_exprs( + int id: @asm_label ref, + int block_expr: @block_expr ref +); + +asm_operand_nameds( + unique int id: @asm_operand_named +); + +#keyset[id] +asm_operand_named_asm_operands( + int id: @asm_operand_named ref, + int asm_operand: @asm_operand ref +); + +#keyset[id] +asm_operand_named_names( + int id: @asm_operand_named ref, + int name: @name ref +); + +asm_options_lists( + unique int id: @asm_options_list +); + +#keyset[id, index] +asm_options_list_asm_options( + int id: @asm_options_list ref, + int index: int ref, + int asm_option: @asm_option ref +); + +asm_reg_operands( + unique int id: @asm_reg_operand +); + +#keyset[id] +asm_reg_operand_asm_dir_specs( + int id: @asm_reg_operand ref, + int asm_dir_spec: @asm_dir_spec ref +); + +#keyset[id] +asm_reg_operand_asm_operand_exprs( + int id: @asm_reg_operand ref, + int asm_operand_expr: @asm_operand_expr ref +); + +#keyset[id] +asm_reg_operand_asm_reg_specs( + int id: @asm_reg_operand ref, + int asm_reg_spec: @asm_reg_spec ref +); + +asm_syms( + unique int id: @asm_sym +); + +#keyset[id] +asm_sym_paths( + int id: @asm_sym ref, + int path: @path ref +); + +assoc_type_args( + unique int id: @assoc_type_arg +); + +#keyset[id] +assoc_type_arg_const_args( + int id: @assoc_type_arg ref, + int const_arg: @const_arg ref +); + +#keyset[id] +assoc_type_arg_generic_arg_lists( + int id: @assoc_type_arg ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +assoc_type_arg_identifiers( + int id: @assoc_type_arg ref, + int identifier: @name_ref ref +); + +#keyset[id] +assoc_type_arg_param_lists( + int id: @assoc_type_arg ref, + int param_list: @param_list ref +); + +#keyset[id] +assoc_type_arg_ret_types( + int id: @assoc_type_arg ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +assoc_type_arg_return_type_syntaxes( + int id: @assoc_type_arg ref, + int return_type_syntax: @return_type_syntax ref +); + +#keyset[id] +assoc_type_arg_type_reprs( + int id: @assoc_type_arg ref, + int type_repr: @type_repr ref +); + +#keyset[id] +assoc_type_arg_type_bound_lists( + int id: @assoc_type_arg ref, + int type_bound_list: @type_bound_list ref +); + +await_exprs( + unique int id: @await_expr +); + +#keyset[id, index] +await_expr_attrs( + int id: @await_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +await_expr_exprs( + int id: @await_expr ref, + int expr: @expr ref +); + +become_exprs( + unique int id: @become_expr +); + +#keyset[id, index] +become_expr_attrs( + int id: @become_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +become_expr_exprs( + int id: @become_expr ref, + int expr: @expr ref +); + +binary_exprs( + unique int id: @binary_expr +); + +#keyset[id, index] +binary_expr_attrs( + int id: @binary_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +binary_expr_lhs( + int id: @binary_expr ref, + int lhs: @expr ref +); + +#keyset[id] +binary_expr_operator_names( + int id: @binary_expr ref, + string operator_name: string ref +); + +#keyset[id] +binary_expr_rhs( + int id: @binary_expr ref, + int rhs: @expr ref +); + +box_pats( + unique int id: @box_pat +); + +#keyset[id] +box_pat_pats( + int id: @box_pat ref, + int pat: @pat ref +); + +break_exprs( + unique int id: @break_expr +); + +#keyset[id, index] +break_expr_attrs( + int id: @break_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +break_expr_exprs( + int id: @break_expr ref, + int expr: @expr ref +); + +#keyset[id] +break_expr_lifetimes( + int id: @break_expr ref, + int lifetime: @lifetime ref +); + +@call_expr_base = + @call_expr +| @method_call_expr +; + +#keyset[id] +call_expr_base_arg_lists( + int id: @call_expr_base ref, + int arg_list: @arg_list ref +); + +#keyset[id, index] +call_expr_base_attrs( + int id: @call_expr_base ref, + int index: int ref, + int attr: @attr ref +); + +cast_exprs( + unique int id: @cast_expr +); + +#keyset[id, index] +cast_expr_attrs( + int id: @cast_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +cast_expr_exprs( + int id: @cast_expr ref, + int expr: @expr ref +); + +#keyset[id] +cast_expr_type_reprs( + int id: @cast_expr ref, + int type_repr: @type_repr ref +); + +closure_exprs( + unique int id: @closure_expr +); + +#keyset[id] +closure_expr_bodies( + int id: @closure_expr ref, + int body: @expr ref +); + +#keyset[id] +closure_expr_closure_binders( + int id: @closure_expr ref, + int closure_binder: @closure_binder ref +); + +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_ret_types( + int id: @closure_expr ref, + int ret_type: @ret_type_repr ref +); + +comments( + unique int id: @comment, + int parent: @ast_node ref, + string text: string ref +); + +const_args( + unique int id: @const_arg +); + +#keyset[id] +const_arg_exprs( + int id: @const_arg ref, + int expr: @expr ref +); + +const_block_pats( + unique int id: @const_block_pat +); + +#keyset[id] +const_block_pat_block_exprs( + int id: @const_block_pat ref, + int block_expr: @block_expr ref +); + +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + +const_params( + unique int id: @const_param +); + +#keyset[id, index] +const_param_attrs( + int id: @const_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_param_default_vals( + int id: @const_param ref, + int default_val: @const_arg ref +); + +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + +#keyset[id] +const_param_names( + int id: @const_param ref, + int name: @name ref +); + +#keyset[id] +const_param_type_reprs( + int id: @const_param ref, + int type_repr: @type_repr ref +); + +continue_exprs( + unique int id: @continue_expr +); + +#keyset[id, index] +continue_expr_attrs( + int id: @continue_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +continue_expr_lifetimes( + int id: @continue_expr ref, + int lifetime: @lifetime ref +); + +dyn_trait_type_reprs( + unique int id: @dyn_trait_type_repr +); + +#keyset[id] +dyn_trait_type_repr_type_bound_lists( + int id: @dyn_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +expr_stmts( + unique int id: @expr_stmt +); + +#keyset[id] +expr_stmt_exprs( + int id: @expr_stmt ref, + int expr: @expr ref +); + +field_exprs( + unique int id: @field_expr +); + +#keyset[id, index] +field_expr_attrs( + int id: @field_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +field_expr_containers( + int id: @field_expr ref, + int container: @expr ref +); + +#keyset[id] +field_expr_identifiers( + int id: @field_expr ref, + int identifier: @name_ref ref +); + +fn_ptr_type_reprs( + unique int id: @fn_ptr_type_repr +); + +#keyset[id] +fn_ptr_type_repr_abis( + int id: @fn_ptr_type_repr ref, + int abi: @abi ref +); + +#keyset[id] +fn_ptr_type_repr_is_async( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_const( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_is_unsafe( + int id: @fn_ptr_type_repr ref +); + +#keyset[id] +fn_ptr_type_repr_param_lists( + int id: @fn_ptr_type_repr ref, + int param_list: @param_list ref +); + +#keyset[id] +fn_ptr_type_repr_ret_types( + int id: @fn_ptr_type_repr ref, + int ret_type: @ret_type_repr ref +); + +for_type_reprs( + unique int id: @for_type_repr +); + +#keyset[id] +for_type_repr_generic_param_lists( + int id: @for_type_repr ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +for_type_repr_type_reprs( + int id: @for_type_repr ref, + int type_repr: @type_repr ref +); + +format_args_exprs( + unique int id: @format_args_expr +); + +#keyset[id, index] +format_args_expr_args( + int id: @format_args_expr ref, + int index: int ref, + int arg: @format_args_arg ref +); + +#keyset[id, index] +format_args_expr_attrs( + int id: @format_args_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +format_args_expr_templates( + int id: @format_args_expr ref, + int template: @expr ref +); + +ident_pats( + unique int id: @ident_pat +); + +#keyset[id, index] +ident_pat_attrs( + int id: @ident_pat ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_names( + int id: @ident_pat ref, + int name: @name ref +); + +#keyset[id] +ident_pat_pats( + int id: @ident_pat ref, + int pat: @pat ref +); + +if_exprs( + unique int id: @if_expr +); + +#keyset[id, index] +if_expr_attrs( + int id: @if_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +if_expr_conditions( + int id: @if_expr ref, + int condition: @expr ref +); + +#keyset[id] +if_expr_elses( + int id: @if_expr ref, + int else: @expr ref +); + +#keyset[id] +if_expr_thens( + int id: @if_expr ref, + int then: @block_expr ref +); + +impl_trait_type_reprs( + unique int id: @impl_trait_type_repr +); + +#keyset[id] +impl_trait_type_repr_type_bound_lists( + int id: @impl_trait_type_repr ref, + int type_bound_list: @type_bound_list ref +); + +index_exprs( + unique int id: @index_expr +); + +#keyset[id, index] +index_expr_attrs( + int id: @index_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +index_expr_bases( + int id: @index_expr ref, + int base: @expr ref +); + +#keyset[id] +index_expr_indices( + int id: @index_expr ref, + int index: @expr ref +); + +infer_type_reprs( + unique int id: @infer_type_repr +); + +@item = + @const +| @enum +| @extern_block +| @extern_crate +| @function +| @impl +| @macro_call +| @macro_def +| @macro_rules +| @module +| @static +| @struct +| @trait +| @trait_alias +| @type_alias +| @union +| @use +; + +@labelable_expr = + @block_expr +| @looping_expr +; + +#keyset[id] +labelable_expr_labels( + int id: @labelable_expr ref, + int label: @label ref +); + +let_exprs( + unique int id: @let_expr +); + +#keyset[id, index] +let_expr_attrs( + int id: @let_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_expr_scrutinees( + int id: @let_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +let_expr_pats( + int id: @let_expr ref, + int pat: @pat ref +); + +let_stmts( + unique int id: @let_stmt +); + +#keyset[id, index] +let_stmt_attrs( + int id: @let_stmt ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +let_stmt_initializers( + int id: @let_stmt ref, + int initializer: @expr ref +); + +#keyset[id] +let_stmt_let_elses( + int id: @let_stmt ref, + int let_else: @let_else ref +); + +#keyset[id] +let_stmt_pats( + int id: @let_stmt ref, + int pat: @pat ref +); + +#keyset[id] +let_stmt_type_reprs( + int id: @let_stmt ref, + int type_repr: @type_repr ref +); + +lifetimes( + unique int id: @lifetime +); + +#keyset[id] +lifetime_texts( + int id: @lifetime ref, + string text: string ref +); + +lifetime_args( + unique int id: @lifetime_arg +); + +#keyset[id] +lifetime_arg_lifetimes( + int id: @lifetime_arg ref, + int lifetime: @lifetime ref +); + +lifetime_params( + unique int id: @lifetime_param +); + +#keyset[id, index] +lifetime_param_attrs( + int id: @lifetime_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +lifetime_param_lifetimes( + int id: @lifetime_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +lifetime_param_type_bound_lists( + int id: @lifetime_param ref, + int type_bound_list: @type_bound_list ref +); + +literal_exprs( + unique int id: @literal_expr +); + +#keyset[id, index] +literal_expr_attrs( + int id: @literal_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +literal_expr_text_values( + int id: @literal_expr ref, + string text_value: string ref +); + +literal_pats( + unique int id: @literal_pat +); + +#keyset[id] +literal_pat_literals( + int id: @literal_pat ref, + int literal: @literal_expr ref +); + +macro_exprs( + unique int id: @macro_expr +); + +#keyset[id] +macro_expr_macro_calls( + int id: @macro_expr ref, + int macro_call: @macro_call ref +); + +macro_pats( + unique int id: @macro_pat +); + +#keyset[id] +macro_pat_macro_calls( + int id: @macro_pat ref, + int macro_call: @macro_call ref +); + +macro_type_reprs( + unique int id: @macro_type_repr +); + +#keyset[id] +macro_type_repr_macro_calls( + int id: @macro_type_repr ref, + int macro_call: @macro_call ref +); + +match_exprs( + unique int id: @match_expr +); + +#keyset[id, index] +match_expr_attrs( + int id: @match_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +match_expr_scrutinees( + int id: @match_expr ref, + int scrutinee: @expr ref +); + +#keyset[id] +match_expr_match_arm_lists( + int id: @match_expr ref, + int match_arm_list: @match_arm_list ref +); + +name_refs( + unique int id: @name_ref +); + +#keyset[id] +name_ref_texts( + int id: @name_ref ref, + string text: string ref +); + +never_type_reprs( + unique int id: @never_type_repr +); + +offset_of_exprs( + unique int id: @offset_of_expr +); + +#keyset[id, index] +offset_of_expr_attrs( + int id: @offset_of_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +offset_of_expr_fields( + int id: @offset_of_expr ref, + int index: int ref, + int field: @name_ref ref +); + +#keyset[id] +offset_of_expr_type_reprs( + int id: @offset_of_expr ref, + int type_repr: @type_repr ref +); + +or_pats( + unique int id: @or_pat +); + +#keyset[id, index] +or_pat_pats( + int id: @or_pat ref, + int index: int ref, + int pat: @pat ref +); + +params( + unique int id: @param +); + +#keyset[id] +param_pats( + int id: @param ref, + int pat: @pat ref +); + +paren_exprs( + unique int id: @paren_expr +); + +#keyset[id, index] +paren_expr_attrs( + int id: @paren_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +paren_expr_exprs( + int id: @paren_expr ref, + int expr: @expr ref +); + +paren_pats( + unique int id: @paren_pat +); + +#keyset[id] +paren_pat_pats( + int id: @paren_pat ref, + int pat: @pat ref +); + +paren_type_reprs( + unique int id: @paren_type_repr +); + +#keyset[id] +paren_type_repr_type_reprs( + int id: @paren_type_repr ref, + int type_repr: @type_repr ref +); + +@path_ast_node = + @path_expr +| @path_pat +| @struct_expr +| @struct_pat +| @tuple_struct_pat +; + +#keyset[id] +path_ast_node_paths( + int id: @path_ast_node ref, + int path: @path ref +); + +@path_expr_base = + @path_expr +; + +path_type_reprs( + unique int id: @path_type_repr +); + +#keyset[id] +path_type_repr_paths( + int id: @path_type_repr ref, + int path: @path ref +); + +prefix_exprs( + unique int id: @prefix_expr +); + +#keyset[id, index] +prefix_expr_attrs( + int id: @prefix_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +prefix_expr_exprs( + int id: @prefix_expr ref, + int expr: @expr ref +); + +#keyset[id] +prefix_expr_operator_names( + int id: @prefix_expr ref, + string operator_name: string ref +); + +ptr_type_reprs( + unique int id: @ptr_type_repr +); + +#keyset[id] +ptr_type_repr_is_const( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_is_mut( + int id: @ptr_type_repr ref +); + +#keyset[id] +ptr_type_repr_type_reprs( + int id: @ptr_type_repr ref, + int type_repr: @type_repr ref +); + +range_exprs( + unique int id: @range_expr +); + +#keyset[id, index] +range_expr_attrs( + int id: @range_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +range_expr_ends( + int id: @range_expr ref, + int end: @expr ref +); + +#keyset[id] +range_expr_operator_names( + int id: @range_expr ref, + string operator_name: string ref +); + +#keyset[id] +range_expr_starts( + int id: @range_expr ref, + int start: @expr ref +); + +range_pats( + unique int id: @range_pat +); + +#keyset[id] +range_pat_ends( + int id: @range_pat ref, + int end: @pat ref +); + +#keyset[id] +range_pat_operator_names( + int id: @range_pat ref, + string operator_name: string ref +); + +#keyset[id] +range_pat_starts( + int id: @range_pat ref, + int start: @pat ref +); + +ref_exprs( + unique int id: @ref_expr +); + +#keyset[id, index] +ref_expr_attrs( + int id: @ref_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +ref_expr_exprs( + int id: @ref_expr ref, + int expr: @expr ref +); + +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + +ref_pats( + unique int id: @ref_pat +); + +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + +#keyset[id] +ref_pat_pats( + int id: @ref_pat ref, + int pat: @pat ref +); + +ref_type_reprs( + unique int id: @ref_type_repr +); + +#keyset[id] +ref_type_repr_is_mut( + int id: @ref_type_repr ref +); + +#keyset[id] +ref_type_repr_lifetimes( + int id: @ref_type_repr ref, + int lifetime: @lifetime ref +); + +#keyset[id] +ref_type_repr_type_reprs( + int id: @ref_type_repr ref, + int type_repr: @type_repr ref +); + +rest_pats( + unique int id: @rest_pat +); + +#keyset[id, index] +rest_pat_attrs( + int id: @rest_pat ref, + int index: int ref, + int attr: @attr ref +); + +return_exprs( + unique int id: @return_expr +); + +#keyset[id, index] +return_expr_attrs( + int id: @return_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +return_expr_exprs( + int id: @return_expr ref, + int expr: @expr ref +); + +self_params( + unique int id: @self_param +); + +#keyset[id] +self_param_is_ref( + int id: @self_param ref +); + +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + +#keyset[id] +self_param_lifetimes( + int id: @self_param ref, + int lifetime: @lifetime ref +); + +#keyset[id] +self_param_names( + int id: @self_param ref, + int name: @name ref +); + +slice_pats( + unique int id: @slice_pat +); + +#keyset[id, index] +slice_pat_pats( + int id: @slice_pat ref, + int index: int ref, + int pat: @pat ref +); + +slice_type_reprs( + unique int id: @slice_type_repr +); + +#keyset[id] +slice_type_repr_type_reprs( + int id: @slice_type_repr ref, + int type_repr: @type_repr ref +); + +struct_field_lists( + unique int id: @struct_field_list +); + +#keyset[id, index] +struct_field_list_fields( + int id: @struct_field_list ref, + int index: int ref, + int field: @struct_field ref +); + +try_exprs( + unique int id: @try_expr +); + +#keyset[id, index] +try_expr_attrs( + int id: @try_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +try_expr_exprs( + int id: @try_expr ref, + int expr: @expr ref +); + +tuple_exprs( + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_attrs( + int id: @tuple_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id, index] +tuple_expr_fields( + int id: @tuple_expr ref, + int index: int ref, + int field: @expr ref +); + +tuple_field_lists( + unique int id: @tuple_field_list +); + +#keyset[id, index] +tuple_field_list_fields( + int id: @tuple_field_list ref, + int index: int ref, + int field: @tuple_field ref +); + +tuple_pats( + unique int id: @tuple_pat +); + +#keyset[id, index] +tuple_pat_fields( + int id: @tuple_pat ref, + int index: int ref, + int field: @pat ref +); + +tuple_type_reprs( + unique int id: @tuple_type_repr +); + +#keyset[id, index] +tuple_type_repr_fields( + int id: @tuple_type_repr ref, + int index: int ref, + int field: @type_repr ref +); + +type_args( + unique int id: @type_arg +); + +#keyset[id] +type_arg_type_reprs( + int id: @type_arg ref, + int type_repr: @type_repr ref +); + +type_params( + unique int id: @type_param +); + +#keyset[id, index] +type_param_attrs( + int id: @type_param ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_param_default_types( + int id: @type_param ref, + int default_type: @type_repr ref +); + +#keyset[id] +type_param_names( + int id: @type_param ref, + int name: @name ref +); + +#keyset[id] +type_param_type_bound_lists( + int id: @type_param ref, + int type_bound_list: @type_bound_list ref +); + +underscore_exprs( + unique int id: @underscore_expr +); + +#keyset[id, index] +underscore_expr_attrs( + int id: @underscore_expr ref, + int index: int ref, + int attr: @attr ref +); + +variants( + unique int id: @variant +); + +#keyset[id, index] +variant_attrs( + int id: @variant ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +variant_discriminants( + int id: @variant ref, + int discriminant: @expr ref +); + +#keyset[id] +variant_field_lists( + int id: @variant ref, + int field_list: @field_list ref +); + +#keyset[id] +variant_names( + int id: @variant ref, + int name: @name ref +); + +#keyset[id] +variant_visibilities( + int id: @variant ref, + int visibility: @visibility ref +); + +wildcard_pats( + unique int id: @wildcard_pat +); + +yeet_exprs( + unique int id: @yeet_expr +); + +#keyset[id, index] +yeet_expr_attrs( + int id: @yeet_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yeet_expr_exprs( + int id: @yeet_expr ref, + int expr: @expr ref +); + +yield_exprs( + unique int id: @yield_expr +); + +#keyset[id, index] +yield_expr_attrs( + int id: @yield_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +yield_expr_exprs( + int id: @yield_expr ref, + int expr: @expr ref +); + +block_exprs( + unique int id: @block_expr +); + +#keyset[id, index] +block_expr_attrs( + int id: @block_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + +#keyset[id] +block_expr_stmt_lists( + int id: @block_expr ref, + int stmt_list: @stmt_list ref +); + +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_functions( + int id: @call_expr ref, + int function: @expr ref +); + +consts( + unique int id: @const +); + +#keyset[id, index] +const_attrs( + int id: @const ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +const_bodies( + int id: @const ref, + int body: @expr ref +); + +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + +#keyset[id] +const_names( + int id: @const ref, + int name: @name ref +); + +#keyset[id] +const_type_reprs( + int id: @const ref, + int type_repr: @type_repr ref +); + +#keyset[id] +const_visibilities( + int id: @const ref, + int visibility: @visibility ref +); + +enums( + unique int id: @enum +); + +#keyset[id, index] +enum_attrs( + int id: @enum ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +enum_generic_param_lists( + int id: @enum ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +enum_names( + int id: @enum ref, + int name: @name ref +); + +#keyset[id] +enum_variant_lists( + int id: @enum ref, + int variant_list: @variant_list ref +); + +#keyset[id] +enum_visibilities( + int id: @enum ref, + int visibility: @visibility ref +); + +#keyset[id] +enum_where_clauses( + int id: @enum ref, + int where_clause: @where_clause ref +); + +extern_blocks( + unique int id: @extern_block +); + +#keyset[id] +extern_block_abis( + int id: @extern_block ref, + int abi: @abi ref +); + +#keyset[id, index] +extern_block_attrs( + int id: @extern_block ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_block_extern_item_lists( + int id: @extern_block ref, + int extern_item_list: @extern_item_list ref +); + +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + +extern_crates( + unique int id: @extern_crate +); + +#keyset[id, index] +extern_crate_attrs( + int id: @extern_crate ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +extern_crate_identifiers( + int id: @extern_crate ref, + int identifier: @name_ref ref +); + +#keyset[id] +extern_crate_renames( + int id: @extern_crate ref, + int rename: @rename ref +); + +#keyset[id] +extern_crate_visibilities( + int id: @extern_crate ref, + int visibility: @visibility ref +); + +functions( + unique int id: @function +); + +#keyset[id] +function_abis( + int id: @function ref, + int abi: @abi ref +); + +#keyset[id] +function_bodies( + int id: @function ref, + int body: @block_expr ref +); + +#keyset[id] +function_generic_param_lists( + int id: @function ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + +#keyset[id] +function_names( + int id: @function ref, + int name: @name ref +); + +#keyset[id] +function_ret_types( + int id: @function ref, + int ret_type: @ret_type_repr ref +); + +#keyset[id] +function_visibilities( + int id: @function ref, + int visibility: @visibility ref +); + +#keyset[id] +function_where_clauses( + int id: @function ref, + int where_clause: @where_clause ref +); + +impls( + unique int id: @impl +); + +#keyset[id] +impl_assoc_item_lists( + int id: @impl ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +impl_attrs( + int id: @impl ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +impl_generic_param_lists( + int id: @impl ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + +#keyset[id] +impl_self_ties( + int id: @impl ref, + int self_ty: @type_repr ref +); + +#keyset[id] +impl_traits( + int id: @impl ref, + int trait: @type_repr ref +); + +#keyset[id] +impl_visibilities( + int id: @impl ref, + int visibility: @visibility ref +); + +#keyset[id] +impl_where_clauses( + int id: @impl ref, + int where_clause: @where_clause ref +); + +@looping_expr = + @for_expr +| @loop_expr +| @while_expr +; + +#keyset[id] +looping_expr_loop_bodies( + int id: @looping_expr ref, + int loop_body: @block_expr ref +); + +macro_calls( + unique int id: @macro_call +); + +#keyset[id, index] +macro_call_attrs( + int id: @macro_call ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_call_paths( + int id: @macro_call ref, + int path: @path ref +); + +#keyset[id] +macro_call_token_trees( + int id: @macro_call ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_call_expandeds( + int id: @macro_call ref, + int expanded: @ast_node ref +); + +macro_defs( + unique int id: @macro_def +); + +#keyset[id] +macro_def_args( + int id: @macro_def ref, + int args: @token_tree ref +); + +#keyset[id, index] +macro_def_attrs( + int id: @macro_def ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_def_bodies( + int id: @macro_def ref, + int body: @token_tree ref +); + +#keyset[id] +macro_def_names( + int id: @macro_def ref, + int name: @name ref +); + +#keyset[id] +macro_def_visibilities( + int id: @macro_def ref, + int visibility: @visibility ref +); + +macro_rules( + unique int id: @macro_rules +); + +#keyset[id, index] +macro_rules_attrs( + int id: @macro_rules ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +macro_rules_names( + int id: @macro_rules ref, + int name: @name ref +); + +#keyset[id] +macro_rules_token_trees( + int id: @macro_rules ref, + int token_tree: @token_tree ref +); + +#keyset[id] +macro_rules_visibilities( + int id: @macro_rules ref, + int visibility: @visibility ref +); + +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_identifiers( + int id: @method_call_expr ref, + int identifier: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + +modules( + unique int id: @module +); + +#keyset[id, index] +module_attrs( + int id: @module ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +module_item_lists( + int id: @module ref, + int item_list: @item_list ref +); + +#keyset[id] +module_names( + int id: @module ref, + int name: @name ref +); + +#keyset[id] +module_visibilities( + int id: @module ref, + int visibility: @visibility ref +); + +path_exprs( + unique int id: @path_expr +); + +#keyset[id, index] +path_expr_attrs( + int id: @path_expr ref, + int index: int ref, + int attr: @attr ref +); + +path_pats( + unique int id: @path_pat +); + +statics( + unique int id: @static +); + +#keyset[id, index] +static_attrs( + int id: @static ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +static_bodies( + int id: @static ref, + int body: @expr ref +); + +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + +#keyset[id] +static_is_unsafe( + int id: @static ref +); + +#keyset[id] +static_names( + int id: @static ref, + int name: @name ref +); + +#keyset[id] +static_type_reprs( + int id: @static ref, + int type_repr: @type_repr ref +); + +#keyset[id] +static_visibilities( + int id: @static ref, + int visibility: @visibility ref +); + +structs( + unique int id: @struct +); + +#keyset[id, index] +struct_attrs( + int id: @struct ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +struct_field_lists_( + int id: @struct ref, + int field_list: @field_list ref +); + +#keyset[id] +struct_generic_param_lists( + int id: @struct ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +struct_names( + int id: @struct ref, + int name: @name ref +); + +#keyset[id] +struct_visibilities( + int id: @struct ref, + int visibility: @visibility ref +); + +#keyset[id] +struct_where_clauses( + int id: @struct ref, + int where_clause: @where_clause ref +); + +struct_exprs( + unique int id: @struct_expr +); + +#keyset[id] +struct_expr_struct_expr_field_lists( + int id: @struct_expr ref, + int struct_expr_field_list: @struct_expr_field_list ref +); + +struct_pats( + unique int id: @struct_pat +); + +#keyset[id] +struct_pat_struct_pat_field_lists( + int id: @struct_pat ref, + int struct_pat_field_list: @struct_pat_field_list ref +); + +traits( + unique int id: @trait +); + +#keyset[id] +trait_assoc_item_lists( + int id: @trait ref, + int assoc_item_list: @assoc_item_list ref +); + +#keyset[id, index] +trait_attrs( + int id: @trait ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_generic_param_lists( + int id: @trait ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + +#keyset[id] +trait_names( + int id: @trait ref, + int name: @name ref +); + +#keyset[id] +trait_type_bound_lists( + int id: @trait ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_visibilities( + int id: @trait ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_where_clauses( + int id: @trait ref, + int where_clause: @where_clause ref +); + +trait_aliases( + unique int id: @trait_alias +); + +#keyset[id, index] +trait_alias_attrs( + int id: @trait_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +trait_alias_generic_param_lists( + int id: @trait_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +trait_alias_names( + int id: @trait_alias ref, + int name: @name ref +); + +#keyset[id] +trait_alias_type_bound_lists( + int id: @trait_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +trait_alias_visibilities( + int id: @trait_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +trait_alias_where_clauses( + int id: @trait_alias ref, + int where_clause: @where_clause ref +); + +tuple_struct_pats( + unique int id: @tuple_struct_pat +); + +#keyset[id, index] +tuple_struct_pat_fields( + int id: @tuple_struct_pat ref, + int index: int ref, + int field: @pat ref +); + +type_aliases( + unique int id: @type_alias +); + +#keyset[id, index] +type_alias_attrs( + int id: @type_alias ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +type_alias_generic_param_lists( + int id: @type_alias ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + +#keyset[id] +type_alias_names( + int id: @type_alias ref, + int name: @name ref +); + +#keyset[id] +type_alias_type_reprs( + int id: @type_alias ref, + int type_repr: @type_repr ref +); + +#keyset[id] +type_alias_type_bound_lists( + int id: @type_alias ref, + int type_bound_list: @type_bound_list ref +); + +#keyset[id] +type_alias_visibilities( + int id: @type_alias ref, + int visibility: @visibility ref +); + +#keyset[id] +type_alias_where_clauses( + int id: @type_alias ref, + int where_clause: @where_clause ref +); + +unions( + unique int id: @union +); + +#keyset[id, index] +union_attrs( + int id: @union ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +union_generic_param_lists( + int id: @union ref, + int generic_param_list: @generic_param_list ref +); + +#keyset[id] +union_names( + int id: @union ref, + int name: @name ref +); + +#keyset[id] +union_struct_field_lists( + int id: @union ref, + int struct_field_list: @struct_field_list ref +); + +#keyset[id] +union_visibilities( + int id: @union ref, + int visibility: @visibility ref +); + +#keyset[id] +union_where_clauses( + int id: @union ref, + int where_clause: @where_clause ref +); + +uses( + unique int id: @use +); + +#keyset[id, index] +use_attrs( + int id: @use ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +use_use_trees( + int id: @use ref, + int use_tree: @use_tree ref +); + +#keyset[id] +use_visibilities( + int id: @use ref, + int visibility: @visibility ref +); + +for_exprs( + unique int id: @for_expr +); + +#keyset[id, index] +for_expr_attrs( + int id: @for_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +for_expr_iterables( + int id: @for_expr ref, + int iterable: @expr ref +); + +#keyset[id] +for_expr_pats( + int id: @for_expr ref, + int pat: @pat ref +); + +loop_exprs( + unique int id: @loop_expr +); + +#keyset[id, index] +loop_expr_attrs( + int id: @loop_expr ref, + int index: int ref, + int attr: @attr ref +); + +while_exprs( + unique int id: @while_expr +); + +#keyset[id, index] +while_expr_attrs( + int id: @while_expr ref, + int index: int ref, + int attr: @attr ref +); + +#keyset[id] +while_expr_conditions( + int id: @while_expr ref, + int condition: @expr ref +); diff --git a/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties new file mode 100644 index 00000000000..c977c1fd43f --- /dev/null +++ b/rust/ql/lib/upgrades/256e80c2dceafb43358213b1ac0e386ea6ef73c3/upgrade.properties @@ -0,0 +1,2 @@ +description: Add `struct_field_is_unsafe` table +compatibility: backwards From 3744ef737968ea8203e5336ed230a2e3b365bb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Mon, 7 Apr 2025 15:43:16 +0200 Subject: [PATCH 102/372] Disable csharp tests that use nuget on macos-15 --- .../posix/standalone_dependencies_no_framework/test.py | 7 +++++-- .../posix/standalone_dependencies_nuget with_space/test.py | 7 +++++-- .../posix/standalone_dependencies_nuget/test.py | 7 +++++-- .../posix/standalone_dependencies_nuget_no_sources/test.py | 5 ++++- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/csharp/ql/integration-tests/posix/standalone_dependencies_no_framework/test.py b/csharp/ql/integration-tests/posix/standalone_dependencies_no_framework/test.py index 4d5c7b24bc9..d1c1745d69b 100644 --- a/csharp/ql/integration-tests/posix/standalone_dependencies_no_framework/test.py +++ b/csharp/ql/integration-tests/posix/standalone_dependencies_no_framework/test.py @@ -3,8 +3,11 @@ import pytest import os -# Skipping the test on the ARM runners, as we're running into trouble with Mono and nuget. -@pytest.mark.only_if(runs_on.linux or (runs_on.macos and runs_on.x86_64)) +# Skipping the test on the ARM runners and macos-15, as we're running into trouble with Mono and nuget. +@pytest.mark.only_if( + runs_on.linux + or (runs_on.macos and runs_on.x86_64 and not runs_on.macos_15) +) def test(codeql, csharp): os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_DOTNET_FRAMEWORK_REFERENCES"] = ( "/non-existent-path" diff --git a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget with_space/test.py b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget with_space/test.py index 5bfcb3bfd1c..6d2058c684c 100644 --- a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget with_space/test.py +++ b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget with_space/test.py @@ -3,8 +3,11 @@ import runs_on import pytest -# Skipping the test on the ARM runners, as we're running into trouble with Mono and nuget. -@pytest.mark.only_if(runs_on.linux or (runs_on.macos and runs_on.x86_64)) +# Skipping the test on the ARM runners and macos-15, as we're running into trouble with Mono and nuget. +@pytest.mark.only_if( + runs_on.linux + or (runs_on.macos and runs_on.x86_64 and not runs_on.macos_15) +) def test(codeql, csharp): # making sure we're not doing any fallback restore: os.environ["CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_TIMEOUT"] = "1" diff --git a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget/test.py b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget/test.py index c7728b64d2a..7f88196097f 100644 --- a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget/test.py +++ b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget/test.py @@ -2,7 +2,10 @@ import runs_on import pytest -# Skipping the test on the ARM runners, as we're running into trouble with Mono and nuget. -@pytest.mark.only_if(runs_on.linux or (runs_on.macos and runs_on.x86_64)) +# Skipping the test on the ARM runners and macos-15, as we're running into trouble with Mono and nuget. +@pytest.mark.only_if( + runs_on.linux + or (runs_on.macos and runs_on.x86_64 and not runs_on.macos_15) +) def test(codeql, csharp): codeql.database.create(build_mode="none") diff --git a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_no_sources/test.py b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_no_sources/test.py index a6a6123f019..185fb5201f9 100644 --- a/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_no_sources/test.py +++ b/csharp/ql/integration-tests/posix/standalone_dependencies_nuget_no_sources/test.py @@ -3,6 +3,9 @@ import pytest # Skipping the test on the ARM runners, as we're running into trouble with Mono and nuget. -@pytest.mark.only_if(runs_on.linux or (runs_on.macos and runs_on.x86_64)) +@pytest.mark.only_if( + runs_on.linux + or (runs_on.macos and runs_on.x86_64 and not runs_on.macos_15) +) def test(codeql, csharp): codeql.database.create(source_root="proj", build_mode="none") From 8e76bb1a43f0d399ccc25889da606c7e4cc0fdf0 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 7 Apr 2025 16:46:54 +0200 Subject: [PATCH 103/372] Rust: Minor changes based on PR review --- rust/ql/lib/codeql/rust/internal/Type.qll | 14 +++++++++----- rust/ql/lib/codeql/rust/internal/TypeMention.qll | 8 ++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/Type.qll b/rust/ql/lib/codeql/rust/internal/Type.qll index c3eb83c8dfa..d9c156ef96f 100644 --- a/rust/ql/lib/codeql/rust/internal/Type.qll +++ b/rust/ql/lib/codeql/rust/internal/Type.qll @@ -16,7 +16,7 @@ newtype TType = TArrayType() or // todo: add size? TRefType() or // todo: add mut? TTypeParamTypeParameter(TypeParam t) or - TAssociatedTypeTypeParameter(TypeAlias t) { any(TraitItemNode trait).getADescendant() = t } or + TAssociatedTypeTypeParameter(TypeAlias t) { any(TraitItemNode trait).getAnAssocItem() = t } or TRefTypeParameter() or TSelfTypeParameter(Trait t) @@ -333,7 +333,11 @@ class TypeParamTypeParameter extends TypeParameter, TTypeParamTypeParameter { } } -/** Gets type alias that is the `i`th type parameter of `trait`. */ +/** + * Gets the type alias that is the `i`th type parameter of `trait`. Type aliases + * are numbered consecutively but in arbitrary order, starting from the index + * following the last ordinary type parameter. + */ predicate traitAliasIndex(Trait trait, int i, TypeAlias typeAlias) { typeAlias = rank[i + 1 - trait.getNumberOfGenericParams()](TypeAlias alias | @@ -354,7 +358,7 @@ predicate traitAliasIndex(Trait trait, int i, TypeAlias typeAlias) { * // ... * } * ``` - * is treated as if it where + * is treated as if it was * ```rust * trait ATrait { * // ... @@ -369,9 +373,9 @@ class AssociatedTypeTypeParameter extends TypeParameter, TAssociatedTypeTypePara TypeAlias getTypeAlias() { result = typeAlias } /** Gets the trait that contains this associated type declaration. */ - TraitItemNode getTrait() { result.getADescendant() = typeAlias } + TraitItemNode getTrait() { result.getAnAssocItem() = typeAlias } - int getIndex() { traitAliasIndex(this.getTrait(), result, typeAlias) } + int getIndex() { traitAliasIndex(_, result, typeAlias) } override Function getMethod(string name) { none() } diff --git a/rust/ql/lib/codeql/rust/internal/TypeMention.qll b/rust/ql/lib/codeql/rust/internal/TypeMention.qll index b049d9b7177..f29b7dfe859 100644 --- a/rust/ql/lib/codeql/rust/internal/TypeMention.qll +++ b/rust/ql/lib/codeql/rust/internal/TypeMention.qll @@ -131,11 +131,15 @@ class TypeParamMention extends TypeMention, TypeParam { override Type resolveType() { result = TTypeParamTypeParameter(this) } } -// Used to represent implicit associated type type arguments in traits. +// Used to represent implicit type arguments for associated types in traits. class TypeAliasMention extends TypeMention, TypeAlias { + private Type t; + + TypeAliasMention() { t = TAssociatedTypeTypeParameter(this) } + override TypeReprMention getTypeArgument(int i) { none() } - override Type resolveType() { result = TAssociatedTypeTypeParameter(this) } + override Type resolveType() { result = t } } /** From 602e617bc669725b836e2a56ab03947d7d242df9 Mon Sep 17 00:00:00 2001 From: Simon Friis Vindum Date: Mon, 7 Apr 2025 17:02:51 +0200 Subject: [PATCH 104/372] Rust: Add type inference test for trait with multiple associated types --- .../test/library-tests/type-inference/main.rs | 33 + .../type-inference/type-inference.expected | 1175 +++++++++-------- 2 files changed, 634 insertions(+), 574 deletions(-) diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index efe1a3444e0..be85debb7c3 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -368,6 +368,18 @@ mod trait_associated_type { } } + // A generic trait with multiple associated types. + trait TraitMultipleAssoc { + type Assoc1; + type Assoc2; + + fn get_zero(&self) -> TrG; + + fn get_one(&self) -> Self::Assoc1; + + fn get_two(&self) -> Self::Assoc2; + } + #[derive(Debug, Default)] struct S; @@ -417,6 +429,23 @@ mod trait_associated_type { thing.m1() // $ method=MyTrait::m1 } + impl TraitMultipleAssoc for AT { + type Assoc1 = S; + type Assoc2 = S2; + + fn get_zero(&self) -> AT { + AT + } + + fn get_one(&self) -> Self::Assoc1 { + S + } + + fn get_two(&self) -> Self::Assoc2 { + S2 + } + } + pub fn f() { let x1 = S; // Call to method in `impl` block @@ -441,6 +470,10 @@ mod trait_associated_type { println!("{:?}", x5.m1()); // $ method=m1 MISSING: type=x5.m1():A.S2 let x6 = S2; println!("{:?}", x6.m2()); // $ method=m2 type=x6.m2():A.S2 + + let assoc_zero = AT.get_zero(); // $ method=get_zero type=assoc_zero:AT + let assoc_one = AT.get_one(); // $ method=get_one type=assoc_one:S + let assoc_two = AT.get_two(); // $ method=get_two type=assoc_two:S2 } } diff --git a/rust/ql/test/library-tests/type-inference/type-inference.expected b/rust/ql/test/library-tests/type-inference/type-inference.expected index 907ea9fcc53..477aebc2099 100644 --- a/rust/ql/test/library-tests/type-inference/type-inference.expected +++ b/rust/ql/test/library-tests/type-inference/type-inference.expected @@ -356,577 +356,604 @@ inferType | main.rs:367:13:367:16 | self | &T | main.rs:359:5:369:5 | Self [trait MyTraitAssoc2] | | main.rs:367:13:367:23 | self.put(...) | | main.rs:360:9:360:52 | GenericAssociatedType | | main.rs:367:22:367:22 | b | | main.rs:365:19:365:19 | A | -| main.rs:384:15:384:18 | SelfParam | | main.rs:371:5:372:13 | S | -| main.rs:384:45:386:9 | { ... } | | main.rs:377:5:378:14 | AT | -| main.rs:385:13:385:14 | AT | | main.rs:377:5:378:14 | AT | -| main.rs:394:19:394:23 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:394:19:394:23 | SelfParam | &T | main.rs:371:5:372:13 | S | -| main.rs:394:26:394:26 | a | | main.rs:394:16:394:16 | A | -| main.rs:394:46:396:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | -| main.rs:394:46:396:9 | { ... } | A | main.rs:394:16:394:16 | A | -| main.rs:395:13:395:32 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | -| main.rs:395:13:395:32 | Wrapper {...} | A | main.rs:394:16:394:16 | A | -| main.rs:395:30:395:30 | a | | main.rs:394:16:394:16 | A | -| main.rs:403:15:403:18 | SelfParam | | main.rs:374:5:375:14 | S2 | -| main.rs:403:45:405:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | -| main.rs:403:45:405:9 | { ... } | A | main.rs:374:5:375:14 | S2 | -| main.rs:404:13:404:35 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | -| main.rs:404:13:404:35 | Wrapper {...} | A | main.rs:374:5:375:14 | S2 | -| main.rs:404:30:404:33 | self | | main.rs:374:5:375:14 | S2 | -| main.rs:410:30:412:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | -| main.rs:410:30:412:9 | { ... } | A | main.rs:374:5:375:14 | S2 | -| main.rs:411:13:411:33 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | -| main.rs:411:13:411:33 | Wrapper {...} | A | main.rs:374:5:375:14 | S2 | -| main.rs:411:30:411:31 | S2 | | main.rs:374:5:375:14 | S2 | -| main.rs:416:22:416:26 | thing | | main.rs:416:10:416:19 | T | -| main.rs:417:9:417:13 | thing | | main.rs:416:10:416:19 | T | -| main.rs:421:13:421:14 | x1 | | main.rs:371:5:372:13 | S | -| main.rs:421:18:421:18 | S | | main.rs:371:5:372:13 | S | -| main.rs:423:26:423:27 | x1 | | main.rs:371:5:372:13 | S | -| main.rs:423:26:423:32 | x1.m1() | | main.rs:377:5:378:14 | AT | -| main.rs:425:13:425:14 | x2 | | main.rs:371:5:372:13 | S | -| main.rs:425:18:425:18 | S | | main.rs:371:5:372:13 | S | -| main.rs:427:13:427:13 | y | | main.rs:377:5:378:14 | AT | -| main.rs:427:17:427:18 | x2 | | main.rs:371:5:372:13 | S | -| main.rs:427:17:427:23 | x2.m2() | | main.rs:377:5:378:14 | AT | -| main.rs:428:26:428:26 | y | | main.rs:377:5:378:14 | AT | -| main.rs:430:13:430:14 | x3 | | main.rs:371:5:372:13 | S | -| main.rs:430:18:430:18 | S | | main.rs:371:5:372:13 | S | -| main.rs:432:26:432:27 | x3 | | main.rs:371:5:372:13 | S | -| main.rs:432:26:432:34 | x3.put(...) | | main.rs:332:5:335:5 | Wrapper | -| main.rs:435:26:435:27 | x3 | | main.rs:371:5:372:13 | S | -| main.rs:437:20:437:20 | S | | main.rs:371:5:372:13 | S | -| main.rs:440:13:440:14 | x5 | | main.rs:374:5:375:14 | S2 | -| main.rs:440:18:440:19 | S2 | | main.rs:374:5:375:14 | S2 | -| main.rs:441:26:441:27 | x5 | | main.rs:374:5:375:14 | S2 | -| main.rs:441:26:441:32 | x5.m1() | | main.rs:332:5:335:5 | Wrapper | -| main.rs:442:13:442:14 | x6 | | main.rs:374:5:375:14 | S2 | -| main.rs:442:18:442:19 | S2 | | main.rs:374:5:375:14 | S2 | -| main.rs:443:26:443:27 | x6 | | main.rs:374:5:375:14 | S2 | -| main.rs:443:26:443:32 | x6.m2() | | main.rs:332:5:335:5 | Wrapper | -| main.rs:443:26:443:32 | x6.m2() | A | main.rs:374:5:375:14 | S2 | -| main.rs:460:15:460:18 | SelfParam | | main.rs:448:5:452:5 | MyEnum | -| main.rs:460:15:460:18 | SelfParam | A | main.rs:459:10:459:10 | T | -| main.rs:460:26:465:9 | { ... } | | main.rs:459:10:459:10 | T | -| main.rs:461:13:464:13 | match self { ... } | | main.rs:459:10:459:10 | T | -| main.rs:461:19:461:22 | self | | main.rs:448:5:452:5 | MyEnum | -| main.rs:461:19:461:22 | self | A | main.rs:459:10:459:10 | T | -| main.rs:462:28:462:28 | a | | main.rs:459:10:459:10 | T | -| main.rs:462:34:462:34 | a | | main.rs:459:10:459:10 | T | -| main.rs:463:30:463:30 | a | | main.rs:459:10:459:10 | T | -| main.rs:463:37:463:37 | a | | main.rs:459:10:459:10 | T | -| main.rs:469:13:469:13 | x | | main.rs:448:5:452:5 | MyEnum | -| main.rs:469:13:469:13 | x | A | main.rs:454:5:455:14 | S1 | -| main.rs:469:17:469:30 | ...::C1(...) | | main.rs:448:5:452:5 | MyEnum | -| main.rs:469:17:469:30 | ...::C1(...) | A | main.rs:454:5:455:14 | S1 | -| main.rs:469:28:469:29 | S1 | | main.rs:454:5:455:14 | S1 | -| main.rs:470:13:470:13 | y | | main.rs:448:5:452:5 | MyEnum | -| main.rs:470:13:470:13 | y | A | main.rs:456:5:457:14 | S2 | -| main.rs:470:17:470:36 | ...::C2 {...} | | main.rs:448:5:452:5 | MyEnum | -| main.rs:470:17:470:36 | ...::C2 {...} | A | main.rs:456:5:457:14 | S2 | -| main.rs:470:33:470:34 | S2 | | main.rs:456:5:457:14 | S2 | -| main.rs:472:26:472:26 | x | | main.rs:448:5:452:5 | MyEnum | -| main.rs:472:26:472:26 | x | A | main.rs:454:5:455:14 | S1 | -| main.rs:472:26:472:31 | x.m1() | | main.rs:454:5:455:14 | S1 | -| main.rs:473:26:473:26 | y | | main.rs:448:5:452:5 | MyEnum | -| main.rs:473:26:473:26 | y | A | main.rs:456:5:457:14 | S2 | -| main.rs:473:26:473:31 | y.m1() | | main.rs:456:5:457:14 | S2 | -| main.rs:495:15:495:18 | SelfParam | | main.rs:493:5:496:5 | Self [trait MyTrait1] | -| main.rs:499:15:499:18 | SelfParam | | main.rs:498:5:509:5 | Self [trait MyTrait2] | -| main.rs:502:9:508:9 | { ... } | | main.rs:498:20:498:22 | Tr2 | -| main.rs:503:13:507:13 | if ... {...} else {...} | | main.rs:498:20:498:22 | Tr2 | -| main.rs:503:26:505:13 | { ... } | | main.rs:498:20:498:22 | Tr2 | -| main.rs:504:17:504:20 | self | | main.rs:498:5:509:5 | Self [trait MyTrait2] | -| main.rs:504:17:504:25 | self.m1() | | main.rs:498:20:498:22 | Tr2 | -| main.rs:505:20:507:13 | { ... } | | main.rs:498:20:498:22 | Tr2 | -| main.rs:506:17:506:30 | ...::m1(...) | | main.rs:498:20:498:22 | Tr2 | -| main.rs:506:26:506:29 | self | | main.rs:498:5:509:5 | Self [trait MyTrait2] | -| main.rs:512:15:512:18 | SelfParam | | main.rs:511:5:522:5 | Self [trait MyTrait3] | -| main.rs:515:9:521:9 | { ... } | | main.rs:511:20:511:22 | Tr3 | -| main.rs:516:13:520:13 | if ... {...} else {...} | | main.rs:511:20:511:22 | Tr3 | -| main.rs:516:26:518:13 | { ... } | | main.rs:511:20:511:22 | Tr3 | -| main.rs:517:17:517:20 | self | | main.rs:511:5:522:5 | Self [trait MyTrait3] | -| main.rs:517:17:517:25 | self.m2() | | main.rs:478:5:481:5 | MyThing | -| main.rs:517:17:517:25 | self.m2() | A | main.rs:511:20:511:22 | Tr3 | -| main.rs:517:17:517:27 | ... .a | | main.rs:511:20:511:22 | Tr3 | -| main.rs:518:20:520:13 | { ... } | | main.rs:511:20:511:22 | Tr3 | -| main.rs:519:17:519:30 | ...::m2(...) | | main.rs:478:5:481:5 | MyThing | -| main.rs:519:17:519:30 | ...::m2(...) | A | main.rs:511:20:511:22 | Tr3 | -| main.rs:519:17:519:32 | ... .a | | main.rs:511:20:511:22 | Tr3 | -| main.rs:519:26:519:29 | self | | main.rs:511:5:522:5 | Self [trait MyTrait3] | -| main.rs:526:15:526:18 | SelfParam | | main.rs:478:5:481:5 | MyThing | -| main.rs:526:15:526:18 | SelfParam | A | main.rs:524:10:524:10 | T | -| main.rs:526:26:528:9 | { ... } | | main.rs:524:10:524:10 | T | -| main.rs:527:13:527:16 | self | | main.rs:478:5:481:5 | MyThing | -| main.rs:527:13:527:16 | self | A | main.rs:524:10:524:10 | T | -| main.rs:527:13:527:18 | self.a | | main.rs:524:10:524:10 | T | -| main.rs:535:15:535:18 | SelfParam | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:535:15:535:18 | SelfParam | A | main.rs:533:10:533:10 | T | -| main.rs:535:35:537:9 | { ... } | | main.rs:478:5:481:5 | MyThing | -| main.rs:535:35:537:9 | { ... } | A | main.rs:533:10:533:10 | T | -| main.rs:536:13:536:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | -| main.rs:536:13:536:33 | MyThing {...} | A | main.rs:533:10:533:10 | T | -| main.rs:536:26:536:29 | self | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:536:26:536:29 | self | A | main.rs:533:10:533:10 | T | -| main.rs:536:26:536:31 | self.a | | main.rs:533:10:533:10 | T | -| main.rs:545:13:545:13 | x | | main.rs:478:5:481:5 | MyThing | -| main.rs:545:13:545:13 | x | A | main.rs:488:5:489:14 | S1 | -| main.rs:545:17:545:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | -| main.rs:545:17:545:33 | MyThing {...} | A | main.rs:488:5:489:14 | S1 | -| main.rs:545:30:545:31 | S1 | | main.rs:488:5:489:14 | S1 | -| main.rs:546:13:546:13 | y | | main.rs:478:5:481:5 | MyThing | -| main.rs:546:13:546:13 | y | A | main.rs:490:5:491:14 | S2 | -| main.rs:546:17:546:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | -| main.rs:546:17:546:33 | MyThing {...} | A | main.rs:490:5:491:14 | S2 | -| main.rs:546:30:546:31 | S2 | | main.rs:490:5:491:14 | S2 | -| main.rs:548:26:548:26 | x | | main.rs:478:5:481:5 | MyThing | -| main.rs:548:26:548:26 | x | A | main.rs:488:5:489:14 | S1 | -| main.rs:548:26:548:31 | x.m1() | | main.rs:488:5:489:14 | S1 | -| main.rs:549:26:549:26 | y | | main.rs:478:5:481:5 | MyThing | -| main.rs:549:26:549:26 | y | A | main.rs:490:5:491:14 | S2 | -| main.rs:549:26:549:31 | y.m1() | | main.rs:490:5:491:14 | S2 | -| main.rs:551:13:551:13 | x | | main.rs:478:5:481:5 | MyThing | -| main.rs:551:13:551:13 | x | A | main.rs:488:5:489:14 | S1 | -| main.rs:551:17:551:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | -| main.rs:551:17:551:33 | MyThing {...} | A | main.rs:488:5:489:14 | S1 | -| main.rs:551:30:551:31 | S1 | | main.rs:488:5:489:14 | S1 | -| main.rs:552:13:552:13 | y | | main.rs:478:5:481:5 | MyThing | -| main.rs:552:13:552:13 | y | A | main.rs:490:5:491:14 | S2 | -| main.rs:552:17:552:33 | MyThing {...} | | main.rs:478:5:481:5 | MyThing | -| main.rs:552:17:552:33 | MyThing {...} | A | main.rs:490:5:491:14 | S2 | -| main.rs:552:30:552:31 | S2 | | main.rs:490:5:491:14 | S2 | -| main.rs:554:26:554:26 | x | | main.rs:478:5:481:5 | MyThing | -| main.rs:554:26:554:26 | x | A | main.rs:488:5:489:14 | S1 | -| main.rs:554:26:554:31 | x.m2() | | main.rs:488:5:489:14 | S1 | -| main.rs:555:26:555:26 | y | | main.rs:478:5:481:5 | MyThing | -| main.rs:555:26:555:26 | y | A | main.rs:490:5:491:14 | S2 | -| main.rs:555:26:555:31 | y.m2() | | main.rs:490:5:491:14 | S2 | -| main.rs:557:13:557:13 | x | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:557:13:557:13 | x | A | main.rs:488:5:489:14 | S1 | -| main.rs:557:17:557:34 | MyThing2 {...} | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:557:17:557:34 | MyThing2 {...} | A | main.rs:488:5:489:14 | S1 | -| main.rs:557:31:557:32 | S1 | | main.rs:488:5:489:14 | S1 | -| main.rs:558:13:558:13 | y | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:558:13:558:13 | y | A | main.rs:490:5:491:14 | S2 | -| main.rs:558:17:558:34 | MyThing2 {...} | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:558:17:558:34 | MyThing2 {...} | A | main.rs:490:5:491:14 | S2 | -| main.rs:558:31:558:32 | S2 | | main.rs:490:5:491:14 | S2 | -| main.rs:560:26:560:26 | x | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:560:26:560:26 | x | A | main.rs:488:5:489:14 | S1 | -| main.rs:560:26:560:31 | x.m3() | | main.rs:488:5:489:14 | S1 | -| main.rs:561:26:561:26 | y | | main.rs:483:5:486:5 | MyThing2 | -| main.rs:561:26:561:26 | y | A | main.rs:490:5:491:14 | S2 | -| main.rs:561:26:561:31 | y.m3() | | main.rs:490:5:491:14 | S2 | -| main.rs:579:22:579:22 | x | | file://:0:0:0:0 | & | -| main.rs:579:22:579:22 | x | &T | main.rs:579:11:579:19 | T | -| main.rs:579:35:581:5 | { ... } | | file://:0:0:0:0 | & | -| main.rs:579:35:581:5 | { ... } | &T | main.rs:579:11:579:19 | T | -| main.rs:580:9:580:9 | x | | file://:0:0:0:0 | & | -| main.rs:580:9:580:9 | x | &T | main.rs:579:11:579:19 | T | -| main.rs:584:17:584:20 | SelfParam | | main.rs:569:5:570:14 | S1 | -| main.rs:584:29:586:9 | { ... } | | main.rs:572:5:573:14 | S2 | -| main.rs:585:13:585:14 | S2 | | main.rs:572:5:573:14 | S2 | -| main.rs:589:21:589:21 | x | | main.rs:589:13:589:14 | T1 | -| main.rs:592:5:594:5 | { ... } | | main.rs:589:17:589:18 | T2 | -| main.rs:593:9:593:9 | x | | main.rs:589:13:589:14 | T1 | -| main.rs:593:9:593:16 | x.into() | | main.rs:589:17:589:18 | T2 | -| main.rs:597:13:597:13 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:597:17:597:18 | S1 | | main.rs:569:5:570:14 | S1 | -| main.rs:598:26:598:31 | id(...) | | file://:0:0:0:0 | & | -| main.rs:598:26:598:31 | id(...) | &T | main.rs:569:5:570:14 | S1 | -| main.rs:598:29:598:30 | &x | | file://:0:0:0:0 | & | -| main.rs:598:29:598:30 | &x | &T | main.rs:569:5:570:14 | S1 | -| main.rs:598:30:598:30 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:600:13:600:13 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:600:17:600:18 | S1 | | main.rs:569:5:570:14 | S1 | -| main.rs:601:26:601:37 | id::<...>(...) | | file://:0:0:0:0 | & | -| main.rs:601:26:601:37 | id::<...>(...) | &T | main.rs:569:5:570:14 | S1 | -| main.rs:601:35:601:36 | &x | | file://:0:0:0:0 | & | -| main.rs:601:35:601:36 | &x | &T | main.rs:569:5:570:14 | S1 | -| main.rs:601:36:601:36 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:603:13:603:13 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:603:17:603:18 | S1 | | main.rs:569:5:570:14 | S1 | -| main.rs:604:26:604:44 | id::<...>(...) | | file://:0:0:0:0 | & | -| main.rs:604:26:604:44 | id::<...>(...) | &T | main.rs:569:5:570:14 | S1 | -| main.rs:604:42:604:43 | &x | | file://:0:0:0:0 | & | -| main.rs:604:42:604:43 | &x | &T | main.rs:569:5:570:14 | S1 | -| main.rs:604:43:604:43 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:606:13:606:13 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:606:17:606:18 | S1 | | main.rs:569:5:570:14 | S1 | -| main.rs:607:9:607:25 | into::<...>(...) | | main.rs:572:5:573:14 | S2 | -| main.rs:607:24:607:24 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:609:13:609:13 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:609:17:609:18 | S1 | | main.rs:569:5:570:14 | S1 | -| main.rs:610:13:610:13 | y | | main.rs:572:5:573:14 | S2 | -| main.rs:610:21:610:27 | into(...) | | main.rs:572:5:573:14 | S2 | -| main.rs:610:26:610:26 | x | | main.rs:569:5:570:14 | S1 | -| main.rs:640:13:640:14 | p1 | | main.rs:615:5:621:5 | PairOption | -| main.rs:640:13:640:14 | p1 | Fst | main.rs:623:5:624:14 | S1 | -| main.rs:640:13:640:14 | p1 | Snd | main.rs:626:5:627:14 | S2 | -| main.rs:640:26:640:53 | ...::PairBoth(...) | | main.rs:615:5:621:5 | PairOption | -| main.rs:640:26:640:53 | ...::PairBoth(...) | Fst | main.rs:623:5:624:14 | S1 | -| main.rs:640:26:640:53 | ...::PairBoth(...) | Snd | main.rs:626:5:627:14 | S2 | -| main.rs:640:47:640:48 | S1 | | main.rs:623:5:624:14 | S1 | -| main.rs:640:51:640:52 | S2 | | main.rs:626:5:627:14 | S2 | -| main.rs:641:26:641:27 | p1 | | main.rs:615:5:621:5 | PairOption | -| main.rs:641:26:641:27 | p1 | Fst | main.rs:623:5:624:14 | S1 | -| main.rs:641:26:641:27 | p1 | Snd | main.rs:626:5:627:14 | S2 | -| main.rs:644:13:644:14 | p2 | | main.rs:615:5:621:5 | PairOption | -| main.rs:644:26:644:47 | ...::PairNone(...) | | main.rs:615:5:621:5 | PairOption | -| main.rs:645:26:645:27 | p2 | | main.rs:615:5:621:5 | PairOption | -| main.rs:648:13:648:14 | p3 | | main.rs:615:5:621:5 | PairOption | -| main.rs:648:13:648:14 | p3 | Snd | main.rs:629:5:630:14 | S3 | -| main.rs:648:34:648:56 | ...::PairSnd(...) | | main.rs:615:5:621:5 | PairOption | -| main.rs:648:34:648:56 | ...::PairSnd(...) | Snd | main.rs:629:5:630:14 | S3 | -| main.rs:648:54:648:55 | S3 | | main.rs:629:5:630:14 | S3 | -| main.rs:649:26:649:27 | p3 | | main.rs:615:5:621:5 | PairOption | -| main.rs:649:26:649:27 | p3 | Snd | main.rs:629:5:630:14 | S3 | -| main.rs:652:13:652:14 | p3 | | main.rs:615:5:621:5 | PairOption | -| main.rs:652:13:652:14 | p3 | Fst | main.rs:629:5:630:14 | S3 | -| main.rs:652:35:652:56 | ...::PairNone(...) | | main.rs:615:5:621:5 | PairOption | -| main.rs:652:35:652:56 | ...::PairNone(...) | Fst | main.rs:629:5:630:14 | S3 | -| main.rs:653:26:653:27 | p3 | | main.rs:615:5:621:5 | PairOption | -| main.rs:653:26:653:27 | p3 | Fst | main.rs:629:5:630:14 | S3 | -| main.rs:666:16:666:24 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:666:16:666:24 | SelfParam | &T | main.rs:664:5:671:5 | Self [trait MyTrait] | -| main.rs:666:27:666:31 | value | | main.rs:664:19:664:19 | S | -| main.rs:668:21:668:29 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:668:21:668:29 | SelfParam | &T | main.rs:664:5:671:5 | Self [trait MyTrait] | -| main.rs:668:32:668:36 | value | | main.rs:664:19:664:19 | S | -| main.rs:669:13:669:16 | self | | file://:0:0:0:0 | & | -| main.rs:669:13:669:16 | self | &T | main.rs:664:5:671:5 | Self [trait MyTrait] | -| main.rs:669:22:669:26 | value | | main.rs:664:19:664:19 | S | -| main.rs:675:16:675:24 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:675:16:675:24 | SelfParam | &T | main.rs:658:5:662:5 | MyOption | -| main.rs:675:16:675:24 | SelfParam | &T.T | main.rs:673:10:673:10 | T | -| main.rs:675:27:675:31 | value | | main.rs:673:10:673:10 | T | -| main.rs:679:26:681:9 | { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:679:26:681:9 | { ... } | T | main.rs:678:10:678:10 | T | -| main.rs:680:13:680:30 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:680:13:680:30 | ...::MyNone(...) | T | main.rs:678:10:678:10 | T | -| main.rs:685:20:685:23 | SelfParam | | main.rs:658:5:662:5 | MyOption | -| main.rs:685:20:685:23 | SelfParam | T | main.rs:658:5:662:5 | MyOption | -| main.rs:685:20:685:23 | SelfParam | T.T | main.rs:684:10:684:10 | T | -| main.rs:685:41:690:9 | { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:685:41:690:9 | { ... } | T | main.rs:684:10:684:10 | T | -| main.rs:686:13:689:13 | match self { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:686:13:689:13 | match self { ... } | T | main.rs:684:10:684:10 | T | -| main.rs:686:19:686:22 | self | | main.rs:658:5:662:5 | MyOption | -| main.rs:686:19:686:22 | self | T | main.rs:658:5:662:5 | MyOption | -| main.rs:686:19:686:22 | self | T.T | main.rs:684:10:684:10 | T | -| main.rs:687:39:687:56 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:687:39:687:56 | ...::MyNone(...) | T | main.rs:684:10:684:10 | T | -| main.rs:688:34:688:34 | x | | main.rs:658:5:662:5 | MyOption | -| main.rs:688:34:688:34 | x | T | main.rs:684:10:684:10 | T | -| main.rs:688:40:688:40 | x | | main.rs:658:5:662:5 | MyOption | -| main.rs:688:40:688:40 | x | T | main.rs:684:10:684:10 | T | -| main.rs:697:13:697:14 | x1 | | main.rs:658:5:662:5 | MyOption | -| main.rs:697:18:697:37 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:698:26:698:27 | x1 | | main.rs:658:5:662:5 | MyOption | -| main.rs:700:13:700:18 | mut x2 | | main.rs:658:5:662:5 | MyOption | -| main.rs:700:13:700:18 | mut x2 | T | main.rs:693:5:694:13 | S | -| main.rs:700:22:700:36 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:700:22:700:36 | ...::new(...) | T | main.rs:693:5:694:13 | S | -| main.rs:701:9:701:10 | x2 | | main.rs:658:5:662:5 | MyOption | -| main.rs:701:9:701:10 | x2 | T | main.rs:693:5:694:13 | S | -| main.rs:701:16:701:16 | S | | main.rs:693:5:694:13 | S | -| main.rs:702:26:702:27 | x2 | | main.rs:658:5:662:5 | MyOption | -| main.rs:702:26:702:27 | x2 | T | main.rs:693:5:694:13 | S | -| main.rs:704:13:704:18 | mut x3 | | main.rs:658:5:662:5 | MyOption | -| main.rs:704:22:704:36 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:705:9:705:10 | x3 | | main.rs:658:5:662:5 | MyOption | -| main.rs:705:21:705:21 | S | | main.rs:693:5:694:13 | S | -| main.rs:706:26:706:27 | x3 | | main.rs:658:5:662:5 | MyOption | -| main.rs:708:13:708:18 | mut x4 | | main.rs:658:5:662:5 | MyOption | -| main.rs:708:13:708:18 | mut x4 | T | main.rs:693:5:694:13 | S | -| main.rs:708:22:708:36 | ...::new(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:708:22:708:36 | ...::new(...) | T | main.rs:693:5:694:13 | S | -| main.rs:709:23:709:29 | &mut x4 | | file://:0:0:0:0 | & | -| main.rs:709:23:709:29 | &mut x4 | &T | main.rs:658:5:662:5 | MyOption | -| main.rs:709:23:709:29 | &mut x4 | &T.T | main.rs:693:5:694:13 | S | -| main.rs:709:28:709:29 | x4 | | main.rs:658:5:662:5 | MyOption | -| main.rs:709:28:709:29 | x4 | T | main.rs:693:5:694:13 | S | -| main.rs:709:32:709:32 | S | | main.rs:693:5:694:13 | S | -| main.rs:710:26:710:27 | x4 | | main.rs:658:5:662:5 | MyOption | -| main.rs:710:26:710:27 | x4 | T | main.rs:693:5:694:13 | S | -| main.rs:712:13:712:14 | x5 | | main.rs:658:5:662:5 | MyOption | -| main.rs:712:13:712:14 | x5 | T | main.rs:658:5:662:5 | MyOption | -| main.rs:712:13:712:14 | x5 | T.T | main.rs:693:5:694:13 | S | -| main.rs:712:18:712:58 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:712:18:712:58 | ...::MySome(...) | T | main.rs:658:5:662:5 | MyOption | -| main.rs:712:18:712:58 | ...::MySome(...) | T.T | main.rs:693:5:694:13 | S | -| main.rs:712:35:712:57 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:712:35:712:57 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | -| main.rs:713:26:713:27 | x5 | | main.rs:658:5:662:5 | MyOption | -| main.rs:713:26:713:27 | x5 | T | main.rs:658:5:662:5 | MyOption | -| main.rs:713:26:713:27 | x5 | T.T | main.rs:693:5:694:13 | S | -| main.rs:715:13:715:14 | x6 | | main.rs:658:5:662:5 | MyOption | -| main.rs:715:13:715:14 | x6 | T | main.rs:658:5:662:5 | MyOption | -| main.rs:715:13:715:14 | x6 | T.T | main.rs:693:5:694:13 | S | -| main.rs:715:18:715:58 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:715:18:715:58 | ...::MySome(...) | T | main.rs:658:5:662:5 | MyOption | -| main.rs:715:18:715:58 | ...::MySome(...) | T.T | main.rs:693:5:694:13 | S | -| main.rs:715:35:715:57 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:715:35:715:57 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | -| main.rs:716:26:716:61 | ...::flatten(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:716:26:716:61 | ...::flatten(...) | T | main.rs:693:5:694:13 | S | -| main.rs:716:59:716:60 | x6 | | main.rs:658:5:662:5 | MyOption | -| main.rs:716:59:716:60 | x6 | T | main.rs:658:5:662:5 | MyOption | -| main.rs:716:59:716:60 | x6 | T.T | main.rs:693:5:694:13 | S | -| main.rs:718:13:718:19 | from_if | | main.rs:658:5:662:5 | MyOption | -| main.rs:718:13:718:19 | from_if | T | main.rs:693:5:694:13 | S | -| main.rs:718:23:722:9 | if ... {...} else {...} | | main.rs:658:5:662:5 | MyOption | -| main.rs:718:23:722:9 | if ... {...} else {...} | T | main.rs:693:5:694:13 | S | -| main.rs:718:36:720:9 | { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:718:36:720:9 | { ... } | T | main.rs:693:5:694:13 | S | -| main.rs:719:13:719:30 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:719:13:719:30 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | -| main.rs:720:16:722:9 | { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:720:16:722:9 | { ... } | T | main.rs:693:5:694:13 | S | -| main.rs:721:13:721:31 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:721:13:721:31 | ...::MySome(...) | T | main.rs:693:5:694:13 | S | -| main.rs:721:30:721:30 | S | | main.rs:693:5:694:13 | S | -| main.rs:723:26:723:32 | from_if | | main.rs:658:5:662:5 | MyOption | -| main.rs:723:26:723:32 | from_if | T | main.rs:693:5:694:13 | S | -| main.rs:725:13:725:22 | from_match | | main.rs:658:5:662:5 | MyOption | -| main.rs:725:13:725:22 | from_match | T | main.rs:693:5:694:13 | S | -| main.rs:725:26:728:9 | match ... { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:725:26:728:9 | match ... { ... } | T | main.rs:693:5:694:13 | S | -| main.rs:726:21:726:38 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:726:21:726:38 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | -| main.rs:727:22:727:40 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:727:22:727:40 | ...::MySome(...) | T | main.rs:693:5:694:13 | S | -| main.rs:727:39:727:39 | S | | main.rs:693:5:694:13 | S | -| main.rs:729:26:729:35 | from_match | | main.rs:658:5:662:5 | MyOption | -| main.rs:729:26:729:35 | from_match | T | main.rs:693:5:694:13 | S | -| main.rs:731:13:731:21 | from_loop | | main.rs:658:5:662:5 | MyOption | -| main.rs:731:13:731:21 | from_loop | T | main.rs:693:5:694:13 | S | -| main.rs:731:25:736:9 | loop { ... } | | main.rs:658:5:662:5 | MyOption | -| main.rs:731:25:736:9 | loop { ... } | T | main.rs:693:5:694:13 | S | -| main.rs:733:23:733:40 | ...::MyNone(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:733:23:733:40 | ...::MyNone(...) | T | main.rs:693:5:694:13 | S | -| main.rs:735:19:735:37 | ...::MySome(...) | | main.rs:658:5:662:5 | MyOption | -| main.rs:735:19:735:37 | ...::MySome(...) | T | main.rs:693:5:694:13 | S | -| main.rs:735:36:735:36 | S | | main.rs:693:5:694:13 | S | -| main.rs:737:26:737:34 | from_loop | | main.rs:658:5:662:5 | MyOption | -| main.rs:737:26:737:34 | from_loop | T | main.rs:693:5:694:13 | S | -| main.rs:750:15:750:18 | SelfParam | | main.rs:743:5:744:19 | S | -| main.rs:750:15:750:18 | SelfParam | T | main.rs:749:10:749:10 | T | -| main.rs:750:26:752:9 | { ... } | | main.rs:749:10:749:10 | T | -| main.rs:751:13:751:16 | self | | main.rs:743:5:744:19 | S | -| main.rs:751:13:751:16 | self | T | main.rs:749:10:749:10 | T | -| main.rs:751:13:751:18 | self.0 | | main.rs:749:10:749:10 | T | -| main.rs:754:15:754:19 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:754:15:754:19 | SelfParam | &T | main.rs:743:5:744:19 | S | -| main.rs:754:15:754:19 | SelfParam | &T.T | main.rs:749:10:749:10 | T | -| main.rs:754:28:756:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:754:28:756:9 | { ... } | &T | main.rs:749:10:749:10 | T | -| main.rs:755:13:755:19 | &... | | file://:0:0:0:0 | & | -| main.rs:755:13:755:19 | &... | &T | main.rs:749:10:749:10 | T | -| main.rs:755:14:755:17 | self | | file://:0:0:0:0 | & | -| main.rs:755:14:755:17 | self | &T | main.rs:743:5:744:19 | S | -| main.rs:755:14:755:17 | self | &T.T | main.rs:749:10:749:10 | T | -| main.rs:755:14:755:19 | self.0 | | main.rs:749:10:749:10 | T | -| main.rs:758:15:758:25 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:758:15:758:25 | SelfParam | &T | main.rs:743:5:744:19 | S | -| main.rs:758:15:758:25 | SelfParam | &T.T | main.rs:749:10:749:10 | T | -| main.rs:758:34:760:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:758:34:760:9 | { ... } | &T | main.rs:749:10:749:10 | T | -| main.rs:759:13:759:19 | &... | | file://:0:0:0:0 | & | -| main.rs:759:13:759:19 | &... | &T | main.rs:749:10:749:10 | T | -| main.rs:759:14:759:17 | self | | file://:0:0:0:0 | & | -| main.rs:759:14:759:17 | self | &T | main.rs:743:5:744:19 | S | -| main.rs:759:14:759:17 | self | &T.T | main.rs:749:10:749:10 | T | -| main.rs:759:14:759:19 | self.0 | | main.rs:749:10:749:10 | T | -| main.rs:764:13:764:14 | x1 | | main.rs:743:5:744:19 | S | -| main.rs:764:13:764:14 | x1 | T | main.rs:746:5:747:14 | S2 | -| main.rs:764:18:764:22 | S(...) | | main.rs:743:5:744:19 | S | -| main.rs:764:18:764:22 | S(...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:764:20:764:21 | S2 | | main.rs:746:5:747:14 | S2 | -| main.rs:765:26:765:27 | x1 | | main.rs:743:5:744:19 | S | -| main.rs:765:26:765:27 | x1 | T | main.rs:746:5:747:14 | S2 | -| main.rs:765:26:765:32 | x1.m1() | | main.rs:746:5:747:14 | S2 | -| main.rs:767:13:767:14 | x2 | | main.rs:743:5:744:19 | S | -| main.rs:767:13:767:14 | x2 | T | main.rs:746:5:747:14 | S2 | -| main.rs:767:18:767:22 | S(...) | | main.rs:743:5:744:19 | S | -| main.rs:767:18:767:22 | S(...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:767:20:767:21 | S2 | | main.rs:746:5:747:14 | S2 | -| main.rs:769:26:769:27 | x2 | | main.rs:743:5:744:19 | S | -| main.rs:769:26:769:27 | x2 | T | main.rs:746:5:747:14 | S2 | -| main.rs:769:26:769:32 | x2.m2() | | file://:0:0:0:0 | & | -| main.rs:769:26:769:32 | x2.m2() | &T | main.rs:746:5:747:14 | S2 | -| main.rs:770:26:770:27 | x2 | | main.rs:743:5:744:19 | S | -| main.rs:770:26:770:27 | x2 | T | main.rs:746:5:747:14 | S2 | -| main.rs:770:26:770:32 | x2.m3() | | file://:0:0:0:0 | & | -| main.rs:770:26:770:32 | x2.m3() | &T | main.rs:746:5:747:14 | S2 | -| main.rs:772:13:772:14 | x3 | | main.rs:743:5:744:19 | S | -| main.rs:772:13:772:14 | x3 | T | main.rs:746:5:747:14 | S2 | -| main.rs:772:18:772:22 | S(...) | | main.rs:743:5:744:19 | S | -| main.rs:772:18:772:22 | S(...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:772:20:772:21 | S2 | | main.rs:746:5:747:14 | S2 | -| main.rs:774:26:774:41 | ...::m2(...) | | file://:0:0:0:0 | & | -| main.rs:774:26:774:41 | ...::m2(...) | &T | main.rs:746:5:747:14 | S2 | -| main.rs:774:38:774:40 | &x3 | | file://:0:0:0:0 | & | -| main.rs:774:38:774:40 | &x3 | &T | main.rs:743:5:744:19 | S | -| main.rs:774:38:774:40 | &x3 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:774:39:774:40 | x3 | | main.rs:743:5:744:19 | S | -| main.rs:774:39:774:40 | x3 | T | main.rs:746:5:747:14 | S2 | -| main.rs:775:26:775:41 | ...::m3(...) | | file://:0:0:0:0 | & | -| main.rs:775:26:775:41 | ...::m3(...) | &T | main.rs:746:5:747:14 | S2 | -| main.rs:775:38:775:40 | &x3 | | file://:0:0:0:0 | & | -| main.rs:775:38:775:40 | &x3 | &T | main.rs:743:5:744:19 | S | -| main.rs:775:38:775:40 | &x3 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:775:39:775:40 | x3 | | main.rs:743:5:744:19 | S | -| main.rs:775:39:775:40 | x3 | T | main.rs:746:5:747:14 | S2 | -| main.rs:777:13:777:14 | x4 | | file://:0:0:0:0 | & | -| main.rs:777:13:777:14 | x4 | &T | main.rs:743:5:744:19 | S | -| main.rs:777:13:777:14 | x4 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:777:18:777:23 | &... | | file://:0:0:0:0 | & | -| main.rs:777:18:777:23 | &... | &T | main.rs:743:5:744:19 | S | -| main.rs:777:18:777:23 | &... | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:777:19:777:23 | S(...) | | main.rs:743:5:744:19 | S | -| main.rs:777:19:777:23 | S(...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:777:21:777:22 | S2 | | main.rs:746:5:747:14 | S2 | -| main.rs:779:26:779:27 | x4 | | file://:0:0:0:0 | & | -| main.rs:779:26:779:27 | x4 | &T | main.rs:743:5:744:19 | S | -| main.rs:779:26:779:27 | x4 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:779:26:779:32 | x4.m2() | | file://:0:0:0:0 | & | -| main.rs:779:26:779:32 | x4.m2() | &T | main.rs:746:5:747:14 | S2 | -| main.rs:780:26:780:27 | x4 | | file://:0:0:0:0 | & | -| main.rs:780:26:780:27 | x4 | &T | main.rs:743:5:744:19 | S | -| main.rs:780:26:780:27 | x4 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:780:26:780:32 | x4.m3() | | file://:0:0:0:0 | & | -| main.rs:780:26:780:32 | x4.m3() | &T | main.rs:746:5:747:14 | S2 | -| main.rs:782:13:782:14 | x5 | | file://:0:0:0:0 | & | -| main.rs:782:13:782:14 | x5 | &T | main.rs:743:5:744:19 | S | -| main.rs:782:13:782:14 | x5 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:782:18:782:23 | &... | | file://:0:0:0:0 | & | -| main.rs:782:18:782:23 | &... | &T | main.rs:743:5:744:19 | S | -| main.rs:782:18:782:23 | &... | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:782:19:782:23 | S(...) | | main.rs:743:5:744:19 | S | -| main.rs:782:19:782:23 | S(...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:782:21:782:22 | S2 | | main.rs:746:5:747:14 | S2 | -| main.rs:784:26:784:27 | x5 | | file://:0:0:0:0 | & | -| main.rs:784:26:784:27 | x5 | &T | main.rs:743:5:744:19 | S | -| main.rs:784:26:784:27 | x5 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:784:26:784:32 | x5.m1() | | main.rs:746:5:747:14 | S2 | -| main.rs:785:26:785:27 | x5 | | file://:0:0:0:0 | & | -| main.rs:785:26:785:27 | x5 | &T | main.rs:743:5:744:19 | S | -| main.rs:785:26:785:27 | x5 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:785:26:785:29 | x5.0 | | main.rs:746:5:747:14 | S2 | -| main.rs:787:13:787:14 | x6 | | file://:0:0:0:0 | & | -| main.rs:787:13:787:14 | x6 | &T | main.rs:743:5:744:19 | S | -| main.rs:787:13:787:14 | x6 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:787:18:787:23 | &... | | file://:0:0:0:0 | & | -| main.rs:787:18:787:23 | &... | &T | main.rs:743:5:744:19 | S | -| main.rs:787:18:787:23 | &... | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:787:19:787:23 | S(...) | | main.rs:743:5:744:19 | S | -| main.rs:787:19:787:23 | S(...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:787:21:787:22 | S2 | | main.rs:746:5:747:14 | S2 | -| main.rs:789:26:789:30 | (...) | | main.rs:743:5:744:19 | S | -| main.rs:789:26:789:30 | (...) | T | main.rs:746:5:747:14 | S2 | -| main.rs:789:26:789:35 | ... .m1() | | main.rs:746:5:747:14 | S2 | -| main.rs:789:27:789:29 | * ... | | main.rs:743:5:744:19 | S | -| main.rs:789:27:789:29 | * ... | T | main.rs:746:5:747:14 | S2 | -| main.rs:789:28:789:29 | x6 | | file://:0:0:0:0 | & | -| main.rs:789:28:789:29 | x6 | &T | main.rs:743:5:744:19 | S | -| main.rs:789:28:789:29 | x6 | &T.T | main.rs:746:5:747:14 | S2 | -| main.rs:796:16:796:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:796:16:796:20 | SelfParam | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | -| main.rs:799:16:799:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:799:16:799:20 | SelfParam | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | -| main.rs:799:32:801:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:799:32:801:9 | { ... } | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | -| main.rs:800:13:800:16 | self | | file://:0:0:0:0 | & | -| main.rs:800:13:800:16 | self | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | -| main.rs:800:13:800:22 | self.foo() | | file://:0:0:0:0 | & | -| main.rs:800:13:800:22 | self.foo() | &T | main.rs:794:5:802:5 | Self [trait MyTrait] | -| main.rs:808:16:808:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:808:16:808:20 | SelfParam | &T | main.rs:804:5:804:20 | MyStruct | -| main.rs:808:36:810:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:808:36:810:9 | { ... } | &T | main.rs:804:5:804:20 | MyStruct | -| main.rs:809:13:809:16 | self | | file://:0:0:0:0 | & | -| main.rs:809:13:809:16 | self | &T | main.rs:804:5:804:20 | MyStruct | -| main.rs:814:13:814:13 | x | | main.rs:804:5:804:20 | MyStruct | -| main.rs:814:17:814:24 | MyStruct | | main.rs:804:5:804:20 | MyStruct | -| main.rs:815:9:815:9 | x | | main.rs:804:5:804:20 | MyStruct | -| main.rs:815:9:815:15 | x.bar() | | file://:0:0:0:0 | & | -| main.rs:815:9:815:15 | x.bar() | &T | main.rs:804:5:804:20 | MyStruct | -| main.rs:825:16:825:20 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:825:16:825:20 | SelfParam | &T | main.rs:822:5:822:26 | MyStruct | -| main.rs:825:16:825:20 | SelfParam | &T.T | main.rs:824:10:824:10 | T | -| main.rs:825:32:827:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:825:32:827:9 | { ... } | &T | main.rs:822:5:822:26 | MyStruct | -| main.rs:825:32:827:9 | { ... } | &T.T | main.rs:824:10:824:10 | T | -| main.rs:826:13:826:16 | self | | file://:0:0:0:0 | & | -| main.rs:826:13:826:16 | self | &T | main.rs:822:5:822:26 | MyStruct | -| main.rs:826:13:826:16 | self | &T.T | main.rs:824:10:824:10 | T | -| main.rs:831:13:831:13 | x | | main.rs:822:5:822:26 | MyStruct | -| main.rs:831:13:831:13 | x | T | main.rs:820:5:820:13 | S | -| main.rs:831:17:831:27 | MyStruct(...) | | main.rs:822:5:822:26 | MyStruct | -| main.rs:831:17:831:27 | MyStruct(...) | T | main.rs:820:5:820:13 | S | -| main.rs:831:26:831:26 | S | | main.rs:820:5:820:13 | S | -| main.rs:832:9:832:9 | x | | main.rs:822:5:822:26 | MyStruct | -| main.rs:832:9:832:9 | x | T | main.rs:820:5:820:13 | S | -| main.rs:832:9:832:15 | x.foo() | | file://:0:0:0:0 | & | -| main.rs:832:9:832:15 | x.foo() | &T | main.rs:822:5:822:26 | MyStruct | -| main.rs:832:9:832:15 | x.foo() | &T.T | main.rs:820:5:820:13 | S | -| main.rs:840:15:840:19 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:840:15:840:19 | SelfParam | &T | main.rs:837:5:837:13 | S | -| main.rs:840:31:842:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:840:31:842:9 | { ... } | &T | main.rs:837:5:837:13 | S | -| main.rs:841:13:841:19 | &... | | file://:0:0:0:0 | & | -| main.rs:841:13:841:19 | &... | &T | main.rs:837:5:837:13 | S | -| main.rs:841:14:841:19 | &... | | file://:0:0:0:0 | & | -| main.rs:841:14:841:19 | &... | &T | main.rs:837:5:837:13 | S | -| main.rs:841:15:841:19 | &self | | file://:0:0:0:0 | & | -| main.rs:841:15:841:19 | &self | &T | main.rs:837:5:837:13 | S | -| main.rs:841:16:841:19 | self | | file://:0:0:0:0 | & | -| main.rs:841:16:841:19 | self | &T | main.rs:837:5:837:13 | S | -| main.rs:844:15:844:25 | SelfParam | | file://:0:0:0:0 | & | -| main.rs:844:15:844:25 | SelfParam | &T | main.rs:837:5:837:13 | S | -| main.rs:844:37:846:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:844:37:846:9 | { ... } | &T | main.rs:837:5:837:13 | S | -| main.rs:845:13:845:19 | &... | | file://:0:0:0:0 | & | -| main.rs:845:13:845:19 | &... | &T | main.rs:837:5:837:13 | S | -| main.rs:845:14:845:19 | &... | | file://:0:0:0:0 | & | -| main.rs:845:14:845:19 | &... | &T | main.rs:837:5:837:13 | S | -| main.rs:845:15:845:19 | &self | | file://:0:0:0:0 | & | -| main.rs:845:15:845:19 | &self | &T | main.rs:837:5:837:13 | S | -| main.rs:845:16:845:19 | self | | file://:0:0:0:0 | & | -| main.rs:845:16:845:19 | self | &T | main.rs:837:5:837:13 | S | -| main.rs:848:15:848:15 | x | | file://:0:0:0:0 | & | -| main.rs:848:15:848:15 | x | &T | main.rs:837:5:837:13 | S | -| main.rs:848:34:850:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:848:34:850:9 | { ... } | &T | main.rs:837:5:837:13 | S | -| main.rs:849:13:849:13 | x | | file://:0:0:0:0 | & | -| main.rs:849:13:849:13 | x | &T | main.rs:837:5:837:13 | S | -| main.rs:852:15:852:15 | x | | file://:0:0:0:0 | & | -| main.rs:852:15:852:15 | x | &T | main.rs:837:5:837:13 | S | -| main.rs:852:34:854:9 | { ... } | | file://:0:0:0:0 | & | -| main.rs:852:34:854:9 | { ... } | &T | main.rs:837:5:837:13 | S | -| main.rs:853:13:853:16 | &... | | file://:0:0:0:0 | & | -| main.rs:853:13:853:16 | &... | &T | main.rs:837:5:837:13 | S | -| main.rs:853:14:853:16 | &... | | file://:0:0:0:0 | & | -| main.rs:853:14:853:16 | &... | &T | main.rs:837:5:837:13 | S | -| main.rs:853:15:853:16 | &x | | file://:0:0:0:0 | & | -| main.rs:853:15:853:16 | &x | &T | main.rs:837:5:837:13 | S | -| main.rs:853:16:853:16 | x | | file://:0:0:0:0 | & | -| main.rs:853:16:853:16 | x | &T | main.rs:837:5:837:13 | S | -| main.rs:858:13:858:13 | x | | main.rs:837:5:837:13 | S | -| main.rs:858:17:858:20 | S {...} | | main.rs:837:5:837:13 | S | -| main.rs:859:9:859:9 | x | | main.rs:837:5:837:13 | S | -| main.rs:859:9:859:14 | x.f1() | | file://:0:0:0:0 | & | -| main.rs:859:9:859:14 | x.f1() | &T | main.rs:837:5:837:13 | S | -| main.rs:860:9:860:9 | x | | main.rs:837:5:837:13 | S | -| main.rs:860:9:860:14 | x.f2() | | file://:0:0:0:0 | & | -| main.rs:860:9:860:14 | x.f2() | &T | main.rs:837:5:837:13 | S | -| main.rs:861:9:861:17 | ...::f3(...) | | file://:0:0:0:0 | & | -| main.rs:861:9:861:17 | ...::f3(...) | &T | main.rs:837:5:837:13 | S | -| main.rs:861:15:861:16 | &x | | file://:0:0:0:0 | & | -| main.rs:861:15:861:16 | &x | &T | main.rs:837:5:837:13 | S | -| main.rs:861:16:861:16 | x | | main.rs:837:5:837:13 | S | -| main.rs:867:5:867:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo | -| main.rs:868:5:868:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo | -| main.rs:868:20:868:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | -| main.rs:868:41:868:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | +| main.rs:376:21:376:25 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:376:21:376:25 | SelfParam | &T | main.rs:371:5:381:5 | Self [trait TraitMultipleAssoc] | +| main.rs:378:20:378:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:378:20:378:24 | SelfParam | &T | main.rs:371:5:381:5 | Self [trait TraitMultipleAssoc] | +| main.rs:380:20:380:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:380:20:380:24 | SelfParam | &T | main.rs:371:5:381:5 | Self [trait TraitMultipleAssoc] | +| main.rs:396:15:396:18 | SelfParam | | main.rs:383:5:384:13 | S | +| main.rs:396:45:398:9 | { ... } | | main.rs:389:5:390:14 | AT | +| main.rs:397:13:397:14 | AT | | main.rs:389:5:390:14 | AT | +| main.rs:406:19:406:23 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:406:19:406:23 | SelfParam | &T | main.rs:383:5:384:13 | S | +| main.rs:406:26:406:26 | a | | main.rs:406:16:406:16 | A | +| main.rs:406:46:408:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | +| main.rs:406:46:408:9 | { ... } | A | main.rs:406:16:406:16 | A | +| main.rs:407:13:407:32 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | +| main.rs:407:13:407:32 | Wrapper {...} | A | main.rs:406:16:406:16 | A | +| main.rs:407:30:407:30 | a | | main.rs:406:16:406:16 | A | +| main.rs:415:15:415:18 | SelfParam | | main.rs:386:5:387:14 | S2 | +| main.rs:415:45:417:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | +| main.rs:415:45:417:9 | { ... } | A | main.rs:386:5:387:14 | S2 | +| main.rs:416:13:416:35 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | +| main.rs:416:13:416:35 | Wrapper {...} | A | main.rs:386:5:387:14 | S2 | +| main.rs:416:30:416:33 | self | | main.rs:386:5:387:14 | S2 | +| main.rs:422:30:424:9 | { ... } | | main.rs:332:5:335:5 | Wrapper | +| main.rs:422:30:424:9 | { ... } | A | main.rs:386:5:387:14 | S2 | +| main.rs:423:13:423:33 | Wrapper {...} | | main.rs:332:5:335:5 | Wrapper | +| main.rs:423:13:423:33 | Wrapper {...} | A | main.rs:386:5:387:14 | S2 | +| main.rs:423:30:423:31 | S2 | | main.rs:386:5:387:14 | S2 | +| main.rs:428:22:428:26 | thing | | main.rs:428:10:428:19 | T | +| main.rs:429:9:429:13 | thing | | main.rs:428:10:428:19 | T | +| main.rs:436:21:436:25 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:436:21:436:25 | SelfParam | &T | main.rs:389:5:390:14 | AT | +| main.rs:436:34:438:9 | { ... } | | main.rs:389:5:390:14 | AT | +| main.rs:437:13:437:14 | AT | | main.rs:389:5:390:14 | AT | +| main.rs:440:20:440:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:440:20:440:24 | SelfParam | &T | main.rs:389:5:390:14 | AT | +| main.rs:440:43:442:9 | { ... } | | main.rs:383:5:384:13 | S | +| main.rs:441:13:441:13 | S | | main.rs:383:5:384:13 | S | +| main.rs:444:20:444:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:444:20:444:24 | SelfParam | &T | main.rs:389:5:390:14 | AT | +| main.rs:444:43:446:9 | { ... } | | main.rs:386:5:387:14 | S2 | +| main.rs:445:13:445:14 | S2 | | main.rs:386:5:387:14 | S2 | +| main.rs:450:13:450:14 | x1 | | main.rs:383:5:384:13 | S | +| main.rs:450:18:450:18 | S | | main.rs:383:5:384:13 | S | +| main.rs:452:26:452:27 | x1 | | main.rs:383:5:384:13 | S | +| main.rs:452:26:452:32 | x1.m1() | | main.rs:389:5:390:14 | AT | +| main.rs:454:13:454:14 | x2 | | main.rs:383:5:384:13 | S | +| main.rs:454:18:454:18 | S | | main.rs:383:5:384:13 | S | +| main.rs:456:13:456:13 | y | | main.rs:389:5:390:14 | AT | +| main.rs:456:17:456:18 | x2 | | main.rs:383:5:384:13 | S | +| main.rs:456:17:456:23 | x2.m2() | | main.rs:389:5:390:14 | AT | +| main.rs:457:26:457:26 | y | | main.rs:389:5:390:14 | AT | +| main.rs:459:13:459:14 | x3 | | main.rs:383:5:384:13 | S | +| main.rs:459:18:459:18 | S | | main.rs:383:5:384:13 | S | +| main.rs:461:26:461:27 | x3 | | main.rs:383:5:384:13 | S | +| main.rs:461:26:461:34 | x3.put(...) | | main.rs:332:5:335:5 | Wrapper | +| main.rs:464:26:464:27 | x3 | | main.rs:383:5:384:13 | S | +| main.rs:466:20:466:20 | S | | main.rs:383:5:384:13 | S | +| main.rs:469:13:469:14 | x5 | | main.rs:386:5:387:14 | S2 | +| main.rs:469:18:469:19 | S2 | | main.rs:386:5:387:14 | S2 | +| main.rs:470:26:470:27 | x5 | | main.rs:386:5:387:14 | S2 | +| main.rs:470:26:470:32 | x5.m1() | | main.rs:332:5:335:5 | Wrapper | +| main.rs:471:13:471:14 | x6 | | main.rs:386:5:387:14 | S2 | +| main.rs:471:18:471:19 | S2 | | main.rs:386:5:387:14 | S2 | +| main.rs:472:26:472:27 | x6 | | main.rs:386:5:387:14 | S2 | +| main.rs:472:26:472:32 | x6.m2() | | main.rs:332:5:335:5 | Wrapper | +| main.rs:472:26:472:32 | x6.m2() | A | main.rs:386:5:387:14 | S2 | +| main.rs:474:13:474:22 | assoc_zero | | main.rs:389:5:390:14 | AT | +| main.rs:474:26:474:27 | AT | | main.rs:389:5:390:14 | AT | +| main.rs:474:26:474:38 | AT.get_zero() | | main.rs:389:5:390:14 | AT | +| main.rs:475:13:475:21 | assoc_one | | main.rs:383:5:384:13 | S | +| main.rs:475:25:475:26 | AT | | main.rs:389:5:390:14 | AT | +| main.rs:475:25:475:36 | AT.get_one() | | main.rs:383:5:384:13 | S | +| main.rs:476:13:476:21 | assoc_two | | main.rs:386:5:387:14 | S2 | +| main.rs:476:25:476:26 | AT | | main.rs:389:5:390:14 | AT | +| main.rs:476:25:476:36 | AT.get_two() | | main.rs:386:5:387:14 | S2 | +| main.rs:493:15:493:18 | SelfParam | | main.rs:481:5:485:5 | MyEnum | +| main.rs:493:15:493:18 | SelfParam | A | main.rs:492:10:492:10 | T | +| main.rs:493:26:498:9 | { ... } | | main.rs:492:10:492:10 | T | +| main.rs:494:13:497:13 | match self { ... } | | main.rs:492:10:492:10 | T | +| main.rs:494:19:494:22 | self | | main.rs:481:5:485:5 | MyEnum | +| main.rs:494:19:494:22 | self | A | main.rs:492:10:492:10 | T | +| main.rs:495:28:495:28 | a | | main.rs:492:10:492:10 | T | +| main.rs:495:34:495:34 | a | | main.rs:492:10:492:10 | T | +| main.rs:496:30:496:30 | a | | main.rs:492:10:492:10 | T | +| main.rs:496:37:496:37 | a | | main.rs:492:10:492:10 | T | +| main.rs:502:13:502:13 | x | | main.rs:481:5:485:5 | MyEnum | +| main.rs:502:13:502:13 | x | A | main.rs:487:5:488:14 | S1 | +| main.rs:502:17:502:30 | ...::C1(...) | | main.rs:481:5:485:5 | MyEnum | +| main.rs:502:17:502:30 | ...::C1(...) | A | main.rs:487:5:488:14 | S1 | +| main.rs:502:28:502:29 | S1 | | main.rs:487:5:488:14 | S1 | +| main.rs:503:13:503:13 | y | | main.rs:481:5:485:5 | MyEnum | +| main.rs:503:13:503:13 | y | A | main.rs:489:5:490:14 | S2 | +| main.rs:503:17:503:36 | ...::C2 {...} | | main.rs:481:5:485:5 | MyEnum | +| main.rs:503:17:503:36 | ...::C2 {...} | A | main.rs:489:5:490:14 | S2 | +| main.rs:503:33:503:34 | S2 | | main.rs:489:5:490:14 | S2 | +| main.rs:505:26:505:26 | x | | main.rs:481:5:485:5 | MyEnum | +| main.rs:505:26:505:26 | x | A | main.rs:487:5:488:14 | S1 | +| main.rs:505:26:505:31 | x.m1() | | main.rs:487:5:488:14 | S1 | +| main.rs:506:26:506:26 | y | | main.rs:481:5:485:5 | MyEnum | +| main.rs:506:26:506:26 | y | A | main.rs:489:5:490:14 | S2 | +| main.rs:506:26:506:31 | y.m1() | | main.rs:489:5:490:14 | S2 | +| main.rs:528:15:528:18 | SelfParam | | main.rs:526:5:529:5 | Self [trait MyTrait1] | +| main.rs:532:15:532:18 | SelfParam | | main.rs:531:5:542:5 | Self [trait MyTrait2] | +| main.rs:535:9:541:9 | { ... } | | main.rs:531:20:531:22 | Tr2 | +| main.rs:536:13:540:13 | if ... {...} else {...} | | main.rs:531:20:531:22 | Tr2 | +| main.rs:536:26:538:13 | { ... } | | main.rs:531:20:531:22 | Tr2 | +| main.rs:537:17:537:20 | self | | main.rs:531:5:542:5 | Self [trait MyTrait2] | +| main.rs:537:17:537:25 | self.m1() | | main.rs:531:20:531:22 | Tr2 | +| main.rs:538:20:540:13 | { ... } | | main.rs:531:20:531:22 | Tr2 | +| main.rs:539:17:539:30 | ...::m1(...) | | main.rs:531:20:531:22 | Tr2 | +| main.rs:539:26:539:29 | self | | main.rs:531:5:542:5 | Self [trait MyTrait2] | +| main.rs:545:15:545:18 | SelfParam | | main.rs:544:5:555:5 | Self [trait MyTrait3] | +| main.rs:548:9:554:9 | { ... } | | main.rs:544:20:544:22 | Tr3 | +| main.rs:549:13:553:13 | if ... {...} else {...} | | main.rs:544:20:544:22 | Tr3 | +| main.rs:549:26:551:13 | { ... } | | main.rs:544:20:544:22 | Tr3 | +| main.rs:550:17:550:20 | self | | main.rs:544:5:555:5 | Self [trait MyTrait3] | +| main.rs:550:17:550:25 | self.m2() | | main.rs:511:5:514:5 | MyThing | +| main.rs:550:17:550:25 | self.m2() | A | main.rs:544:20:544:22 | Tr3 | +| main.rs:550:17:550:27 | ... .a | | main.rs:544:20:544:22 | Tr3 | +| main.rs:551:20:553:13 | { ... } | | main.rs:544:20:544:22 | Tr3 | +| main.rs:552:17:552:30 | ...::m2(...) | | main.rs:511:5:514:5 | MyThing | +| main.rs:552:17:552:30 | ...::m2(...) | A | main.rs:544:20:544:22 | Tr3 | +| main.rs:552:17:552:32 | ... .a | | main.rs:544:20:544:22 | Tr3 | +| main.rs:552:26:552:29 | self | | main.rs:544:5:555:5 | Self [trait MyTrait3] | +| main.rs:559:15:559:18 | SelfParam | | main.rs:511:5:514:5 | MyThing | +| main.rs:559:15:559:18 | SelfParam | A | main.rs:557:10:557:10 | T | +| main.rs:559:26:561:9 | { ... } | | main.rs:557:10:557:10 | T | +| main.rs:560:13:560:16 | self | | main.rs:511:5:514:5 | MyThing | +| main.rs:560:13:560:16 | self | A | main.rs:557:10:557:10 | T | +| main.rs:560:13:560:18 | self.a | | main.rs:557:10:557:10 | T | +| main.rs:568:15:568:18 | SelfParam | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:568:15:568:18 | SelfParam | A | main.rs:566:10:566:10 | T | +| main.rs:568:35:570:9 | { ... } | | main.rs:511:5:514:5 | MyThing | +| main.rs:568:35:570:9 | { ... } | A | main.rs:566:10:566:10 | T | +| main.rs:569:13:569:33 | MyThing {...} | | main.rs:511:5:514:5 | MyThing | +| main.rs:569:13:569:33 | MyThing {...} | A | main.rs:566:10:566:10 | T | +| main.rs:569:26:569:29 | self | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:569:26:569:29 | self | A | main.rs:566:10:566:10 | T | +| main.rs:569:26:569:31 | self.a | | main.rs:566:10:566:10 | T | +| main.rs:578:13:578:13 | x | | main.rs:511:5:514:5 | MyThing | +| main.rs:578:13:578:13 | x | A | main.rs:521:5:522:14 | S1 | +| main.rs:578:17:578:33 | MyThing {...} | | main.rs:511:5:514:5 | MyThing | +| main.rs:578:17:578:33 | MyThing {...} | A | main.rs:521:5:522:14 | S1 | +| main.rs:578:30:578:31 | S1 | | main.rs:521:5:522:14 | S1 | +| main.rs:579:13:579:13 | y | | main.rs:511:5:514:5 | MyThing | +| main.rs:579:13:579:13 | y | A | main.rs:523:5:524:14 | S2 | +| main.rs:579:17:579:33 | MyThing {...} | | main.rs:511:5:514:5 | MyThing | +| main.rs:579:17:579:33 | MyThing {...} | A | main.rs:523:5:524:14 | S2 | +| main.rs:579:30:579:31 | S2 | | main.rs:523:5:524:14 | S2 | +| main.rs:581:26:581:26 | x | | main.rs:511:5:514:5 | MyThing | +| main.rs:581:26:581:26 | x | A | main.rs:521:5:522:14 | S1 | +| main.rs:581:26:581:31 | x.m1() | | main.rs:521:5:522:14 | S1 | +| main.rs:582:26:582:26 | y | | main.rs:511:5:514:5 | MyThing | +| main.rs:582:26:582:26 | y | A | main.rs:523:5:524:14 | S2 | +| main.rs:582:26:582:31 | y.m1() | | main.rs:523:5:524:14 | S2 | +| main.rs:584:13:584:13 | x | | main.rs:511:5:514:5 | MyThing | +| main.rs:584:13:584:13 | x | A | main.rs:521:5:522:14 | S1 | +| main.rs:584:17:584:33 | MyThing {...} | | main.rs:511:5:514:5 | MyThing | +| main.rs:584:17:584:33 | MyThing {...} | A | main.rs:521:5:522:14 | S1 | +| main.rs:584:30:584:31 | S1 | | main.rs:521:5:522:14 | S1 | +| main.rs:585:13:585:13 | y | | main.rs:511:5:514:5 | MyThing | +| main.rs:585:13:585:13 | y | A | main.rs:523:5:524:14 | S2 | +| main.rs:585:17:585:33 | MyThing {...} | | main.rs:511:5:514:5 | MyThing | +| main.rs:585:17:585:33 | MyThing {...} | A | main.rs:523:5:524:14 | S2 | +| main.rs:585:30:585:31 | S2 | | main.rs:523:5:524:14 | S2 | +| main.rs:587:26:587:26 | x | | main.rs:511:5:514:5 | MyThing | +| main.rs:587:26:587:26 | x | A | main.rs:521:5:522:14 | S1 | +| main.rs:587:26:587:31 | x.m2() | | main.rs:521:5:522:14 | S1 | +| main.rs:588:26:588:26 | y | | main.rs:511:5:514:5 | MyThing | +| main.rs:588:26:588:26 | y | A | main.rs:523:5:524:14 | S2 | +| main.rs:588:26:588:31 | y.m2() | | main.rs:523:5:524:14 | S2 | +| main.rs:590:13:590:13 | x | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:590:13:590:13 | x | A | main.rs:521:5:522:14 | S1 | +| main.rs:590:17:590:34 | MyThing2 {...} | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:590:17:590:34 | MyThing2 {...} | A | main.rs:521:5:522:14 | S1 | +| main.rs:590:31:590:32 | S1 | | main.rs:521:5:522:14 | S1 | +| main.rs:591:13:591:13 | y | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:591:13:591:13 | y | A | main.rs:523:5:524:14 | S2 | +| main.rs:591:17:591:34 | MyThing2 {...} | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:591:17:591:34 | MyThing2 {...} | A | main.rs:523:5:524:14 | S2 | +| main.rs:591:31:591:32 | S2 | | main.rs:523:5:524:14 | S2 | +| main.rs:593:26:593:26 | x | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:593:26:593:26 | x | A | main.rs:521:5:522:14 | S1 | +| main.rs:593:26:593:31 | x.m3() | | main.rs:521:5:522:14 | S1 | +| main.rs:594:26:594:26 | y | | main.rs:516:5:519:5 | MyThing2 | +| main.rs:594:26:594:26 | y | A | main.rs:523:5:524:14 | S2 | +| main.rs:594:26:594:31 | y.m3() | | main.rs:523:5:524:14 | S2 | +| main.rs:612:22:612:22 | x | | file://:0:0:0:0 | & | +| main.rs:612:22:612:22 | x | &T | main.rs:612:11:612:19 | T | +| main.rs:612:35:614:5 | { ... } | | file://:0:0:0:0 | & | +| main.rs:612:35:614:5 | { ... } | &T | main.rs:612:11:612:19 | T | +| main.rs:613:9:613:9 | x | | file://:0:0:0:0 | & | +| main.rs:613:9:613:9 | x | &T | main.rs:612:11:612:19 | T | +| main.rs:617:17:617:20 | SelfParam | | main.rs:602:5:603:14 | S1 | +| main.rs:617:29:619:9 | { ... } | | main.rs:605:5:606:14 | S2 | +| main.rs:618:13:618:14 | S2 | | main.rs:605:5:606:14 | S2 | +| main.rs:622:21:622:21 | x | | main.rs:622:13:622:14 | T1 | +| main.rs:625:5:627:5 | { ... } | | main.rs:622:17:622:18 | T2 | +| main.rs:626:9:626:9 | x | | main.rs:622:13:622:14 | T1 | +| main.rs:626:9:626:16 | x.into() | | main.rs:622:17:622:18 | T2 | +| main.rs:630:13:630:13 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:630:17:630:18 | S1 | | main.rs:602:5:603:14 | S1 | +| main.rs:631:26:631:31 | id(...) | | file://:0:0:0:0 | & | +| main.rs:631:26:631:31 | id(...) | &T | main.rs:602:5:603:14 | S1 | +| main.rs:631:29:631:30 | &x | | file://:0:0:0:0 | & | +| main.rs:631:29:631:30 | &x | &T | main.rs:602:5:603:14 | S1 | +| main.rs:631:30:631:30 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:633:13:633:13 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:633:17:633:18 | S1 | | main.rs:602:5:603:14 | S1 | +| main.rs:634:26:634:37 | id::<...>(...) | | file://:0:0:0:0 | & | +| main.rs:634:26:634:37 | id::<...>(...) | &T | main.rs:602:5:603:14 | S1 | +| main.rs:634:35:634:36 | &x | | file://:0:0:0:0 | & | +| main.rs:634:35:634:36 | &x | &T | main.rs:602:5:603:14 | S1 | +| main.rs:634:36:634:36 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:636:13:636:13 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:636:17:636:18 | S1 | | main.rs:602:5:603:14 | S1 | +| main.rs:637:26:637:44 | id::<...>(...) | | file://:0:0:0:0 | & | +| main.rs:637:26:637:44 | id::<...>(...) | &T | main.rs:602:5:603:14 | S1 | +| main.rs:637:42:637:43 | &x | | file://:0:0:0:0 | & | +| main.rs:637:42:637:43 | &x | &T | main.rs:602:5:603:14 | S1 | +| main.rs:637:43:637:43 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:639:13:639:13 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:639:17:639:18 | S1 | | main.rs:602:5:603:14 | S1 | +| main.rs:640:9:640:25 | into::<...>(...) | | main.rs:605:5:606:14 | S2 | +| main.rs:640:24:640:24 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:642:13:642:13 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:642:17:642:18 | S1 | | main.rs:602:5:603:14 | S1 | +| main.rs:643:13:643:13 | y | | main.rs:605:5:606:14 | S2 | +| main.rs:643:21:643:27 | into(...) | | main.rs:605:5:606:14 | S2 | +| main.rs:643:26:643:26 | x | | main.rs:602:5:603:14 | S1 | +| main.rs:673:13:673:14 | p1 | | main.rs:648:5:654:5 | PairOption | +| main.rs:673:13:673:14 | p1 | Fst | main.rs:656:5:657:14 | S1 | +| main.rs:673:13:673:14 | p1 | Snd | main.rs:659:5:660:14 | S2 | +| main.rs:673:26:673:53 | ...::PairBoth(...) | | main.rs:648:5:654:5 | PairOption | +| main.rs:673:26:673:53 | ...::PairBoth(...) | Fst | main.rs:656:5:657:14 | S1 | +| main.rs:673:26:673:53 | ...::PairBoth(...) | Snd | main.rs:659:5:660:14 | S2 | +| main.rs:673:47:673:48 | S1 | | main.rs:656:5:657:14 | S1 | +| main.rs:673:51:673:52 | S2 | | main.rs:659:5:660:14 | S2 | +| main.rs:674:26:674:27 | p1 | | main.rs:648:5:654:5 | PairOption | +| main.rs:674:26:674:27 | p1 | Fst | main.rs:656:5:657:14 | S1 | +| main.rs:674:26:674:27 | p1 | Snd | main.rs:659:5:660:14 | S2 | +| main.rs:677:13:677:14 | p2 | | main.rs:648:5:654:5 | PairOption | +| main.rs:677:26:677:47 | ...::PairNone(...) | | main.rs:648:5:654:5 | PairOption | +| main.rs:678:26:678:27 | p2 | | main.rs:648:5:654:5 | PairOption | +| main.rs:681:13:681:14 | p3 | | main.rs:648:5:654:5 | PairOption | +| main.rs:681:13:681:14 | p3 | Snd | main.rs:662:5:663:14 | S3 | +| main.rs:681:34:681:56 | ...::PairSnd(...) | | main.rs:648:5:654:5 | PairOption | +| main.rs:681:34:681:56 | ...::PairSnd(...) | Snd | main.rs:662:5:663:14 | S3 | +| main.rs:681:54:681:55 | S3 | | main.rs:662:5:663:14 | S3 | +| main.rs:682:26:682:27 | p3 | | main.rs:648:5:654:5 | PairOption | +| main.rs:682:26:682:27 | p3 | Snd | main.rs:662:5:663:14 | S3 | +| main.rs:685:13:685:14 | p3 | | main.rs:648:5:654:5 | PairOption | +| main.rs:685:13:685:14 | p3 | Fst | main.rs:662:5:663:14 | S3 | +| main.rs:685:35:685:56 | ...::PairNone(...) | | main.rs:648:5:654:5 | PairOption | +| main.rs:685:35:685:56 | ...::PairNone(...) | Fst | main.rs:662:5:663:14 | S3 | +| main.rs:686:26:686:27 | p3 | | main.rs:648:5:654:5 | PairOption | +| main.rs:686:26:686:27 | p3 | Fst | main.rs:662:5:663:14 | S3 | +| main.rs:699:16:699:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:699:16:699:24 | SelfParam | &T | main.rs:697:5:704:5 | Self [trait MyTrait] | +| main.rs:699:27:699:31 | value | | main.rs:697:19:697:19 | S | +| main.rs:701:21:701:29 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:701:21:701:29 | SelfParam | &T | main.rs:697:5:704:5 | Self [trait MyTrait] | +| main.rs:701:32:701:36 | value | | main.rs:697:19:697:19 | S | +| main.rs:702:13:702:16 | self | | file://:0:0:0:0 | & | +| main.rs:702:13:702:16 | self | &T | main.rs:697:5:704:5 | Self [trait MyTrait] | +| main.rs:702:22:702:26 | value | | main.rs:697:19:697:19 | S | +| main.rs:708:16:708:24 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:708:16:708:24 | SelfParam | &T | main.rs:691:5:695:5 | MyOption | +| main.rs:708:16:708:24 | SelfParam | &T.T | main.rs:706:10:706:10 | T | +| main.rs:708:27:708:31 | value | | main.rs:706:10:706:10 | T | +| main.rs:712:26:714:9 | { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:712:26:714:9 | { ... } | T | main.rs:711:10:711:10 | T | +| main.rs:713:13:713:30 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:713:13:713:30 | ...::MyNone(...) | T | main.rs:711:10:711:10 | T | +| main.rs:718:20:718:23 | SelfParam | | main.rs:691:5:695:5 | MyOption | +| main.rs:718:20:718:23 | SelfParam | T | main.rs:691:5:695:5 | MyOption | +| main.rs:718:20:718:23 | SelfParam | T.T | main.rs:717:10:717:10 | T | +| main.rs:718:41:723:9 | { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:718:41:723:9 | { ... } | T | main.rs:717:10:717:10 | T | +| main.rs:719:13:722:13 | match self { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:719:13:722:13 | match self { ... } | T | main.rs:717:10:717:10 | T | +| main.rs:719:19:719:22 | self | | main.rs:691:5:695:5 | MyOption | +| main.rs:719:19:719:22 | self | T | main.rs:691:5:695:5 | MyOption | +| main.rs:719:19:719:22 | self | T.T | main.rs:717:10:717:10 | T | +| main.rs:720:39:720:56 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:720:39:720:56 | ...::MyNone(...) | T | main.rs:717:10:717:10 | T | +| main.rs:721:34:721:34 | x | | main.rs:691:5:695:5 | MyOption | +| main.rs:721:34:721:34 | x | T | main.rs:717:10:717:10 | T | +| main.rs:721:40:721:40 | x | | main.rs:691:5:695:5 | MyOption | +| main.rs:721:40:721:40 | x | T | main.rs:717:10:717:10 | T | +| main.rs:730:13:730:14 | x1 | | main.rs:691:5:695:5 | MyOption | +| main.rs:730:18:730:37 | ...::new(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:731:26:731:27 | x1 | | main.rs:691:5:695:5 | MyOption | +| main.rs:733:13:733:18 | mut x2 | | main.rs:691:5:695:5 | MyOption | +| main.rs:733:13:733:18 | mut x2 | T | main.rs:726:5:727:13 | S | +| main.rs:733:22:733:36 | ...::new(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:733:22:733:36 | ...::new(...) | T | main.rs:726:5:727:13 | S | +| main.rs:734:9:734:10 | x2 | | main.rs:691:5:695:5 | MyOption | +| main.rs:734:9:734:10 | x2 | T | main.rs:726:5:727:13 | S | +| main.rs:734:16:734:16 | S | | main.rs:726:5:727:13 | S | +| main.rs:735:26:735:27 | x2 | | main.rs:691:5:695:5 | MyOption | +| main.rs:735:26:735:27 | x2 | T | main.rs:726:5:727:13 | S | +| main.rs:737:13:737:18 | mut x3 | | main.rs:691:5:695:5 | MyOption | +| main.rs:737:22:737:36 | ...::new(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:738:9:738:10 | x3 | | main.rs:691:5:695:5 | MyOption | +| main.rs:738:21:738:21 | S | | main.rs:726:5:727:13 | S | +| main.rs:739:26:739:27 | x3 | | main.rs:691:5:695:5 | MyOption | +| main.rs:741:13:741:18 | mut x4 | | main.rs:691:5:695:5 | MyOption | +| main.rs:741:13:741:18 | mut x4 | T | main.rs:726:5:727:13 | S | +| main.rs:741:22:741:36 | ...::new(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:741:22:741:36 | ...::new(...) | T | main.rs:726:5:727:13 | S | +| main.rs:742:23:742:29 | &mut x4 | | file://:0:0:0:0 | & | +| main.rs:742:23:742:29 | &mut x4 | &T | main.rs:691:5:695:5 | MyOption | +| main.rs:742:23:742:29 | &mut x4 | &T.T | main.rs:726:5:727:13 | S | +| main.rs:742:28:742:29 | x4 | | main.rs:691:5:695:5 | MyOption | +| main.rs:742:28:742:29 | x4 | T | main.rs:726:5:727:13 | S | +| main.rs:742:32:742:32 | S | | main.rs:726:5:727:13 | S | +| main.rs:743:26:743:27 | x4 | | main.rs:691:5:695:5 | MyOption | +| main.rs:743:26:743:27 | x4 | T | main.rs:726:5:727:13 | S | +| main.rs:745:13:745:14 | x5 | | main.rs:691:5:695:5 | MyOption | +| main.rs:745:13:745:14 | x5 | T | main.rs:691:5:695:5 | MyOption | +| main.rs:745:13:745:14 | x5 | T.T | main.rs:726:5:727:13 | S | +| main.rs:745:18:745:58 | ...::MySome(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:745:18:745:58 | ...::MySome(...) | T | main.rs:691:5:695:5 | MyOption | +| main.rs:745:18:745:58 | ...::MySome(...) | T.T | main.rs:726:5:727:13 | S | +| main.rs:745:35:745:57 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:745:35:745:57 | ...::MyNone(...) | T | main.rs:726:5:727:13 | S | +| main.rs:746:26:746:27 | x5 | | main.rs:691:5:695:5 | MyOption | +| main.rs:746:26:746:27 | x5 | T | main.rs:691:5:695:5 | MyOption | +| main.rs:746:26:746:27 | x5 | T.T | main.rs:726:5:727:13 | S | +| main.rs:748:13:748:14 | x6 | | main.rs:691:5:695:5 | MyOption | +| main.rs:748:13:748:14 | x6 | T | main.rs:691:5:695:5 | MyOption | +| main.rs:748:13:748:14 | x6 | T.T | main.rs:726:5:727:13 | S | +| main.rs:748:18:748:58 | ...::MySome(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:748:18:748:58 | ...::MySome(...) | T | main.rs:691:5:695:5 | MyOption | +| main.rs:748:18:748:58 | ...::MySome(...) | T.T | main.rs:726:5:727:13 | S | +| main.rs:748:35:748:57 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:748:35:748:57 | ...::MyNone(...) | T | main.rs:726:5:727:13 | S | +| main.rs:749:26:749:61 | ...::flatten(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:749:26:749:61 | ...::flatten(...) | T | main.rs:726:5:727:13 | S | +| main.rs:749:59:749:60 | x6 | | main.rs:691:5:695:5 | MyOption | +| main.rs:749:59:749:60 | x6 | T | main.rs:691:5:695:5 | MyOption | +| main.rs:749:59:749:60 | x6 | T.T | main.rs:726:5:727:13 | S | +| main.rs:751:13:751:19 | from_if | | main.rs:691:5:695:5 | MyOption | +| main.rs:751:13:751:19 | from_if | T | main.rs:726:5:727:13 | S | +| main.rs:751:23:755:9 | if ... {...} else {...} | | main.rs:691:5:695:5 | MyOption | +| main.rs:751:23:755:9 | if ... {...} else {...} | T | main.rs:726:5:727:13 | S | +| main.rs:751:36:753:9 | { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:751:36:753:9 | { ... } | T | main.rs:726:5:727:13 | S | +| main.rs:752:13:752:30 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:752:13:752:30 | ...::MyNone(...) | T | main.rs:726:5:727:13 | S | +| main.rs:753:16:755:9 | { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:753:16:755:9 | { ... } | T | main.rs:726:5:727:13 | S | +| main.rs:754:13:754:31 | ...::MySome(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:754:13:754:31 | ...::MySome(...) | T | main.rs:726:5:727:13 | S | +| main.rs:754:30:754:30 | S | | main.rs:726:5:727:13 | S | +| main.rs:756:26:756:32 | from_if | | main.rs:691:5:695:5 | MyOption | +| main.rs:756:26:756:32 | from_if | T | main.rs:726:5:727:13 | S | +| main.rs:758:13:758:22 | from_match | | main.rs:691:5:695:5 | MyOption | +| main.rs:758:13:758:22 | from_match | T | main.rs:726:5:727:13 | S | +| main.rs:758:26:761:9 | match ... { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:758:26:761:9 | match ... { ... } | T | main.rs:726:5:727:13 | S | +| main.rs:759:21:759:38 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:759:21:759:38 | ...::MyNone(...) | T | main.rs:726:5:727:13 | S | +| main.rs:760:22:760:40 | ...::MySome(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:760:22:760:40 | ...::MySome(...) | T | main.rs:726:5:727:13 | S | +| main.rs:760:39:760:39 | S | | main.rs:726:5:727:13 | S | +| main.rs:762:26:762:35 | from_match | | main.rs:691:5:695:5 | MyOption | +| main.rs:762:26:762:35 | from_match | T | main.rs:726:5:727:13 | S | +| main.rs:764:13:764:21 | from_loop | | main.rs:691:5:695:5 | MyOption | +| main.rs:764:13:764:21 | from_loop | T | main.rs:726:5:727:13 | S | +| main.rs:764:25:769:9 | loop { ... } | | main.rs:691:5:695:5 | MyOption | +| main.rs:764:25:769:9 | loop { ... } | T | main.rs:726:5:727:13 | S | +| main.rs:766:23:766:40 | ...::MyNone(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:766:23:766:40 | ...::MyNone(...) | T | main.rs:726:5:727:13 | S | +| main.rs:768:19:768:37 | ...::MySome(...) | | main.rs:691:5:695:5 | MyOption | +| main.rs:768:19:768:37 | ...::MySome(...) | T | main.rs:726:5:727:13 | S | +| main.rs:768:36:768:36 | S | | main.rs:726:5:727:13 | S | +| main.rs:770:26:770:34 | from_loop | | main.rs:691:5:695:5 | MyOption | +| main.rs:770:26:770:34 | from_loop | T | main.rs:726:5:727:13 | S | +| main.rs:783:15:783:18 | SelfParam | | main.rs:776:5:777:19 | S | +| main.rs:783:15:783:18 | SelfParam | T | main.rs:782:10:782:10 | T | +| main.rs:783:26:785:9 | { ... } | | main.rs:782:10:782:10 | T | +| main.rs:784:13:784:16 | self | | main.rs:776:5:777:19 | S | +| main.rs:784:13:784:16 | self | T | main.rs:782:10:782:10 | T | +| main.rs:784:13:784:18 | self.0 | | main.rs:782:10:782:10 | T | +| main.rs:787:15:787:19 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:787:15:787:19 | SelfParam | &T | main.rs:776:5:777:19 | S | +| main.rs:787:15:787:19 | SelfParam | &T.T | main.rs:782:10:782:10 | T | +| main.rs:787:28:789:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:787:28:789:9 | { ... } | &T | main.rs:782:10:782:10 | T | +| main.rs:788:13:788:19 | &... | | file://:0:0:0:0 | & | +| main.rs:788:13:788:19 | &... | &T | main.rs:782:10:782:10 | T | +| main.rs:788:14:788:17 | self | | file://:0:0:0:0 | & | +| main.rs:788:14:788:17 | self | &T | main.rs:776:5:777:19 | S | +| main.rs:788:14:788:17 | self | &T.T | main.rs:782:10:782:10 | T | +| main.rs:788:14:788:19 | self.0 | | main.rs:782:10:782:10 | T | +| main.rs:791:15:791:25 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:791:15:791:25 | SelfParam | &T | main.rs:776:5:777:19 | S | +| main.rs:791:15:791:25 | SelfParam | &T.T | main.rs:782:10:782:10 | T | +| main.rs:791:34:793:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:791:34:793:9 | { ... } | &T | main.rs:782:10:782:10 | T | +| main.rs:792:13:792:19 | &... | | file://:0:0:0:0 | & | +| main.rs:792:13:792:19 | &... | &T | main.rs:782:10:782:10 | T | +| main.rs:792:14:792:17 | self | | file://:0:0:0:0 | & | +| main.rs:792:14:792:17 | self | &T | main.rs:776:5:777:19 | S | +| main.rs:792:14:792:17 | self | &T.T | main.rs:782:10:782:10 | T | +| main.rs:792:14:792:19 | self.0 | | main.rs:782:10:782:10 | T | +| main.rs:797:13:797:14 | x1 | | main.rs:776:5:777:19 | S | +| main.rs:797:13:797:14 | x1 | T | main.rs:779:5:780:14 | S2 | +| main.rs:797:18:797:22 | S(...) | | main.rs:776:5:777:19 | S | +| main.rs:797:18:797:22 | S(...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:797:20:797:21 | S2 | | main.rs:779:5:780:14 | S2 | +| main.rs:798:26:798:27 | x1 | | main.rs:776:5:777:19 | S | +| main.rs:798:26:798:27 | x1 | T | main.rs:779:5:780:14 | S2 | +| main.rs:798:26:798:32 | x1.m1() | | main.rs:779:5:780:14 | S2 | +| main.rs:800:13:800:14 | x2 | | main.rs:776:5:777:19 | S | +| main.rs:800:13:800:14 | x2 | T | main.rs:779:5:780:14 | S2 | +| main.rs:800:18:800:22 | S(...) | | main.rs:776:5:777:19 | S | +| main.rs:800:18:800:22 | S(...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:800:20:800:21 | S2 | | main.rs:779:5:780:14 | S2 | +| main.rs:802:26:802:27 | x2 | | main.rs:776:5:777:19 | S | +| main.rs:802:26:802:27 | x2 | T | main.rs:779:5:780:14 | S2 | +| main.rs:802:26:802:32 | x2.m2() | | file://:0:0:0:0 | & | +| main.rs:802:26:802:32 | x2.m2() | &T | main.rs:779:5:780:14 | S2 | +| main.rs:803:26:803:27 | x2 | | main.rs:776:5:777:19 | S | +| main.rs:803:26:803:27 | x2 | T | main.rs:779:5:780:14 | S2 | +| main.rs:803:26:803:32 | x2.m3() | | file://:0:0:0:0 | & | +| main.rs:803:26:803:32 | x2.m3() | &T | main.rs:779:5:780:14 | S2 | +| main.rs:805:13:805:14 | x3 | | main.rs:776:5:777:19 | S | +| main.rs:805:13:805:14 | x3 | T | main.rs:779:5:780:14 | S2 | +| main.rs:805:18:805:22 | S(...) | | main.rs:776:5:777:19 | S | +| main.rs:805:18:805:22 | S(...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:805:20:805:21 | S2 | | main.rs:779:5:780:14 | S2 | +| main.rs:807:26:807:41 | ...::m2(...) | | file://:0:0:0:0 | & | +| main.rs:807:26:807:41 | ...::m2(...) | &T | main.rs:779:5:780:14 | S2 | +| main.rs:807:38:807:40 | &x3 | | file://:0:0:0:0 | & | +| main.rs:807:38:807:40 | &x3 | &T | main.rs:776:5:777:19 | S | +| main.rs:807:38:807:40 | &x3 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:807:39:807:40 | x3 | | main.rs:776:5:777:19 | S | +| main.rs:807:39:807:40 | x3 | T | main.rs:779:5:780:14 | S2 | +| main.rs:808:26:808:41 | ...::m3(...) | | file://:0:0:0:0 | & | +| main.rs:808:26:808:41 | ...::m3(...) | &T | main.rs:779:5:780:14 | S2 | +| main.rs:808:38:808:40 | &x3 | | file://:0:0:0:0 | & | +| main.rs:808:38:808:40 | &x3 | &T | main.rs:776:5:777:19 | S | +| main.rs:808:38:808:40 | &x3 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:808:39:808:40 | x3 | | main.rs:776:5:777:19 | S | +| main.rs:808:39:808:40 | x3 | T | main.rs:779:5:780:14 | S2 | +| main.rs:810:13:810:14 | x4 | | file://:0:0:0:0 | & | +| main.rs:810:13:810:14 | x4 | &T | main.rs:776:5:777:19 | S | +| main.rs:810:13:810:14 | x4 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:810:18:810:23 | &... | | file://:0:0:0:0 | & | +| main.rs:810:18:810:23 | &... | &T | main.rs:776:5:777:19 | S | +| main.rs:810:18:810:23 | &... | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:810:19:810:23 | S(...) | | main.rs:776:5:777:19 | S | +| main.rs:810:19:810:23 | S(...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:810:21:810:22 | S2 | | main.rs:779:5:780:14 | S2 | +| main.rs:812:26:812:27 | x4 | | file://:0:0:0:0 | & | +| main.rs:812:26:812:27 | x4 | &T | main.rs:776:5:777:19 | S | +| main.rs:812:26:812:27 | x4 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:812:26:812:32 | x4.m2() | | file://:0:0:0:0 | & | +| main.rs:812:26:812:32 | x4.m2() | &T | main.rs:779:5:780:14 | S2 | +| main.rs:813:26:813:27 | x4 | | file://:0:0:0:0 | & | +| main.rs:813:26:813:27 | x4 | &T | main.rs:776:5:777:19 | S | +| main.rs:813:26:813:27 | x4 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:813:26:813:32 | x4.m3() | | file://:0:0:0:0 | & | +| main.rs:813:26:813:32 | x4.m3() | &T | main.rs:779:5:780:14 | S2 | +| main.rs:815:13:815:14 | x5 | | file://:0:0:0:0 | & | +| main.rs:815:13:815:14 | x5 | &T | main.rs:776:5:777:19 | S | +| main.rs:815:13:815:14 | x5 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:815:18:815:23 | &... | | file://:0:0:0:0 | & | +| main.rs:815:18:815:23 | &... | &T | main.rs:776:5:777:19 | S | +| main.rs:815:18:815:23 | &... | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:815:19:815:23 | S(...) | | main.rs:776:5:777:19 | S | +| main.rs:815:19:815:23 | S(...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:815:21:815:22 | S2 | | main.rs:779:5:780:14 | S2 | +| main.rs:817:26:817:27 | x5 | | file://:0:0:0:0 | & | +| main.rs:817:26:817:27 | x5 | &T | main.rs:776:5:777:19 | S | +| main.rs:817:26:817:27 | x5 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:817:26:817:32 | x5.m1() | | main.rs:779:5:780:14 | S2 | +| main.rs:818:26:818:27 | x5 | | file://:0:0:0:0 | & | +| main.rs:818:26:818:27 | x5 | &T | main.rs:776:5:777:19 | S | +| main.rs:818:26:818:27 | x5 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:818:26:818:29 | x5.0 | | main.rs:779:5:780:14 | S2 | +| main.rs:820:13:820:14 | x6 | | file://:0:0:0:0 | & | +| main.rs:820:13:820:14 | x6 | &T | main.rs:776:5:777:19 | S | +| main.rs:820:13:820:14 | x6 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:820:18:820:23 | &... | | file://:0:0:0:0 | & | +| main.rs:820:18:820:23 | &... | &T | main.rs:776:5:777:19 | S | +| main.rs:820:18:820:23 | &... | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:820:19:820:23 | S(...) | | main.rs:776:5:777:19 | S | +| main.rs:820:19:820:23 | S(...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:820:21:820:22 | S2 | | main.rs:779:5:780:14 | S2 | +| main.rs:822:26:822:30 | (...) | | main.rs:776:5:777:19 | S | +| main.rs:822:26:822:30 | (...) | T | main.rs:779:5:780:14 | S2 | +| main.rs:822:26:822:35 | ... .m1() | | main.rs:779:5:780:14 | S2 | +| main.rs:822:27:822:29 | * ... | | main.rs:776:5:777:19 | S | +| main.rs:822:27:822:29 | * ... | T | main.rs:779:5:780:14 | S2 | +| main.rs:822:28:822:29 | x6 | | file://:0:0:0:0 | & | +| main.rs:822:28:822:29 | x6 | &T | main.rs:776:5:777:19 | S | +| main.rs:822:28:822:29 | x6 | &T.T | main.rs:779:5:780:14 | S2 | +| main.rs:829:16:829:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:829:16:829:20 | SelfParam | &T | main.rs:827:5:835:5 | Self [trait MyTrait] | +| main.rs:832:16:832:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:832:16:832:20 | SelfParam | &T | main.rs:827:5:835:5 | Self [trait MyTrait] | +| main.rs:832:32:834:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:832:32:834:9 | { ... } | &T | main.rs:827:5:835:5 | Self [trait MyTrait] | +| main.rs:833:13:833:16 | self | | file://:0:0:0:0 | & | +| main.rs:833:13:833:16 | self | &T | main.rs:827:5:835:5 | Self [trait MyTrait] | +| main.rs:833:13:833:22 | self.foo() | | file://:0:0:0:0 | & | +| main.rs:833:13:833:22 | self.foo() | &T | main.rs:827:5:835:5 | Self [trait MyTrait] | +| main.rs:841:16:841:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:841:16:841:20 | SelfParam | &T | main.rs:837:5:837:20 | MyStruct | +| main.rs:841:36:843:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:841:36:843:9 | { ... } | &T | main.rs:837:5:837:20 | MyStruct | +| main.rs:842:13:842:16 | self | | file://:0:0:0:0 | & | +| main.rs:842:13:842:16 | self | &T | main.rs:837:5:837:20 | MyStruct | +| main.rs:847:13:847:13 | x | | main.rs:837:5:837:20 | MyStruct | +| main.rs:847:17:847:24 | MyStruct | | main.rs:837:5:837:20 | MyStruct | +| main.rs:848:9:848:9 | x | | main.rs:837:5:837:20 | MyStruct | +| main.rs:848:9:848:15 | x.bar() | | file://:0:0:0:0 | & | +| main.rs:848:9:848:15 | x.bar() | &T | main.rs:837:5:837:20 | MyStruct | +| main.rs:858:16:858:20 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:858:16:858:20 | SelfParam | &T | main.rs:855:5:855:26 | MyStruct | +| main.rs:858:16:858:20 | SelfParam | &T.T | main.rs:857:10:857:10 | T | +| main.rs:858:32:860:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:858:32:860:9 | { ... } | &T | main.rs:855:5:855:26 | MyStruct | +| main.rs:858:32:860:9 | { ... } | &T.T | main.rs:857:10:857:10 | T | +| main.rs:859:13:859:16 | self | | file://:0:0:0:0 | & | +| main.rs:859:13:859:16 | self | &T | main.rs:855:5:855:26 | MyStruct | +| main.rs:859:13:859:16 | self | &T.T | main.rs:857:10:857:10 | T | +| main.rs:864:13:864:13 | x | | main.rs:855:5:855:26 | MyStruct | +| main.rs:864:13:864:13 | x | T | main.rs:853:5:853:13 | S | +| main.rs:864:17:864:27 | MyStruct(...) | | main.rs:855:5:855:26 | MyStruct | +| main.rs:864:17:864:27 | MyStruct(...) | T | main.rs:853:5:853:13 | S | +| main.rs:864:26:864:26 | S | | main.rs:853:5:853:13 | S | +| main.rs:865:9:865:9 | x | | main.rs:855:5:855:26 | MyStruct | +| main.rs:865:9:865:9 | x | T | main.rs:853:5:853:13 | S | +| main.rs:865:9:865:15 | x.foo() | | file://:0:0:0:0 | & | +| main.rs:865:9:865:15 | x.foo() | &T | main.rs:855:5:855:26 | MyStruct | +| main.rs:865:9:865:15 | x.foo() | &T.T | main.rs:853:5:853:13 | S | +| main.rs:873:15:873:19 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:873:15:873:19 | SelfParam | &T | main.rs:870:5:870:13 | S | +| main.rs:873:31:875:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:873:31:875:9 | { ... } | &T | main.rs:870:5:870:13 | S | +| main.rs:874:13:874:19 | &... | | file://:0:0:0:0 | & | +| main.rs:874:13:874:19 | &... | &T | main.rs:870:5:870:13 | S | +| main.rs:874:14:874:19 | &... | | file://:0:0:0:0 | & | +| main.rs:874:14:874:19 | &... | &T | main.rs:870:5:870:13 | S | +| main.rs:874:15:874:19 | &self | | file://:0:0:0:0 | & | +| main.rs:874:15:874:19 | &self | &T | main.rs:870:5:870:13 | S | +| main.rs:874:16:874:19 | self | | file://:0:0:0:0 | & | +| main.rs:874:16:874:19 | self | &T | main.rs:870:5:870:13 | S | +| main.rs:877:15:877:25 | SelfParam | | file://:0:0:0:0 | & | +| main.rs:877:15:877:25 | SelfParam | &T | main.rs:870:5:870:13 | S | +| main.rs:877:37:879:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:877:37:879:9 | { ... } | &T | main.rs:870:5:870:13 | S | +| main.rs:878:13:878:19 | &... | | file://:0:0:0:0 | & | +| main.rs:878:13:878:19 | &... | &T | main.rs:870:5:870:13 | S | +| main.rs:878:14:878:19 | &... | | file://:0:0:0:0 | & | +| main.rs:878:14:878:19 | &... | &T | main.rs:870:5:870:13 | S | +| main.rs:878:15:878:19 | &self | | file://:0:0:0:0 | & | +| main.rs:878:15:878:19 | &self | &T | main.rs:870:5:870:13 | S | +| main.rs:878:16:878:19 | self | | file://:0:0:0:0 | & | +| main.rs:878:16:878:19 | self | &T | main.rs:870:5:870:13 | S | +| main.rs:881:15:881:15 | x | | file://:0:0:0:0 | & | +| main.rs:881:15:881:15 | x | &T | main.rs:870:5:870:13 | S | +| main.rs:881:34:883:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:881:34:883:9 | { ... } | &T | main.rs:870:5:870:13 | S | +| main.rs:882:13:882:13 | x | | file://:0:0:0:0 | & | +| main.rs:882:13:882:13 | x | &T | main.rs:870:5:870:13 | S | +| main.rs:885:15:885:15 | x | | file://:0:0:0:0 | & | +| main.rs:885:15:885:15 | x | &T | main.rs:870:5:870:13 | S | +| main.rs:885:34:887:9 | { ... } | | file://:0:0:0:0 | & | +| main.rs:885:34:887:9 | { ... } | &T | main.rs:870:5:870:13 | S | +| main.rs:886:13:886:16 | &... | | file://:0:0:0:0 | & | +| main.rs:886:13:886:16 | &... | &T | main.rs:870:5:870:13 | S | +| main.rs:886:14:886:16 | &... | | file://:0:0:0:0 | & | +| main.rs:886:14:886:16 | &... | &T | main.rs:870:5:870:13 | S | +| main.rs:886:15:886:16 | &x | | file://:0:0:0:0 | & | +| main.rs:886:15:886:16 | &x | &T | main.rs:870:5:870:13 | S | +| main.rs:886:16:886:16 | x | | file://:0:0:0:0 | & | +| main.rs:886:16:886:16 | x | &T | main.rs:870:5:870:13 | S | +| main.rs:891:13:891:13 | x | | main.rs:870:5:870:13 | S | +| main.rs:891:17:891:20 | S {...} | | main.rs:870:5:870:13 | S | +| main.rs:892:9:892:9 | x | | main.rs:870:5:870:13 | S | +| main.rs:892:9:892:14 | x.f1() | | file://:0:0:0:0 | & | +| main.rs:892:9:892:14 | x.f1() | &T | main.rs:870:5:870:13 | S | +| main.rs:893:9:893:9 | x | | main.rs:870:5:870:13 | S | +| main.rs:893:9:893:14 | x.f2() | | file://:0:0:0:0 | & | +| main.rs:893:9:893:14 | x.f2() | &T | main.rs:870:5:870:13 | S | +| main.rs:894:9:894:17 | ...::f3(...) | | file://:0:0:0:0 | & | +| main.rs:894:9:894:17 | ...::f3(...) | &T | main.rs:870:5:870:13 | S | +| main.rs:894:15:894:16 | &x | | file://:0:0:0:0 | & | +| main.rs:894:15:894:16 | &x | &T | main.rs:870:5:870:13 | S | +| main.rs:894:16:894:16 | x | | main.rs:870:5:870:13 | S | +| main.rs:900:5:900:20 | ...::f(...) | | main.rs:67:5:67:21 | Foo | +| main.rs:901:5:901:60 | ...::g(...) | | main.rs:67:5:67:21 | Foo | +| main.rs:901:20:901:38 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | +| main.rs:901:41:901:59 | ...::Foo {...} | | main.rs:67:5:67:21 | Foo | From de0d374cce0b3cc2a8522813834581bfc1644cc3 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 7 Apr 2025 16:58:26 +0200 Subject: [PATCH 105/372] Rust: add `upgrades` property in `qlpack.yml` --- rust/ql/lib/qlpack.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/ql/lib/qlpack.yml b/rust/ql/lib/qlpack.yml index 603ede342c7..b8bd5c63c9e 100644 --- a/rust/ql/lib/qlpack.yml +++ b/rust/ql/lib/qlpack.yml @@ -4,6 +4,7 @@ groups: rust extractor: rust dbscheme: rust.dbscheme library: true +upgrades: upgrades dependencies: codeql/controlflow: ${workspace} codeql/dataflow: ${workspace} From ff07ec8d8c58749dded7417c17585f7dfdb80d73 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 13:43:50 +0200 Subject: [PATCH 106/372] Add flow summaries for TypedArray methods `set` and `subarray` --- .../internal/flow_summaries/TypedArrays.qll | 29 +++++++++++++++++++ .../TaintTracking/BasicTaintTracking.expected | 7 +++-- .../TaintTracking/typed-arrays.js | 4 --- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll index 788992d7c1c..43c2a5e07e5 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll @@ -36,3 +36,32 @@ class BufferTypedArray extends DataFlow::AdditionalFlowStep { ) } } + +class SetLike extends SummarizedCallable { + SetLike() { this = "TypedArray#set" } + + override InstanceCall getACall() { + result = typedArrayConstructorRef().getAnInstantiation().getReturn().getMember("set").getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[0].ArrayElement" and + output = "Argument[this].ArrayElement" + } +} + +class SubArrayLike extends SummarizedCallable { + SubArrayLike() { this = "TypedArray#subarray" } + + override InstanceCall getACall() { + result = + typedArrayConstructorRef().getAnInstantiation().getReturn().getMember("subarray").getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[this].ArrayElement" and + output = "ReturnValue.ArrayElement" + } +} diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index 3856dfe15f8..78dbc3dc5dc 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -38,14 +38,13 @@ legacyDataFlowDifference | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:5:10:5:10 | y | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:7:10:7:17 | y.buffer | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:15 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:18 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:22 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -334,6 +333,8 @@ flow | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:5:10:5:10 | y | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:7:10:7:17 | y.buffer | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | | xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js index 4ccf64131b6..1b66d5491d9 100644 --- a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -16,8 +16,4 @@ function test() { const sub = y.subarray(1, 3) sink(sub); // NOT OK - - const clone = new y.constructor(y.length); - clone.set(y); - sink(clone); // NOT OK } From 0e099474c56b9157905478c7cb0881e28124ec41 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 13:50:46 +0200 Subject: [PATCH 107/372] Added test cases for `ArrayBuffer` and `SharedArrayBuffer` --- .../TaintTracking/BasicTaintTracking.expected | 4 ++++ .../library-tests/TaintTracking/typed-arrays.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index 78dbc3dc5dc..c51eb479313 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -45,6 +45,10 @@ consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:22 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:26 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:30 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:34 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js index 1b66d5491d9..9b85e8f2804 100644 --- a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -16,4 +16,20 @@ function test() { const sub = y.subarray(1, 3) sink(sub); // NOT OK + + const buffer = new ArrayBuffer(x); + const view = new Uint8Array(buffer); + sink(view); // NOT OK + + const sharedBuffer = new SharedArrayBuffer(x); + const view1 = new Uint8Array(sharedBuffer); + sink(view1); // NOT OK + + const transfered = buffer.transfer(); + const transferedView = new Uint8Array(transfered); + sink(transferedView); // NOT OK + + const transfered2 = buffer.transferToFixedLength(); + const transferedView2 = new Uint8Array(transfered2); + sink(transferedView2); // NOT OK } From f4277204b7fb664be85d6c8cb80ddb6d84da1bd1 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 13:56:13 +0200 Subject: [PATCH 108/372] Add flow summaries and entry points for `ArrayBuffer` and `SharedArrayBuffer` --- .../internal/flow_summaries/TypedArrays.qll | 44 +++++++++++++++++++ .../TaintTracking/BasicTaintTracking.expected | 12 +++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll index 43c2a5e07e5..81e84d806fd 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll @@ -65,3 +65,47 @@ class SubArrayLike extends SummarizedCallable { output = "ReturnValue.ArrayElement" } } + +private class ArrayBufferEntryPoint extends API::EntryPoint { + ArrayBufferEntryPoint() { this = ["global.ArrayBuffer", "global.SharedArrayBuffer"] } + + override DataFlow::SourceNode getASource() { + result = DataFlow::globalVarRef(["ArrayBuffer", "SharedArrayBuffer"]) + } +} + +pragma[nomagic] +API::Node arrayBufferConstructorRef() { result = any(ArrayBufferEntryPoint a).getANode() } + +class ArrayBufferConstructorSummary extends SummarizedCallable { + ArrayBufferConstructorSummary() { this = "ArrayBuffer constructor" } + + override DataFlow::InvokeNode getACall() { + result = arrayBufferConstructorRef().getAnInstantiation() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[0].ArrayElement" and + output = "ReturnValue.ArrayElement" + } +} + +class TransferLike extends SummarizedCallable { + TransferLike() { this = "ArrayBuffer#transfer" } + + override InstanceCall getACall() { + result = + arrayBufferConstructorRef() + .getAnInstantiation() + .getReturn() + .getMember(["transfer", "transferToFixedLength"]) + .getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[this].ArrayElement" and + output = "ReturnValue.ArrayElement" + } +} diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index c51eb479313..fa33cf23125 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -40,15 +40,15 @@ legacyDataFlowDifference | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:22:10:22:13 | view | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:26:10:26:14 | view1 | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:22 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:26 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:30 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:34 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -339,6 +339,10 @@ flow | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:22:10:22:13 | view | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:26:10:26:14 | view1 | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | | xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text | From f28478e87668c644e3990254c4b8e1a921ee7878 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 14:23:44 +0200 Subject: [PATCH 109/372] Add test cases from `TypedArrays` to strings. --- .../TaintTracking/BasicTaintTracking.expected | 4 ++++ .../library-tests/TaintTracking/typed-arrays.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index fa33cf23125..b20e0062411 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -44,11 +44,14 @@ legacyDataFlowDifference | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:26:10:26:14 | view1 | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:46:10:46:12 | str | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | +| typed-arrays.js:40 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | +| typed-arrays.js:50 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -343,6 +346,7 @@ flow | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:26:10:26:14 | view1 | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:46:10:46:12 | str | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | | xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js index 9b85e8f2804..d2dc8b2168c 100644 --- a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -32,4 +32,20 @@ function test() { const transfered2 = buffer.transferToFixedLength(); const transferedView2 = new Uint8Array(transfered2); sink(transferedView2); // NOT OK + + var typedArrayToString = (function () { + return function (a) { return String.fromCharCode.apply(null, a); }; + })(); + + sink(typedArrayToString(y)); // NOT OK -- Should be flagged but it is not. + + let str = ''; + for (let i = 0; i < y.length; i++) + str += String.fromCharCode(y[i]); + + sink(str); // NOT OK + + const decoder = new TextDecoder('utf-8'); + const str2 = decoder.decode(y); + sink(str2); // NOT OK } From b97c61864e904d0cde359132e600f899374deb94 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 14:37:52 +0200 Subject: [PATCH 110/372] Add flow summaries and entry points for `TextDecoder` --- .../flow_summaries/AllFlowSummaries.qll | 1 + .../internal/flow_summaries/Decoders.qll | 29 +++++++++++++++++++ .../TaintTracking/BasicTaintTracking.expected | 3 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll index 20247b7e268..dfbe9ef7da3 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/AllFlowSummaries.qll @@ -13,3 +13,4 @@ private import Strings private import DynamicImportStep private import UrlSearchParams private import TypedArrays +private import Decoders diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll new file mode 100644 index 00000000000..567a0403bcf --- /dev/null +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll @@ -0,0 +1,29 @@ +private import javascript +private import semmle.javascript.dataflow.FlowSummary +private import semmle.javascript.dataflow.InferredTypes +private import semmle.javascript.dataflow.internal.DataFlowPrivate as Private +private import FlowSummaryUtil + +private class TextDecoderEntryPoint extends API::EntryPoint { + TextDecoderEntryPoint() { this = "global.TextDecoder" } + + override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("TextDecoder") } +} + +pragma[nomagic] +API::Node textDecoderConstructorRef() { result = any(TextDecoderEntryPoint e).getANode() } + +class DecodeLike extends SummarizedCallable { + DecodeLike() { this = "TextDecoder#decode" } + + override InstanceCall getACall() { + result = + textDecoderConstructorRef().getAnInstantiation().getReturn().getMember("decode").getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + input = "Argument[0]" and + output = "ReturnValue" + } +} diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index b20e0062411..e0cbc7b3b2e 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -45,13 +45,13 @@ legacyDataFlowDifference | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:46:10:46:12 | str | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:50:10:50:13 | str2 | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | | typed-arrays.js:40 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | -| typed-arrays.js:50 | expected an alert, but found none | NOT OK | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -347,6 +347,7 @@ flow | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:46:10:46:12 | str | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:50:10:50:13 | str2 | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | | xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text | From 873db7c1215e8fcee250c9f55a7c9061bed0e286 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 7 Apr 2025 15:16:22 +0200 Subject: [PATCH 111/372] Added change note --- javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md diff --git a/javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md b/javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md new file mode 100644 index 00000000000..f09e6831743 --- /dev/null +++ b/javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added taint propagation for `Uint8Array`, `ArrayBuffer`, `SharedArrayBuffer` and `TextDecoder.decode()`. From 5e74bdc8dda99bc7cdbc3007597e11c099734566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Mon, 7 Apr 2025 17:49:18 +0200 Subject: [PATCH 112/372] Disable csharp test failing on macos-15 --- .../all-platforms/diag_missing_project_files/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py b/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py index a2676d16d9c..fa941f346df 100644 --- a/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py +++ b/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py @@ -1,2 +1,8 @@ +import pytest +import runs_on + + +# Skipping the test on macos-15, as we're running into trouble. +@pytest.mark.only_if(not runs_on.macos_15) def test(codeql, csharp): codeql.database.create(_assert_failure=True) From 37db35431b4bf7886845c1e8db790ac2417618ba Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Fri, 4 Apr 2025 16:44:42 -0700 Subject: [PATCH 113/372] Actions: Ensure autobuild invocations work when the CLI path contains spaces Quote the paths to the CodeQL CLI dist or autobuild scripts when invoked. This unblocks integration testing, since our integration tests always use a CLI with a space in its directory name. --- actions/extractor/tools/autobuild-impl.ps1 | 4 ++-- actions/extractor/tools/autobuild.cmd | 2 +- actions/extractor/tools/autobuild.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actions/extractor/tools/autobuild-impl.ps1 b/actions/extractor/tools/autobuild-impl.ps1 index 1b7805efa04..5a5aa1ab53a 100644 --- a/actions/extractor/tools/autobuild-impl.ps1 +++ b/actions/extractor/tools/autobuild-impl.ps1 @@ -21,7 +21,7 @@ if (($null -ne $env:LGTM_INDEX_INCLUDE) -or ($null -ne $env:LGTM_INDEX_EXCLUDE) # Find the JavaScript extractor directory via `codeql resolve extractor`. $CodeQL = Join-Path $env:CODEQL_DIST 'codeql.exe' -$env:CODEQL_EXTRACTOR_JAVASCRIPT_ROOT = &$CodeQL resolve extractor --language javascript +$env:CODEQL_EXTRACTOR_JAVASCRIPT_ROOT = &"$CodeQL" resolve extractor --language javascript if ($LASTEXITCODE -ne 0) { throw 'Failed to resolve JavaScript extractor.' } @@ -40,7 +40,7 @@ $env:CODEQL_EXTRACTOR_JAVASCRIPT_SOURCE_ARCHIVE_DIR = $env:CODEQL_EXTRACTOR_ACTI $env:CODEQL_EXTRACTOR_JAVASCRIPT_TRAP_DIR = $env:CODEQL_EXTRACTOR_ACTIONS_TRAP_DIR $env:CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE = $env:CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE -&$JavaScriptAutoBuild +&"$JavaScriptAutoBuild" if ($LASTEXITCODE -ne 0) { throw "JavaScript autobuilder failed." } diff --git a/actions/extractor/tools/autobuild.cmd b/actions/extractor/tools/autobuild.cmd index ff5ca89d94a..cd05b979110 100644 --- a/actions/extractor/tools/autobuild.cmd +++ b/actions/extractor/tools/autobuild.cmd @@ -1,3 +1,3 @@ @echo off rem All of the work is done in the PowerShell script -powershell.exe %~dp0autobuild-impl.ps1 +powershell.exe "%~dp0autobuild-impl.ps1" diff --git a/actions/extractor/tools/autobuild.sh b/actions/extractor/tools/autobuild.sh index ce6a02b5b76..703154f99c9 100755 --- a/actions/extractor/tools/autobuild.sh +++ b/actions/extractor/tools/autobuild.sh @@ -26,7 +26,7 @@ else fi # Find the JavaScript extractor directory via `codeql resolve extractor`. -CODEQL_EXTRACTOR_JAVASCRIPT_ROOT="$($CODEQL_DIST/codeql resolve extractor --language javascript)" +CODEQL_EXTRACTOR_JAVASCRIPT_ROOT="$("${CODEQL_DIST}/codeql" resolve extractor --language javascript)" export CODEQL_EXTRACTOR_JAVASCRIPT_ROOT echo "Found JavaScript extractor at '${CODEQL_EXTRACTOR_JAVASCRIPT_ROOT}'." @@ -42,4 +42,4 @@ env CODEQL_EXTRACTOR_JAVASCRIPT_DIAGNOSTIC_DIR="${CODEQL_EXTRACTOR_ACTIONS_DIAGN CODEQL_EXTRACTOR_JAVASCRIPT_SOURCE_ARCHIVE_DIR="${CODEQL_EXTRACTOR_ACTIONS_SOURCE_ARCHIVE_DIR}" \ CODEQL_EXTRACTOR_JAVASCRIPT_TRAP_DIR="${CODEQL_EXTRACTOR_ACTIONS_TRAP_DIR}" \ CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE="${CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE}" \ - ${JAVASCRIPT_AUTO_BUILD} + "${JAVASCRIPT_AUTO_BUILD}" From 0bb4ab950f46967171b83948e53a087151d0385c Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Fri, 4 Apr 2025 17:46:28 -0700 Subject: [PATCH 114/372] Actions: Add integration test for default filter behaviour Include a reachable workflow, and several unreachable workflow files. Include action metadata files at various depths, all reachable. This test exercises the default filters when the user doesn't specify paths/paths-ignore. --- .../filters-default/actions.expected | 4 ++++ .../ql/integration-tests/filters-default/actions.ql | 5 +++++ .../filters-default/src/.github/action.yaml | 11 +++++++++++ .../src/.github/actions/action-name/action.yml | 11 +++++++++++ .../src/.github/unreachable-workflow.yml | 12 ++++++++++++ .../src/.github/workflows/workflow.yml | 12 ++++++++++++ .../integration-tests/filters-default/src/action.yml | 11 +++++++++++ .../filters-default/src/unreachable-workflow.yml | 12 ++++++++++++ actions/ql/integration-tests/filters-default/test.py | 2 ++ 9 files changed, 80 insertions(+) create mode 100644 actions/ql/integration-tests/filters-default/actions.expected create mode 100644 actions/ql/integration-tests/filters-default/actions.ql create mode 100644 actions/ql/integration-tests/filters-default/src/.github/action.yaml create mode 100644 actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml create mode 100644 actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml create mode 100644 actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml create mode 100644 actions/ql/integration-tests/filters-default/src/action.yml create mode 100644 actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml create mode 100755 actions/ql/integration-tests/filters-default/test.py diff --git a/actions/ql/integration-tests/filters-default/actions.expected b/actions/ql/integration-tests/filters-default/actions.expected new file mode 100644 index 00000000000..376c71bad6d --- /dev/null +++ b/actions/ql/integration-tests/filters-default/actions.expected @@ -0,0 +1,4 @@ +| src/.github/action.yaml:1:1:11:32 | name: ' ... action' | +| src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' | +| src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow | +| src/action.yml:1:1:11:32 | name: ' ... action' | diff --git a/actions/ql/integration-tests/filters-default/actions.ql b/actions/ql/integration-tests/filters-default/actions.ql new file mode 100644 index 00000000000..f0a3e0ab297 --- /dev/null +++ b/actions/ql/integration-tests/filters-default/actions.ql @@ -0,0 +1,5 @@ +import actions + +from AstNode n +where n instanceof Workflow or n instanceof CompositeAction +select n diff --git a/actions/ql/integration-tests/filters-default/src/.github/action.yaml b/actions/ql/integration-tests/filters-default/src/.github/action.yaml new file mode 100644 index 00000000000..f611f8c72ff --- /dev/null +++ b/actions/ql/integration-tests/filters-default/src/.github/action.yaml @@ -0,0 +1,11 @@ +name: 'A composite action' +description: 'Do something' +runs: + using: "composite" + steps: + - name: Print + run: echo "Hello world" + shell: bash + + - name: Checkout + uses: actions/checkout@v4 diff --git a/actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml b/actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml new file mode 100644 index 00000000000..f611f8c72ff --- /dev/null +++ b/actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml @@ -0,0 +1,11 @@ +name: 'A composite action' +description: 'Do something' +runs: + using: "composite" + steps: + - name: Print + run: echo "Hello world" + shell: bash + + - name: Checkout + uses: actions/checkout@v4 diff --git a/actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml b/actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml new file mode 100644 index 00000000000..6f980d6a6b0 --- /dev/null +++ b/actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml @@ -0,0 +1,12 @@ +name: An unreachable workflow +on: + push: + branches: + - main + +jobs: + job: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 \ No newline at end of file diff --git a/actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml b/actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml new file mode 100644 index 00000000000..8be09d6d07e --- /dev/null +++ b/actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml @@ -0,0 +1,12 @@ +name: A workflow +on: + push: + branches: + - main + +jobs: + job: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 \ No newline at end of file diff --git a/actions/ql/integration-tests/filters-default/src/action.yml b/actions/ql/integration-tests/filters-default/src/action.yml new file mode 100644 index 00000000000..f611f8c72ff --- /dev/null +++ b/actions/ql/integration-tests/filters-default/src/action.yml @@ -0,0 +1,11 @@ +name: 'A composite action' +description: 'Do something' +runs: + using: "composite" + steps: + - name: Print + run: echo "Hello world" + shell: bash + + - name: Checkout + uses: actions/checkout@v4 diff --git a/actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml b/actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml new file mode 100644 index 00000000000..6f980d6a6b0 --- /dev/null +++ b/actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml @@ -0,0 +1,12 @@ +name: An unreachable workflow +on: + push: + branches: + - main + +jobs: + job: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 \ No newline at end of file diff --git a/actions/ql/integration-tests/filters-default/test.py b/actions/ql/integration-tests/filters-default/test.py new file mode 100755 index 00000000000..c0ac8d191b9 --- /dev/null +++ b/actions/ql/integration-tests/filters-default/test.py @@ -0,0 +1,2 @@ +def test(codeql, actions): + codeql.database.create(source_root="src") From 98b6e5ce2f28347d15e6aa963db3b10d70481030 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 7 Apr 2025 17:33:43 -0700 Subject: [PATCH 115/372] Docs: Fix formatting of GitHub Actions content Discovered in internal review of docs preview. Use double backticks to render inline code blocks. Use __ after inline hyperlinks. Use an extra blank line to format the Actions library predicates table correctly. Fix some rogue references to Ruby and case inconsistency. --- .../codeql-for-actions.rst | 2 +- .../codeql-library-for-actions.rst | 25 ++++++++++--------- ...customizing-library-models-for-actions.rst | 2 +- .../customizing-library-models-for-ruby.rst | 2 +- .../codeql/reusables/supported-frameworks.rst | 4 +-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/codeql/codeql-language-guides/codeql-for-actions.rst b/docs/codeql/codeql-language-guides/codeql-for-actions.rst index d4597811a47..23b87193abf 100644 --- a/docs/codeql/codeql-language-guides/codeql-for-actions.rst +++ b/docs/codeql/codeql-language-guides/codeql-for-actions.rst @@ -12,6 +12,6 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat codeql-library-for-actions customizing-library-models-for-actions -- :doc:`CodeQL library for GitHub Actions `: When you're analyzing a Ruby program, you can make use of the large collection of classes in the CodeQL library for GitHub Actions. +- :doc:`CodeQL library for GitHub Actions `: When you're analyzing GitHub Actions code, you can make use of the large collection of classes in the CodeQL library for GitHub Actions. - :doc:`Customizing library models for GitHub Actions `: You can model frameworks and libraries that your codebase depends on using data extensions and publish them as CodeQL model packs. diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst b/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst index 507438583c6..7be7f3c8cfe 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst @@ -95,7 +95,7 @@ to all AST classes: * - ``getAChildNode()`` - Gets a child node of this node. * - ``getParentNode()`` - - Gets the parent of this `AstNode`, if this node is not a root node. + - Gets the parent of this ``AstNode``, if this node is not a root node. * - ``getATriggerEvent()`` - Gets an Actions trigger event that can start the enclosing Actions workflow, if any. @@ -104,9 +104,9 @@ Workflows ~~~~~~~~~ A workflow is a configurable automated process made up of one or more jobs, -defined in a workflow YAML file in the `.github/workflows` directory of a GitHub repository. +defined in a workflow YAML file in the ``.github/workflows`` directory of a GitHub repository. -In the CodeQL AST library, a `Workflow` is an `AstNode` representing the mapping at the top level of an Actions YAML workflow file. +In the CodeQL AST library, a ``Workflow`` is an ``AstNode`` representing the mapping at the top level of an Actions YAML workflow file. See the GitHub Actions documentation on `workflows `__ and `workflow syntax `__ for more information. @@ -116,16 +116,17 @@ See the GitHub Actions documentation on `workflows `, Workflows - `GitHub Actions action metadata YAML files `, Actions + `GitHub Actions workflow YAML files `__, Workflows + `GitHub Actions action metadata YAML files `__, Actions Go built-in support ================================ From cf4989e1f854a8fe63472ab1bccb59b375e7a73d Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 7 Apr 2025 17:37:21 -0700 Subject: [PATCH 116/372] Docs: Place GitHub Actions link lower in sidebar Order by the human-readable language name that is rendered, i.e. 'GitHub Actions', not 'actions'. --- docs/codeql/codeql-language-guides/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/codeql-language-guides/index.rst b/docs/codeql/codeql-language-guides/index.rst index f59d8163db2..ca03ebffd75 100644 --- a/docs/codeql/codeql-language-guides/index.rst +++ b/docs/codeql/codeql-language-guides/index.rst @@ -7,9 +7,9 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat .. toctree:: - codeql-for-actions codeql-for-cpp codeql-for-csharp + codeql-for-actions codeql-for-go codeql-for-java codeql-for-javascript From df89739085904e75cc4f08b99ed7dc3f79500dbd Mon Sep 17 00:00:00 2001 From: Napalys Date: Tue, 8 Apr 2025 08:10:10 +0200 Subject: [PATCH 117/372] Added test cases for `open` package. --- .../query-tests/Security/CWE-022/TaintedPath/open.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js new file mode 100644 index 00000000000..10077281b3a --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js @@ -0,0 +1,11 @@ +import open, {openApp, apps} from 'open'; + +const express = require('express'); +const app = express(); + +app.get('/open', (req, res) => { + const file = req.query.file; // $ MISSING: Source + + open(file); // $ MISSING: Alert + openApp(file); // $ MISSING: Alert +}); From b8802a29f4ca34b5057a9d9452315bb3428299b4 Mon Sep 17 00:00:00 2001 From: Napalys Date: Tue, 8 Apr 2025 08:12:30 +0200 Subject: [PATCH 118/372] Added `open` package model as data. --- javascript/ql/lib/ext/open.model.yml | 7 +++++++ .../Security/CWE-022/TaintedPath/TaintedPath.expected | 9 +++++++++ .../query-tests/Security/CWE-022/TaintedPath/open.js | 6 +++--- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 javascript/ql/lib/ext/open.model.yml diff --git a/javascript/ql/lib/ext/open.model.yml b/javascript/ql/lib/ext/open.model.yml new file mode 100644 index 00000000000..2159fe794d7 --- /dev/null +++ b/javascript/ql/lib/ext/open.model.yml @@ -0,0 +1,7 @@ +extensions: + - addsTo: + pack: codeql/javascript-all + extensible: sinkModel + data: + - ["open", "Argument[0]", "path-injection"] + - ["open", "Member[openApp].Argument[0]", "path-injection"] diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected index 99be2545b8e..88334b64c38 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected @@ -140,6 +140,8 @@ | normalizedPaths.js:408:19:408:60 | pathMod ... t('/')) | normalizedPaths.js:408:38:408:48 | req.query.x | normalizedPaths.js:408:19:408:60 | pathMod ... t('/')) | This path depends on a $@. | normalizedPaths.js:408:38:408:48 | req.query.x | user-provided value | | normalizedPaths.js:415:19:415:22 | path | normalizedPaths.js:412:35:412:45 | req.query.x | normalizedPaths.js:415:19:415:22 | path | This path depends on a $@. | normalizedPaths.js:412:35:412:45 | req.query.x | user-provided value | | normalizedPaths.js:426:21:426:24 | path | normalizedPaths.js:412:35:412:45 | req.query.x | normalizedPaths.js:426:21:426:24 | path | This path depends on a $@. | normalizedPaths.js:412:35:412:45 | req.query.x | user-provided value | +| open.js:9:10:9:13 | file | open.js:7:18:7:31 | req.query.file | open.js:9:10:9:13 | file | This path depends on a $@. | open.js:7:18:7:31 | req.query.file | user-provided value | +| open.js:10:13:10:16 | file | open.js:7:18:7:31 | req.query.file | open.js:10:13:10:16 | file | This path depends on a $@. | open.js:7:18:7:31 | req.query.file | user-provided value | | other-fs-libraries.js:11:19:11:22 | path | other-fs-libraries.js:9:24:9:30 | req.url | other-fs-libraries.js:11:19:11:22 | path | This path depends on a $@. | other-fs-libraries.js:9:24:9:30 | req.url | user-provided value | | other-fs-libraries.js:12:27:12:30 | path | other-fs-libraries.js:9:24:9:30 | req.url | other-fs-libraries.js:12:27:12:30 | path | This path depends on a $@. | other-fs-libraries.js:9:24:9:30 | req.url | user-provided value | | other-fs-libraries.js:13:24:13:27 | path | other-fs-libraries.js:9:24:9:30 | req.url | other-fs-libraries.js:13:24:13:27 | path | This path depends on a $@. | other-fs-libraries.js:9:24:9:30 | req.url | user-provided value | @@ -561,6 +563,9 @@ edges | normalizedPaths.js:412:7:412:46 | path | normalizedPaths.js:426:21:426:24 | path | provenance | | | normalizedPaths.js:412:14:412:46 | pathMod ... uery.x) | normalizedPaths.js:412:7:412:46 | path | provenance | | | normalizedPaths.js:412:35:412:45 | req.query.x | normalizedPaths.js:412:14:412:46 | pathMod ... uery.x) | provenance | Config | +| open.js:7:11:7:31 | file | open.js:9:10:9:13 | file | provenance | | +| open.js:7:11:7:31 | file | open.js:10:13:10:16 | file | provenance | | +| open.js:7:18:7:31 | req.query.file | open.js:7:11:7:31 | file | provenance | | | other-fs-libraries.js:9:7:9:48 | path | other-fs-libraries.js:11:19:11:22 | path | provenance | | | other-fs-libraries.js:9:7:9:48 | path | other-fs-libraries.js:12:27:12:30 | path | provenance | | | other-fs-libraries.js:9:7:9:48 | path | other-fs-libraries.js:13:24:13:27 | path | provenance | | @@ -1116,6 +1121,10 @@ nodes | normalizedPaths.js:412:35:412:45 | req.query.x | semmle.label | req.query.x | | normalizedPaths.js:415:19:415:22 | path | semmle.label | path | | normalizedPaths.js:426:21:426:24 | path | semmle.label | path | +| open.js:7:11:7:31 | file | semmle.label | file | +| open.js:7:18:7:31 | req.query.file | semmle.label | req.query.file | +| open.js:9:10:9:13 | file | semmle.label | file | +| open.js:10:13:10:16 | file | semmle.label | file | | other-fs-libraries.js:9:7:9:48 | path | semmle.label | path | | other-fs-libraries.js:9:14:9:37 | url.par ... , true) | semmle.label | url.par ... , true) | | other-fs-libraries.js:9:14:9:43 | url.par ... ).query | semmle.label | url.par ... ).query | diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js index 10077281b3a..ce93d6284a2 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/open.js @@ -4,8 +4,8 @@ const express = require('express'); const app = express(); app.get('/open', (req, res) => { - const file = req.query.file; // $ MISSING: Source + const file = req.query.file; // $ Source - open(file); // $ MISSING: Alert - openApp(file); // $ MISSING: Alert + open(file); // $ Alert + openApp(file); // $ Alert }); From 4a4d78bbdef1eb882e0a0fec36281f1e4da31f97 Mon Sep 17 00:00:00 2001 From: Napalys Date: Tue, 8 Apr 2025 08:12:42 +0200 Subject: [PATCH 119/372] Added change note --- javascript/ql/lib/change-notes/2025-04-07-open-package.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2025-04-07-open-package.md diff --git a/javascript/ql/lib/change-notes/2025-04-07-open-package.md b/javascript/ql/lib/change-notes/2025-04-07-open-package.md new file mode 100644 index 00000000000..a4c02f0d6d9 --- /dev/null +++ b/javascript/ql/lib/change-notes/2025-04-07-open-package.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added support for the `open` package. From 15606dd89414e44f2265e928aa0b8b3e9983d030 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 8 Apr 2025 08:20:54 +0200 Subject: [PATCH 120/372] Bazel: update to 8.1.1 --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index ae9a76b9249..0e79152459e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.0.0 +8.1.1 From 10ad5780b5d83a6af212552021008ea6cf5eab5a Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 8 Apr 2025 09:03:12 +0100 Subject: [PATCH 121/372] Rust: Try a different toolchain version to fix the test in CI? --- rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml b/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml index afeb5929325..5d56faf9ae0 100644 --- a/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml +++ b/rust/ql/test/query-tests/security/CWE-770/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2025-03-17" +channel = "nightly" From 7459548118699421b25aed08fd8adb23098e3f89 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 8 Apr 2025 11:49:16 +0200 Subject: [PATCH 122/372] Rust: Cache tweaks --- .../rust/dataflow/internal/DataFlowImpl.qll | 2 + .../rust/elements/internal/AstNodeImpl.qll | 1 + .../rust/elements/internal/VariableImpl.qll | 88 ++++++++++++------- .../lib/codeql/rust/internal/CachedStages.qll | 4 + .../codeql/rust/internal/PathResolution.qll | 7 +- 5 files changed, 69 insertions(+), 33 deletions(-) diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll index 91af72fce4e..4376df7caf8 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll @@ -846,9 +846,11 @@ module RustDataFlow implements InputSig { /** Provides logic related to captured variables. */ module VariableCapture { + private import codeql.rust.internal.CachedStages private import codeql.dataflow.VariableCapture as SharedVariableCapture private predicate closureFlowStep(ExprCfgNode e1, ExprCfgNode e2) { + Stages::DataFlowStage::ref() and e1 = getALastEvalNode(e2) or exists(Ssa::Definition def | diff --git a/rust/ql/lib/codeql/rust/elements/internal/AstNodeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/AstNodeImpl.qll index c33b1f3dd6e..dea172a7266 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/AstNodeImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/AstNodeImpl.qll @@ -33,6 +33,7 @@ module Impl { * Gets the nearest enclosing parent of this node, which is also an `AstNode`, * if any. */ + cached AstNode getParentNode() { result = getParentOfAstStep*(getImmediateParent(this)) } /** Gets the immediately enclosing callable of this node, if any. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll index 88a1b815f6b..9bb2029cd44 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/VariableImpl.qll @@ -68,36 +68,36 @@ module Impl { * where `definingNode` is the entire `Either::Left(x) | Either::Right(x)` * pattern. */ + cached private predicate variableDecl(AstNode definingNode, Name name, string text) { - ( - exists(SelfParam sp | - name = sp.getName() and - definingNode = name and - text = name.getText() and - // exclude self parameters from functions without a body as these are - // trait method declarations without implementations - not exists(Function f | not f.hasBody() and f.getParamList().getSelfParam() = sp) - ) - or - exists(IdentPat pat | - name = pat.getName() and - ( - definingNode = getOutermostEnclosingOrPat(pat) - or - not exists(getOutermostEnclosingOrPat(pat)) and definingNode = name - ) and - text = name.getText() and - // exclude for now anything starting with an uppercase character, which may be a reference to - // an enum constant (e.g. `None`). This excludes static and constant variables (UPPERCASE), - // which we don't appear to recognize yet anyway. This also assumes programmers follow the - // naming guidelines, which they generally do, but they're not enforced. - not text.charAt(0).isUppercase() and - // exclude parameters from functions without a body as these are trait method declarations - // without implementations - not exists(Function f | not f.hasBody() and f.getParamList().getAParam().getPat() = pat) and - // exclude parameters from function pointer types (e.g. `x` in `fn(x: i32) -> i32`) - not exists(FnPtrTypeRepr fp | fp.getParamList().getParam(_).getPat() = pat) - ) + Cached::ref() and + exists(SelfParam sp | + name = sp.getName() and + definingNode = name and + text = name.getText() and + // exclude self parameters from functions without a body as these are + // trait method declarations without implementations + not exists(Function f | not f.hasBody() and f.getParamList().getSelfParam() = sp) + ) + or + exists(IdentPat pat | + name = pat.getName() and + ( + definingNode = getOutermostEnclosingOrPat(pat) + or + not exists(getOutermostEnclosingOrPat(pat)) and definingNode = name + ) and + text = name.getText() and + // exclude for now anything starting with an uppercase character, which may be a reference to + // an enum constant (e.g. `None`). This excludes static and constant variables (UPPERCASE), + // which we don't appear to recognize yet anyway. This also assumes programmers follow the + // naming guidelines, which they generally do, but they're not enforced. + not text.charAt(0).isUppercase() and + // exclude parameters from functions without a body as these are trait method declarations + // without implementations + not exists(Function f | not f.hasBody() and f.getParamList().getAParam().getPat() = pat) and + // exclude parameters from function pointer types (e.g. `x` in `fn(x: i32) -> i32`) + not exists(FnPtrTypeRepr fp | fp.getParamList().getParam(_).getPat() = pat) ) } @@ -156,8 +156,12 @@ module Impl { predicate isCaptured() { this.getAnAccess().isCapture() } /** Gets the parameter that introduces this variable, if any. */ + cached ParamBase getParameter() { - result = this.getSelfParam() or result.(Param).getPat() = getAVariablePatAncestor(this) + Cached::ref() and + result = this.getSelfParam() + or + result.(Param).getPat() = getAVariablePatAncestor(this) } /** Hold is this variable is mutable. */ @@ -614,12 +618,18 @@ module Impl { /** A variable write. */ class VariableWriteAccess extends VariableAccess { - VariableWriteAccess() { assignmentExprDescendant(this) } + cached + VariableWriteAccess() { + Cached::ref() and + assignmentExprDescendant(this) + } } /** A variable read. */ class VariableReadAccess extends VariableAccess { + cached VariableReadAccess() { + Cached::ref() and not this instanceof VariableWriteAccess and not this = any(RefExpr re).getExpr() and not this = any(CompoundAssignmentExpr cae).getLhs() @@ -638,6 +648,22 @@ module Impl { cached private module Cached { + cached + predicate ref() { 1 = 1 } + + cached + predicate backref() { + 1 = 1 + or + variableDecl(_, _, _) + or + exists(VariableReadAccess a) + or + exists(VariableWriteAccess a) + or + exists(any(Variable v).getParameter()) + } + cached newtype TVariable = MkVariable(AstNode definingNode, string name) { variableDecl(definingNode, _, name) } diff --git a/rust/ql/lib/codeql/rust/internal/CachedStages.qll b/rust/ql/lib/codeql/rust/internal/CachedStages.qll index 41e81919569..4041b2731f9 100644 --- a/rust/ql/lib/codeql/rust/internal/CachedStages.qll +++ b/rust/ql/lib/codeql/rust/internal/CachedStages.qll @@ -123,6 +123,10 @@ module Stages { exists(any(ItemNode i).getASuccessor(_)) or exists(any(ItemNode i).getASuccessorRec(_)) + or + exists(any(ImplOrTraitItemNode i).getASelfPath()) + or + any(TypeParamItemNode i).hasTraitBound() } } diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c..f7f67311ca4 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -384,7 +384,9 @@ abstract class ImplOrTraitItemNode extends ItemNode { } /** Gets a `Self` path that refers to this item. */ + cached Path getASelfPath() { + Stages::PathResolutionStage::ref() and isUnqualifiedSelfPath(result) and this = unqualifiedPathLookup(result, _) } @@ -578,7 +580,7 @@ private class BlockExprItemNode extends ItemNode instanceof BlockExpr { override TypeParam getTypeParam(int i) { none() } } -private class TypeParamItemNode extends ItemNode instanceof TypeParam { +class TypeParamItemNode extends ItemNode instanceof TypeParam { pragma[nomagic] Path getABoundPath() { result = super.getTypeBoundList().getABound().getTypeRepr().(PathTypeRepr).getPath() @@ -598,8 +600,9 @@ private class TypeParamItemNode extends ItemNode instanceof TypeParam { * impl Foo where T: Trait { ... } // has trait bound * ``` */ - pragma[nomagic] + cached predicate hasTraitBound() { + Stages::PathResolutionStage::ref() and exists(this.getABoundPath()) or exists(ItemNode declaringItem, WherePred wp | From 7798b716ff73b9a762e622a0bbf79a29fad0968e Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Tue, 8 Apr 2025 12:04:12 +0100 Subject: [PATCH 123/372] Go: Fix `err` instead of `decErr` in `GetPkgsInfo` --- go/extractor/toolchain/toolchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/extractor/toolchain/toolchain.go b/go/extractor/toolchain/toolchain.go index 119e3782f6f..8abe93ba096 100644 --- a/go/extractor/toolchain/toolchain.go +++ b/go/extractor/toolchain/toolchain.go @@ -259,7 +259,7 @@ func GetPkgsInfo(patterns []string, includingDeps bool, extractTests bool, flags break } if decErr != nil { - log.Printf("Error decoding output of go list -json: %s", err.Error()) + log.Printf("Error decoding output of go list -json: %s", decErr.Error()) return nil, decErr } pkgAbsDir, err := filepath.Abs(pkgInfo.Dir) From 2e1b8b8b0e8ec208831259e7c2ae15b2972a1fed Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 8 Apr 2025 13:10:52 +0200 Subject: [PATCH 124/372] Rust: Fix bad join in `unqualifiedPathLookup` Before ``` Pipeline standard for PathResolution::unqualifiedPathLookup/2#6b171b76#reorder_2_0_1@822d53wq was evaluated in 61 iterations totaling 118ms (delta sizes total: 131072). 606491 ~0% {4} r1 = SCAN `PathResolution::getASuccessor/3#febac7bd#prev_delta` OUTPUT In.1, In.2, In.0, In.3 106457 ~1% {3} | JOIN WITH `PathResolution::unqualifiedPathLookup/4#e32cdfce_1230#join_rhs` ON FIRST 3 OUTPUT Lhs.3, Rhs.3, Lhs.1 606491 ~2% {4} r2 = SCAN `PathResolution::getASuccessor/3#febac7bd#prev_delta` OUTPUT In.0, In.2, In.3, In.1 19261 ~0% {4} r3 = JOIN r2 WITH `PathResolution::ModuleLikeNode.isRoot/0#dispred#21662e64` ON FIRST 1 OUTPUT Lhs.3, Lhs.0, Lhs.1, Lhs.2 42776643 ~1% {4} r4 = JOIN r2 WITH `doublyBoundedFastTC@PathResolution::hasChild/2#6b318d51#2@PathResolution::isRoot/1#a01ce5c3#1@PathResolution::hasCratePath/1#73ea688d#1` ON FIRST 1 OUTPUT Lhs.3, Rhs.1, Lhs.1, Lhs.2 42795904 ~1% {4} r5 = r3 UNION r4 24921 ~6% {3} | JOIN WITH `PathResolution::RelevantPath.isCratePath/2#e595e892_120#join_rhs` ON FIRST 2 OUTPUT Lhs.3, Rhs.2, Lhs.2 131378 ~2% {3} r6 = r1 UNION r5 131072 ~2% {3} | AND NOT `PathResolution::unqualifiedPathLookup/2#6b171b76#reorder_2_0_1#prev`(FIRST 3) return r6 ``` After ``` Pipeline standard for PathResolution::unqualifiedPathLookup/2#6b171b76#reorder_2_0_1@0553a4wi was evaluated in 66 iterations totaling 10ms (delta sizes total: 131072). 610251 ~0% {4} r1 = SCAN `PathResolution::getASuccessor/3#febac7bd#prev_delta` OUTPUT In.1, In.2, In.0, In.3 131378 ~0% {3} | JOIN WITH `PathResolution::unqualifiedPathLookup1/4#781de0cd_1230#join_rhs` ON FIRST 3 OUTPUT Lhs.3, Rhs.3, Lhs.1 131072 ~0% {3} | AND NOT `PathResolution::unqualifiedPathLookup/2#6b171b76#reorder_2_0_1#prev`(FIRST 3) return r1 ``` --- .../codeql/rust/internal/PathResolution.qll | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c..74f03e3f609 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -882,20 +882,24 @@ private predicate hasChild(ItemNode parent, ItemNode child) { child.getImmediate private predicate rootHasCratePathTc(ItemNode i1, ItemNode i2) = doublyBoundedFastTC(hasChild/2, isRoot/1, hasCratePath/1)(i1, i2) +pragma[nomagic] +private predicate unqualifiedPathLookup1(RelevantPath p, string name, Namespace ns, ItemNode encl) { + unqualifiedPathLookup(p, name, ns, encl) + or + // For `($)crate`, jump directly to the root module + exists(ItemNode i | p.isCratePath(name, i) | + encl.(ModuleLikeNode).isRoot() and + encl = i + or + rootHasCratePathTc(encl, i) + ) +} + pragma[nomagic] private ItemNode unqualifiedPathLookup(RelevantPath path, Namespace ns) { exists(ItemNode encl, string name | - result = getASuccessor(encl, pragma[only_bind_into](name), ns) - | - unqualifiedPathLookup(path, name, ns, encl) - or - // For `($)crate`, jump directly to the root module - exists(ItemNode i | path.isCratePath(pragma[only_bind_into](name), i) | - encl.(ModuleLikeNode).isRoot() and - encl = i - or - rootHasCratePathTc(encl, i) - ) + result = getASuccessor(encl, name, ns) and + unqualifiedPathLookup1(path, name, ns, encl) ) } @@ -916,8 +920,7 @@ private ItemNode resolvePath0(RelevantPath path, Namespace ns) { or exists(ItemNode q, string name | q = resolvePathQualifier(path, name) and - result = q.getASuccessor(name) and - ns = result.getNamespace() + result = getASuccessor(q, name, ns) ) or result = resolveUseTreeListItem(_, _, path) and From 95add2f60bc474b69625a1394c12f4b2a4822b0b Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 8 Apr 2025 13:11:32 +0200 Subject: [PATCH 125/372] Rust: Fix bad join in `getAPrivateVisibleModule` Before ``` Pipeline standard for PathResolution::getAPrivateVisibleModule/1#3829a5ee@822d5hwq was evaluated in 24 iterations totaling 16ms (delta sizes total: 4843). 105047 ~63652% {2} r1 = SCAN `PathResolution::resolvePathPrivate/3#56db2cdf#reorder_1_2_0_3#prev_delta` OUTPUT In.0, In.0 69 ~0% {2} r2 = JOIN `#PathResolution::ItemNode.getImmediateParentModule/0#dispred#57c4c6d5Plus#bf#reorder_1_0#prev_delta` WITH `PathResolution::resolvePathPrivate/3#56db2cdf#reorder_1_2_0_3#prev` ON FIRST 1 OUTPUT Lhs.0, Lhs.1 5766690 ~148309% {2} r3 = JOIN `PathResolution::resolvePathPrivate/3#56db2cdf#reorder_1_2_0_3#prev_delta` WITH `#PathResolution::ItemNode.getImmediateParentModule/0#dispred#57c4c6d5Plus#bf#reorder_1_0#prev` ON FIRST 1 OUTPUT Lhs.0, Rhs.1 5871806 ~143984% {2} r4 = r1 UNION r2 UNION r3 6859 ~148% {2} | AND NOT `PathResolution::getAPrivateVisibleModule/1#3829a5ee#prev`(FIRST 2) return r4 ``` After ``` Pipeline standard for PathResolution::getAPrivateVisibleModule/1#3829a5ee@5edefhwp was evaluated in 12 iterations totaling 0ms (delta sizes total: 3515). 339 ~1% {2} r1 = SCAN `PathResolution::isItemParent/1#d5e587d6#prev_delta` OUTPUT In.0, In.0 3130 ~0% {2} r2 = JOIN `PathResolution::isItemParent/1#d5e587d6#prev_delta` WITH `#PathResolution::ItemNode.getImmediateParentModule/0#dispred#57c4c6d5Plus#bf#reorder_1_0#prev` ON FIRST 1 OUTPUT Lhs.0, Rhs.1 46 ~0% {2} r3 = JOIN `#PathResolution::ItemNode.getImmediateParentModule/0#dispred#57c4c6d5Plus#bf#reorder_1_0#prev_delta` WITH `PathResolution::isItemParent/1#d5e587d6#prev` ON FIRST 1 OUTPUT Lhs.0, Lhs.1 3515 ~2% {2} r4 = r1 UNION r2 UNION r3 3515 ~2% {2} | AND NOT `PathResolution::getAPrivateVisibleModule/1#3829a5ee#prev`(FIRST 2) return r4 ``` --- rust/ql/lib/codeql/rust/internal/PathResolution.qll | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 74f03e3f609..fca46835959 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -981,6 +981,11 @@ private ItemNode resolvePathPrivate( ) } +pragma[nomagic] +private predicate isItemParent(ModuleLikeNode itemParent) { + exists(resolvePathPrivate(_, itemParent, _)) +} + /** * Gets a module that has access to private items defined inside `itemParent`. * @@ -991,7 +996,7 @@ private ItemNode resolvePathPrivate( */ pragma[nomagic] private ModuleLikeNode getAPrivateVisibleModule(ModuleLikeNode itemParent) { - exists(resolvePathPrivate(_, itemParent, _)) and + isItemParent(itemParent) and result.getImmediateParentModule*() = itemParent } From b5e1b255534d3fb69c3f8c2a1f959f2811e8ecc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Tue, 8 Apr 2025 13:51:09 +0200 Subject: [PATCH 126/372] use sudo nice for running maven test server --- .../java/buildless-inherit-trust-store/test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py b/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py index b69070ddf81..b067844b7a4 100644 --- a/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py +++ b/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py @@ -1,10 +1,15 @@ import subprocess import os +import runs_on def test(codeql, java, cwd): # This serves the "repo" directory on https://locahost:4443 - repo_server_process = subprocess.Popen(["python3", "../server.py"], cwd="repo") + command = ["python3", "../server.py"] + if runs_on.github_actions and runs_on.posix: + # On GitHub Actions, we try to run the server with higher priority + command = ["sudo", "nice", "-n", "10"] + command + repo_server_process = subprocess.Popen(command, cwd="repo") certspath = cwd / "jdk8_shipped_cacerts_plus_cert_pem" # If we override MAVEN_OPTS, we'll break cross-test maven isolation, so we need to append to it instead maven_opts = os.environ["MAVEN_OPTS"] + f" -Djavax.net.ssl.trustStore={certspath}" From e49fb839b8e3fa08555da5457599eb9a8216f663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Tue, 8 Apr 2025 15:28:18 +0200 Subject: [PATCH 127/372] Update java/ql/integration-tests/java/buildless-inherit-trust-store/test.py Co-authored-by: Paolo Tranquilli --- .../java/buildless-inherit-trust-store/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py b/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py index b067844b7a4..000ca3e86eb 100644 --- a/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py +++ b/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py @@ -8,7 +8,7 @@ def test(codeql, java, cwd): command = ["python3", "../server.py"] if runs_on.github_actions and runs_on.posix: # On GitHub Actions, we try to run the server with higher priority - command = ["sudo", "nice", "-n", "10"] + command + command = ["sudo"] + command repo_server_process = subprocess.Popen(command, cwd="repo") certspath = cwd / "jdk8_shipped_cacerts_plus_cert_pem" # If we override MAVEN_OPTS, we'll break cross-test maven isolation, so we need to append to it instead From 3b56f954804fae1b0e28747b353acc555441253b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Tue, 8 Apr 2025 16:19:33 +0200 Subject: [PATCH 128/372] use only sudo for running maven test server (remove nice) --- .../java/buildless-snapshot-repository/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/integration-tests/java/buildless-snapshot-repository/test.py b/java/ql/integration-tests/java/buildless-snapshot-repository/test.py index 2241f2917b9..3a45161a56a 100644 --- a/java/ql/integration-tests/java/buildless-snapshot-repository/test.py +++ b/java/ql/integration-tests/java/buildless-snapshot-repository/test.py @@ -7,7 +7,7 @@ def test(codeql, java): command = ["python3", "-m", "http.server", "9427", "-b", "localhost"] if runs_on.github_actions and runs_on.posix: # On GitHub Actions, we try to run the server with higher priority - command = ["sudo", "nice", "-n", "10"] + command + command = ["sudo"] + command repo_server_process = subprocess.Popen( command, cwd="repo" ) From 1eb4a1aa811e726ac7ea3fb950d673868622ff11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Tue, 8 Apr 2025 16:29:16 +0200 Subject: [PATCH 129/372] Update java/ql/integration-tests/java/buildless-snapshot-repository/test.py Co-authored-by: Paolo Tranquilli --- .../java/buildless-snapshot-repository/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/integration-tests/java/buildless-snapshot-repository/test.py b/java/ql/integration-tests/java/buildless-snapshot-repository/test.py index 3a45161a56a..a4814e1f8a1 100644 --- a/java/ql/integration-tests/java/buildless-snapshot-repository/test.py +++ b/java/ql/integration-tests/java/buildless-snapshot-repository/test.py @@ -6,7 +6,8 @@ def test(codeql, java): # This serves the "repo" directory on http://localhost:9427 command = ["python3", "-m", "http.server", "9427", "-b", "localhost"] if runs_on.github_actions and runs_on.posix: - # On GitHub Actions, we try to run the server with higher priority + # On GitHub Actions, we saw the server timing out while running in parallel with other tests + # we work around that by running it with higher permissions command = ["sudo"] + command repo_server_process = subprocess.Popen( command, cwd="repo" From afe3e5332f89deee3628d29593bc8b510d55a35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20San=20Jos=C3=A9?= Date: Tue, 8 Apr 2025 16:29:23 +0200 Subject: [PATCH 130/372] Update java/ql/integration-tests/java/buildless-inherit-trust-store/test.py Co-authored-by: Paolo Tranquilli --- .../java/buildless-inherit-trust-store/test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py b/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py index 000ca3e86eb..93a527620e1 100644 --- a/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py +++ b/java/ql/integration-tests/java/buildless-inherit-trust-store/test.py @@ -7,7 +7,8 @@ def test(codeql, java, cwd): # This serves the "repo" directory on https://locahost:4443 command = ["python3", "../server.py"] if runs_on.github_actions and runs_on.posix: - # On GitHub Actions, we try to run the server with higher priority + # On GitHub Actions, we saw the server timing out while running in parallel with other tests + # we work around that by running it with higher permissions command = ["sudo"] + command repo_server_process = subprocess.Popen(command, cwd="repo") certspath = cwd / "jdk8_shipped_cacerts_plus_cert_pem" From 259a09386e4b42981dd3536e90c9d900a1e10264 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Tue, 8 Apr 2025 09:17:41 +0200 Subject: [PATCH 131/372] Move query suite selector logic to security-and-quality-suite --- .../java-security-and-quality.qls | 160 +++++++++++++++++- 1 file changed, 158 insertions(+), 2 deletions(-) diff --git a/java/ql/src/codeql-suites/java-security-and-quality.qls b/java/ql/src/codeql-suites/java-security-and-quality.qls index 2b9ca6c132f..6b1897cc506 100644 --- a/java/ql/src/codeql-suites/java-security-and-quality.qls +++ b/java/ql/src/codeql-suites/java-security-and-quality.qls @@ -1,4 +1,160 @@ - description: Security-and-quality queries for Java - queries: . -- apply: security-and-quality-selectors.yml - from: codeql/suite-helpers +- include: + kind: + - problem + - path-problem + precision: + - high + - very-high +- include: + kind: + - problem + - path-problem + precision: medium + problem.severity: + - error + - warning +- include: + kind: + - diagnostic +- include: + kind: + - metric + tags contain: + - summary +- exclude: + deprecated: // +- exclude: + query path: + - /^experimental\/.*/ + - Metrics/Summaries/FrameworkCoverage.ql + - /Diagnostics/Internal/.*/ +- exclude: + tags contain: + - modeleditor + - modelgenerator + + +java/abs-of-random +java/abstract-to-concrete-cast +java/call-to-object-tostring +java/call-to-thread-run +java/chained-type-tests +java/class-name-matches-super-class +java/comparison-of-identical-expressions +java/comparison-with-nan +java/confusing-method-name +java/confusing-method-signature +java/constant-comparison +java/constant-loop-condition +java/constants-only-interface +java/continue-in-false-loop +java/contradictory-type-checks +java/database-resource-leak +java/deprecated-call +java/dereferenced-expr-may-be-null +java/dereferenced-value-is-always-null +java/dereferenced-value-may-be-null +java/empty-container +java/empty-zip-file-entry +java/equals-on-arrays +java/equals-on-unrelated-types +java/equals-typo +java/evaluation-to-constant +java/field-masks-super-field +java/hashcode-typo +java/hashing-without-hashcode +java/ignored-error-status-of-call +java/implicit-cast-in-compound-assignment +java/inconsistent-compareto-and-equals +java/inconsistent-equals-and-hashcode +java/inconsistent-javadoc-throws +java/inconsistent-sync-writeobject +java/incorrect-serial-version-uid +java/index-out-of-bounds +java/ineffective-annotation-present-check +java/inefficient-boxed-constructor +java/inefficient-empty-string-test +java/inefficient-key-set-iterator +java/inefficient-output-stream +java/inefficient-string-constructor +java/input-resource-leak +java/integer-multiplication-cast-to-long +java/internal-representation-exposure +java/iterable-wraps-iterator +java/iterator-hasnext-calls-next +java/iterator-implements-iterable +java/iterator-remove-failure +java/jdk-internal-api-access +java/local-shadows-field +java/local-variable-is-never-read +java/lshift-larger-than-type-width +java/misleading-indentation +java/missing-call-to-super-clone +java/missing-case-in-switch +java/missing-clone-method +java/missing-format-argument +java/missing-no-arg-constructor-on-externalizable +java/missing-no-arg-constructor-on-serializable +java/missing-override-annotation +java/missing-space-in-concatenation +java/missing-super-finalize +java/multiplication-of-remainder +java/non-final-call-in-constructor +java/non-null-boxed-variable +java/non-overriding-package-private +java/non-serializable-inner-class +java/non-short-circuit-evaluation +java/non-static-nested-class +java/non-sync-override +java/notify-instead-of-notify-all +java/output-resource-leak +java/print-array +java/random-used-once +java/redundant-assignment +java/reference-equality-of-boxed-types +java/reference-equality-on-strings +java/run-finalizers-on-exit +java/sleep-with-lock-held +java/spin-on-field +java/string-buffer-char-init +java/subtle-inherited-call +java/suspicious-date-format +java/sync-on-boxed-types +java/test-for-negative-container-size +java/thread-start-in-constructor +java/thread-unsafe-dateformat +java/tostring-typo +java/type-bound-extends-final +java/type-mismatch-access +java/type-mismatch-modification +java/type-variable-hides-type +java/uncaught-number-format-exception +java/unchecked-cast-in-equals +java/underscore-identifier +java/unimplementable-interface +java/unknown-javadoc-parameter +java/unreachable-catch-clause +java/unreleased-lock +java/unsafe-double-checked-locking +java/unsafe-double-checked-locking-init-order +java/unsafe-get-resource +java/unsafe-sync-on-field +java/unsynchronized-getter +java/unused-container +java/unused-format-argument +java/unused-label +java/unused-parameter +java/unused-reference-type +java/useless-null-check +java/useless-tostring-call +java/useless-type-test +java/wait-on-condition-interface +java/whitespace-contradicts-precedence +java/wrong-compareto-signature +java/wrong-equals-signature +java/wrong-junit-suite-signature +java/wrong-object-serialization-signature +java/wrong-readresolve-signature +java/wrong-swing-event-adapter-signature From 6abff483da26ce10b9665896611b2056a6286c01 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Tue, 8 Apr 2025 09:18:01 +0200 Subject: [PATCH 132/372] Java: Add explicit filtering for quality queries that should be included in security-and-quality --- .../java-security-and-quality.qls | 256 +++++++++--------- 1 file changed, 130 insertions(+), 126 deletions(-) diff --git a/java/ql/src/codeql-suites/java-security-and-quality.qls b/java/ql/src/codeql-suites/java-security-and-quality.qls index 6b1897cc506..91751e6da1b 100644 --- a/java/ql/src/codeql-suites/java-security-and-quality.qls +++ b/java/ql/src/codeql-suites/java-security-and-quality.qls @@ -7,14 +7,142 @@ precision: - high - very-high + tags contain: + - security - include: kind: - problem - path-problem precision: medium problem.severity: - - error - - warning + - error + - warning + tags contain: + - security +- include: + id: + - java/abs-of-random + - java/abstract-to-concrete-cast + - java/call-to-object-tostring + - java/call-to-thread-run + - java/chained-type-tests + - java/class-name-matches-super-class + - java/comparison-of-identical-expressions + - java/comparison-with-nan + - java/confusing-method-name + - java/confusing-method-signature + - java/constant-comparison + - java/constant-loop-condition + - java/constants-only-interface + - java/continue-in-false-loop + - java/contradictory-type-checks + - java/database-resource-leak + - java/deprecated-call + - java/dereferenced-expr-may-be-null + - java/dereferenced-value-is-always-null + - java/dereferenced-value-may-be-null + - java/empty-container + - java/empty-zip-file-entry + - java/equals-on-arrays + - java/equals-on-unrelated-types + - java/equals-typo + - java/evaluation-to-constant + - java/field-masks-super-field + - java/hashcode-typo + - java/hashing-without-hashcode + - java/ignored-error-status-of-call + - java/implicit-cast-in-compound-assignment + - java/inconsistent-compareto-and-equals + - java/inconsistent-equals-and-hashcode + - java/inconsistent-javadoc-throws + - java/inconsistent-sync-writeobject + - java/incorrect-serial-version-uid + - java/index-out-of-bounds + - java/ineffective-annotation-present-check + - java/inefficient-boxed-constructor + - java/inefficient-empty-string-test + - java/inefficient-key-set-iterator + - java/inefficient-output-stream + - java/inefficient-string-constructor + - java/input-resource-leak + - java/integer-multiplication-cast-to-long + - java/internal-representation-exposure + - java/iterable-wraps-iterator + - java/iterator-hasnext-calls-next + - java/iterator-implements-iterable + - java/iterator-remove-failure + - java/jdk-internal-api-access + - java/local-shadows-field + - java/local-variable-is-never-read + - java/lshift-larger-than-type-width + - java/misleading-indentation + - java/missing-call-to-super-clone + - java/missing-case-in-switch + - java/missing-clone-method + - java/missing-format-argument + - java/missing-no-arg-constructor-on-externalizable + - java/missing-no-arg-constructor-on-serializable + - java/missing-override-annotation + - java/missing-space-in-concatenation + - java/missing-super-finalize + - java/multiplication-of-remainder + - java/non-final-call-in-constructor + - java/non-null-boxed-variable + - java/non-overriding-package-private + - java/non-serializable-inner-class + - java/non-short-circuit-evaluation + - java/non-static-nested-class + - java/non-sync-override + - java/notify-instead-of-notify-all + - java/output-resource-leak + - java/print-array + - java/random-used-once + - java/redundant-assignment + - java/reference-equality-of-boxed-types + - java/reference-equality-on-strings + - java/run-finalizers-on-exit + - java/sleep-with-lock-held + - java/spin-on-field + - java/string-buffer-char-init + - java/subtle-inherited-call + - java/suspicious-date-format + - java/sync-on-boxed-types + - java/test-for-negative-container-size + - java/thread-start-in-constructor + - java/thread-unsafe-dateformat + - java/tostring-typo + - java/type-bound-extends-final + - java/type-mismatch-access + - java/type-mismatch-modification + - java/type-variable-hides-type + - java/uncaught-number-format-exception + - java/unchecked-cast-in-equals + - java/underscore-identifier + - java/unimplementable-interface + - java/unknown-javadoc-parameter + - java/unreachable-catch-clause + - java/unreleased-lock + - java/unsafe-double-checked-locking + - java/unsafe-double-checked-locking-init-order + - java/unsafe-get-resource + - java/unsafe-sync-on-field + - java/unsynchronized-getter + - java/unused-container + - java/unused-format-argument + - java/unused-label + - java/unused-parameter + - java/unused-reference-type + - java/useless-null-check + - java/useless-tostring-call + - java/useless-type-test + - java/wait-on-condition-interface + - java/whitespace-contradicts-precedence + - java/wrong-compareto-signature + - java/wrong-equals-signature + - java/wrong-junit-suite-signature + - java/wrong-object-serialization-signature + - java/wrong-readresolve-signature + - java/wrong-swing-event-adapter-signature - include: kind: - diagnostic @@ -34,127 +162,3 @@ tags contain: - modeleditor - modelgenerator - - -java/abs-of-random -java/abstract-to-concrete-cast -java/call-to-object-tostring -java/call-to-thread-run -java/chained-type-tests -java/class-name-matches-super-class -java/comparison-of-identical-expressions -java/comparison-with-nan -java/confusing-method-name -java/confusing-method-signature -java/constant-comparison -java/constant-loop-condition -java/constants-only-interface -java/continue-in-false-loop -java/contradictory-type-checks -java/database-resource-leak -java/deprecated-call -java/dereferenced-expr-may-be-null -java/dereferenced-value-is-always-null -java/dereferenced-value-may-be-null -java/empty-container -java/empty-zip-file-entry -java/equals-on-arrays -java/equals-on-unrelated-types -java/equals-typo -java/evaluation-to-constant -java/field-masks-super-field -java/hashcode-typo -java/hashing-without-hashcode -java/ignored-error-status-of-call -java/implicit-cast-in-compound-assignment -java/inconsistent-compareto-and-equals -java/inconsistent-equals-and-hashcode -java/inconsistent-javadoc-throws -java/inconsistent-sync-writeobject -java/incorrect-serial-version-uid -java/index-out-of-bounds -java/ineffective-annotation-present-check -java/inefficient-boxed-constructor -java/inefficient-empty-string-test -java/inefficient-key-set-iterator -java/inefficient-output-stream -java/inefficient-string-constructor -java/input-resource-leak -java/integer-multiplication-cast-to-long -java/internal-representation-exposure -java/iterable-wraps-iterator -java/iterator-hasnext-calls-next -java/iterator-implements-iterable -java/iterator-remove-failure -java/jdk-internal-api-access -java/local-shadows-field -java/local-variable-is-never-read -java/lshift-larger-than-type-width -java/misleading-indentation -java/missing-call-to-super-clone -java/missing-case-in-switch -java/missing-clone-method -java/missing-format-argument -java/missing-no-arg-constructor-on-externalizable -java/missing-no-arg-constructor-on-serializable -java/missing-override-annotation -java/missing-space-in-concatenation -java/missing-super-finalize -java/multiplication-of-remainder -java/non-final-call-in-constructor -java/non-null-boxed-variable -java/non-overriding-package-private -java/non-serializable-inner-class -java/non-short-circuit-evaluation -java/non-static-nested-class -java/non-sync-override -java/notify-instead-of-notify-all -java/output-resource-leak -java/print-array -java/random-used-once -java/redundant-assignment -java/reference-equality-of-boxed-types -java/reference-equality-on-strings -java/run-finalizers-on-exit -java/sleep-with-lock-held -java/spin-on-field -java/string-buffer-char-init -java/subtle-inherited-call -java/suspicious-date-format -java/sync-on-boxed-types -java/test-for-negative-container-size -java/thread-start-in-constructor -java/thread-unsafe-dateformat -java/tostring-typo -java/type-bound-extends-final -java/type-mismatch-access -java/type-mismatch-modification -java/type-variable-hides-type -java/uncaught-number-format-exception -java/unchecked-cast-in-equals -java/underscore-identifier -java/unimplementable-interface -java/unknown-javadoc-parameter -java/unreachable-catch-clause -java/unreleased-lock -java/unsafe-double-checked-locking -java/unsafe-double-checked-locking-init-order -java/unsafe-get-resource -java/unsafe-sync-on-field -java/unsynchronized-getter -java/unused-container -java/unused-format-argument -java/unused-label -java/unused-parameter -java/unused-reference-type -java/useless-null-check -java/useless-tostring-call -java/useless-type-test -java/wait-on-condition-interface -java/whitespace-contradicts-precedence -java/wrong-compareto-signature -java/wrong-equals-signature -java/wrong-junit-suite-signature -java/wrong-object-serialization-signature -java/wrong-readresolve-signature -java/wrong-swing-event-adapter-signature From e1633449077621942b87d28b1fef594f7bbbdce4 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Tue, 8 Apr 2025 17:06:46 +0200 Subject: [PATCH 133/372] Java: Add test to check queries not included in well-known query suites --- .../query-suite/not_included_in_qls.expected | 285 ++++++++++++++++++ .../java/query-suite/test.py | 32 +- 2 files changed, 309 insertions(+), 8 deletions(-) create mode 100644 java/ql/integration-tests/java/query-suite/not_included_in_qls.expected diff --git a/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected b/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected new file mode 100644 index 00000000000..38c0db1c66d --- /dev/null +++ b/java/ql/integration-tests/java/query-suite/not_included_in_qls.expected @@ -0,0 +1,285 @@ +ql/java/ql/src/Advisory/Declarations/NonFinalImmutableField.ql +ql/java/ql/src/Advisory/Declarations/NonPrivateField.ql +ql/java/ql/src/Advisory/Documentation/MissingJavadocMethods.ql +ql/java/ql/src/Advisory/Documentation/MissingJavadocParameters.ql +ql/java/ql/src/Advisory/Documentation/MissingJavadocReturnValues.ql +ql/java/ql/src/Advisory/Documentation/MissingJavadocThrows.ql +ql/java/ql/src/Advisory/Documentation/MissingJavadocTypes.ql +ql/java/ql/src/Advisory/Java Objects/AvoidCloneMethodAccess.ql +ql/java/ql/src/Advisory/Java Objects/AvoidCloneOverride.ql +ql/java/ql/src/Advisory/Java Objects/AvoidCloneableInterface.ql +ql/java/ql/src/Advisory/Java Objects/AvoidFinalizeOverride.ql +ql/java/ql/src/Advisory/Naming/NamingConventionsConstants.ql +ql/java/ql/src/Advisory/Naming/NamingConventionsMethods.ql +ql/java/ql/src/Advisory/Naming/NamingConventionsPackages.ql +ql/java/ql/src/Advisory/Naming/NamingConventionsRefTypes.ql +ql/java/ql/src/Advisory/Naming/NamingConventionsVariables.ql +ql/java/ql/src/Advisory/Statements/MissingDefaultInSwitch.ql +ql/java/ql/src/Advisory/Statements/OneStatementPerLine.ql +ql/java/ql/src/Advisory/Statements/TerminateIfElseIfWithElse.ql +ql/java/ql/src/Advisory/Types/GenericsConstructor.ql +ql/java/ql/src/Advisory/Types/GenericsReturnType.ql +ql/java/ql/src/Advisory/Types/GenericsVariable.ql +ql/java/ql/src/AlertSuppression.ql +ql/java/ql/src/AlertSuppressionAnnotations.ql +ql/java/ql/src/Architecture/Dependencies/MutualDependency.ql +ql/java/ql/src/Architecture/Dependencies/UnusedMavenDependencyBinary.ql +ql/java/ql/src/Architecture/Dependencies/UnusedMavenDependencySource.ql +ql/java/ql/src/Architecture/Refactoring Opportunities/DeeplyNestedClass.ql +ql/java/ql/src/Architecture/Refactoring Opportunities/FeatureEnvy.ql +ql/java/ql/src/Architecture/Refactoring Opportunities/HubClasses.ql +ql/java/ql/src/Architecture/Refactoring Opportunities/InappropriateIntimacy.ql +ql/java/ql/src/Complexity/BlockWithTooManyStatements.ql +ql/java/ql/src/Complexity/ComplexCondition.ql +ql/java/ql/src/DeadCode/DeadClass.ql +ql/java/ql/src/DeadCode/DeadEnumConstant.ql +ql/java/ql/src/DeadCode/DeadField.ql +ql/java/ql/src/DeadCode/DeadMethod.ql +ql/java/ql/src/DeadCode/FLinesOfDeadCode.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbContainerInterference.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbFileIO.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbGraphics.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbNative.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbReflection.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbSecurityConfiguration.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbSerialization.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbSetSocketOrUrlFactory.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbSocketAsServer.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbStaticFieldNonFinal.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbSynchronization.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbThis.ql +ql/java/ql/src/Frameworks/JavaEE/EJB/EjbThreads.ql +ql/java/ql/src/Frameworks/Spring/Architecture/Refactoring Opportunities/MissingParentBean.ql +ql/java/ql/src/Frameworks/Spring/Architecture/Refactoring Opportunities/TooManyBeans.ql +ql/java/ql/src/Frameworks/Spring/Architecture/Refactoring Opportunities/UnusedBean.ql +ql/java/ql/src/Frameworks/Spring/Architecture/Refactoring Opportunities/UselessPropertyOverride.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/AvoidAutowiring.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/DontUseConstructorArgIndex.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/ImportsFirst.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/NoBeanDescription.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/ParentShouldNotUseAbstractClass.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/UseIdInsteadOfName.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/UseLocalRef.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/UseSetterInjection.ql +ql/java/ql/src/Frameworks/Spring/Violations of Best Practice/UseShortcutForms.ql +ql/java/ql/src/Frameworks/Spring/XML Configuration Errors/MissingSetters.ql +ql/java/ql/src/Language Abuse/CastThisToTypeParameter.ql +ql/java/ql/src/Language Abuse/DubiousDowncastOfThis.ql +ql/java/ql/src/Language Abuse/DubiousTypeTestOfThis.ql +ql/java/ql/src/Language Abuse/EmptyMethod.ql +ql/java/ql/src/Language Abuse/EmptyStatement.ql +ql/java/ql/src/Language Abuse/EnumIdentifier.ql +ql/java/ql/src/Language Abuse/ImplementsAnnotation.ql +ql/java/ql/src/Language Abuse/MissedTernaryOpportunity.ql +ql/java/ql/src/Language Abuse/UselessUpcast.ql +ql/java/ql/src/Likely Bugs/Arithmetic/BadCheckOdd.ql +ql/java/ql/src/Likely Bugs/Arithmetic/CondExprTypes.ql +ql/java/ql/src/Likely Bugs/Arithmetic/OctalLiteral.ql +ql/java/ql/src/Likely Bugs/Comparison/BitwiseSignCheck.ql +ql/java/ql/src/Likely Bugs/Comparison/DefineEqualsWhenAddingFields.ql +ql/java/ql/src/Likely Bugs/Comparison/EqualsUsesInstanceOf.ql +ql/java/ql/src/Likely Bugs/Comparison/NoAssignInBooleanExprs.ql +ql/java/ql/src/Likely Bugs/Comparison/NoComparisonOnFloats.ql +ql/java/ql/src/Likely Bugs/Comparison/ObjectComparison.ql +ql/java/ql/src/Likely Bugs/Concurrency/BusyWait.ql +ql/java/ql/src/Likely Bugs/Concurrency/EmptyRunMethodInThread.ql +ql/java/ql/src/Likely Bugs/Concurrency/InconsistentAccess.ql +ql/java/ql/src/Likely Bugs/Concurrency/LazyInitStaticField.ql +ql/java/ql/src/Likely Bugs/Concurrency/NotifyWithoutSynch.ql +ql/java/ql/src/Likely Bugs/Concurrency/PriorityCalls.ql +ql/java/ql/src/Likely Bugs/Concurrency/WaitOutsideLoop.ql +ql/java/ql/src/Likely Bugs/Concurrency/WaitWithTwoLocks.ql +ql/java/ql/src/Likely Bugs/Concurrency/YieldCalls.ql +ql/java/ql/src/Likely Bugs/Frameworks/JUnit/TearDownNoSuper.ql +ql/java/ql/src/Likely Bugs/Frameworks/JUnit/TestCaseNoTests.ql +ql/java/ql/src/Likely Bugs/Frameworks/Swing/ThreadSafety.ql +ql/java/ql/src/Likely Bugs/I18N/MissingLocaleArgument.ql +ql/java/ql/src/Likely Bugs/Likely Typos/ConstructorTypo.ql +ql/java/ql/src/Likely Bugs/Likely Typos/NestedLoopsSameVariable.ql +ql/java/ql/src/Likely Bugs/Serialization/NonSerializableComparator.ql +ql/java/ql/src/Likely Bugs/Serialization/NonSerializableField.ql +ql/java/ql/src/Likely Bugs/Serialization/TransientNotSerializable.ql +ql/java/ql/src/Likely Bugs/Statements/EmptyBlock.ql +ql/java/ql/src/Likely Bugs/Statements/EmptySynchronizedBlock.ql +ql/java/ql/src/Likely Bugs/Statements/ImpossibleCast.ql +ql/java/ql/src/Likely Bugs/Statements/InconsistentCallOnResult.ql +ql/java/ql/src/Likely Bugs/Statements/ReturnValueIgnored.ql +ql/java/ql/src/Likely Bugs/Statements/StaticFieldWrittenByInstance.ql +ql/java/ql/src/Metrics/Authors/AuthorsPerFile.ql +ql/java/ql/src/Metrics/Callables/CCyclomaticComplexity.ql +ql/java/ql/src/Metrics/Callables/CLinesOfCode.ql +ql/java/ql/src/Metrics/Callables/CLinesOfComment.ql +ql/java/ql/src/Metrics/Callables/CNumberOfCalls.ql +ql/java/ql/src/Metrics/Callables/CNumberOfParameters.ql +ql/java/ql/src/Metrics/Callables/CNumberOfStatements.ql +ql/java/ql/src/Metrics/Callables/StatementNestingDepth.ql +ql/java/ql/src/Metrics/Dependencies/ExternalDependencies.ql +ql/java/ql/src/Metrics/Dependencies/ExternalDependenciesSourceLinks.ql +ql/java/ql/src/Metrics/Files/FAfferentCoupling.ql +ql/java/ql/src/Metrics/Files/FCommentRatio.ql +ql/java/ql/src/Metrics/Files/FCyclomaticComplexity.ql +ql/java/ql/src/Metrics/Files/FEfferentCoupling.ql +ql/java/ql/src/Metrics/Files/FLines.ql +ql/java/ql/src/Metrics/Files/FLinesOfCode.ql +ql/java/ql/src/Metrics/Files/FLinesOfComment.ql +ql/java/ql/src/Metrics/Files/FLinesOfCommentedCode.ql +ql/java/ql/src/Metrics/Files/FLinesOfDuplicatedCode.ql +ql/java/ql/src/Metrics/Files/FLinesOfSimilarCode.ql +ql/java/ql/src/Metrics/Files/FNumberOfClasses.ql +ql/java/ql/src/Metrics/Files/FNumberOfInterfaces.ql +ql/java/ql/src/Metrics/Files/FNumberOfTests.ql +ql/java/ql/src/Metrics/Files/FSelfContainedness.ql +ql/java/ql/src/Metrics/RefTypes/TAfferentCoupling.ql +ql/java/ql/src/Metrics/RefTypes/TEfferentCoupling.ql +ql/java/ql/src/Metrics/RefTypes/TEfferentSourceCoupling.ql +ql/java/ql/src/Metrics/RefTypes/TInheritanceDepth.ql +ql/java/ql/src/Metrics/RefTypes/TLackOfCohesionCK.ql +ql/java/ql/src/Metrics/RefTypes/TLackOfCohesionHS.ql +ql/java/ql/src/Metrics/RefTypes/TLinesOfCode.ql +ql/java/ql/src/Metrics/RefTypes/TLinesOfComment.ql +ql/java/ql/src/Metrics/RefTypes/TNumberOfCallables.ql +ql/java/ql/src/Metrics/RefTypes/TNumberOfFields.ql +ql/java/ql/src/Metrics/RefTypes/TNumberOfStatements.ql +ql/java/ql/src/Metrics/RefTypes/TPercentageOfComments.ql +ql/java/ql/src/Metrics/RefTypes/TPercentageOfComplexCode.ql +ql/java/ql/src/Metrics/RefTypes/TResponse.ql +ql/java/ql/src/Metrics/RefTypes/TSelfContainedness.ql +ql/java/ql/src/Metrics/RefTypes/TSizeOfAPI.ql +ql/java/ql/src/Metrics/RefTypes/TSpecialisationIndex.ql +ql/java/ql/src/Metrics/Summaries/FrameworkCoverage.ql +ql/java/ql/src/Metrics/Summaries/GeneratedVsManualCoverage.ql +ql/java/ql/src/Performance/ConcatenationInLoops.ql +ql/java/ql/src/Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql +ql/java/ql/src/Security/CWE/CWE-020/UntrustedDataToExternalAPI.ql +ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstructionCodeSpecified.ql +ql/java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndexCodeSpecified.ql +ql/java/ql/src/Security/CWE/CWE-190/ArithmeticWithExtremeValues.ql +ql/java/ql/src/Security/CWE/CWE-312/CleartextStorageClass.ql +ql/java/ql/src/Security/CWE/CWE-319/HttpsUrls.ql +ql/java/ql/src/Security/CWE/CWE-319/UseSSL.ql +ql/java/ql/src/Security/CWE/CWE-319/UseSSLSocketFactories.ql +ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsComparison.ql +ql/java/ql/src/Security/CWE/CWE-798/HardcodedCredentialsSourceCall.ql +ql/java/ql/src/Security/CWE/CWE-798/HardcodedPasswordField.ql +ql/java/ql/src/Security/CWE/CWE-833/LockOrderInconsistency.ql +ql/java/ql/src/Violations of Best Practice/Boolean Logic/SimplifyBoolExpr.ql +ql/java/ql/src/Violations of Best Practice/Comments/CommentedCode.ql +ql/java/ql/src/Violations of Best Practice/Comments/TodoComments.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/AssignmentInReturn.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/DeadStoreOfLocal.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/DeadStoreOfLocalUnread.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/EmptyFinalize.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/FinalizerNullsFields.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/LocalInitialisedButNotUsed.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/LocalNotRead.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/NonAssignedFields.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/PointlessForwardingMethod.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/UnusedField.ql +ql/java/ql/src/Violations of Best Practice/Dead Code/UnusedLocal.ql +ql/java/ql/src/Violations of Best Practice/Declarations/BreakInSwitchCase.ql +ql/java/ql/src/Violations of Best Practice/Declarations/MakeImportsExplicit.ql +ql/java/ql/src/Violations of Best Practice/Exception Handling/DroppedExceptions.ql +ql/java/ql/src/Violations of Best Practice/Exception Handling/ExceptionCatch.ql +ql/java/ql/src/Violations of Best Practice/Implementation Hiding/StaticArray.ql +ql/java/ql/src/Violations of Best Practice/Magic Constants/MagicConstantsNumbers.ql +ql/java/ql/src/Violations of Best Practice/Magic Constants/MagicConstantsString.ql +ql/java/ql/src/Violations of Best Practice/Magic Constants/MagicNumbersUseConstant.ql +ql/java/ql/src/Violations of Best Practice/Magic Constants/MagicStringsUseConstant.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverridesNames.ql +ql/java/ql/src/Violations of Best Practice/Naming Conventions/LocalShadowsField.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/CallsToSystemExit.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/GarbageCollection.ql +ql/java/ql/src/Violations of Best Practice/legacy/AutoBoxing.ql +ql/java/ql/src/Violations of Best Practice/legacy/FinallyMayNotComplete.ql +ql/java/ql/src/Violations of Best Practice/legacy/InexactVarArg.ql +ql/java/ql/src/Violations of Best Practice/legacy/ParameterAssignment.ql +ql/java/ql/src/Violations of Best Practice/legacy/UnnecessaryCast.ql +ql/java/ql/src/Violations of Best Practice/legacy/UnnecessaryImport.ql +ql/java/ql/src/definitions.ql +ql/java/ql/src/experimental/Security/CWE/CWE-016/InsecureSpringActuatorConfig.ql +ql/java/ql/src/experimental/Security/CWE/CWE-020/Log4jJndiInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-036/OpenStream.ql +ql/java/ql/src/experimental/Security/CWE/CWE-073/FilePathInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-078/CommandInjectionRuntimeExec.ql +ql/java/ql/src/experimental/Security/CWE/CWE-078/CommandInjectionRuntimeExecLocal.ql +ql/java/ql/src/experimental/Security/CWE/CWE-078/ExecTainted.ql +ql/java/ql/src/experimental/Security/CWE/CWE-089/MyBatisAnnotationSqlInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-089/MyBatisMapperXmlSqlInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/BeanShellInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/InsecureDexLoading.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/JShellInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/JakartaExpressionInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/JythonInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/ScriptInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/SpringImplicitViewManipulation.ql +ql/java/ql/src/experimental/Security/CWE/CWE-094/SpringViewManipulation.ql +ql/java/ql/src/experimental/Security/CWE/CWE-1004/InsecureTomcatConfig.ql +ql/java/ql/src/experimental/Security/CWE/CWE-1004/SensitiveCookieNotHttpOnly.ql +ql/java/ql/src/experimental/Security/CWE/CWE-200/InsecureWebResourceResponse.ql +ql/java/ql/src/experimental/Security/CWE/CWE-200/SensitiveAndroidFileLeak.ql +ql/java/ql/src/experimental/Security/CWE/CWE-208/PossibleTimingAttackAgainstSignature.ql +ql/java/ql/src/experimental/Security/CWE/CWE-208/TimingAttackAgainstHeader.ql +ql/java/ql/src/experimental/Security/CWE/CWE-208/TimingAttackAgainstSignature.ql +ql/java/ql/src/experimental/Security/CWE/CWE-295/JxBrowserWithoutCertValidation.ql +ql/java/ql/src/experimental/Security/CWE/CWE-297/IgnoredHostnameVerification.ql +ql/java/ql/src/experimental/Security/CWE/CWE-297/InsecureLdapEndpoint.ql +ql/java/ql/src/experimental/Security/CWE/CWE-299/DisabledRevocationChecking.ql +ql/java/ql/src/experimental/Security/CWE/CWE-327/Azure/UnsafeUsageOfClientSideEncryptionVersion.ql +ql/java/ql/src/experimental/Security/CWE/CWE-327/UnsafeTlsVersion.ql +ql/java/ql/src/experimental/Security/CWE/CWE-346/UnvalidatedCors.ql +ql/java/ql/src/experimental/Security/CWE/CWE-347/Auth0NoVerifier.ql +ql/java/ql/src/experimental/Security/CWE/CWE-348/ClientSuppliedIpUsedInSecurityCheck.ql +ql/java/ql/src/experimental/Security/CWE/CWE-352/JsonpInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-400/LocalThreadResourceAbuse.ql +ql/java/ql/src/experimental/Security/CWE/CWE-400/ThreadResourceAbuse.ql +ql/java/ql/src/experimental/Security/CWE/CWE-470/LoadClassNoSignatureCheck.ql +ql/java/ql/src/experimental/Security/CWE/CWE-470/UnsafeReflection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-489/EJBMain.ql +ql/java/ql/src/experimental/Security/CWE/CWE-489/WebComponentMain.ql +ql/java/ql/src/experimental/Security/CWE/CWE-489/devMode.ql +ql/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeDeserializationRmi.ql +ql/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClass.ql +ql/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfiguration.ql +ql/java/ql/src/experimental/Security/CWE/CWE-522-DecompressionBombs/DecompressionBomb.ql +ql/java/ql/src/experimental/Security/CWE/CWE-548/InsecureDirectoryConfig.ql +ql/java/ql/src/experimental/Security/CWE/CWE-555/CredentialsInPropertiesFile.ql +ql/java/ql/src/experimental/Security/CWE/CWE-555/PasswordInConfigurationFile.ql +ql/java/ql/src/experimental/Security/CWE/CWE-598/SensitiveGetQuery.ql +ql/java/ql/src/experimental/Security/CWE/CWE-600/UncaughtServletException.ql +ql/java/ql/src/experimental/Security/CWE/CWE-601/SpringUrlRedirect.ql +ql/java/ql/src/experimental/Security/CWE/CWE-625/PermissiveDotRegex.ql +ql/java/ql/src/experimental/Security/CWE/CWE-652/XQueryInjection.ql +ql/java/ql/src/experimental/Security/CWE/CWE-665/InsecureRmiJmxEnvironmentConfiguration.ql +ql/java/ql/src/experimental/Security/CWE/CWE-755/NFEAndroidDoS.ql +ql/java/ql/src/experimental/Security/CWE/CWE-759/HashWithoutSalt.ql +ql/java/ql/src/experimental/Security/CWE/CWE-939/IncorrectURLVerification.ql +ql/java/ql/src/external/DuplicateAnonymous.ql +ql/java/ql/src/external/DuplicateBlock.ql +ql/java/ql/src/external/DuplicateMethod.ql +ql/java/ql/src/external/MostlyDuplicateClass.ql +ql/java/ql/src/external/MostlyDuplicateFile.ql +ql/java/ql/src/external/MostlyDuplicateMethod.ql +ql/java/ql/src/external/MostlySimilarFile.ql +ql/java/ql/src/filters/ClassifyFiles.ql +ql/java/ql/src/meta/frameworks/Coverage.ql +ql/java/ql/src/meta/ssa/AmbiguousToString.ql +ql/java/ql/src/meta/ssa/TooFewPhiInputs.ql +ql/java/ql/src/meta/ssa/UncertainDefWithoutPrior.ql +ql/java/ql/src/meta/ssa/UseWithoutUniqueSsaVariable.ql +ql/java/ql/src/utils/modelconverter/ExtractNeutrals.ql +ql/java/ql/src/utils/modelconverter/ExtractSinks.ql +ql/java/ql/src/utils/modelconverter/ExtractSources.ql +ql/java/ql/src/utils/modelconverter/ExtractSummaries.ql +ql/java/ql/src/utils/modeleditor/ApplicationModeEndpoints.ql +ql/java/ql/src/utils/modeleditor/FrameworkModeEndpoints.ql +ql/java/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureNeutralModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureSinkModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureSourceModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureSummaryModels.ql +ql/java/ql/src/utils/modelgenerator/CaptureTypeBasedSummaryModels.ql +ql/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPartialPath.ql +ql/java/ql/src/utils/modelgenerator/debug/CaptureSummaryModelsPath.ql +ql/java/ql/src/utils/stub-generator/MinimalStubsFromSource.ql diff --git a/java/ql/integration-tests/java/query-suite/test.py b/java/ql/integration-tests/java/query-suite/test.py index c829eb9ffa0..83551ecfc19 100644 --- a/java/ql/integration-tests/java/query-suite/test.py +++ b/java/ql/integration-tests/java/query-suite/test.py @@ -2,12 +2,28 @@ import os import runs_on import pytest -@runs_on.linux -@pytest.mark.parametrize("query_suite", ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls']) +well_known_query_suites = ['java-code-quality.qls', 'java-security-and-quality.qls', 'java-security-extended.qls', 'java-code-scanning.qls'] + +@runs_on.posix +@pytest.mark.parametrize("query_suite", well_known_query_suites) def test(codeql, java, cwd, expected_files, semmle_code_dir, query_suite): - actual = codeql.resolve.queries(query_suite, _capture=True).strip() - actual = sorted(actual.splitlines()) - actual = [os.path.relpath(q, semmle_code_dir) for q in actual] - actual_file_name = query_suite + '.actual' - expected_files.add(actual_file_name) - (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + actual = codeql.resolve.queries(query_suite, _capture=True).strip() + actual = sorted(actual.splitlines()) + actual = [os.path.relpath(q, semmle_code_dir) for q in actual] + actual_file_name = query_suite + '.actual' + expected_files.add(actual_file_name) + (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + +@runs_on.posix +def test_not_included_queries(codeql, java, cwd, expected_files, semmle_code_dir): + all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / 'java' / 'ql' / 'src', _capture=True).strip().splitlines() + + included_in_qls = set() + for query_suite in well_known_query_suites: + included_in_qls |= set(codeql.resolve.queries(query_suite, _capture=True).strip().splitlines()) + + not_included = sorted(set(all_queries) - included_in_qls) + not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] + not_included_file_name = 'not_included_in_qls.actual' + expected_files.add(not_included_file_name) + (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') From 25bd0c3b21a8c4edc3606b7ca59e4155778bcac6 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 8 Apr 2025 17:27:16 +0200 Subject: [PATCH 134/372] Rust: add test setup script --- rust/ql/test/setup.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 rust/ql/test/setup.sh diff --git a/rust/ql/test/setup.sh b/rust/ql/test/setup.sh new file mode 100755 index 00000000000..822097140bb --- /dev/null +++ b/rust/ql/test/setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +# This script is run by the CI to set up the test environment for the Rust QL tests +# We run this as rustup is not meant to be run in parallel, and will this setup will be run by rust-analyzer in the +# parallel QL tests unless we do the setup prior to launching the tests. +# We do this for each `rust-toolchain.toml` we use in the tests (and the root one in `rust`) + +cd "$(dirname "$0")" + +rustup install +rustup component add rust-src + +find . -name rust-toolchain.toml \ + -execdir rustup install \; \ + -execdir rustup component add rust-src \; From 2e75dbd51971df73546a0c5552544624f0a9c5ee Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Tue, 8 Apr 2025 19:30:02 -0700 Subject: [PATCH 135/372] Actions: Fix invocation of autobuild PowerShell script Pass the quoted script path to PowerShell using `-File`. This ensures the path is treated as a string rather than a command, and correctly handles file paths that contain spaces, unblocking integration tests. Add logging to autobuild.cmd for easier debugging. --- actions/extractor/tools/autobuild.cmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/actions/extractor/tools/autobuild.cmd b/actions/extractor/tools/autobuild.cmd index cd05b979110..3118347d279 100644 --- a/actions/extractor/tools/autobuild.cmd +++ b/actions/extractor/tools/autobuild.cmd @@ -1,3 +1,4 @@ @echo off rem All of the work is done in the PowerShell script -powershell.exe "%~dp0autobuild-impl.ps1" +echo "Running PowerShell script at '%~dp0autobuild-impl.ps1'" +powershell.exe -File "%~dp0autobuild-impl.ps1" From 35f9157e429c2337a006d9a081ed5f4c241a0710 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 9 Apr 2025 09:28:55 +0200 Subject: [PATCH 136/372] Ruby: Fix bad join in `DeadStoreOfLocal.ql` --- ruby/ql/src/queries/variables/DeadStoreOfLocal.ql | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ruby/ql/src/queries/variables/DeadStoreOfLocal.ql b/ruby/ql/src/queries/variables/DeadStoreOfLocal.ql index 8717047e995..547d7d3cd89 100644 --- a/ruby/ql/src/queries/variables/DeadStoreOfLocal.ql +++ b/ruby/ql/src/queries/variables/DeadStoreOfLocal.ql @@ -11,15 +11,20 @@ */ import codeql.ruby.AST +import codeql.ruby.CFG import codeql.ruby.dataflow.SSA import codeql.ruby.ApiGraphs +pragma[nomagic] +private predicate hasErbResultCall(CfgScope scope) { + scope = API::getTopLevelMember("ERB").getInstance().getAMethodCall("result").asExpr().getScope() +} + class RelevantLocalVariableWriteAccess extends LocalVariableWriteAccess { RelevantLocalVariableWriteAccess() { not this.getVariable().getName().charAt(0) = "_" and not this = any(Parameter p).getAVariable().getDefiningAccess() and - not API::getTopLevelMember("ERB").getInstance().getAMethodCall("result").asExpr().getScope() = - this.getCfgScope() and + not hasErbResultCall(this.getCfgScope()) and not exists(RetryStmt r | r.getCfgScope() = this.getCfgScope()) and not exists(MethodCall c | c.getReceiver() instanceof SelfVariableAccess and From da7d6d33468e642c704a12faf983790dd5ed2ec7 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 9 Apr 2025 11:28:21 +0200 Subject: [PATCH 137/372] JS: Change note --- javascript/ql/src/change-notes/2025-04-09-web-response.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/src/change-notes/2025-04-09-web-response.md diff --git a/javascript/ql/src/change-notes/2025-04-09-web-response.md b/javascript/ql/src/change-notes/2025-04-09-web-response.md new file mode 100644 index 00000000000..3afebf1b6a7 --- /dev/null +++ b/javascript/ql/src/change-notes/2025-04-09-web-response.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Data passed to the [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) constructor is now treated as a sink for `js/reflected-xss`. From 4bc3e9e736e112c7d2950857b0f768b904bce388 Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 9 Apr 2025 12:16:53 +0200 Subject: [PATCH 138/372] Addressed comments Co-authored-by: Asgerf --- .../internal/flow_summaries/Decoders.qll | 3 +-- .../internal/flow_summaries/TypedArrays.qll | 22 ++++++------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll index 567a0403bcf..7e75d6482c5 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll @@ -17,8 +17,7 @@ class DecodeLike extends SummarizedCallable { DecodeLike() { this = "TextDecoder#decode" } override InstanceCall getACall() { - result = - textDecoderConstructorRef().getAnInstantiation().getReturn().getMember("decode").getACall() + result = textDecoderConstructorRef().getInstance().getMember("decode").getACall() } override predicate propagatesFlow(string input, string output, boolean preservesValue) { diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll index 81e84d806fd..9f3140497ab 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll @@ -37,11 +37,11 @@ class BufferTypedArray extends DataFlow::AdditionalFlowStep { } } -class SetLike extends SummarizedCallable { - SetLike() { this = "TypedArray#set" } +class TypedArraySet extends SummarizedCallable { + TypedArraySet() { this = "TypedArray#set" } override InstanceCall getACall() { - result = typedArrayConstructorRef().getAnInstantiation().getReturn().getMember("set").getACall() + result = typedArrayConstructorRef().getInstance().getMember("set").getACall() } override predicate propagatesFlow(string input, string output, boolean preservesValue) { @@ -51,13 +51,10 @@ class SetLike extends SummarizedCallable { } } -class SubArrayLike extends SummarizedCallable { - SubArrayLike() { this = "TypedArray#subarray" } +class TypedArraySubarray extends SummarizedCallable { + TypedArraySubarray() { this = "TypedArray#subarray" } - override InstanceCall getACall() { - result = - typedArrayConstructorRef().getAnInstantiation().getReturn().getMember("subarray").getACall() - } + override InstanceCall getACall() { result.getMethodName() = "subarray" } override predicate propagatesFlow(string input, string output, boolean preservesValue) { preservesValue = true and @@ -95,12 +92,7 @@ class TransferLike extends SummarizedCallable { TransferLike() { this = "ArrayBuffer#transfer" } override InstanceCall getACall() { - result = - arrayBufferConstructorRef() - .getAnInstantiation() - .getReturn() - .getMember(["transfer", "transferToFixedLength"]) - .getACall() + result.getMethodName() = ["transfer", "transferToFixedLength"] } override predicate propagatesFlow(string input, string output, boolean preservesValue) { From 0a293cf357be62d4e32cc4cf2257f16d078225df Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 9 Apr 2025 12:12:35 +0100 Subject: [PATCH 139/372] Add EnumType to SimpleTypeSanitizer --- java/ql/lib/semmle/code/java/security/Sanitizers.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/lib/semmle/code/java/security/Sanitizers.qll b/java/ql/lib/semmle/code/java/security/Sanitizers.qll index 6035b068bd0..5340ba34482 100644 --- a/java/ql/lib/semmle/code/java/security/Sanitizers.qll +++ b/java/ql/lib/semmle/code/java/security/Sanitizers.qll @@ -23,6 +23,7 @@ class SimpleTypeSanitizer extends DataFlow::Node { this.getType() .(RefType) .getASourceSupertype*() - .hasQualifiedName("java.time.temporal", "TemporalAccessor") + .hasQualifiedName("java.time.temporal", "TemporalAccessor") or + this.getType() instanceof EnumType } } From a3e4e62eacb3279bf8b30b6087bca0e023365bd3 Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 9 Apr 2025 13:27:13 +0200 Subject: [PATCH 140/372] Removed taint from `ArrayBuffer` constructor as it accepts `length` --- .../internal/flow_summaries/TypedArrays.qll | 14 ------------ .../TaintTracking/BasicTaintTracking.expected | 22 ++++++++----------- .../TaintTracking/typed-arrays.js | 14 +++++++----- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll index 9f3140497ab..19a28036db4 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/TypedArrays.qll @@ -74,20 +74,6 @@ private class ArrayBufferEntryPoint extends API::EntryPoint { pragma[nomagic] API::Node arrayBufferConstructorRef() { result = any(ArrayBufferEntryPoint a).getANode() } -class ArrayBufferConstructorSummary extends SummarizedCallable { - ArrayBufferConstructorSummary() { this = "ArrayBuffer constructor" } - - override DataFlow::InvokeNode getACall() { - result = arrayBufferConstructorRef().getAnInstantiation() - } - - override predicate propagatesFlow(string input, string output, boolean preservesValue) { - preservesValue = true and - input = "Argument[0].ArrayElement" and - output = "ReturnValue.ArrayElement" - } -} - class TransferLike extends SummarizedCallable { TransferLike() { this = "ArrayBuffer#transfer" } diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index e0cbc7b3b2e..b82fdc8d1ee 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -40,18 +40,18 @@ legacyDataFlowDifference | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | only flow with NEW data flow library | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:22:10:22:13 | view | only flow with NEW data flow library | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:26:10:26:14 | view1 | only flow with NEW data flow library | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | only flow with NEW data flow library | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | only flow with NEW data flow library | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:46:10:46:12 | str | only flow with NEW data flow library | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:50:10:50:13 | str2 | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:48:10:48:12 | str | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:52:10:52:13 | str2 | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | consistencyIssue | nested-props.js:20 | expected an alert, but found none | NOT OK - but not found | Consistency | | stringification-read-steps.js:17 | expected an alert, but found none | NOT OK | Consistency | | stringification-read-steps.js:25 | expected an alert, but found none | NOT OK | Consistency | -| typed-arrays.js:40 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | +| typed-arrays.js:23 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | +| typed-arrays.js:28 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | +| typed-arrays.js:32 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | +| typed-arrays.js:36 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | +| typed-arrays.js:42 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -342,12 +342,8 @@ flow | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:22:10:22:13 | view | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:26:10:26:14 | view1 | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:30:10:30:23 | transferedView | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:34:10:34:24 | transferedView2 | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:46:10:46:12 | str | -| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:50:10:50:13 | str2 | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:48:10:48:12 | str | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:52:10:52:13 | str2 | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | | xml.js:5:18:5:25 | source() | xml.js:8:14:8:17 | text | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js index d2dc8b2168c..e3eed25dd87 100644 --- a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -17,21 +17,23 @@ function test() { const sub = y.subarray(1, 3) sink(sub); // NOT OK - const buffer = new ArrayBuffer(x); + const buffer = new ArrayBuffer(8); const view = new Uint8Array(buffer); - sink(view); // NOT OK + view.set(x, 3); + sink(buffer); // NOT OK -- Should be flagged but it is not. - const sharedBuffer = new SharedArrayBuffer(x); + const sharedBuffer = new SharedArrayBuffer(8); const view1 = new Uint8Array(sharedBuffer); - sink(view1); // NOT OK + view1.set(x, 3); + sink(sharedBuffer); // NOT OK -- Should be flagged but it is not. const transfered = buffer.transfer(); const transferedView = new Uint8Array(transfered); - sink(transferedView); // NOT OK + sink(transferedView); // NOT OK -- Should be flagged but it is not. const transfered2 = buffer.transferToFixedLength(); const transferedView2 = new Uint8Array(transfered2); - sink(transferedView2); // NOT OK + sink(transferedView2); // NOT OK -- Should be flagged but it is not. var typedArrayToString = (function () { return function (a) { return String.fromCharCode.apply(null, a); }; From 3373c2457c3e8915e48e7bf38bd85c90807ba283 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 9 Apr 2025 12:27:48 +0100 Subject: [PATCH 141/372] Update test expectation --- .../diagnostics.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected b/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected index 8e5fb7fc737..9dd6b8297e6 100644 --- a/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected +++ b/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected @@ -13,7 +13,7 @@ } } { - "markdownMessage": "Built a Gradle project without the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). This may use an incompatible version of Gradle.", + "markdownMessage": "Analyzed a Gradle project without the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). This may use an incompatible version of Gradle.", "severity": "warning", "source": { "extractorName": "java", From 5c7a4eb51176516ecd3e0fb857b255c8bfc259a0 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 9 Apr 2025 12:51:18 +0100 Subject: [PATCH 142/372] Reorder test expectations --- .../diagnostics.expected | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected b/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected index 9dd6b8297e6..f40920e10d6 100644 --- a/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected +++ b/java/ql/integration-tests/java/gradle-sample-without-wrapper-or-gradle-buildless/diagnostics.expected @@ -1,10 +1,10 @@ { - "markdownMessage": "Build tool(s) should have been able to provide a recommended classpath but the attempt failed. Extraction will continue, but external dependencies will be inferred from the Java package names used. Consider troubleshooting the build tool error or using a build mode other than 'none'.", - "severity": "note", + "markdownMessage": "Analyzed a Gradle project without the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). This may use an incompatible version of Gradle.", + "severity": "warning", "source": { "extractorName": "java", - "id": "java/autobuilder/buildless/classpath-from-tool-failed", - "name": "Failed to extract dependency information from build tool tool Gradle" + "id": "java/autobuilder/guessed-gradle-version", + "name": "Required Gradle version not specified" }, "visibility": { "cliSummaryTable": true, @@ -13,12 +13,12 @@ } } { - "markdownMessage": "Analyzed a Gradle project without the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). This may use an incompatible version of Gradle.", - "severity": "warning", + "markdownMessage": "Build tool(s) should have been able to provide a recommended classpath but the attempt failed. Extraction will continue, but external dependencies will be inferred from the Java package names used. Consider troubleshooting the build tool error or using a build mode other than 'none'.", + "severity": "note", "source": { "extractorName": "java", - "id": "java/autobuilder/guessed-gradle-version", - "name": "Required Gradle version not specified" + "id": "java/autobuilder/buildless/classpath-from-tool-failed", + "name": "Failed to extract dependency information from build tool tool Gradle" }, "visibility": { "cliSummaryTable": true, From 0c52b5ad9596b6bc8d5e4227f6205991e3672628 Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 9 Apr 2025 14:24:43 +0200 Subject: [PATCH 143/372] Added summary flow for `StringFromCharCode` --- .../internal/flow_summaries/Strings.qll | 16 ++++++++++++++++ .../TaintTracking/BasicTaintTracking.expected | 3 ++- .../library-tests/TaintTracking/typed-arrays.js | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll index 154668cde08..8c8ab1ac4ac 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll @@ -99,3 +99,19 @@ class StringSplitHashOrQuestionMark extends SummarizedCallable { ) } } + +class StringFromCharCode extends SummarizedCallable { + StringFromCharCode() { this = "String#fromCharCode" } + + override DataFlow::CallNode getACall() { + result = DataFlow::globalVarRef("String").getAPropertyRead("fromCharCode").getACall() + } + + override predicate propagatesFlow(string input, string output, boolean preservesValue) { + preservesValue = true and + ( + input = "Argument[0..]" and + output = "ReturnValue" + ) + } +} diff --git a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected index b82fdc8d1ee..0083e55e642 100644 --- a/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected +++ b/javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected @@ -40,6 +40,7 @@ legacyDataFlowDifference | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | only flow with NEW data flow library | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:42:10:42:30 | typedAr ... ring(y) | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:48:10:48:12 | str | only flow with NEW data flow library | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:52:10:52:13 | str2 | only flow with NEW data flow library | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:15:10:15:10 | x | only flow with NEW data flow library | @@ -51,7 +52,6 @@ consistencyIssue | typed-arrays.js:28 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | | typed-arrays.js:32 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | | typed-arrays.js:36 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | -| typed-arrays.js:42 | expected an alert, but found none | NOT OK -- Should be flagged but it is not. | Consistency | flow | access-path-sanitizer.js:2:18:2:25 | source() | access-path-sanitizer.js:4:8:4:12 | obj.x | | addexpr.js:4:10:4:17 | source() | addexpr.js:7:8:7:8 | x | @@ -342,6 +342,7 @@ flow | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:11:10:11:12 | arr | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:15:10:15:10 | z | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:18:10:18:12 | sub | +| typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:42:10:42:30 | typedAr ... ring(y) | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:48:10:48:12 | str | | typed-arrays.js:2:13:2:20 | source() | typed-arrays.js:52:10:52:13 | str2 | | use-use-after-implicit-read.js:7:17:7:24 | source() | use-use-after-implicit-read.js:8:10:8:17 | captured | diff --git a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js index e3eed25dd87..0118c2ae690 100644 --- a/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js +++ b/javascript/ql/test/library-tests/TaintTracking/typed-arrays.js @@ -39,7 +39,7 @@ function test() { return function (a) { return String.fromCharCode.apply(null, a); }; })(); - sink(typedArrayToString(y)); // NOT OK -- Should be flagged but it is not. + sink(typedArrayToString(y)); // NOT OK let str = ''; for (let i = 0; i < y.length; i++) From 2dca95af9220bf0adbfa567edc3af2d114289c35 Mon Sep 17 00:00:00 2001 From: Napalys Klicius Date: Wed, 9 Apr 2025 14:26:00 +0200 Subject: [PATCH 144/372] Update javascript/ql/lib/change-notes/2025-04-07-websocket.md Co-authored-by: Asger F --- javascript/ql/lib/change-notes/2025-04-07-websocket.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/ql/lib/change-notes/2025-04-07-websocket.md b/javascript/ql/lib/change-notes/2025-04-07-websocket.md index a6f6e214f3a..1d6cdb8e6b1 100644 --- a/javascript/ql/lib/change-notes/2025-04-07-websocket.md +++ b/javascript/ql/lib/change-notes/2025-04-07-websocket.md @@ -1,5 +1,5 @@ --- category: minorAnalysis --- -* Improved `WebSocket` analysis by refactoring the model to use API graphs. +* Improved detection of `WebSocket` and `SockJS` usage. * Added data received from `WebSocket` clients as a remote flow source. From 674f40b35fdf4ea6aaf22c31b7a76d1f23c6d65a Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 9 Apr 2025 14:39:09 +0200 Subject: [PATCH 145/372] Added test cases for `make-dir` package. --- .../Security/CWE-022/TaintedPath/make-dir.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js new file mode 100644 index 00000000000..a91287bb0b0 --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js @@ -0,0 +1,11 @@ +import { makeDirectory, makeDirectorySync } from 'make-dir'; + +const express = require('express'); +const app = express(); + +app.get('/makedir', (req, res) => { + const file = req.query.file; // $ MISSING: Source + + makeDirectory(file); // $ MISSING: Alert + makeDirectorySync(file); // $ MISSING: Alert +}); From ce2fc25cdbd0c21bb40845f0ac317f6d1d47ddb2 Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 9 Apr 2025 14:40:28 +0200 Subject: [PATCH 146/372] Added `make-dir` model as data --- javascript/ql/lib/ext/make-dir.model.yml | 6 ++++++ .../Security/CWE-022/TaintedPath/TaintedPath.expected | 9 +++++++++ .../query-tests/Security/CWE-022/TaintedPath/make-dir.js | 6 +++--- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 javascript/ql/lib/ext/make-dir.model.yml diff --git a/javascript/ql/lib/ext/make-dir.model.yml b/javascript/ql/lib/ext/make-dir.model.yml new file mode 100644 index 00000000000..512259126a6 --- /dev/null +++ b/javascript/ql/lib/ext/make-dir.model.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/javascript-all + extensible: sinkModel + data: + - ["make-dir", "Member[makeDirectory,makeDirectorySync].Argument[0]", "path-injection"] diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected index 4fa0dbd3a2a..02fc6c0ce95 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected @@ -52,6 +52,8 @@ | handlebars.js:11:32:11:39 | filePath | handlebars.js:29:46:29:60 | req.params.path | handlebars.js:11:32:11:39 | filePath | This path depends on a $@. | handlebars.js:29:46:29:60 | req.params.path | user-provided value | | handlebars.js:15:25:15:32 | filePath | handlebars.js:43:15:43:29 | req.params.path | handlebars.js:15:25:15:32 | filePath | This path depends on a $@. | handlebars.js:43:15:43:29 | req.params.path | user-provided value | | hapi.js:15:44:15:51 | filepath | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:15:44:15:51 | filepath | This path depends on a $@. | hapi.js:14:30:14:51 | request ... ilepath | user-provided value | +| make-dir.js:9:19:9:22 | file | make-dir.js:7:18:7:31 | req.query.file | make-dir.js:9:19:9:22 | file | This path depends on a $@. | make-dir.js:7:18:7:31 | req.query.file | user-provided value | +| make-dir.js:10:23:10:26 | file | make-dir.js:7:18:7:31 | req.query.file | make-dir.js:10:23:10:26 | file | This path depends on a $@. | make-dir.js:7:18:7:31 | req.query.file | user-provided value | | mkdirp.js:11:12:11:18 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:11:12:11:18 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | | mkdirp.js:12:17:12:23 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:12:17:12:23 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | | mkdirp.js:13:23:13:29 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:13:23:13:29 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | @@ -403,6 +405,9 @@ edges | handlebars.js:43:15:43:29 | req.params.path | handlebars.js:13:73:13:80 | filePath | provenance | | | hapi.js:14:19:14:51 | filepath | hapi.js:15:44:15:51 | filepath | provenance | | | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:14:19:14:51 | filepath | provenance | | +| make-dir.js:7:11:7:31 | file | make-dir.js:9:19:9:22 | file | provenance | | +| make-dir.js:7:11:7:31 | file | make-dir.js:10:23:10:26 | file | provenance | | +| make-dir.js:7:18:7:31 | req.query.file | make-dir.js:7:11:7:31 | file | provenance | | | mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:11:12:11:18 | dirPath | provenance | | | mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:12:17:12:23 | dirPath | provenance | | | mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:13:23:13:29 | dirPath | provenance | | @@ -949,6 +954,10 @@ nodes | hapi.js:14:19:14:51 | filepath | semmle.label | filepath | | hapi.js:14:30:14:51 | request ... ilepath | semmle.label | request ... ilepath | | hapi.js:15:44:15:51 | filepath | semmle.label | filepath | +| make-dir.js:7:11:7:31 | file | semmle.label | file | +| make-dir.js:7:18:7:31 | req.query.file | semmle.label | req.query.file | +| make-dir.js:9:19:9:22 | file | semmle.label | file | +| make-dir.js:10:23:10:26 | file | semmle.label | file | | mkdirp.js:9:11:9:76 | dirPath | semmle.label | dirPath | | mkdirp.js:9:21:9:76 | path.jo ... ltDir') | semmle.label | path.jo ... ltDir') | | mkdirp.js:9:42:9:59 | req.query.filename | semmle.label | req.query.filename | diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js index a91287bb0b0..59b0cfe8d8c 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js @@ -4,8 +4,8 @@ const express = require('express'); const app = express(); app.get('/makedir', (req, res) => { - const file = req.query.file; // $ MISSING: Source + const file = req.query.file; // $ Source - makeDirectory(file); // $ MISSING: Alert - makeDirectorySync(file); // $ MISSING: Alert + makeDirectory(file); // $ Alert + makeDirectorySync(file); // $ Alert }); From 5ec71ab9af33fe00bc2e9eb673c67e0bac80da02 Mon Sep 17 00:00:00 2001 From: Napalys Date: Wed, 9 Apr 2025 14:40:36 +0200 Subject: [PATCH 147/372] Added change note --- javascript/ql/lib/change-notes/2025-04-09-make-dir.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2025-04-09-make-dir.md diff --git a/javascript/ql/lib/change-notes/2025-04-09-make-dir.md b/javascript/ql/lib/change-notes/2025-04-09-make-dir.md new file mode 100644 index 00000000000..fd056bbc98d --- /dev/null +++ b/javascript/ql/lib/change-notes/2025-04-09-make-dir.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added support for the `make-dir` package. From 0acccf240ad10ccc5f146332440b88bdb888f1b1 Mon Sep 17 00:00:00 2001 From: Florin Coada Date: Wed, 9 Apr 2025 13:45:21 +0100 Subject: [PATCH 148/372] Update codeql-library-for-actions.rst --- .../codeql-language-guides/codeql-library-for-actions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst b/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst index 7be7f3c8cfe..aa37abc5784 100644 --- a/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst +++ b/docs/codeql/codeql-language-guides/codeql-library-for-actions.rst @@ -121,9 +121,9 @@ See the GitHub Actions documentation on `workflows Date: Wed, 9 Apr 2025 14:56:24 +0200 Subject: [PATCH 149/372] Brought back old methods and marked them as `deprecated` --- .../javascript/frameworks/WebSocket.qll | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll index 5e40360a4d8..f71b1cf9e0d 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebSocket.qll @@ -70,10 +70,35 @@ module ClientWebSocket { /** * A class that can be used to instantiate a WebSocket instance. */ - class SocketClass extends API::Node { + deprecated class SocketClass extends DataFlow::SourceNode { LibraryName library; // the name of the WebSocket library. Can be one of the libraries defined in `LibraryNames`. SocketClass() { + this = DataFlow::globalVarRef("WebSocket") and library = websocket() + or + this = DataFlow::moduleImport("ws") and library = ws() + or + // the sockjs-client library:https://www.npmjs.com/package/sockjs-client + library = sockjs() and + ( + this = DataFlow::moduleImport("sockjs-client") or + this = DataFlow::globalVarRef("SockJS") + ) + } + + /** + * Gets the WebSocket library name. + */ + LibraryName getLibrary() { result = library } + } + + /** + * A class that can be used to instantiate a WebSocket instance. + */ + class WebSocketClass extends API::Node { + LibraryName library; // the name of the WebSocket library. Can be one of the libraries defined in `LibraryNames`. + + WebSocketClass() { this = any(WebSocketEntryPoint e).getANode() and library = websocket() or this = API::moduleImport("ws") and library = ws() @@ -96,7 +121,7 @@ module ClientWebSocket { * A client WebSocket instance. */ class ClientSocket extends EventEmitter::Range, API::NewNode, ClientRequest::Range { - SocketClass socketClass; + WebSocketClass socketClass; ClientSocket() { this = socketClass.getAnInvocation() } @@ -212,7 +237,18 @@ module ServerWebSocket { /** * Gets a server created by a library named `library`. */ - API::InvokeNode getAServer(LibraryName library) { + deprecated DataFlow::SourceNode getAServer(LibraryName library) { + library = ws() and + result = DataFlow::moduleImport("ws").getAConstructorInvocation("Server") + or + library = sockjs() and + result = DataFlow::moduleImport("sockjs").getAMemberCall("createServer") + } + + /** + * Gets a server created by a library named `library`. + */ + API::InvokeNode getAServerInvocation(LibraryName library) { library = ws() and result = API::moduleImport("ws").getMember("Server").getAnInvocation() or @@ -224,7 +260,7 @@ module ServerWebSocket { * Gets a `socket.on("connection", (msg, req) => {})` call. */ private DataFlow::CallNode getAConnectionCall(LibraryName library) { - result = getAServer(library).getReturn().getMember(EventEmitter::on()).getACall() and + result = getAServerInvocation(library).getReturn().getMember(EventEmitter::on()).getACall() and result.getArgument(0).mayHaveStringValue("connection") } From 84aa2e8627abcf3ca1dceb1d4ebfaaf16033b8e6 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Wed, 9 Apr 2025 14:07:38 +0100 Subject: [PATCH 150/372] Apply review suggestion - Tweak wording of example comment Co-authored-by: Taus --- python/ql/src/Variables/LoopVariableCapture/examples/good2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/examples/good2.py b/python/ql/src/Variables/LoopVariableCapture/examples/good2.py index 1a2469b4220..7047e11d0b6 100644 --- a/python/ql/src/Variables/LoopVariableCapture/examples/good2.py +++ b/python/ql/src/Variables/LoopVariableCapture/examples/good2.py @@ -1,5 +1,5 @@ import functools -# GOOD: A default parameter is used, so the variable `i` is not being captured. +# GOOD: `functools.partial` takes care of capturing the _value_ of `i`. tasks = [] for i in range(5): tasks.append(functools.partial(lambda i: print(i), i)) From fbab715cb6a17a69cd2766075c0928b4a905b3bc Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 9 Apr 2025 15:20:33 +0200 Subject: [PATCH 151/372] Rust: Allow for crate self-references in crate graph paths --- rust/ql/lib/codeql/rust/internal/PathResolution.qll | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c..00257238f21 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -764,6 +764,10 @@ private predicate crateDependencyEdge(ModuleLikeNode m, string name, CrateItemNo // entry/transitive source file m = c.getASourceFile() ) + or + // paths inside the crate graph use the name of the crate itself as prefix, + // although that is not valid in Rust + dep = any(Crate c | name = c.getName() and m = c.getModule()) } private predicate useTreeDeclares(UseTree tree, string name) { From f31b49b022637d8c00b8b7fa13d33694c4858813 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 9 Apr 2025 15:41:48 +0100 Subject: [PATCH 152/372] Change note --- java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md diff --git a/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md b/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md new file mode 100644 index 00000000000..9c4e7b574d7 --- /dev/null +++ b/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Enum-typed values are now assumed to be safe by most queries. This means that queries may return less results where an enum value is used in a sensitive context, e.g. pasted into a query string. From 7a8dfdb97157d7efc6c8ab2cf7e18e6fb86bd288 Mon Sep 17 00:00:00 2001 From: Chris Smowton Date: Wed, 9 Apr 2025 15:52:48 +0100 Subject: [PATCH 153/372] Grammar --- java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md b/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md index 9c4e7b574d7..9b120e84ff7 100644 --- a/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md +++ b/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md @@ -1,4 +1,4 @@ --- category: minorAnalysis --- -* Enum-typed values are now assumed to be safe by most queries. This means that queries may return less results where an enum value is used in a sensitive context, e.g. pasted into a query string. +* Enum-typed values are now assumed to be safe by most queries. This means that queries may return fewer results where an enum value is used in a sensitive context, e.g. pasted into a query string. From 52401aaa735cc623e293e195cb391cdc477eaa5a Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 9 Apr 2025 17:19:25 +0200 Subject: [PATCH 154/372] Address review comments --- .../codeql/rust/internal/PathResolution.qll | 9 ++++++-- shared/util/codeql/util/FileSystem.qll | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index ad64e50d009..9a73d8d035c 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -655,6 +655,11 @@ private predicate fileModule(SourceFile f, string name, Folder folder) { ) } +/** + * Gets the `Meta` of the module `m`'s [path attribute][1]. + * + * [1]: https://doc.rust-lang.org/reference/items/modules.html#r-items.mod.outlined.path + */ private Meta getPathAttrMeta(Module m) { result = m.getAnAttr().getMeta() and result.getPath().getText() = "path" @@ -725,7 +730,7 @@ private predicate pathAttrImport(Folder f, Module m, string relativePath) { ) } -private predicate append(Folder f, string relativePath) { pathAttrImport(f, _, relativePath) } +private predicate shouldAppend(Folder f, string relativePath) { pathAttrImport(f, _, relativePath) } /** Holds if `m` is a `mod name;` item importing file `f`. */ private predicate fileImport(Module m, SourceFile f) { @@ -743,7 +748,7 @@ private predicate fileImport(Module m, SourceFile f) { or exists(Folder folder, string relativePath | pathAttrImport(folder, m, relativePath) and - f.getFile() = Folder::Append::append(folder, relativePath) + f.getFile() = Folder::Append::append(folder, relativePath) ) } diff --git a/shared/util/codeql/util/FileSystem.qll b/shared/util/codeql/util/FileSystem.qll index 261139dcf41..ea58db929c5 100644 --- a/shared/util/codeql/util/FileSystem.qll +++ b/shared/util/codeql/util/FileSystem.qll @@ -222,20 +222,27 @@ module Make { /** Provides logic related to `Folder`s. */ module Folder { /** Holds if `relativePath` needs to be appended to `f`. */ - signature predicate appendSig(Folder f, string relativePath); + signature predicate shouldAppendSig(Folder f, string relativePath); /** Provides the `append` predicate for appending a relative path onto a folder. */ - module Append { + module Append { pragma[nomagic] private string getComponent(string relativePath, int i) { - app(_, relativePath) and + shouldAppend(_, relativePath) and result = relativePath.replaceAll("\\", "/").regexpFind("[^/]+", i, _) } + private int getNumberOfComponents(string relativePath) { + result = strictcount(int i | exists(getComponent(relativePath, i)) | i) + or + relativePath = "" and + result = 0 + } + pragma[nomagic] private Container appendStep(Folder f, string relativePath, int i) { i = -1 and - app(f, relativePath) and + shouldAppend(f, relativePath) and result = f or exists(Container mid, string comp | @@ -258,9 +265,9 @@ module Make { */ pragma[nomagic] Container append(Folder f, string relativePath) { - exists(int components | - components = (-1).maximum(max(int comp | exists(getComponent(relativePath, comp)) | comp)) and - result = appendStep(f, relativePath, components) + exists(int last | + last = getNumberOfComponents(relativePath) - 1 and + result = appendStep(f, relativePath, last) ) } } From bd3342af8aa071ca6c53cea1656ba301964bb750 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Wed, 9 Apr 2025 20:59:40 -0700 Subject: [PATCH 155/372] Actions: Update integration test for default filters Create a common file structure to be shared among multiple tests for path filters, and rename accordingly. Update test expectations with additional files. Use pytest markers to indicate the expected outputs. Add source archive checking in addition to checking query output. This allows us to test which YAML files were extracted separately from whether they are semantically meaningful to the Actions analysis. --- actions/ql/integration-tests/filters-default/test.py | 2 -- .../actions.default-filters.expected} | 2 ++ actions/ql/integration-tests/filters/actions.ql | 5 +++++ .../filters/source_archive.default-filters.expected | 6 ++++++ .../src/.github/action.yaml | 0 .../src/.github/actions/action-name/action.yml | 0 .../src/.github/unreachable-workflow.yml | 0 .../src/.github/workflows/workflow.yml | 0 .../{filters-default => filters}/src/action.yml | 0 .../filters/src/excluded/action.yml | 11 +++++++++++ .../src/excluded}/unreachable-workflow.yml | 0 .../filters/src/included/action.yml | 11 +++++++++++ .../filters/src/included/not-an-action.yml | 1 + .../filters/src/included/unreachable-workflow.yml | 12 ++++++++++++ .../filters/src/unreachable-workflow.yml | 12 ++++++++++++ actions/ql/integration-tests/filters/test.py | 6 ++++++ 16 files changed, 66 insertions(+), 2 deletions(-) delete mode 100755 actions/ql/integration-tests/filters-default/test.py rename actions/ql/integration-tests/{filters-default/actions.expected => filters/actions.default-filters.expected} (68%) create mode 100644 actions/ql/integration-tests/filters/actions.ql create mode 100644 actions/ql/integration-tests/filters/source_archive.default-filters.expected rename actions/ql/integration-tests/{filters-default => filters}/src/.github/action.yaml (100%) rename actions/ql/integration-tests/{filters-default => filters}/src/.github/actions/action-name/action.yml (100%) rename actions/ql/integration-tests/{filters-default => filters}/src/.github/unreachable-workflow.yml (100%) rename actions/ql/integration-tests/{filters-default => filters}/src/.github/workflows/workflow.yml (100%) rename actions/ql/integration-tests/{filters-default => filters}/src/action.yml (100%) create mode 100644 actions/ql/integration-tests/filters/src/excluded/action.yml rename actions/ql/integration-tests/{filters-default/src => filters/src/excluded}/unreachable-workflow.yml (100%) create mode 100644 actions/ql/integration-tests/filters/src/included/action.yml create mode 100644 actions/ql/integration-tests/filters/src/included/not-an-action.yml create mode 100644 actions/ql/integration-tests/filters/src/included/unreachable-workflow.yml create mode 100644 actions/ql/integration-tests/filters/src/unreachable-workflow.yml create mode 100755 actions/ql/integration-tests/filters/test.py diff --git a/actions/ql/integration-tests/filters-default/test.py b/actions/ql/integration-tests/filters-default/test.py deleted file mode 100755 index c0ac8d191b9..00000000000 --- a/actions/ql/integration-tests/filters-default/test.py +++ /dev/null @@ -1,2 +0,0 @@ -def test(codeql, actions): - codeql.database.create(source_root="src") diff --git a/actions/ql/integration-tests/filters-default/actions.expected b/actions/ql/integration-tests/filters/actions.default-filters.expected similarity index 68% rename from actions/ql/integration-tests/filters-default/actions.expected rename to actions/ql/integration-tests/filters/actions.default-filters.expected index 376c71bad6d..c2b8216dfa6 100644 --- a/actions/ql/integration-tests/filters-default/actions.expected +++ b/actions/ql/integration-tests/filters/actions.default-filters.expected @@ -2,3 +2,5 @@ | src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' | | src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow | | src/action.yml:1:1:11:32 | name: ' ... action' | +| src/excluded/action.yml:1:1:11:32 | name: ' ... action' | +| src/included/action.yml:1:1:11:32 | name: ' ... action' | diff --git a/actions/ql/integration-tests/filters/actions.ql b/actions/ql/integration-tests/filters/actions.ql new file mode 100644 index 00000000000..f0a3e0ab297 --- /dev/null +++ b/actions/ql/integration-tests/filters/actions.ql @@ -0,0 +1,5 @@ +import actions + +from AstNode n +where n instanceof Workflow or n instanceof CompositeAction +select n diff --git a/actions/ql/integration-tests/filters/source_archive.default-filters.expected b/actions/ql/integration-tests/filters/source_archive.default-filters.expected new file mode 100644 index 00000000000..647b180890a --- /dev/null +++ b/actions/ql/integration-tests/filters/source_archive.default-filters.expected @@ -0,0 +1,6 @@ +src/.github/action.yaml +src/.github/actions/action-name/action.yml +src/.github/workflows/workflow.yml +src/action.yml +src/excluded/action.yml +src/included/action.yml diff --git a/actions/ql/integration-tests/filters-default/src/.github/action.yaml b/actions/ql/integration-tests/filters/src/.github/action.yaml similarity index 100% rename from actions/ql/integration-tests/filters-default/src/.github/action.yaml rename to actions/ql/integration-tests/filters/src/.github/action.yaml diff --git a/actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml b/actions/ql/integration-tests/filters/src/.github/actions/action-name/action.yml similarity index 100% rename from actions/ql/integration-tests/filters-default/src/.github/actions/action-name/action.yml rename to actions/ql/integration-tests/filters/src/.github/actions/action-name/action.yml diff --git a/actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml b/actions/ql/integration-tests/filters/src/.github/unreachable-workflow.yml similarity index 100% rename from actions/ql/integration-tests/filters-default/src/.github/unreachable-workflow.yml rename to actions/ql/integration-tests/filters/src/.github/unreachable-workflow.yml diff --git a/actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml b/actions/ql/integration-tests/filters/src/.github/workflows/workflow.yml similarity index 100% rename from actions/ql/integration-tests/filters-default/src/.github/workflows/workflow.yml rename to actions/ql/integration-tests/filters/src/.github/workflows/workflow.yml diff --git a/actions/ql/integration-tests/filters-default/src/action.yml b/actions/ql/integration-tests/filters/src/action.yml similarity index 100% rename from actions/ql/integration-tests/filters-default/src/action.yml rename to actions/ql/integration-tests/filters/src/action.yml diff --git a/actions/ql/integration-tests/filters/src/excluded/action.yml b/actions/ql/integration-tests/filters/src/excluded/action.yml new file mode 100644 index 00000000000..f611f8c72ff --- /dev/null +++ b/actions/ql/integration-tests/filters/src/excluded/action.yml @@ -0,0 +1,11 @@ +name: 'A composite action' +description: 'Do something' +runs: + using: "composite" + steps: + - name: Print + run: echo "Hello world" + shell: bash + + - name: Checkout + uses: actions/checkout@v4 diff --git a/actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml b/actions/ql/integration-tests/filters/src/excluded/unreachable-workflow.yml similarity index 100% rename from actions/ql/integration-tests/filters-default/src/unreachable-workflow.yml rename to actions/ql/integration-tests/filters/src/excluded/unreachable-workflow.yml diff --git a/actions/ql/integration-tests/filters/src/included/action.yml b/actions/ql/integration-tests/filters/src/included/action.yml new file mode 100644 index 00000000000..f611f8c72ff --- /dev/null +++ b/actions/ql/integration-tests/filters/src/included/action.yml @@ -0,0 +1,11 @@ +name: 'A composite action' +description: 'Do something' +runs: + using: "composite" + steps: + - name: Print + run: echo "Hello world" + shell: bash + + - name: Checkout + uses: actions/checkout@v4 diff --git a/actions/ql/integration-tests/filters/src/included/not-an-action.yml b/actions/ql/integration-tests/filters/src/included/not-an-action.yml new file mode 100644 index 00000000000..78449e5c484 --- /dev/null +++ b/actions/ql/integration-tests/filters/src/included/not-an-action.yml @@ -0,0 +1 @@ +name: 'Not an action, just a YAML file' diff --git a/actions/ql/integration-tests/filters/src/included/unreachable-workflow.yml b/actions/ql/integration-tests/filters/src/included/unreachable-workflow.yml new file mode 100644 index 00000000000..6f980d6a6b0 --- /dev/null +++ b/actions/ql/integration-tests/filters/src/included/unreachable-workflow.yml @@ -0,0 +1,12 @@ +name: An unreachable workflow +on: + push: + branches: + - main + +jobs: + job: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 \ No newline at end of file diff --git a/actions/ql/integration-tests/filters/src/unreachable-workflow.yml b/actions/ql/integration-tests/filters/src/unreachable-workflow.yml new file mode 100644 index 00000000000..6f980d6a6b0 --- /dev/null +++ b/actions/ql/integration-tests/filters/src/unreachable-workflow.yml @@ -0,0 +1,12 @@ +name: An unreachable workflow +on: + push: + branches: + - main + +jobs: + job: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 \ No newline at end of file diff --git a/actions/ql/integration-tests/filters/test.py b/actions/ql/integration-tests/filters/test.py new file mode 100755 index 00000000000..a2abcf90b03 --- /dev/null +++ b/actions/ql/integration-tests/filters/test.py @@ -0,0 +1,6 @@ +import pytest + +@pytest.mark.ql_test(expected=".default-filters.expected") +def test_default_filters(codeql, actions, check_source_archive): + check_source_archive.expected_suffix = ".default-filters.expected" + codeql.database.create(source_root="src") \ No newline at end of file From 800dd168c2c9e33f8408c8bc9dd99594a13bded5 Mon Sep 17 00:00:00 2001 From: Asger F Date: Thu, 10 Apr 2025 07:19:26 +0200 Subject: [PATCH 156/372] JS: Add failing TRAP test for trailing comma --- .../tests/json/input/array-trailing-comma.json | 6 ++++++ .../output/trap/array-trailing-comma.json.trap | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 javascript/extractor/tests/json/input/array-trailing-comma.json create mode 100644 javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap diff --git a/javascript/extractor/tests/json/input/array-trailing-comma.json b/javascript/extractor/tests/json/input/array-trailing-comma.json new file mode 100644 index 00000000000..5658e96a3d0 --- /dev/null +++ b/javascript/extractor/tests/json/input/array-trailing-comma.json @@ -0,0 +1,6 @@ +{ + "array": [ + "foo", + "bar", + ] +} diff --git a/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap b/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap new file mode 100644 index 00000000000..042bf630e8f --- /dev/null +++ b/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap @@ -0,0 +1,15 @@ +#10000=@"/array-trailing-comma.json;sourcefile" +files(#10000,"/array-trailing-comma.json") +#10001=@"/;folder" +folders(#10001,"/") +containerparent(#10001,#10000) +#10002=@"loc,{#10000},0,0,0,0" +locations_default(#10002,#10000,0,0,0,0) +hasLocation(#10000,#10002) +#20000=* +json_errors(#20000,"Error: Omitted elements are not allowed in JSON.") +#20001=@"loc,{#10000},5,4,5,4" +locations_default(#20001,#10000,5,4,5,4) +hasLocation(#20000,#20001) +numlines(#10000,6,0,0) +filetype(#10000,"json") From 1434f7acd2a7cb696ac80c87e511815ed9f83e00 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 9 Apr 2025 23:14:56 +0200 Subject: [PATCH 157/372] JS: Tolerate trailing comma in JSON array Previously we'd fail to extract some tsconfig.json files because of this. --- .../src/com/semmle/js/parser/JSONParser.java | 3 --- .../trap/array-trailing-comma.json.trap | 26 ++++++++++++++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/javascript/extractor/src/com/semmle/js/parser/JSONParser.java b/javascript/extractor/src/com/semmle/js/parser/JSONParser.java index 26af68b0cd3..be55eb8397e 100644 --- a/javascript/extractor/src/com/semmle/js/parser/JSONParser.java +++ b/javascript/extractor/src/com/semmle/js/parser/JSONParser.java @@ -205,9 +205,6 @@ public class JSONParser { char c = peek(); switch (c) { case ']': - if (!needsComma) { - raise("Omitted elements are not allowed in JSON."); - } next(); break out; case ',': diff --git a/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap b/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap index 042bf630e8f..77d36908a3b 100644 --- a/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap +++ b/javascript/extractor/tests/json/output/trap/array-trailing-comma.json.trap @@ -7,9 +7,27 @@ containerparent(#10001,#10000) locations_default(#10002,#10000,0,0,0,0) hasLocation(#10000,#10002) #20000=* -json_errors(#20000,"Error: Omitted elements are not allowed in JSON.") -#20001=@"loc,{#10000},5,4,5,4" -locations_default(#20001,#10000,5,4,5,4) -hasLocation(#20000,#20001) +json(#20000,5,#10000,0,"{\n "" ... ]\n}") +#20001=@"loc,{#10000},1,1,6,1" +locations_default(#20001,#10000,1,1,6,1) +json_locations(#20000,#20001) +#20002=* +json(#20002,4,#20000,0,"[\n ... ,\n ]") +#20003=@"loc,{#10000},2,14,5,5" +locations_default(#20003,#10000,2,14,5,5) +json_locations(#20002,#20003) +#20004=* +json(#20004,3,#20002,0,"""foo""") +#20005=@"loc,{#10000},3,9,3,13" +locations_default(#20005,#10000,3,9,3,13) +json_locations(#20004,#20005) +json_literals("foo","""foo""",#20004) +#20006=* +json(#20006,3,#20002,1,"""bar""") +#20007=@"loc,{#10000},4,9,4,13" +locations_default(#20007,#10000,4,9,4,13) +json_locations(#20006,#20007) +json_literals("bar","""bar""",#20006) +json_properties(#20000,"array",#20002) numlines(#10000,6,0,0) filetype(#10000,"json") From cfa1a9b603ce16b00d0fdb9d92b102a8790f90fe Mon Sep 17 00:00:00 2001 From: Asger F Date: Thu, 10 Apr 2025 07:14:38 +0200 Subject: [PATCH 158/372] JS: Update extractor version string --- javascript/extractor/src/com/semmle/js/extractor/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/extractor/src/com/semmle/js/extractor/Main.java b/javascript/extractor/src/com/semmle/js/extractor/Main.java index 0b92711b01d..45691d1d7f4 100644 --- a/javascript/extractor/src/com/semmle/js/extractor/Main.java +++ b/javascript/extractor/src/com/semmle/js/extractor/Main.java @@ -42,7 +42,7 @@ public class Main { * A version identifier that should be updated every time the extractor changes in such a way that * it may produce different tuples for the same file under the same {@link ExtractorConfig}. */ - public static final String EXTRACTOR_VERSION = "2025-03-20"; + public static final String EXTRACTOR_VERSION = "2025-04-10"; public static final Pattern NEWLINE = Pattern.compile("\n"); From 3da1f261f7e51b50181f457a6a3902efb2f9c54e Mon Sep 17 00:00:00 2001 From: Asger F Date: Thu, 10 Apr 2025 07:21:48 +0200 Subject: [PATCH 159/372] JS: Change note --- .../src/change-notes/2025-04-10-json-array-trailing-comma.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md diff --git a/javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md b/javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md new file mode 100644 index 00000000000..7a0acd541e1 --- /dev/null +++ b/javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md @@ -0,0 +1,4 @@ +--- +category: fix +--- +* Fixed a bug that would prevent extraction of `tsconfig.json` files when it contained an array literal with a trailing comma. From 00999baf9ae4f7ecad7c2bb627ab6f715a79dfba Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Thu, 10 Apr 2025 09:06:01 +0100 Subject: [PATCH 160/372] Apply docs review suggestion - Reword query description. Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql index 514a6790ea0..034ac05ee94 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.ql @@ -1,6 +1,6 @@ /** * @name Loop variable capture - * @description Capture of a loop variable is not the same as capturing the value of a loop variable, and may be erroneous. + * @description Capturing a loop variable is not the same as capturing its value, and can lead to unexpected behavior or bugs. * @kind path-problem * @tags correctness * quality From 6802037c892b51ecb1758d0d4d884135e71eb6e2 Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Thu, 10 Apr 2025 09:52:18 +0100 Subject: [PATCH 161/372] Update qhelp formatting --- .../Variables/LoopVariableCapture/LoopVariableCapture.qhelp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp index b902f976a53..2f3beeb2e9f 100644 --- a/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp +++ b/python/ql/src/Variables/LoopVariableCapture/LoopVariableCapture.qhelp @@ -22,11 +22,11 @@ To capture the value of a loop variable at the time the closure is created, use

    -In the following (BAD) example, a `tasks` list is created, but each task captures the loop variable i, and reads the same value when run. +In the following (BAD) example, a tasks list is created, but each task captures the loop variable i, and reads the same value when run.

    -In the following (GOOD) example, each closure has an `i` default parameter, shadowing the outer i variable, the default value of which is determined as the value of the loop variable i at the time the closure is created. +In the following (GOOD) example, each closure has an i default parameter, shadowing the outer i variable, the default value of which is determined as the value of the loop variable i at the time the closure is created.

    From 041adcd63a567d28e769c1578f37991b42ff738f Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 21 Mar 2025 16:28:20 +0000 Subject: [PATCH 162/372] Java: Add initial version of string replaceAll with no regex query --- .../StringReplaceAllWithNonRegex.md | 28 +++++++++++++++++++ .../StringReplaceAllWithNonRegex.ql | 20 +++++++++++++ .../StringReplaceAllWithNonRegex.expected | 1 + .../StringReplaceAllWithNonRegex.qlref | 1 + .../StringReplaceAllWithNonRegex/Test.java | 7 +++++ 5 files changed, 57 insertions(+) create mode 100644 java/ql/src/Performance/StringReplaceAllWithNonRegex.md create mode 100644 java/ql/src/Performance/StringReplaceAllWithNonRegex.ql create mode 100644 java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected create mode 100644 java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref create mode 100644 java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md new file mode 100644 index 00000000000..b38ee002f97 --- /dev/null +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md @@ -0,0 +1,28 @@ +# J-STR-001: Use of `String.replaceAll` with a first argument of a non regular expression + +Using `String.replaceAll` is less performant than `String.replace` when the first argument is not a regular expression. + +## Overview + +The underlying implementation of `String.replaceAll` uses `Pattern.compile` and expects a regular expression as its first argument. However in cases where the argument could be represented by just a plain `String` that does not represent an interesting regular expression, a call to `String.replace` may be more performant as it does not need to compile the regular expression. + +## Recommendation + +Use `String.replace` instead where a `replaceAll` call uses a trivial string as its first argument. + +## Example + +```java +public class Test { + void f() { + String s1 = "test"; + s1 = s1.replaceAll("t", "x"); // NON_COMPLIANT + s1 = s1.replaceAll(".*", "x"); // COMPLIANT + } +} + +``` + +## References + +- [String.replaceAll](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/String.html#replaceAll(java.lang.String,java.lang.String)) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql new file mode 100644 index 00000000000..d5d4c63cc6e --- /dev/null +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -0,0 +1,20 @@ +/** + * @id java/string-replace-all-with-non-regex + * @name J-STR-001: Use of `String#replaceAll` with a first argument of a non regular expression + * @description Using `String#replaceAll` is less performant than `String#replace` when the first + * argument is not a regular expression. + * @kind problem + * @precision very-high + * @problem.severity recommendation + * @tags performance + */ + +import java + +from MethodCall replaceAllCall +where + replaceAllCall.getMethod().hasQualifiedName("java.lang", "String", "replaceAll") and + //only contains characters that could be a simple string + replaceAllCall.getArgument(0).(StringLiteral).getValue().regexpMatch("^[a-zA-Z0-9]+$") +select replaceAllCall, + "Call to 'replaceAll' uses an argument comprised of plain string characters only." diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected new file mode 100644 index 00000000000..f47e86d1f0e --- /dev/null +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected @@ -0,0 +1 @@ +| Test.java:4:14:4:36 | replaceAll(...) | Call to 'replaceAll' uses an argument comprised of plain string characters only. | diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref new file mode 100644 index 00000000000..c82994caef5 --- /dev/null +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref @@ -0,0 +1 @@ +Performance/StringReplaceAllWithNonRegex.ql diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java new file mode 100644 index 00000000000..e2734f10135 --- /dev/null +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java @@ -0,0 +1,7 @@ +public class Test { + void f() { + String s1 = "test"; + s1 = s1.replaceAll("t", "x"); // NON_COMPLIANT + s1 = s1.replaceAll(".*", "x"); // COMPLIANT + } +} From ff2947a0e5da92daf993aa32cb8bbe71f4d861cb Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 25 Mar 2025 11:34:39 +0000 Subject: [PATCH 163/372] Adjust query name --- java/ql/src/Performance/StringReplaceAllWithNonRegex.md | 2 +- java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md index b38ee002f97..d9e8c722782 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md @@ -1,4 +1,4 @@ -# J-STR-001: Use of `String.replaceAll` with a first argument of a non regular expression +# Use of `String#replaceAll` with a first argument which is not a regular expression Using `String.replaceAll` is less performant than `String.replace` when the first argument is not a regular expression. diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index d5d4c63cc6e..02768d6817e 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -1,6 +1,6 @@ /** * @id java/string-replace-all-with-non-regex - * @name J-STR-001: Use of `String#replaceAll` with a first argument of a non regular expression + * @name Use of `String#replaceAll` with a first argument which is not a regular expression * @description Using `String#replaceAll` is less performant than `String#replace` when the first * argument is not a regular expression. * @kind problem From b5b252b10f7f8ae735c093a03c3ce3feadb83cee Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 25 Mar 2025 11:36:37 +0000 Subject: [PATCH 164/372] Convert test to inline expectations --- .../StringReplaceAllWithNonRegex.qlref | 3 ++- .../test/query-tests/StringReplaceAllWithNonRegex/Test.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref index c82994caef5..7737507b19e 100644 --- a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.qlref @@ -1 +1,2 @@ -Performance/StringReplaceAllWithNonRegex.ql +query: Performance/StringReplaceAllWithNonRegex.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java index e2734f10135..e3d9dafb531 100644 --- a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java @@ -1,7 +1,7 @@ public class Test { void f() { String s1 = "test"; - s1 = s1.replaceAll("t", "x"); // NON_COMPLIANT - s1 = s1.replaceAll(".*", "x"); // COMPLIANT + s1 = s1.replaceAll("t", "x"); // $ Alert + s1 = s1.replaceAll(".*", "x"); } } From 441c79ebdf999dfb4802dcf2a418770da72eff17 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 25 Mar 2025 11:38:07 +0000 Subject: [PATCH 165/372] Use existing class StringReplaceAllCall --- java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index 02768d6817e..a5918c642ea 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -11,9 +11,8 @@ import java -from MethodCall replaceAllCall +from StringReplaceAllCall replaceAllCall where - replaceAllCall.getMethod().hasQualifiedName("java.lang", "String", "replaceAll") and //only contains characters that could be a simple string replaceAllCall.getArgument(0).(StringLiteral).getValue().regexpMatch("^[a-zA-Z0-9]+$") select replaceAllCall, From fea3d10b97a7d8659b22ce46778f5d550786024b Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 25 Mar 2025 11:41:59 +0000 Subject: [PATCH 166/372] Update qhelp --- java/ql/src/Performance/StringReplaceAllWithNonRegex.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md index d9e8c722782..b5b35fcceff 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md @@ -1,14 +1,14 @@ # Use of `String#replaceAll` with a first argument which is not a regular expression -Using `String.replaceAll` is less performant than `String.replace` when the first argument is not a regular expression. +Using `String#replaceAll` is less performant than `String#replace` when the first argument is not a regular expression. ## Overview -The underlying implementation of `String.replaceAll` uses `Pattern.compile` and expects a regular expression as its first argument. However in cases where the argument could be represented by just a plain `String` that does not represent an interesting regular expression, a call to `String.replace` may be more performant as it does not need to compile the regular expression. +The underlying implementation of `String#replaceAll` uses `Pattern#compile` and expects a regular expression as its first argument. However in cases where the argument could be represented by just a plain `String` that does not represent an interesting regular expression, a call to `String#replace` may be more performant as it does not need to compile the regular expression. ## Recommendation -Use `String.replace` instead where a `replaceAll` call uses a trivial string as its first argument. +Use `String#replace` instead where a `replaceAll` call uses a trivial string as its first argument. ## Example @@ -25,4 +25,4 @@ public class Test { ## References -- [String.replaceAll](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/String.html#replaceAll(java.lang.String,java.lang.String)) +- Java SE Documentation: [String.replaceAll](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/String.html#replaceAll(java.lang.String,java.lang.String)). From 042fe074944033bb6d0ce7ff2fe7ab3cb96b382b Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 25 Mar 2025 11:50:42 +0000 Subject: [PATCH 167/372] Adjust alert message --- java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 8 +++++--- .../StringReplaceAllWithNonRegex.expected | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index a5918c642ea..49198bc5219 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -11,9 +11,11 @@ import java -from StringReplaceAllCall replaceAllCall +from StringReplaceAllCall replaceAllCall, StringLiteral firstArg where + firstArg = replaceAllCall.getArgument(0) and //only contains characters that could be a simple string - replaceAllCall.getArgument(0).(StringLiteral).getValue().regexpMatch("^[a-zA-Z0-9]+$") + firstArg.getValue().regexpMatch("^[a-zA-Z0-9]+$") select replaceAllCall, - "Call to 'replaceAll' uses an argument comprised of plain string characters only." + "This call to 'replaceAll' should be a call `replace` as its $@ is not a regular expression.", + firstArg, "first argument" diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected index f47e86d1f0e..c64ee0db334 100644 --- a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected @@ -1 +1 @@ -| Test.java:4:14:4:36 | replaceAll(...) | Call to 'replaceAll' uses an argument comprised of plain string characters only. | +| Test.java:4:14:4:36 | replaceAll(...) | This call to 'replaceAll' should be a call `replace` as its $@ is not a regular expression. | Test.java:4:28:4:30 | "t" | first argument | From c4e56b1ec8cf4911577cc72f9d6809c3e18efe3e Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 25 Mar 2025 13:44:21 +0000 Subject: [PATCH 168/372] Add quality and cwe tag to query CWE-1176: Inefficient CPU Computation --- java/ql/src/Performance/StringReplaceAllWithNonRegex.md | 1 + java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 2 ++ 2 files changed, 3 insertions(+) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md index b5b35fcceff..4b14303bd7a 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md @@ -26,3 +26,4 @@ public class Test { ## References - Java SE Documentation: [String.replaceAll](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/String.html#replaceAll(java.lang.String,java.lang.String)). +- Common Weakness Enumeration: [CWE-1176](https://cwe.mitre.org/data/definitions/1176.html) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index 49198bc5219..3f0fb5829dd 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -7,6 +7,8 @@ * @precision very-high * @problem.severity recommendation * @tags performance + * quality + * external/cwe/cwe-1176 */ import java From 626a7d50074befe1092981198c7ca7d8d67ac310 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 26 Mar 2025 10:19:31 +0000 Subject: [PATCH 169/372] Fix punctuation --- java/ql/src/Performance/StringReplaceAllWithNonRegex.md | 2 +- java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md index 4b14303bd7a..a297ad519f8 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md @@ -26,4 +26,4 @@ public class Test { ## References - Java SE Documentation: [String.replaceAll](https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/String.html#replaceAll(java.lang.String,java.lang.String)). -- Common Weakness Enumeration: [CWE-1176](https://cwe.mitre.org/data/definitions/1176.html) +- Common Weakness Enumeration: [CWE-1176](https://cwe.mitre.org/data/definitions/1176.html). diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index 3f0fb5829dd..d02a7ff0a08 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -19,5 +19,5 @@ where //only contains characters that could be a simple string firstArg.getValue().regexpMatch("^[a-zA-Z0-9]+$") select replaceAllCall, - "This call to 'replaceAll' should be a call `replace` as its $@ is not a regular expression.", + "This call to 'replaceAll' should be a call to 'replace' as its $@ is not a regular expression.", firstArg, "first argument" From 04ec1d783062d709442d60fa9789977139ebff45 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 26 Mar 2025 11:01:09 +0000 Subject: [PATCH 170/372] Update test expectations --- .../StringReplaceAllWithNonRegex.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected index c64ee0db334..944dd3d23a3 100644 --- a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/StringReplaceAllWithNonRegex.expected @@ -1 +1 @@ -| Test.java:4:14:4:36 | replaceAll(...) | This call to 'replaceAll' should be a call `replace` as its $@ is not a regular expression. | Test.java:4:28:4:30 | "t" | first argument | +| Test.java:4:14:4:36 | replaceAll(...) | This call to 'replaceAll' should be a call to 'replace' as its $@ is not a regular expression. | Test.java:4:28:4:30 | "t" | first argument | From e1c5517de71b8f73338c9dcd02582ddb20a03dcb Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 27 Mar 2025 11:40:53 +0000 Subject: [PATCH 171/372] Keep COMPLIANT and NON_COMPLIANT comments in test --- .../test/query-tests/StringReplaceAllWithNonRegex/Test.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java index e3d9dafb531..1465343b8c2 100644 --- a/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java +++ b/java/ql/test/query-tests/StringReplaceAllWithNonRegex/Test.java @@ -1,7 +1,7 @@ public class Test { void f() { String s1 = "test"; - s1 = s1.replaceAll("t", "x"); // $ Alert - s1 = s1.replaceAll(".*", "x"); + s1 = s1.replaceAll("t", "x"); // $ Alert // NON_COMPLIANT + s1 = s1.replaceAll(".*", "x"); // COMPLIANT } } From 3ea5cc1b66670181d96e5cd7e28ca69933f06d13 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 27 Mar 2025 16:00:05 +0000 Subject: [PATCH 172/372] Add query to code-quality query suite --- java/ql/src/codeql-suites/java-code-quality.qls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/ql/src/codeql-suites/java-code-quality.qls b/java/ql/src/codeql-suites/java-code-quality.qls index ac1f52624c4..0f6151a5e8d 100644 --- a/java/ql/src/codeql-suites/java-code-quality.qls +++ b/java/ql/src/codeql-suites/java-code-quality.qls @@ -11,4 +11,5 @@ - java/unused-container - java/input-resource-leak - java/output-resource-leak - - java/type-variable-hides-type \ No newline at end of file + - java/type-variable-hides-type + - java/string-replace-all-with-non-regex From ad89e7980ef1d3eb05bd5917de0aad9db81da668 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Mon, 31 Mar 2025 22:45:02 +0100 Subject: [PATCH 173/372] Tweak documentation --- java/ql/src/Performance/StringReplaceAllWithNonRegex.md | 2 +- java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md index a297ad519f8..6e298b4955b 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.md +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.md @@ -4,7 +4,7 @@ Using `String#replaceAll` is less performant than `String#replace` when the firs ## Overview -The underlying implementation of `String#replaceAll` uses `Pattern#compile` and expects a regular expression as its first argument. However in cases where the argument could be represented by just a plain `String` that does not represent an interesting regular expression, a call to `String#replace` may be more performant as it does not need to compile the regular expression. +The `String#replaceAll` method is designed to work with regular expressions as its first parameter. When you use a simple string without any regex patterns (like special characters or syntax), it's more efficient to use `String#replace` instead. This is because `replaceAll` has to compile the input as a regular expression first, which adds unnecessary overhead when you are just replacing literal text. ## Recommendation diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index d02a7ff0a08..3f662b60cf3 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -1,8 +1,8 @@ /** * @id java/string-replace-all-with-non-regex * @name Use of `String#replaceAll` with a first argument which is not a regular expression - * @description Using `String#replaceAll` is less performant than `String#replace` when the first - * argument is not a regular expression. + * @description Using `String#replaceAll` with a first argument which is not a regular expression + * is less efficient than using `String#replace`. * @kind problem * @precision very-high * @problem.severity recommendation From 576f4cf19f92f82960ff55283229763c432a2576 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 10 Apr 2025 12:20:31 +0100 Subject: [PATCH 174/372] Update tags --- java/ql/src/Performance/StringReplaceAllWithNonRegex.ql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql index 3f662b60cf3..bc05b3bf063 100644 --- a/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +++ b/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql @@ -6,8 +6,9 @@ * @kind problem * @precision very-high * @problem.severity recommendation - * @tags performance - * quality + * @tags quality + * reliability + * performance * external/cwe/cwe-1176 */ From acfcc6d490b985e3726a0a29d9748a686df8368f Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 10 Apr 2025 12:35:42 +0100 Subject: [PATCH 175/372] Sort ids in `java-code-quality.qls` --- java/ql/src/codeql-suites/java-code-quality.qls | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/java/ql/src/codeql-suites/java-code-quality.qls b/java/ql/src/codeql-suites/java-code-quality.qls index 0f6151a5e8d..2eafe785532 100644 --- a/java/ql/src/codeql-suites/java-code-quality.qls +++ b/java/ql/src/codeql-suites/java-code-quality.qls @@ -1,15 +1,15 @@ - queries: . - include: id: - - java/suspicious-date-format - - java/integer-multiplication-cast-to-long - - java/equals-on-unrelated-types - java/contradictory-type-checks - - java/reference-equality-of-boxed-types + - java/equals-on-unrelated-types - java/inconsistent-equals-and-hashcode + - java/input-resource-leak + - java/integer-multiplication-cast-to-long + - java/output-resource-leak + - java/reference-equality-of-boxed-types + - java/string-replace-all-with-non-regex + - java/suspicious-date-format + - java/type-variable-hides-type - java/unchecked-cast-in-equals - java/unused-container - - java/input-resource-leak - - java/output-resource-leak - - java/type-variable-hides-type - - java/string-replace-all-with-non-regex From 78a26cfdb2bb06c4fc3120f2b94762238a157367 Mon Sep 17 00:00:00 2001 From: Felicity Chapman Date: Thu, 10 Apr 2025 13:09:51 +0100 Subject: [PATCH 176/372] Update index.rst --- docs/codeql/query-help/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/query-help/index.rst b/docs/codeql/query-help/index.rst index f9408d1913c..685b7551ea3 100644 --- a/docs/codeql/query-help/index.rst +++ b/docs/codeql/query-help/index.rst @@ -29,9 +29,9 @@ For a full list of the CWEs covered by these queries, see ":doc:`CodeQL CWE cove :hidden: :titlesonly: - actions cpp csharp + actions go java javascript From 171a84609e4ad54ae6cb6dc66fc680ee33883a59 Mon Sep 17 00:00:00 2001 From: Napalys Date: Thu, 10 Apr 2025 14:13:48 +0200 Subject: [PATCH 177/372] Applied copilot suggestion. --- .../Security/CWE-022/TaintedPath/TaintedPath.expected | 6 +++--- .../query-tests/Security/CWE-022/TaintedPath/make-dir.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected index 02fc6c0ce95..08bf15800da 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected @@ -52,7 +52,7 @@ | handlebars.js:11:32:11:39 | filePath | handlebars.js:29:46:29:60 | req.params.path | handlebars.js:11:32:11:39 | filePath | This path depends on a $@. | handlebars.js:29:46:29:60 | req.params.path | user-provided value | | handlebars.js:15:25:15:32 | filePath | handlebars.js:43:15:43:29 | req.params.path | handlebars.js:15:25:15:32 | filePath | This path depends on a $@. | handlebars.js:43:15:43:29 | req.params.path | user-provided value | | hapi.js:15:44:15:51 | filepath | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:15:44:15:51 | filepath | This path depends on a $@. | hapi.js:14:30:14:51 | request ... ilepath | user-provided value | -| make-dir.js:9:19:9:22 | file | make-dir.js:7:18:7:31 | req.query.file | make-dir.js:9:19:9:22 | file | This path depends on a $@. | make-dir.js:7:18:7:31 | req.query.file | user-provided value | +| make-dir.js:9:25:9:28 | file | make-dir.js:7:18:7:31 | req.query.file | make-dir.js:9:25:9:28 | file | This path depends on a $@. | make-dir.js:7:18:7:31 | req.query.file | user-provided value | | make-dir.js:10:23:10:26 | file | make-dir.js:7:18:7:31 | req.query.file | make-dir.js:10:23:10:26 | file | This path depends on a $@. | make-dir.js:7:18:7:31 | req.query.file | user-provided value | | mkdirp.js:11:12:11:18 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:11:12:11:18 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | | mkdirp.js:12:17:12:23 | dirPath | mkdirp.js:9:42:9:59 | req.query.filename | mkdirp.js:12:17:12:23 | dirPath | This path depends on a $@. | mkdirp.js:9:42:9:59 | req.query.filename | user-provided value | @@ -405,7 +405,7 @@ edges | handlebars.js:43:15:43:29 | req.params.path | handlebars.js:13:73:13:80 | filePath | provenance | | | hapi.js:14:19:14:51 | filepath | hapi.js:15:44:15:51 | filepath | provenance | | | hapi.js:14:30:14:51 | request ... ilepath | hapi.js:14:19:14:51 | filepath | provenance | | -| make-dir.js:7:11:7:31 | file | make-dir.js:9:19:9:22 | file | provenance | | +| make-dir.js:7:11:7:31 | file | make-dir.js:9:25:9:28 | file | provenance | | | make-dir.js:7:11:7:31 | file | make-dir.js:10:23:10:26 | file | provenance | | | make-dir.js:7:18:7:31 | req.query.file | make-dir.js:7:11:7:31 | file | provenance | | | mkdirp.js:9:11:9:76 | dirPath | mkdirp.js:11:12:11:18 | dirPath | provenance | | @@ -956,7 +956,7 @@ nodes | hapi.js:15:44:15:51 | filepath | semmle.label | filepath | | make-dir.js:7:11:7:31 | file | semmle.label | file | | make-dir.js:7:18:7:31 | req.query.file | semmle.label | req.query.file | -| make-dir.js:9:19:9:22 | file | semmle.label | file | +| make-dir.js:9:25:9:28 | file | semmle.label | file | | make-dir.js:10:23:10:26 | file | semmle.label | file | | mkdirp.js:9:11:9:76 | dirPath | semmle.label | dirPath | | mkdirp.js:9:21:9:76 | path.jo ... ltDir') | semmle.label | path.jo ... ltDir') | diff --git a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js index 59b0cfe8d8c..2306e00bcae 100644 --- a/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js +++ b/javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/make-dir.js @@ -3,9 +3,9 @@ import { makeDirectory, makeDirectorySync } from 'make-dir'; const express = require('express'); const app = express(); -app.get('/makedir', (req, res) => { +app.get('/makedir', async (req, res) => { const file = req.query.file; // $ Source - makeDirectory(file); // $ Alert + await makeDirectory(file); // $ Alert makeDirectorySync(file); // $ Alert }); From 81cba7fa2f8e873ec8532004426aa17efafa2410 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 31 Mar 2025 13:50:56 +0200 Subject: [PATCH 178/372] Added test cases with missing alerts for `Request` and `NextRequest`. --- .../Request/app/api/proxy/route.serverSide.ts | 5 +++++ .../Request/app/api/proxy/route2.serverSide.ts | 8 ++++++++ .../Security/CWE-918/Request/package.json | 13 +++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts create mode 100644 javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts create mode 100644 javascript/ql/test/query-tests/Security/CWE-918/Request/package.json diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts new file mode 100644 index 00000000000..bfee2442afb --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts @@ -0,0 +1,5 @@ +export async function POST(req: Request) { + const { url } = await req.json(); // $ MISSING: Source[js/request-forgery] + const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + return new Response(res.body, { headers: res.headers }); +} diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts new file mode 100644 index 00000000000..7b212a73542 --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts @@ -0,0 +1,8 @@ +import { NextRequest, NextResponse } from 'next/server'; + +export async function POST(req: NextRequest) { + const { url } = await req.json(); // $ MISSING: Source[js/request-forgery] + const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const data = await res.text(); + return new NextResponse(data, { headers: res.headers }); +} diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/package.json b/javascript/ql/test/query-tests/Security/CWE-918/Request/package.json new file mode 100644 index 00000000000..329c7acb823 --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/package.json @@ -0,0 +1,13 @@ +{ + "name": "next-edge-proxy-app", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start" + }, + "dependencies": { + "next": "15.1.7" + } +} From 63a3953b0cdab643d356ad4234c4f18510cfbc03 Mon Sep 17 00:00:00 2001 From: Napalys Date: Mon, 31 Mar 2025 13:57:43 +0200 Subject: [PATCH 179/372] Enhance Next.js API endpoint handling for compatibility with both Pages and App Router structures. --- .../lib/semmle/javascript/frameworks/Next.qll | 58 ++++++++++++++++++- .../Request/app/api/proxy/route.serverSide.ts | 4 +- .../app/api/proxy/route2.serverSide.ts | 4 +- .../Security/CWE-918/RequestForgery.expected | 20 +++++++ 4 files changed, 80 insertions(+), 6 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll index 8fce608a970..6333c9442d8 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll @@ -213,10 +213,12 @@ module NextJS { /** * Gets a folder that contains API endpoints for a Next.js application. * These API endpoints act as Express-like route-handlers. + * It matches both the Pages Router (`pages/api/`) Next.js 12 or earlier and + * the App Router (`app/api/`) Next.js 13+ structures. */ Folder apiFolder() { - result = getANextPackage().getFile().getParentContainer().getFolder("pages").getFolder("api") - or + result = + getANextPackage().getFile().getParentContainer().getFolder(["pages", "app"]).getFolder("api") or result = apiFolder().getAFolder() } @@ -271,4 +273,56 @@ module NextJS { override string getCredentialsKind() { result = "jwt key" } } } + + /** + * A route handler for Next.js 13+ App Router API endpoints, which are defined by exporting + * HTTP method functions (like `GET`, `POST`, `PUT`, `DELETE`) from route.js files inside + * the `app/api/` directory. + */ + class NextAppRouteHandler extends DataFlow::FunctionNode, Http::Servers::StandardRouteHandler { + NextAppRouteHandler() { + exists(Module mod | mod.getFile().getParentContainer() = apiFolder() | + this = mod.getAnExportedValue(any(Http::RequestMethodName m)).getAFunctionValue() and + ( + this.getParameter(0).hasUnderlyingType("next/server", "NextRequest") + or + this.getParameter(0).hasUnderlyingType("Request") + ) + ) + } + + /** + * Gets the request parameter, which is either a `NextRequest` object (from `next/server`) or a standard web `Request` object. + */ + DataFlow::SourceNode getRequest() { result = this.getParameter(0) } + } + + /** + * A source of user-controlled data from a `NextRequest` object (from `next/server`) or a standard web `Request` object + * in a Next.js App Router route handler. + */ + class NextAppRequestSource extends Http::RequestInputAccess { + NextAppRouteHandler handler; + string kind; + + NextAppRequestSource() { + ( + this = + handler.getRequest().getAMethodCall(["json", "formData", "blob", "arrayBuffer", "text"]) + or + this = handler.getRequest().getAPropertyRead("body") + ) and + kind = "body" + or + this = handler.getRequest().getAPropertyRead(["url", "nextUrl"]) and kind = "url" + or + this = handler.getRequest().getAPropertyRead("headers") and kind = "headers" + } + + override string getKind() { result = kind } + + override Http::RouteHandler getRouteHandler() { result = handler } + + override string getSourceType() { result = "Next.js App Router request" } + } } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts index bfee2442afb..f3d05b7e5aa 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts @@ -1,5 +1,5 @@ export async function POST(req: Request) { - const { url } = await req.json(); // $ MISSING: Source[js/request-forgery] - const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const { url } = await req.json(); // $ Source[js/request-forgery] + const res = await fetch(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] return new Response(res.body, { headers: res.headers }); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts index 7b212a73542..051ba67e401 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts @@ -1,8 +1,8 @@ import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) { - const { url } = await req.json(); // $ MISSING: Source[js/request-forgery] - const res = await fetch(url); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const { url } = await req.json(); // $ Source[js/request-forgery] + const res = await fetch(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] const data = await res.text(); return new NextResponse(data, { headers: res.headers }); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index 78b02c5f7db..b8436fa6722 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -1,4 +1,6 @@ #select +| Request/app/api/proxy/route2.serverSide.ts:5:21:5:30 | fetch(url) | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | URL | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | user-provided value | +| Request/app/api/proxy/route.serverSide.ts:3:21:3:30 | fetch(url) | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | URL | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | user-provided value | | apollo.serverSide.ts:8:39:8:64 | get(fil ... => {}) | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:8:43:8:50 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:8:43:8:50 | file.url | URL | apollo.serverSide.ts:7:36:7:44 | { files } | user-provided value | | apollo.serverSide.ts:18:37:18:62 | get(fil ... => {}) | apollo.serverSide.ts:17:34:17:42 | { files } | apollo.serverSide.ts:18:41:18:48 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:18:41:18:48 | file.url | URL | apollo.serverSide.ts:17:34:17:42 | { files } | user-provided value | | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | The $@ of this request depends on a $@. | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | endpoint | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | user-provided value | @@ -27,6 +29,14 @@ | serverSide.js:125:5:128:6 | axios({ ... \\n }) | serverSide.js:123:29:123:35 | req.url | serverSide.js:127:14:127:20 | tainted | The $@ of this request depends on a $@. | serverSide.js:127:14:127:20 | tainted | URL | serverSide.js:123:29:123:35 | req.url | user-provided value | | serverSide.js:131:5:131:20 | axios.get(myUrl) | serverSide.js:123:29:123:35 | req.url | serverSide.js:131:15:131:19 | myUrl | The $@ of this request depends on a $@. | serverSide.js:131:15:131:19 | myUrl | URL | serverSide.js:123:29:123:35 | req.url | user-provided value | edges +| Request/app/api/proxy/route2.serverSide.ts:4:9:4:15 | { url } | Request/app/api/proxy/route2.serverSide.ts:4:9:4:34 | url | provenance | | +| Request/app/api/proxy/route2.serverSide.ts:4:9:4:34 | url | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | provenance | | +| Request/app/api/proxy/route2.serverSide.ts:4:19:4:34 | await req.json() | Request/app/api/proxy/route2.serverSide.ts:4:9:4:15 | { url } | provenance | | +| Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | Request/app/api/proxy/route2.serverSide.ts:4:19:4:34 | await req.json() | provenance | | +| Request/app/api/proxy/route.serverSide.ts:2:9:2:15 | { url } | Request/app/api/proxy/route.serverSide.ts:2:9:2:34 | url | provenance | | +| Request/app/api/proxy/route.serverSide.ts:2:9:2:34 | url | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | provenance | | +| Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | Request/app/api/proxy/route.serverSide.ts:2:9:2:15 | { url } | provenance | | +| Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | provenance | | | apollo.serverSide.ts:7:36:7:44 | files | apollo.serverSide.ts:8:13:8:17 | files | provenance | | | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:7:36:7:44 | files | provenance | | | apollo.serverSide.ts:8:13:8:17 | files | apollo.serverSide.ts:8:28:8:31 | file | provenance | | @@ -91,6 +101,16 @@ edges | serverSide.js:130:9:130:45 | myUrl | serverSide.js:131:15:131:19 | myUrl | provenance | | | serverSide.js:130:37:130:43 | tainted | serverSide.js:130:9:130:45 | myUrl | provenance | | nodes +| Request/app/api/proxy/route2.serverSide.ts:4:9:4:15 | { url } | semmle.label | { url } | +| Request/app/api/proxy/route2.serverSide.ts:4:9:4:34 | url | semmle.label | url | +| Request/app/api/proxy/route2.serverSide.ts:4:19:4:34 | await req.json() | semmle.label | await req.json() | +| Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | semmle.label | req.json() | +| Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | semmle.label | url | +| Request/app/api/proxy/route.serverSide.ts:2:9:2:15 | { url } | semmle.label | { url } | +| Request/app/api/proxy/route.serverSide.ts:2:9:2:34 | url | semmle.label | url | +| Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | semmle.label | await req.json() | +| Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | semmle.label | req.json() | +| Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | semmle.label | url | | apollo.serverSide.ts:7:36:7:44 | files | semmle.label | files | | apollo.serverSide.ts:7:36:7:44 | { files } | semmle.label | { files } | | apollo.serverSide.ts:8:13:8:17 | files | semmle.label | files | From a1dc87496a02c1eeb538630fd867c8a189256fd9 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 13:56:38 +0100 Subject: [PATCH 180/372] Shared: Replace a 'count' with a 'strictcount' to prevent a CP when testing on C++. --- .../codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index 0678d07e7f4..61b6b2434dc 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -687,7 +687,7 @@ module MakeModelGenerator< private DataFlow::ParameterNode parameter; ContentDataFlowSummaryTargetApi() { - count(string input, string output | + strictcount(string input, string output | exists( PropagateContentFlow::AccessPath reads, ReturnNodeExt returnNodeExt, PropagateContentFlow::AccessPath stores From 8acb0243ada91759d96d24121dc625d5b39db9a2 Mon Sep 17 00:00:00 2001 From: Napalys Date: Tue, 1 Apr 2025 14:14:27 +0200 Subject: [PATCH 181/372] Added test cases for `NextResponse` and `Response` --- .../ReflectedXss/ReflectedXss.expected | 17 ++++++++++ .../ReflectedXssWithCustomSanitizer.expected | 4 +++ .../CWE-079/ReflectedXss/app/api/route.ts | 30 +++++++++++++++++ .../ReflectedXss/app/api/routeNextRequest.ts | 32 +++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/route.ts create mode 100644 javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected index 75bef3e1b3b..d4462e6064b 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected @@ -27,6 +27,10 @@ | ReflectedXssContentTypes.js:39:13:39:35 | "FOO: " ... rams.id | ReflectedXssContentTypes.js:39:23:39:35 | req.params.id | ReflectedXssContentTypes.js:39:13:39:35 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to a $@. | ReflectedXssContentTypes.js:39:23:39:35 | req.params.id | user-provided value | | ReflectedXssContentTypes.js:70:12:70:34 | "FOO: " ... rams.id | ReflectedXssContentTypes.js:70:22:70:34 | req.params.id | ReflectedXssContentTypes.js:70:12:70:34 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to a $@. | ReflectedXssContentTypes.js:70:22:70:34 | req.params.id | user-provided value | | ReflectedXssGood3.js:139:12:139:27 | escapeHtml3(url) | ReflectedXssGood3.js:135:15:135:27 | req.params.id | ReflectedXssGood3.js:139:12:139:27 | escapeHtml3(url) | Cross-site scripting vulnerability due to a $@. | ReflectedXssGood3.js:135:15:135:27 | req.params.id | user-provided value | +| app/api/route.ts:5:18:5:21 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:5:18:5:21 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/route.ts:13:18:13:21 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:13:18:13:21 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/route.ts:25:18:25:21 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:25:18:25:21 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/route.ts:29:25:29:28 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:29:25:29:28 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | | etherpad.js:11:12:11:19 | response | etherpad.js:9:16:9:30 | req.query.jsonp | etherpad.js:11:12:11:19 | response | Cross-site scripting vulnerability due to a $@. | etherpad.js:9:16:9:30 | req.query.jsonp | user-provided value | | formatting.js:6:14:6:47 | util.fo ... , evil) | formatting.js:4:16:4:29 | req.query.evil | formatting.js:6:14:6:47 | util.fo ... , evil) | Cross-site scripting vulnerability due to a $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | | formatting.js:7:14:7:53 | require ... , evil) | formatting.js:4:16:4:29 | req.query.evil | formatting.js:7:14:7:53 | require ... , evil) | Cross-site scripting vulnerability due to a $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | @@ -128,6 +132,12 @@ edges | ReflectedXssGood3.js:135:15:135:27 | req.params.id | ReflectedXssGood3.js:135:9:135:27 | url | provenance | | | ReflectedXssGood3.js:139:24:139:26 | url | ReflectedXssGood3.js:68:22:68:26 | value | provenance | | | ReflectedXssGood3.js:139:24:139:26 | url | ReflectedXssGood3.js:139:12:139:27 | escapeHtml3(url) | provenance | | +| app/api/route.ts:2:11:2:33 | body | app/api/route.ts:5:18:5:21 | body | provenance | | +| app/api/route.ts:2:11:2:33 | body | app/api/route.ts:13:18:13:21 | body | provenance | | +| app/api/route.ts:2:11:2:33 | body | app/api/route.ts:25:18:25:21 | body | provenance | | +| app/api/route.ts:2:11:2:33 | body | app/api/route.ts:29:25:29:28 | body | provenance | | +| app/api/route.ts:2:18:2:33 | await req.json() | app/api/route.ts:2:11:2:33 | body | provenance | | +| app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:2:18:2:33 | await req.json() | provenance | | | etherpad.js:9:5:9:53 | response | etherpad.js:11:12:11:19 | response | provenance | | | etherpad.js:9:16:9:30 | req.query.jsonp | etherpad.js:9:5:9:53 | response | provenance | | | formatting.js:4:9:4:29 | evil | formatting.js:6:43:6:46 | evil | provenance | | @@ -309,6 +319,13 @@ nodes | ReflectedXssGood3.js:135:15:135:27 | req.params.id | semmle.label | req.params.id | | ReflectedXssGood3.js:139:12:139:27 | escapeHtml3(url) | semmle.label | escapeHtml3(url) | | ReflectedXssGood3.js:139:24:139:26 | url | semmle.label | url | +| app/api/route.ts:2:11:2:33 | body | semmle.label | body | +| app/api/route.ts:2:18:2:33 | await req.json() | semmle.label | await req.json() | +| app/api/route.ts:2:24:2:33 | req.json() | semmle.label | req.json() | +| app/api/route.ts:5:18:5:21 | body | semmle.label | body | +| app/api/route.ts:13:18:13:21 | body | semmle.label | body | +| app/api/route.ts:25:18:25:21 | body | semmle.label | body | +| app/api/route.ts:29:25:29:28 | body | semmle.label | body | | etherpad.js:9:5:9:53 | response | semmle.label | response | | etherpad.js:9:16:9:30 | req.query.jsonp | semmle.label | req.query.jsonp | | etherpad.js:11:12:11:19 | response | semmle.label | response | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected index 5532af3cf11..8fb9524ff45 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected @@ -26,6 +26,10 @@ | ReflectedXssContentTypes.js:39:13:39:35 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to $@. | ReflectedXssContentTypes.js:39:23:39:35 | req.params.id | user-provided value | | ReflectedXssContentTypes.js:70:12:70:34 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to $@. | ReflectedXssContentTypes.js:70:22:70:34 | req.params.id | user-provided value | | ReflectedXssGood3.js:139:12:139:27 | escapeHtml3(url) | Cross-site scripting vulnerability due to $@. | ReflectedXssGood3.js:135:15:135:27 | req.params.id | user-provided value | +| app/api/route.ts:5:18:5:21 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/route.ts:13:18:13:21 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/route.ts:25:18:25:21 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/route.ts:29:25:29:28 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | | formatting.js:6:14:6:47 | util.fo ... , evil) | Cross-site scripting vulnerability due to $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | | formatting.js:7:14:7:53 | require ... , evil) | Cross-site scripting vulnerability due to $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | | live-server.js:6:13:6:50 | ` ... /html>` | Cross-site scripting vulnerability due to $@. | live-server.js:4:21:4:27 | req.url | user-provided value | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/route.ts b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/route.ts new file mode 100644 index 00000000000..467f02a8ff8 --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/route.ts @@ -0,0 +1,30 @@ +export async function POST(req: Request) { + const body = await req.json(); // $ Source + + new Response(body, {headers: { 'Content-Type': 'application/json' }}); + new Response(body, {headers: { 'Content-Type': 'text/html' }}); // $ Alert + + const headers2 = new Headers(req.headers); + headers2.append('Content-Type', 'application/json'); + new Response(body, { headers: headers2 }); + + const headers3 = new Headers(req.headers); + headers3.append('Content-Type', 'text/html'); + new Response(body, { headers: headers3 }); // $ Alert + + const headers4 = new Headers({ + ...Object.fromEntries(req.headers), + 'Content-Type': 'application/json' + }); + new Response(body, { headers: headers4 }); + + const headers5 = new Headers({ + ...Object.fromEntries(req.headers), + 'Content-Type': 'text/html' + }); + new Response(body, { headers: headers5 }); // $ Alert + + const headers = new Headers(req.headers); + headers.set('Content-Type', 'text/html'); + return new Response(body, { headers }); // $ Alert +} diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts new file mode 100644 index 00000000000..758b91e1caa --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts @@ -0,0 +1,32 @@ +import { NextRequest, NextResponse } from 'next/server'; + +export async function POST(req: NextRequest) { + const body = await req.json(); // $ MISSING: Source + + new NextResponse(body, {headers: { 'Content-Type': 'application/json' }}); + new NextResponse(body, {headers: { 'Content-Type': 'text/html' }}); // $ MISSING: Alert + + const headers2 = new Headers(req.headers); + headers2.append('Content-Type', 'application/json'); + new NextResponse(body, { headers: headers2 }); + + const headers3 = new Headers(req.headers); + headers3.append('Content-Type', 'text/html'); + new NextResponse(body, { headers: headers3 }); // $ MISSING: Alert + + const headers4 = new Headers({ + ...Object.fromEntries(req.headers), + 'Content-Type': 'application/json' + }); + new NextResponse(body, { headers: headers4 }); + + const headers5 = new Headers({ + ...Object.fromEntries(req.headers), + 'Content-Type': 'text/html' + }); + new NextResponse(body, { headers: headers5 }); // $ MISSING: Alert + + const headers = new Headers(req.headers); + headers.set('Content-Type', 'text/html'); + return new NextResponse(body, { headers }); // $ MISSING: Alert +} From 732fcbf1c908abbe7f6976e7aff17712eca8ab89 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 13:58:59 +0100 Subject: [PATCH 182/372] Shared: Move 'asParameter' out of the class signature. --- .../modelgenerator/internal/ModelGeneratorImpl.qll | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index 61b6b2434dc..270301f361d 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -55,11 +55,8 @@ signature module ModelGeneratorInputSig */ Callable getAsExprEnclosingCallable(); - /** - * Gets the parameter corresponding to this node, if any. - */ - Parameter asParameter(); - } + /** Gets the parameter corresponding to this node, if any. */ + Parameter asParameter(NodeExtended n); /** * A class of callables that are potentially relevant for generating summary or @@ -390,7 +387,7 @@ module MakeModelGenerator< * Gets the MaD string representation of the parameter node `p`. */ string parameterNodeAsInput(DataFlow::ParameterNode p) { - result = parameterAccess(p.(NodeExtended).asParameter()) + result = parameterAccess(asParameter(p)) or result = qualifierString() and p instanceof InstanceParameterNode } @@ -613,7 +610,7 @@ module MakeModelGenerator< * when used in content flow. */ private string parameterNodeAsContentInput(DataFlow::ParameterNode p) { - result = parameterContentAccess(p.(NodeExtended).asParameter()) + result = parameterContentAccess(asParameter(p)) or result = qualifierString() and p instanceof InstanceParameterNode } From c484945f395d31e7c6c131ef373baf467ca8b555 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:00:11 +0100 Subject: [PATCH 183/372] Shared: Move 'getEnclosingCallable' and 'getAsExprEnclosingCallable' out of the class signature. --- .../internal/ModelGeneratorImpl.qll | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index 270301f361d..da06e74e10f 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -44,16 +44,15 @@ signature module ModelGeneratorInputSig * Gets the type of this node. */ Type getType(); + } - /** - * Gets the enclosing callable of this node. - */ - Callable getEnclosingCallable(); + /** Gets the enclosing callable of `node`. */ + Callable getEnclosingCallable(NodeExtended node); - /** - * Gets the enclosing callable of this node, when considered as an expression. - */ - Callable getAsExprEnclosingCallable(); + /** + * Gets the enclosing callable of `node`, when considered as an expression. + */ + Callable getAsExprEnclosingCallable(NodeExtended node); /** Gets the parameter corresponding to this node, if any. */ Parameter asParameter(NodeExtended n); @@ -462,7 +461,7 @@ module MakeModelGenerator< predicate isSource(DataFlow::Node source, FlowState state) { source instanceof DataFlow::ParameterNode and exists(Callable c | - c = source.(NodeExtended).getEnclosingCallable() and + c = getEnclosingCallable(source) and c instanceof DataFlowSummaryTargetApi and not isUninterestingForHeuristicDataFlowModels(c) ) and @@ -472,7 +471,7 @@ module MakeModelGenerator< predicate isSink(DataFlow::Node sink, FlowState state) { sink instanceof ReturnNodeExt and not isOwnInstanceAccessNode(sink) and - not exists(captureQualifierFlow(sink.(NodeExtended).getAsExprEnclosingCallable())) and + not exists(captureQualifierFlow(getAsExprEnclosingCallable(sink))) and (state instanceof TaintRead or state instanceof TaintStore) } @@ -516,8 +515,8 @@ module MakeModelGenerator< DataFlowSummaryTargetApi api, DataFlow::ParameterNode p, ReturnNodeExt returnNodeExt ) { exists(string input, string output | - p.(NodeExtended).getEnclosingCallable() = api and - returnNodeExt.getEnclosingCallable() = api and + getEnclosingCallable(p) = api and + getEnclosingCallable(returnNodeExt) = api and input = parameterNodeAsInput(p) and output = getOutput(returnNodeExt) and input != output and @@ -567,11 +566,12 @@ module MakeModelGenerator< private module PropagateContentFlowConfig implements ContentDataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { source instanceof DataFlow::ParameterNode and - source.(NodeExtended).getEnclosingCallable() instanceof DataFlowSummaryTargetApi + getEnclosingCallable(source) instanceof DataFlowSummaryTargetApi } predicate isSink(DataFlow::Node sink) { - sink.(ReturnNodeExt).getEnclosingCallable() instanceof DataFlowSummaryTargetApi + sink instanceof ReturnNodeExt and + getEnclosingCallable(sink) instanceof DataFlowSummaryTargetApi } predicate isAdditionalFlowStep = isAdditionalContentFlowStep/2; @@ -664,8 +664,8 @@ module MakeModelGenerator< PropagateContentFlow::AccessPath stores, boolean preservesValue ) { PropagateContentFlow::flow(p, reads, returnNodeExt, stores, preservesValue) and - returnNodeExt.getEnclosingCallable() = api and - p.(NodeExtended).getEnclosingCallable() = api + getEnclosingCallable(returnNodeExt) = api and + getEnclosingCallable(p) = api } /** @@ -709,8 +709,8 @@ module MakeModelGenerator< PropagateContentFlow::AccessPath stores, boolean preservesValue ) { PropagateContentFlow::flow(p, reads, returnNodeExt, stores, preservesValue) and - returnNodeExt.getEnclosingCallable() = api and - p.(NodeExtended).getEnclosingCallable() = api and + getEnclosingCallable(returnNodeExt) = api and + getEnclosingCallable(p) = api and p = api.getARelevantParameterNode() } @@ -982,7 +982,8 @@ module MakeModelGenerator< } predicate isSink(DataFlow::Node sink) { - sink.(ReturnNodeExt).getEnclosingCallable() instanceof DataFlowSourceTargetApi + sink instanceof ReturnNodeExt and + getEnclosingCallable(sink) instanceof DataFlowSourceTargetApi } DataFlow::FlowFeature getAFeature() { result instanceof DataFlow::FeatureHasSinkCallContext } @@ -1005,8 +1006,8 @@ module MakeModelGenerator< exists(NodeExtended source, ReturnNodeExt sink, string kind | PropagateFromSource::flow(source, sink) and sourceNode(source, kind) and - api = sink.getEnclosingCallable() and - not irrelevantSourceSinkApi(source.getEnclosingCallable(), api) and + api = getEnclosingCallable(sink) and + not irrelevantSourceSinkApi(getEnclosingCallable(source), api) and result = ModelPrinting::asSourceModel(api, getOutput(sink), kind) ) } @@ -1021,7 +1022,7 @@ module MakeModelGenerator< module PropagateToSinkConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { apiSource(source) and - source.(NodeExtended).getEnclosingCallable() instanceof DataFlowSinkTargetApi + getEnclosingCallable(source) instanceof DataFlowSinkTargetApi } predicate isSink(DataFlow::Node sink) { @@ -1050,7 +1051,7 @@ module MakeModelGenerator< exists(NodeExtended src, NodeExtended sink, string kind | PropagateToSink::flow(src, sink) and sinkNode(sink, kind) and - api = src.getEnclosingCallable() and + api = getEnclosingCallable(src) and result = ModelPrinting::asSinkModel(api, asInputArgument(src), kind) ) } From 04bf908a4bcb26179988550f84bdf4f4c2cb2635 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:01:00 +0100 Subject: [PATCH 184/372] C#: Fixup MaD input. --- .../utils/modelgenerator/internal/CaptureModels.qll | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 125204d7c5b..ce83369df07 100644 --- a/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/csharp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -22,10 +22,16 @@ module ModelGeneratorInput implements ModelGeneratorInputSig`. */ From b6c658767e23f0c74d7825bbcf65fd9584948d24 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:01:11 +0100 Subject: [PATCH 185/372] Java: Fixup MaD input. --- .../utils/modelgenerator/internal/CaptureModels.qll | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 1f96d8ad296..9dd317b3006 100644 --- a/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/java/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -32,10 +32,16 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Thu, 10 Apr 2025 14:01:20 +0100 Subject: [PATCH 186/372] Rust: Fixup MaD input. --- .../modelgenerator/internal/CaptureModels.qll | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 3a14f6a4a48..237da46750b 100644 --- a/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/rust/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -20,15 +20,17 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Thu, 10 Apr 2025 14:02:31 +0100 Subject: [PATCH 187/372] Shared: Provide a hook to MaD generation to modify the 'ReturnValue' string. --- .../internal/ModelGeneratorImpl.qll | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll index da06e74e10f..37934b92114 100644 --- a/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll +++ b/shared/mad/codeql/mad/modelgenerator/internal/ModelGeneratorImpl.qll @@ -222,6 +222,14 @@ signature module ModelGeneratorInputSig */ default Lang::ParameterPosition getReturnKindParamPosition(Lang::ReturnKind node) { none() } + /** + * Gets the string that represents the return value corresponding to the + * return kind `kind`. + * + * For most languages this will be the string "ReturnValue". + */ + default string getReturnValueString(Lang::ReturnKind kind) { result = "ReturnValue" } + /** * Holds if it is irrelevant to generate models for `api` based on data flow analysis. * @@ -317,9 +325,11 @@ module MakeModelGenerator< private module PrintReturnNodeExt { string getOutput(ReturnNodeExt node) { - node.getKind() instanceof DataFlow::ValueReturnKind and - not exists(node.getPosition()) and - result = "ReturnValue" + exists(DataFlow::ValueReturnKind valueReturnKind | + valueReturnKind = node.getKind() and + not exists(node.getPosition()) and + result = getReturnValueString(valueReturnKind.getKind()) + ) or exists(DataFlow::ParameterPosition pos | pos = node.getPosition() and From a578f44af4a19f9eff6f1bdf28f66295867884ed Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Thu, 10 Apr 2025 14:40:59 +0200 Subject: [PATCH 188/372] QL4QL: Restrict `ql/qlref-inline-expectations` to `(path-)problem` queries --- ql/ql/src/codeql/files/FileSystem.qll | 2 + ql/ql/src/codeql_ql/ast/Yaml.qll | 71 +++++++++++++++++++ .../queries/style/QlRefInlineExpectations.ql | 6 +- .../ProblemQuery.expected | 0 .../QlRefInlineExpectations/ProblemQuery.ql | 13 ++++ .../QlRefInlineExpectations.expected | 3 +- .../style/QlRefInlineExpectations/Test1.qlref | 2 +- .../style/QlRefInlineExpectations/Test2.qlref | 2 +- .../style/QlRefInlineExpectations/Test3.qlref | 2 +- 9 files changed, 94 insertions(+), 7 deletions(-) create mode 100644 ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.expected create mode 100644 ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql diff --git a/ql/ql/src/codeql/files/FileSystem.qll b/ql/ql/src/codeql/files/FileSystem.qll index 738241a402f..5a219f3b7f0 100644 --- a/ql/ql/src/codeql/files/FileSystem.qll +++ b/ql/ql/src/codeql/files/FileSystem.qll @@ -30,6 +30,8 @@ class Container = Impl::Container; class Folder = Impl::Folder; +module Folder = Impl::Folder; + /** A file. */ class File extends Container, Impl::File { /** Gets a token in this file. */ diff --git a/ql/ql/src/codeql_ql/ast/Yaml.qll b/ql/ql/src/codeql_ql/ast/Yaml.qll index d5e80365ff4..403640c1f84 100644 --- a/ql/ql/src/codeql_ql/ast/Yaml.qll +++ b/ql/ql/src/codeql_ql/ast/Yaml.qll @@ -6,6 +6,7 @@ */ private import codeql.yaml.Yaml as LibYaml +private import codeql.files.FileSystem private module YamlSig implements LibYaml::InputSig { import codeql.Locations @@ -49,6 +50,58 @@ private module YamlSig implements LibYaml::InputSig { import LibYaml::Make +/** A `qlpack.yml` document. */ +class QlPackDocument extends YamlDocument { + QlPackDocument() { this.getFile().getBaseName() = ["qlpack.yml", "qlpack.test.yml"] } + + /** Gets the name of this QL pack. */ + string getPackName() { + exists(YamlMapping n | + n.getDocument() = this and + result = n.lookup("name").(YamlScalar).getValue() + ) + } + + private string getADependencyName() { + exists(YamlMapping n, YamlScalar key | + n.getDocument() = this and + n.lookup("dependencies").(YamlMapping).maps(key, _) and + result = key.getValue() + ) + } + + /** Gets a dependency of this QL pack. */ + QlPackDocument getADependency() { result.getPackName() = this.getADependencyName() } + + private Folder getRootFolder() { result = this.getFile().getParentContainer() } + + /** Gets a folder inside this QL pack. */ + pragma[nomagic] + Folder getAFolder() { + result = this.getRootFolder() + or + exists(Folder mid | + mid = this.getAFolder() and + result.getParentContainer() = mid and + not result = any(QlPackDocument other).getRootFolder() + ) + } +} + +private predicate shouldAppend(QlRefDocument qlref, Folder f, string relativePath) { + relativePath = qlref.getRelativeQueryPath() and + ( + exists(QlPackDocument pack | + pack.getAFolder() = qlref.getFile().getParentContainer() and + f = [pack, pack.getADependency()].getFile().getParentContainer() + ) + or + f = qlref.getFile().getParentContainer() + ) +} + +private predicate shouldAppend(Folder f, string relativePath) { shouldAppend(_, f, relativePath) } + /** A `.qlref` YAML document. */ class QlRefDocument extends YamlDocument { QlRefDocument() { this.getFile().getExtension() = "qlref" } @@ -65,6 +118,24 @@ class QlRefDocument extends YamlDocument { ) } + /** Gets the relative path of the query in this `.qlref` file. */ + string getRelativeQueryPath() { + exists(YamlMapping n | n.getDocument() = this | + result = n.lookup("query").(YamlScalar).getValue() + ) + or + not exists(YamlMapping n | n.getDocument() = this) and + result = this.eval().(YamlScalar).getValue() + } + + /** Gets the query file referenced in this `.qlref` file. */ + File getQueryFile() { + exists(Folder f, string relativePath | + shouldAppend(this, f, relativePath) and + result = Folder::Append::append(f, relativePath) + ) + } + predicate isPrintAst() { this.getFile().getStem() = "PrintAst" or diff --git a/ql/ql/src/queries/style/QlRefInlineExpectations.ql b/ql/ql/src/queries/style/QlRefInlineExpectations.ql index 66c139f683f..7f47f2d06c8 100644 --- a/ql/ql/src/queries/style/QlRefInlineExpectations.ql +++ b/ql/ql/src/queries/style/QlRefInlineExpectations.ql @@ -10,8 +10,10 @@ import ql import codeql_ql.ast.Yaml -from QlRefDocument f +from QlRefDocument f, TopLevel t, QueryDoc doc where not f.usesInlineExpectations() and - not f.isPrintAst() + t.getFile() = f.getQueryFile() and + doc = t.getQLDoc() and + doc.getQueryKind() in ["problem", "path-problem"] select f, "Query test does not use inline test expectations." diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.expected b/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql b/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql new file mode 100644 index 00000000000..fe4867113f3 --- /dev/null +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/ProblemQuery.ql @@ -0,0 +1,13 @@ +/** + * @name Problem query + * @description Description of the problem + * @kind problem + * @problem.severity warning + * @id ql/problem-query + */ + +import ql + +from VarDecl decl +where none() +select decl, "Problem" diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected b/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected index 7dd57a3ef86..9605589e514 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/QlRefInlineExpectations.expected @@ -1,2 +1 @@ -| QlRefInlineExpectations.qlref:1:1:1:40 | queries ... ions.ql | Query test does not use inline test expectations. | -| Test3.qlref:1:1:1:39 | query: ... ists.ql | Query test does not use inline test expectations. | +| Test3.qlref:1:1:1:22 | query: ... uery.ql | Query test does not use inline test expectations. | diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref b/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref index 03dd6f50713..07255415589 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/Test1.qlref @@ -1,2 +1,2 @@ -query: queries/style/OmittableExists.ql +query: ProblemQuery.ql postprocess: utils/test/InlineExpectationsTestQuery.ql \ No newline at end of file diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref b/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref index 414c61f1e9c..a0c03488dae 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/Test2.qlref @@ -1,3 +1,3 @@ -query: queries/style/OmittableExists.ql +query: ProblemQuery.ql postprocess: - utils/test/InlineExpectationsTestQuery.ql \ No newline at end of file diff --git a/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref b/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref index 496512e7b45..5582a96837a 100644 --- a/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref +++ b/ql/ql/test/queries/style/QlRefInlineExpectations/Test3.qlref @@ -1 +1 @@ -query: queries/style/OmittableExists.ql \ No newline at end of file +query: ProblemQuery.ql \ No newline at end of file From 86b64afa13848bdc9bb6cdeeb1a7dee7fc2778d4 Mon Sep 17 00:00:00 2001 From: Napalys Date: Thu, 10 Apr 2025 15:06:44 +0200 Subject: [PATCH 189/372] Added `NextResponse` to the `ResponseCall` class it models similar near idential behaviour. --- .../javascript/frameworks/WebResponse.qll | 7 +++++-- .../CWE-079/ReflectedXss/ReflectedXss.expected | 17 +++++++++++++++++ .../ReflectedXssWithCustomSanitizer.expected | 4 ++++ .../ReflectedXss/app/api/routeNextRequest.ts | 10 +++++----- 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll b/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll index 0e3f93d8099..dfdee73c9d9 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/WebResponse.qll @@ -19,10 +19,13 @@ private class HeadersEntryPoint extends API::EntryPoint { } /** - * A call to the `Response` constructor. + * A call to the `Response` and `NextResponse` constructor. */ private class ResponseCall extends API::InvokeNode { - ResponseCall() { this = any(ResponseEntryPoint e).getANode().getAnInstantiation() } + ResponseCall() { + this = any(ResponseEntryPoint e).getANode().getAnInstantiation() or + this = API::moduleImport("next/server").getMember("NextResponse").getAnInstantiation() + } } /** diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected index d4462e6064b..5681ae99aa8 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXss.expected @@ -31,6 +31,10 @@ | app/api/route.ts:13:18:13:21 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:13:18:13:21 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | | app/api/route.ts:25:18:25:21 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:25:18:25:21 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | | app/api/route.ts:29:25:29:28 | body | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:29:25:29:28 | body | Cross-site scripting vulnerability due to a $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:7:20:7:23 | body | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | app/api/routeNextRequest.ts:7:20:7:23 | body | Cross-site scripting vulnerability due to a $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:15:20:15:23 | body | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | app/api/routeNextRequest.ts:15:20:15:23 | body | Cross-site scripting vulnerability due to a $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:27:20:27:23 | body | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | app/api/routeNextRequest.ts:27:20:27:23 | body | Cross-site scripting vulnerability due to a $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:31:27:31:30 | body | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | app/api/routeNextRequest.ts:31:27:31:30 | body | Cross-site scripting vulnerability due to a $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | | etherpad.js:11:12:11:19 | response | etherpad.js:9:16:9:30 | req.query.jsonp | etherpad.js:11:12:11:19 | response | Cross-site scripting vulnerability due to a $@. | etherpad.js:9:16:9:30 | req.query.jsonp | user-provided value | | formatting.js:6:14:6:47 | util.fo ... , evil) | formatting.js:4:16:4:29 | req.query.evil | formatting.js:6:14:6:47 | util.fo ... , evil) | Cross-site scripting vulnerability due to a $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | | formatting.js:7:14:7:53 | require ... , evil) | formatting.js:4:16:4:29 | req.query.evil | formatting.js:7:14:7:53 | require ... , evil) | Cross-site scripting vulnerability due to a $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | @@ -138,6 +142,12 @@ edges | app/api/route.ts:2:11:2:33 | body | app/api/route.ts:29:25:29:28 | body | provenance | | | app/api/route.ts:2:18:2:33 | await req.json() | app/api/route.ts:2:11:2:33 | body | provenance | | | app/api/route.ts:2:24:2:33 | req.json() | app/api/route.ts:2:18:2:33 | await req.json() | provenance | | +| app/api/routeNextRequest.ts:4:9:4:31 | body | app/api/routeNextRequest.ts:7:20:7:23 | body | provenance | | +| app/api/routeNextRequest.ts:4:9:4:31 | body | app/api/routeNextRequest.ts:15:20:15:23 | body | provenance | | +| app/api/routeNextRequest.ts:4:9:4:31 | body | app/api/routeNextRequest.ts:27:20:27:23 | body | provenance | | +| app/api/routeNextRequest.ts:4:9:4:31 | body | app/api/routeNextRequest.ts:31:27:31:30 | body | provenance | | +| app/api/routeNextRequest.ts:4:16:4:31 | await req.json() | app/api/routeNextRequest.ts:4:9:4:31 | body | provenance | | +| app/api/routeNextRequest.ts:4:22:4:31 | req.json() | app/api/routeNextRequest.ts:4:16:4:31 | await req.json() | provenance | | | etherpad.js:9:5:9:53 | response | etherpad.js:11:12:11:19 | response | provenance | | | etherpad.js:9:16:9:30 | req.query.jsonp | etherpad.js:9:5:9:53 | response | provenance | | | formatting.js:4:9:4:29 | evil | formatting.js:6:43:6:46 | evil | provenance | | @@ -326,6 +336,13 @@ nodes | app/api/route.ts:13:18:13:21 | body | semmle.label | body | | app/api/route.ts:25:18:25:21 | body | semmle.label | body | | app/api/route.ts:29:25:29:28 | body | semmle.label | body | +| app/api/routeNextRequest.ts:4:9:4:31 | body | semmle.label | body | +| app/api/routeNextRequest.ts:4:16:4:31 | await req.json() | semmle.label | await req.json() | +| app/api/routeNextRequest.ts:4:22:4:31 | req.json() | semmle.label | req.json() | +| app/api/routeNextRequest.ts:7:20:7:23 | body | semmle.label | body | +| app/api/routeNextRequest.ts:15:20:15:23 | body | semmle.label | body | +| app/api/routeNextRequest.ts:27:20:27:23 | body | semmle.label | body | +| app/api/routeNextRequest.ts:31:27:31:30 | body | semmle.label | body | | etherpad.js:9:5:9:53 | response | semmle.label | response | | etherpad.js:9:16:9:30 | req.query.jsonp | semmle.label | req.query.jsonp | | etherpad.js:11:12:11:19 | response | semmle.label | response | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected index 8fb9524ff45..b57d294c7a7 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/ReflectedXssWithCustomSanitizer.expected @@ -30,6 +30,10 @@ | app/api/route.ts:13:18:13:21 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | | app/api/route.ts:25:18:25:21 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | | app/api/route.ts:29:25:29:28 | body | Cross-site scripting vulnerability due to $@. | app/api/route.ts:2:24:2:33 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:7:20:7:23 | body | Cross-site scripting vulnerability due to $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:15:20:15:23 | body | Cross-site scripting vulnerability due to $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:27:20:27:23 | body | Cross-site scripting vulnerability due to $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | +| app/api/routeNextRequest.ts:31:27:31:30 | body | Cross-site scripting vulnerability due to $@. | app/api/routeNextRequest.ts:4:22:4:31 | req.json() | user-provided value | | formatting.js:6:14:6:47 | util.fo ... , evil) | Cross-site scripting vulnerability due to $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | | formatting.js:7:14:7:53 | require ... , evil) | Cross-site scripting vulnerability due to $@. | formatting.js:4:16:4:29 | req.query.evil | user-provided value | | live-server.js:6:13:6:50 | ` ... /html>` | Cross-site scripting vulnerability due to $@. | live-server.js:4:21:4:27 | req.url | user-provided value | diff --git a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts index 758b91e1caa..91d9f4ecb51 100644 --- a/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts +++ b/javascript/ql/test/query-tests/Security/CWE-079/ReflectedXss/app/api/routeNextRequest.ts @@ -1,10 +1,10 @@ import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) { - const body = await req.json(); // $ MISSING: Source + const body = await req.json(); // $ Source new NextResponse(body, {headers: { 'Content-Type': 'application/json' }}); - new NextResponse(body, {headers: { 'Content-Type': 'text/html' }}); // $ MISSING: Alert + new NextResponse(body, {headers: { 'Content-Type': 'text/html' }}); // $ Alert const headers2 = new Headers(req.headers); headers2.append('Content-Type', 'application/json'); @@ -12,7 +12,7 @@ export async function POST(req: NextRequest) { const headers3 = new Headers(req.headers); headers3.append('Content-Type', 'text/html'); - new NextResponse(body, { headers: headers3 }); // $ MISSING: Alert + new NextResponse(body, { headers: headers3 }); // $ Alert const headers4 = new Headers({ ...Object.fromEntries(req.headers), @@ -24,9 +24,9 @@ export async function POST(req: NextRequest) { ...Object.fromEntries(req.headers), 'Content-Type': 'text/html' }); - new NextResponse(body, { headers: headers5 }); // $ MISSING: Alert + new NextResponse(body, { headers: headers5 }); // $ Alert const headers = new Headers(req.headers); headers.set('Content-Type', 'text/html'); - return new NextResponse(body, { headers }); // $ MISSING: Alert + return new NextResponse(body, { headers }); // $ Alert } From 94e08e318de8d73c35ab126ee4fc437ae9dbe863 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:18:47 +0100 Subject: [PATCH 190/372] C++: Expose a few predicates from 'ExternalFlow'. --- .../semmle/code/cpp/dataflow/ExternalFlow.qll | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll index 9e335dbcbfe..456768081a1 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll @@ -465,7 +465,7 @@ private predicate isFunctionConstructedFrom(Function f, Function templateFunc) { } /** Gets the fully templated version of `f`. */ -private Function getFullyTemplatedFunction(Function f) { +Function getFullyTemplatedFunction(Function f) { not f.isFromUninstantiatedTemplate(_) and ( exists(Class c, Class templateClass, int i | @@ -559,12 +559,15 @@ private string getTypeName(Type t, boolean needsSpace) { /** * Gets a type name for the `n`'th parameter of `f` without any template - * arguments. The result may be a string representing a type for which the - * typedefs have been resolved. + * arguments. + * + * If `canonical = false` then the result may be a string representing a type + * for which the typedefs have been resolved. If `canonical = true` then the + * result will be a string representing a type without resolving `typedefs`. */ bindingset[f] pragma[inline_late] -string getParameterTypeWithoutTemplateArguments(Function f, int n) { +string getParameterTypeWithoutTemplateArguments(Function f, int n, boolean canonical) { exists(string s, string base, string specifiers, Type t | t = f.getParameter(n).getType() and // The name of the string can either be the possibly typedefed name @@ -572,14 +575,19 @@ string getParameterTypeWithoutTemplateArguments(Function f, int n) { // `getTypeName(t, _)` is almost equal to `t.resolveTypedefs().getName()`, // except that `t.resolveTypedefs()` doesn't have a result when the // resulting type doesn't appear in the database. - s = [t.getName(), getTypeName(t, _)] and + ( + s = t.getName() and canonical = true + or + s = getTypeName(t, _) and canonical = false + ) and parseAngles(s, base, _, specifiers) and result = base + specifiers ) or f.isVarargs() and n = f.getNumberOfParameters() and - result = "..." + result = "..." and + canonical = true } /** @@ -590,7 +598,7 @@ private string getTypeNameWithoutFunctionTemplates(Function f, int n, int remain exists(Function templateFunction | templateFunction = getFullyTemplatedFunction(f) and remaining = templateFunction.getNumberOfTemplateArguments() and - result = getParameterTypeWithoutTemplateArguments(templateFunction, n) + result = getParameterTypeWithoutTemplateArguments(templateFunction, n, _) ) or exists(string mid, TypeTemplateParameter tp, Function templateFunction | @@ -627,7 +635,7 @@ private string getTypeNameWithoutClassTemplates(Function f, int n, int remaining } /** Gets the string representation of the `i`'th parameter of `c`. */ -private string getParameterTypeName(Function c, int i) { +string getParameterTypeName(Function c, int i) { result = getTypeNameWithoutClassTemplates(c, i, 0) } From 960e9900af2bacc094d64e162adfbac931e7e3b7 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:20:56 +0100 Subject: [PATCH 191/372] C++: Move the 'getArgumentIndex' into the abstract 'Position' class. It is implemented in all subclasses anyway. --- .../cpp/ir/dataflow/internal/DataFlowPrivate.qll | 14 +++++++++++--- .../code/cpp/ir/dataflow/internal/DataFlowUtil.qll | 6 +++--- .../cpp/ir/dataflow/internal/TaintTrackingUtil.qll | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index 8a515523930..fdfbb07f2a7 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -371,7 +371,7 @@ private class PrimaryArgumentNode extends ArgumentNode, OperandNode { PrimaryArgumentNode() { exists(CallInstruction call | op = call.getAnArgumentOperand()) } override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { - op = call.getArgumentOperand(pos.(DirectPosition).getIndex()) + op = call.getArgumentOperand(pos.(DirectPosition).getArgumentIndex()) } } @@ -410,8 +410,16 @@ class ParameterPosition = Position; class ArgumentPosition = Position; abstract class Position extends TPosition { + /** Gets a textual representation of this position. */ abstract string toString(); + /** + * Gets the argument index of this position. The qualifier of a call has + * argument index `-1`. + */ + abstract int getArgumentIndex(); + + /** Gets the indirection index of this position. */ abstract int getIndirectionIndex(); } @@ -428,7 +436,7 @@ class DirectPosition extends Position, TDirectPosition { result = index.toString() } - int getIndex() { result = index } + override int getArgumentIndex() { result = index } final override int getIndirectionIndex() { result = 0 } } @@ -445,7 +453,7 @@ class IndirectionPosition extends Position, TIndirectionPosition { else result = repeatStars(indirectionIndex) + argumentIndex.toString() } - int getArgumentIndex() { result = argumentIndex } + override int getArgumentIndex() { result = argumentIndex } final override int getIndirectionIndex() { result = indirectionIndex } } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll index 3b6e190cc98..62ad9f02fe2 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll @@ -1445,7 +1445,7 @@ private class ExplicitParameterInstructionNode extends AbstractExplicitParameter ExplicitParameterInstructionNode() { exists(instr.getParameter()) } override predicate isSourceParameterOf(Function f, ParameterPosition pos) { - f.getParameter(pos.(DirectPosition).getIndex()) = instr.getParameter() + f.getParameter(pos.(DirectPosition).getArgumentIndex()) = instr.getParameter() } override string toStringImpl() { result = instr.getParameter().toString() } @@ -1460,7 +1460,7 @@ class ThisParameterInstructionNode extends AbstractExplicitParameterNode, ThisParameterInstructionNode() { instr.getIRVariable() instanceof IRThisVariable } override predicate isSourceParameterOf(Function f, ParameterPosition pos) { - pos.(DirectPosition).getIndex() = -1 and + pos.(DirectPosition).getArgumentIndex() = -1 and instr.getEnclosingFunction() = f } @@ -1494,7 +1494,7 @@ private class DirectBodyLessParameterNode extends AbstractExplicitParameterNode, override predicate isSourceParameterOf(Function f, ParameterPosition pos) { this.getFunction() = f and - f.getParameter(pos.(DirectPosition).getIndex()) = p + f.getParameter(pos.(DirectPosition).getArgumentIndex()) = p } override Parameter getParameter() { result = p } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll index b6d332e3d4c..83fac3ebb49 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/TaintTrackingUtil.qll @@ -229,11 +229,11 @@ private module SpeculativeTaintFlow { not exists(DataFlowDispatch::viableCallable(call)) and src.(DataFlowPrivate::ArgumentNode).argumentOf(call, argpos) | - not argpos.(DirectPosition).getIndex() = -1 and + not argpos.(DirectPosition).getArgumentIndex() = -1 and sink.(PostUpdateNode) .getPreUpdateNode() .(DataFlowPrivate::ArgumentNode) - .argumentOf(call, any(DirectPosition qualpos | qualpos.getIndex() = -1)) + .argumentOf(call, any(DirectPosition qualpos | qualpos.getArgumentIndex() = -1)) or sink.(DataFlowPrivate::OutNode).getCall() = call ) From b678112f4d1d82facf6de22654e22b403994888f Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:21:50 +0100 Subject: [PATCH 192/372] C++: Add a few predicates to 'ReturnKind'. --- .../ir/dataflow/internal/DataFlowPrivate.qll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index fdfbb07f2a7..44d7a6d725a 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -509,6 +509,15 @@ class ReturnKind extends TReturnKind { /** Gets a textual representation of this return kind. */ abstract string toString(); + + /** Holds if this `ReturnKind` is generated from a `return` statement. */ + abstract predicate isNormalReturn(); + + /** + * Holds if this `ReturnKind` is generated from a write to the parameter with + * index `argumentIndex` + */ + abstract predicate isIndirectReturn(int argumentIndex); } /** @@ -522,6 +531,10 @@ class NormalReturnKind extends ReturnKind, TNormalReturnKind { override int getIndirectionIndex() { result = indirectionIndex } override string toString() { result = "indirect return" } + + override predicate isNormalReturn() { any() } + + override predicate isIndirectReturn(int argumentIndex) { none() } } /** @@ -536,6 +549,10 @@ private class IndirectReturnKind extends ReturnKind, TIndirectReturnKind { override int getIndirectionIndex() { result = indirectionIndex } override string toString() { result = "indirect outparam[" + argumentIndex.toString() + "]" } + + override predicate isNormalReturn() { none() } + + override predicate isIndirectReturn(int argumentIndex_) { argumentIndex_ = argumentIndex } } /** A data flow node that occurs as the result of a `ReturnStmt`. */ From 3bb249f580eb28c84f6e523d9428fb0abca32ac6 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 10 Apr 2025 14:23:38 +0100 Subject: [PATCH 193/372] C++: Ensure we always have 'Position's even if there are no calls in the DB. --- .../cpp/ir/dataflow/internal/DataFlowPrivate.qll | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index 44d7a6d725a..1cf67dba1ee 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -459,10 +459,23 @@ class IndirectionPosition extends Position, TIndirectionPosition { } newtype TPosition = - TDirectPosition(int argumentIndex) { exists(any(CallInstruction c).getArgument(argumentIndex)) } or + TDirectPosition(int argumentIndex) { + exists(any(CallInstruction c).getArgument(argumentIndex)) + or + // Handle the rare case where the is a function definition but no call to + // the function. + exists(any(Cpp::Function f).getParameter(argumentIndex)) + } or TIndirectionPosition(int argumentIndex, int indirectionIndex) { Ssa::hasIndirectOperand(any(CallInstruction call).getArgumentOperand(argumentIndex), indirectionIndex) + or + // Handle the rare case where the is a function definition but no call to + // the function. + exists(Cpp::Function f, Cpp::Parameter p | + p = f.getParameter(argumentIndex) and + indirectionIndex = [1 .. Ssa::getMaxIndirectionsForType(p.getUnspecifiedType()) - 1] + ) } private newtype TReturnKind = From 4f5bdbb5174dbecf06e848493185756abf866732 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 10 Apr 2025 14:37:11 +0100 Subject: [PATCH 194/372] Add new query to java-code-quality.qls.expected --- .../java/query-suite/java-code-quality.qls.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected index 6f396573aa1..2cff4a3eaa6 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -9,3 +9,4 @@ ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql +ql/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql From 30ce0c5cbfd3d8c8a9626bbf72cc32ce96283970 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Wed, 9 Apr 2025 21:18:58 -0700 Subject: [PATCH 195/372] Actions: Add integration tests for configured path filters Use the common structure from the existing test for default filters. Check both query output finding workflows and actions, and source archive output showing all extracted YAML files. The test for only `paths-ignore` fails in this commit, demonstrating a bug: we start with all YAML files rather than starting with the default includes. The tests for `paths` reflect current behaviour which is consistent with other languages: `paths` overrides the default inclusions, and only files under `paths` are included. This may not be the best user experience for Actions, since we want to scan all workflow and action files even in the presence of `paths`, but that is not currently addressed. --- .../actions.paths-and-paths-ignore.expected | 2 ++ .../filters/actions.paths-ignore-only.expected | 5 +++++ .../filters/actions.paths-only.expected | 2 ++ .../codeql-config.paths-and-paths-ignore.yml | 4 ++++ .../filters/codeql-config.paths-ignore-only.yml | 2 ++ .../filters/codeql-config.paths-only.yml | 2 ++ .../source_archive.paths-and-paths-ignore.expected | 3 +++ .../source_archive.paths-ignore-only.expected | 5 +++++ .../filters/source_archive.paths-only.expected | 3 +++ actions/ql/integration-tests/filters/test.py | 14 +++++++++++++- 10 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 actions/ql/integration-tests/filters/actions.paths-and-paths-ignore.expected create mode 100644 actions/ql/integration-tests/filters/actions.paths-ignore-only.expected create mode 100644 actions/ql/integration-tests/filters/actions.paths-only.expected create mode 100644 actions/ql/integration-tests/filters/codeql-config.paths-and-paths-ignore.yml create mode 100644 actions/ql/integration-tests/filters/codeql-config.paths-ignore-only.yml create mode 100644 actions/ql/integration-tests/filters/codeql-config.paths-only.yml create mode 100644 actions/ql/integration-tests/filters/source_archive.paths-and-paths-ignore.expected create mode 100644 actions/ql/integration-tests/filters/source_archive.paths-ignore-only.expected create mode 100644 actions/ql/integration-tests/filters/source_archive.paths-only.expected diff --git a/actions/ql/integration-tests/filters/actions.paths-and-paths-ignore.expected b/actions/ql/integration-tests/filters/actions.paths-and-paths-ignore.expected new file mode 100644 index 00000000000..b521ff6b930 --- /dev/null +++ b/actions/ql/integration-tests/filters/actions.paths-and-paths-ignore.expected @@ -0,0 +1,2 @@ +| src/included/action.yml:1:1:11:32 | name: ' ... action' | +| src/included/unreachable-workflow.yml:1:1:12:33 | name: A ... orkflow | \ No newline at end of file diff --git a/actions/ql/integration-tests/filters/actions.paths-ignore-only.expected b/actions/ql/integration-tests/filters/actions.paths-ignore-only.expected new file mode 100644 index 00000000000..2fd8f3a0520 --- /dev/null +++ b/actions/ql/integration-tests/filters/actions.paths-ignore-only.expected @@ -0,0 +1,5 @@ +| src/.github/action.yaml:1:1:11:32 | name: ' ... action' | +| src/.github/actions/action-name/action.yml:1:1:11:32 | name: ' ... action' | +| src/.github/workflows/workflow.yml:1:1:12:33 | name: A workflow | +| src/action.yml:1:1:11:32 | name: ' ... action' | +| src/included/action.yml:1:1:11:32 | name: ' ... action' | diff --git a/actions/ql/integration-tests/filters/actions.paths-only.expected b/actions/ql/integration-tests/filters/actions.paths-only.expected new file mode 100644 index 00000000000..f90744eddb5 --- /dev/null +++ b/actions/ql/integration-tests/filters/actions.paths-only.expected @@ -0,0 +1,2 @@ +| src/included/action.yml:1:1:11:32 | name: ' ... action' | +| src/included/unreachable-workflow.yml:1:1:12:33 | name: A ... orkflow | diff --git a/actions/ql/integration-tests/filters/codeql-config.paths-and-paths-ignore.yml b/actions/ql/integration-tests/filters/codeql-config.paths-and-paths-ignore.yml new file mode 100644 index 00000000000..aad4e6f2af7 --- /dev/null +++ b/actions/ql/integration-tests/filters/codeql-config.paths-and-paths-ignore.yml @@ -0,0 +1,4 @@ +paths: + - 'included' +paths-ignore: + - 'excluded' diff --git a/actions/ql/integration-tests/filters/codeql-config.paths-ignore-only.yml b/actions/ql/integration-tests/filters/codeql-config.paths-ignore-only.yml new file mode 100644 index 00000000000..a1664407f5b --- /dev/null +++ b/actions/ql/integration-tests/filters/codeql-config.paths-ignore-only.yml @@ -0,0 +1,2 @@ +paths-ignore: + - 'excluded' diff --git a/actions/ql/integration-tests/filters/codeql-config.paths-only.yml b/actions/ql/integration-tests/filters/codeql-config.paths-only.yml new file mode 100644 index 00000000000..e07472255bf --- /dev/null +++ b/actions/ql/integration-tests/filters/codeql-config.paths-only.yml @@ -0,0 +1,2 @@ +paths: + - 'included' diff --git a/actions/ql/integration-tests/filters/source_archive.paths-and-paths-ignore.expected b/actions/ql/integration-tests/filters/source_archive.paths-and-paths-ignore.expected new file mode 100644 index 00000000000..70fb47e93a6 --- /dev/null +++ b/actions/ql/integration-tests/filters/source_archive.paths-and-paths-ignore.expected @@ -0,0 +1,3 @@ +src/included/action.yml +src/included/not-an-action.yml +src/included/unreachable-workflow.yml \ No newline at end of file diff --git a/actions/ql/integration-tests/filters/source_archive.paths-ignore-only.expected b/actions/ql/integration-tests/filters/source_archive.paths-ignore-only.expected new file mode 100644 index 00000000000..4abf239fa34 --- /dev/null +++ b/actions/ql/integration-tests/filters/source_archive.paths-ignore-only.expected @@ -0,0 +1,5 @@ +src/.github/action.yaml +src/.github/actions/action-name/action.yml +src/.github/workflows/workflow.yml +src/action.yml +src/included/action.yml \ No newline at end of file diff --git a/actions/ql/integration-tests/filters/source_archive.paths-only.expected b/actions/ql/integration-tests/filters/source_archive.paths-only.expected new file mode 100644 index 00000000000..70fb47e93a6 --- /dev/null +++ b/actions/ql/integration-tests/filters/source_archive.paths-only.expected @@ -0,0 +1,3 @@ +src/included/action.yml +src/included/not-an-action.yml +src/included/unreachable-workflow.yml \ No newline at end of file diff --git a/actions/ql/integration-tests/filters/test.py b/actions/ql/integration-tests/filters/test.py index a2abcf90b03..8ad37c16487 100755 --- a/actions/ql/integration-tests/filters/test.py +++ b/actions/ql/integration-tests/filters/test.py @@ -3,4 +3,16 @@ import pytest @pytest.mark.ql_test(expected=".default-filters.expected") def test_default_filters(codeql, actions, check_source_archive): check_source_archive.expected_suffix = ".default-filters.expected" - codeql.database.create(source_root="src") \ No newline at end of file + codeql.database.create(source_root="src") + +@pytest.mark.ql_test(expected=".paths-only.expected") +def test_config_paths_only(codeql, actions): + codeql.database.create(source_root="src", codescanning_config="codeql-config.paths-only.yml") + +@pytest.mark.ql_test(expected=".paths-ignore-only.expected") +def test_config_paths_ignore_only(codeql, actions): + codeql.database.create(source_root="src", codescanning_config="codeql-config.paths-ignore-only.yml") + +@pytest.mark.ql_test(expected=".paths-and-paths-ignore.expected") +def test_config_paths_and_paths_ignore(codeql, actions): + codeql.database.create(source_root="src", codescanning_config="codeql-config.paths-and-paths-ignore.yml") \ No newline at end of file From 283503b06d80c6a3f5cfaac3e77d6f8f553a2aab Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Thu, 10 Apr 2025 11:07:14 -0700 Subject: [PATCH 196/372] Actions: Fix handling of paths-ignore in autobuild scripts Always concatenate the default filters with the user-provided filters. This ensures that when `paths-ignore` is provided, we begin with the default path inclusions, not all YAML files. This makes the `paths-ignore-only` integration test variant under `filters` pass. The handling of `paths` is unchanged: if provided, this overrides the default filters. --- actions/extractor/tools/autobuild-impl.ps1 | 41 +++++++++++++--------- actions/extractor/tools/autobuild.sh | 18 ++++++++-- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/actions/extractor/tools/autobuild-impl.ps1 b/actions/extractor/tools/autobuild-impl.ps1 index 5a5aa1ab53a..e232cd3cc54 100644 --- a/actions/extractor/tools/autobuild-impl.ps1 +++ b/actions/extractor/tools/autobuild-impl.ps1 @@ -1,21 +1,28 @@ -if (($null -ne $env:LGTM_INDEX_INCLUDE) -or ($null -ne $env:LGTM_INDEX_EXCLUDE) -or ($null -ne $env:LGTM_INDEX_FILTERS)) { - Write-Output 'Path filters set. Passing them through to the JavaScript extractor.' -} else { - Write-Output 'No path filters set. Using the default filters.' - # Note: We're adding the `reusable_workflows` subdirectories to proactively - # record workflows that were called cross-repo, check them out locally, - # and enable an interprocedural analysis across the workflow files. - # These workflows follow the convention `.github/reusable_workflows//*.ya?ml` - $DefaultPathFilters = @( - 'exclude:**/*', - 'include:.github/workflows/*.yml', - 'include:.github/workflows/*.yaml', - 'include:.github/reusable_workflows/**/*.yml', - 'include:.github/reusable_workflows/**/*.yaml', - 'include:**/action.yml', - 'include:**/action.yaml' - ) +# Note: We're adding the `reusable_workflows` subdirectories to proactively +# record workflows that were called cross-repo, check them out locally, +# and enable an interprocedural analysis across the workflow files. +# These workflows follow the convention `.github/reusable_workflows//*.ya?ml` +$DefaultPathFilters = @( + 'exclude:**/*', + 'include:.github/workflows/*.yml', + 'include:.github/workflows/*.yaml', + 'include:.github/reusable_workflows/**/*.yml', + 'include:.github/reusable_workflows/**/*.yaml', + 'include:**/action.yml', + 'include:**/action.yaml' +) +if ($null -ne $env:LGTM_INDEX_FILTERS) { + Write-Output 'LGTM_INDEX_FILTERS set. Using the default filters together with the user-provided filters, and passing through to the JavaScript extractor.' + # Begin with the default path inclusions only, + # followed by the user-provided filters. + # If the user provided `paths`, those patterns override the default inclusions + # (because `LGTM_INDEX_FILTERS` will begin with `exclude:**/*`). + # If the user provided `paths-ignore`, those patterns are excluded. + $PathFilters = ($DefaultPathFilters -join "`n") + "`n" + $env:LGTM_INDEX_FILTERS + $env:LGTM_INDEX_FILTERS = $PathFilters +} else { + Write-Output 'LGTM_INDEX_FILTERS not set. Using the default filters, and passing through to the JavaScript extractor.' $env:LGTM_INDEX_FILTERS = $DefaultPathFilters -join "`n" } diff --git a/actions/extractor/tools/autobuild.sh b/actions/extractor/tools/autobuild.sh index 703154f99c9..f2cbb7ddfa7 100755 --- a/actions/extractor/tools/autobuild.sh +++ b/actions/extractor/tools/autobuild.sh @@ -17,10 +17,22 @@ include:**/action.yaml END ) -if [ -n "${LGTM_INDEX_INCLUDE:-}" ] || [ -n "${LGTM_INDEX_EXCLUDE:-}" ] || [ -n "${LGTM_INDEX_FILTERS:-}" ] ; then - echo "Path filters set. Passing them through to the JavaScript extractor." +if [ -n "${LGTM_INDEX_FILTERS:-}" ]; then + echo "LGTM_INDEX_FILTERS set. Using the default filters together with the user-provided filters, and passing through to the JavaScript extractor." + # Begin with the default path inclusions only, + # followed by the user-provided filters. + # If the user provided `paths`, those patterns override the default inclusions + # (because `LGTM_INDEX_FILTERS` will begin with `exclude:**/*`). + # If the user provided `paths-ignore`, those patterns are excluded. + PATH_FILTERS="$(cat << END +${DEFAULT_PATH_FILTERS} +${LGTM_INDEX_FILTERS} +END +)" + LGTM_INDEX_FILTERS="${PATH_FILTERS}" + export LGTM_INDEX_FILTERS else - echo "No path filters set. Using the default filters." + echo "LGTM_INDEX_FILTERS not set. Using the default filters, and passing through to the JavaScript extractor." LGTM_INDEX_FILTERS="${DEFAULT_PATH_FILTERS}" export LGTM_INDEX_FILTERS fi From 1ca25b2ccb7da1942d5c2c52d905e1dcc8fd8102 Mon Sep 17 00:00:00 2001 From: yoff Date: Wed, 9 Apr 2025 16:49:36 +0200 Subject: [PATCH 197/372] ruby: add test of `rb/uninitialized-local-variable` --- .../UninitializedLocal.expected | 14 ++++++ .../UninitializedLocal.qlref | 2 + .../UninitializedLocal/UninitializedLocal.rb | 46 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected create mode 100644 ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.qlref create mode 100644 ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected new file mode 100644 index 00000000000..206af4ee3b4 --- /dev/null +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected @@ -0,0 +1,14 @@ +| UninitializedLocal.rb:12:3:12:3 | m | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:8:7:8:7 | m | m | +| UninitializedLocal.rb:17:16:17:16 | a | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:17:7:17:7 | a | a | +| UninitializedLocal.rb:30:3:30:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:31:3:31:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:32:3:32:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:32:8:32:8 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:33:3:33:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:33:14:33:14 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:33:20:33:20 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:34:3:34:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:34:15:34:15 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:34:21:34:21 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | +| UninitializedLocal.rb:44:13:44:13 | a | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:40:11:40:11 | a | a | +| UninitializedLocal.rb:45:3:45:3 | a | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:40:11:40:11 | a | a | diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.qlref b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.qlref new file mode 100644 index 00000000000..e37501dffbf --- /dev/null +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.qlref @@ -0,0 +1,2 @@ +query: queries/variables/UninitializedLocal.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql \ No newline at end of file diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb new file mode 100644 index 00000000000..bf591be5005 --- /dev/null +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb @@ -0,0 +1,46 @@ +def m + puts "m" +end + +def foo + m # calls m above + if false + m = 0 + m # reads local variable m + else + end + m #$ Alert + m2 # undefined local variable or method 'm2' for main (NameError) +end + +def test_guards + if (a = 3 && a) #$ Alert + a + end + if (a = 3) && a # OK - a is assigned in the previous conjunct + a + end + if !(a = 3) or a # OK - a is assigned in the previous conjunct + a + end + if false + b = 0 + end + b.nil? + b || 0 #$ SPURIOUS: Alert + b&.m #$ SPURIOUS: Alert + b if b #$ SPURIOUS: Alert + b.close if b && !b.closed #$ SPURIOUS: Alert + b.blowup if b || !b.blownup #$ Alert +end + +def test_loop + begin + if false + a = 0 + else + set_a + end + end until a #$ SPURIOUS: Alert + a #$ SPURIOUS: Alert +end \ No newline at end of file From 53c88da91ba08a10eefe832648d16db2c5eb5073 Mon Sep 17 00:00:00 2001 From: yoff Date: Tue, 1 Apr 2025 13:21:54 +0200 Subject: [PATCH 198/372] ruby: refine query for uninitialised local variables - there are places where uninitialised reads are intentional - there are also some places where they are impossible --- .../variables/UninitializedLocal.qhelp | 36 +++++++++ .../queries/variables/UninitializedLocal.ql | 63 +++++++++++++-- .../variables/examples/UninitializedLocal.rb | 14 ++++ .../UninitializedLocal.expected | 15 +--- .../UninitializedLocal/UninitializedLocal.rb | 76 ++++++++++++------- 5 files changed, 159 insertions(+), 45 deletions(-) create mode 100644 ruby/ql/src/queries/variables/UninitializedLocal.qhelp create mode 100644 ruby/ql/src/queries/variables/examples/UninitializedLocal.rb diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.qhelp b/ruby/ql/src/queries/variables/UninitializedLocal.qhelp new file mode 100644 index 00000000000..d06bdc7087f --- /dev/null +++ b/ruby/ql/src/queries/variables/UninitializedLocal.qhelp @@ -0,0 +1,36 @@ + + + +

    +In Ruby, raw identifiers like x can be both local variable accesses and method calls. It is a local variable access iff it is syntactically preceded by something that binds it (like an assignment). +Consider the following example: +

    + + + +

    +This will generate an alert on the last access to m, where it is not clear that the programmer intended to read from the local variable. +

    + + + + +

    +Ensure that you check the control and data flow in the method carefully. +Check that the variable reference is spelled correctly, perhaps the variable has been renamed and the reference needs to be updated. +Another possibility is that an exception may be raised before the variable is assigned, in which case the read should be protected by a check for nil. +

    + +
    + + + + +
  • Wikipedia: Dead store.
  • + + + +
    + diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index df8a275431a..5f0fb77872a 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -5,20 +5,71 @@ * @kind problem * @problem.severity error * @id rb/uninitialized-local-variable - * @tags reliability + * @tags quality + * reliability * correctness - * @precision low + * @precision high */ import codeql.ruby.AST import codeql.ruby.dataflow.SSA +private import codeql.ruby.dataflow.internal.DataFlowPublic +import codeql.ruby.controlflow.internal.Guards as Guards +import codeql.ruby.controlflow.CfgNodes + +predicate isInBooleanContext(Expr e) { + e = any(ConditionalExpr c).getCondition() + or + e = any(ConditionalLoop l).getCondition() + or + e = any(LogicalAndExpr n).getAnOperand() + or + e = any(LogicalOrExpr n).getAnOperand() + or + e = any(NotExpr n).getOperand() +} + +predicate isGuarded(LocalVariableReadAccess read) { + exists(AstCfgNode guard, boolean branch | + Guards::guardControlsBlock(guard, read.getAControlFlowNode().getBasicBlock(), branch) + | + // guard is `var` + guard.getAstNode() = read.getVariable().getAnAccess() and + branch = true + or + // guard is `!var` + guard.getAstNode().(NotExpr).getOperand() = read.getVariable().getAnAccess() and + branch = false + or + // guard is `var.nil?` + exists(MethodCall c | guard.getAstNode() = c | + c.getReceiver() = read.getVariable().getAnAccess() and + c.getMethodName() = "nil?" + ) and + branch = false + or + // guard is `!var.nil?` + exists(MethodCall c | guard.getAstNode().(NotExpr).getOperand() = c | + c.getReceiver() = read.getVariable().getAnAccess() and + c.getMethodName() = "nil?" + ) and + branch = true + ) +} + +predicate isNilChecked(LocalVariableReadAccess read) { + exists(MethodCall c | c.getReceiver() = read | + c.getMethodName() = "nil?" + or + c.isSafeNavigation() + ) +} class RelevantLocalVariableReadAccess extends LocalVariableReadAccess { RelevantLocalVariableReadAccess() { - not exists(MethodCall c | - c.getReceiver() = this and - c.getMethodName() = "nil?" - ) + not isInBooleanContext(this) and + not isNilChecked(this) and + not isGuarded(this) } } diff --git a/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb b/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb new file mode 100644 index 00000000000..f7c79410ffc --- /dev/null +++ b/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb @@ -0,0 +1,14 @@ +def m + puts "m" +end + +def foo + m # calls m above + if false + m = 0 + m # reads local variable m + else + end + m # reads uninitialized local variable m, `nil` + m2 # undefined local variable or method 'm2' for main (NameError) +end \ No newline at end of file diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected index 206af4ee3b4..e8ab4210760 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected @@ -1,14 +1,3 @@ | UninitializedLocal.rb:12:3:12:3 | m | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:8:7:8:7 | m | m | -| UninitializedLocal.rb:17:16:17:16 | a | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:17:7:17:7 | a | a | -| UninitializedLocal.rb:30:3:30:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:31:3:31:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:32:3:32:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:32:8:32:8 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:33:3:33:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:33:14:33:14 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:33:20:33:20 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:34:3:34:3 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:34:15:34:15 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:34:21:34:21 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:7:27:7 | b | b | -| UninitializedLocal.rb:44:13:44:13 | a | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:40:11:40:11 | a | a | -| UninitializedLocal.rb:45:3:45:3 | a | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:40:11:40:11 | a | a | +| UninitializedLocal.rb:34:5:34:5 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:9:27:9 | b | b | +| UninitializedLocal.rb:34:23:34:23 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:9:27:9 | b | b | diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb index bf591be5005..6682a4bc1e0 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb @@ -14,33 +14,57 @@ def foo end def test_guards - if (a = 3 && a) #$ Alert - a - end - if (a = 3) && a # OK - a is assigned in the previous conjunct - a - end - if !(a = 3) or a # OK - a is assigned in the previous conjunct - a - end - if false - b = 0 - end - b.nil? - b || 0 #$ SPURIOUS: Alert - b&.m #$ SPURIOUS: Alert - b if b #$ SPURIOUS: Alert - b.close if b && !b.closed #$ SPURIOUS: Alert - b.blowup if b || !b.blownup #$ Alert + if (a = 3 && a) # OK - a is in a Boolean context + a + end + if (a = 3) && a # OK - a is assigned in the previous conjunct + a + end + if !(a = 3) or a # OK - a is assigned in the previous conjunct + a + end + if false + b = 0 + end + b.nil? + b || 0 # OK + b&.m # OK - safe navigation + b if b # OK + b.close if b && !b.closed # OK + b.blowup if b || !b.blownup #$ Alert + + if false + c = 0 + end + unless c + return + end + c # OK - given above unless + + if false + d = 0 + end + if (d.nil?) + return + end + d # OK - given above check + + if false + e = 0 + end + unless (!e.nil?) + return + end + e # OK - given above unless end def test_loop - begin - if false - a = 0 - else - set_a - end - end until a #$ SPURIOUS: Alert - a #$ SPURIOUS: Alert + begin + if false + a = 0 + else + set_a + end + end until a # OK + a # OK - given previous until end \ No newline at end of file From 8555e8c8c817e97218fb11ffe58c13e6e62cd334 Mon Sep 17 00:00:00 2001 From: yoff Date: Thu, 3 Apr 2025 12:12:44 +0200 Subject: [PATCH 199/372] ruby: add change notes --- .../2025-04-02-adjust-uninitialized-local-alert-message.md | 4 ++++ .../2025-04-02-adjust-uninitialized-local-metadata.md | 4 ++++ ruby/ql/src/queries/variables/UninitializedLocal.ql | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md create mode 100644 ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md diff --git a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md new file mode 100644 index 00000000000..201e6e8928a --- /dev/null +++ b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The query `rb/uninitialized-local-variable` now take various guards into account and should produce fewer false positives. It also now comes with a help file. diff --git a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md new file mode 100644 index 00000000000..d6c5f353a53 --- /dev/null +++ b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md @@ -0,0 +1,4 @@ +--- +category: queryMetadata +--- +* The query `rb/uninitialized-local-variable` now only produces alerts when it can find local flow; we have adjusted the precision to 'medium'. diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index 5f0fb77872a..aa001ac9bc4 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -8,7 +8,7 @@ * @tags quality * reliability * correctness - * @precision high + * @precision medium */ import codeql.ruby.AST From 159d31d494c52b11425dba7184dfcd2537c37c04 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Tue, 8 Apr 2025 13:25:14 +0200 Subject: [PATCH 200/372] Reenable problematic test --- .../all-platforms/diag_missing_project_files/test.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py b/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py index fa941f346df..a2676d16d9c 100644 --- a/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py +++ b/csharp/ql/integration-tests/all-platforms/diag_missing_project_files/test.py @@ -1,8 +1,2 @@ -import pytest -import runs_on - - -# Skipping the test on macos-15, as we're running into trouble. -@pytest.mark.only_if(not runs_on.macos_15) def test(codeql, csharp): codeql.database.create(_assert_failure=True) From becea89a473cd891f1e3405d12213d5c5931c9c6 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 08:26:48 +0200 Subject: [PATCH 201/372] Rust: refine `ql/test/setup.sh` --- rust/ql/test/setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rust/ql/test/setup.sh b/rust/ql/test/setup.sh index 822097140bb..1c12456107a 100755 --- a/rust/ql/test/setup.sh +++ b/rust/ql/test/setup.sh @@ -5,13 +5,13 @@ set -euo pipefail # This script is run by the CI to set up the test environment for the Rust QL tests # We run this as rustup is not meant to be run in parallel, and will this setup will be run by rust-analyzer in the # parallel QL tests unless we do the setup prior to launching the tests. -# We do this for each `rust-toolchain.toml` we use in the tests (and the root one in `rust`) +# We do this for each `rust-toolchain.toml` we use in the tests (and the root one in `rust` last, so it becomes the +# default). +# Notice that we do not need to explicitly add the rust-std component as it's listed in ql/rust/rust-toolchain.toml. cd "$(dirname "$0")" -rustup install -rustup component add rust-src - find . -name rust-toolchain.toml \ - -execdir rustup install \; \ - -execdir rustup component add rust-src \; + -execdir rustup install \; + +rustup install From 547833afb5a4106a255e6cb8107c23a2e8d567b6 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 08:32:33 +0200 Subject: [PATCH 202/372] Rust: add to `CODEOWNERS` --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 90c3cb9af60..318d9f2c6de 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,6 +8,7 @@ /javascript/ @github/codeql-javascript /python/ @github/codeql-python /ruby/ @github/codeql-ruby +/rust/ @github/codeql-rust /swift/ @github/codeql-swift /misc/codegen/ @github/codeql-swift /java/kotlin-extractor/ @github/codeql-kotlin @@ -41,6 +42,7 @@ MODULE.bazel @github/codeql-ci-reviewers /.github/workflows/go-* @github/codeql-go /.github/workflows/ql-for-ql-* @github/codeql-ql-for-ql-reviewers /.github/workflows/ruby-* @github/codeql-ruby +/.github/workflows/rust.yml @github/codeql-rust /.github/workflows/swift.yml @github/codeql-swift # Misc From 7703b1fab5211538d70ae2e4c994cab3c00a49a0 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 11 Apr 2025 08:26:04 +0200 Subject: [PATCH 203/372] JS: Add test for missing getALocalSource flow for rest pattern --- .../GetALocalSource/rest-pattern.js | 15 ++++++++++ .../GetALocalSource/test.expected | 1 + .../library-tests/GetALocalSource/test.ql | 30 +++++++++++++++++++ .../library-tests/GetALocalSource/test.qlref | 2 ++ 4 files changed, 48 insertions(+) create mode 100644 javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js create mode 100644 javascript/ql/test/library-tests/GetALocalSource/test.expected create mode 100644 javascript/ql/test/library-tests/GetALocalSource/test.ql create mode 100644 javascript/ql/test/library-tests/GetALocalSource/test.qlref diff --git a/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js new file mode 100644 index 00000000000..8eb0c808853 --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js @@ -0,0 +1,15 @@ +function t1() { + const { ...rest } = source('t1.1'); + rest; // $ MISSING: getALocalSource=rest +} + +function t2() { + const [ ...rest ] = source('t2.1'); + rest; // $ MISSING: getALocalSource=rest +} + +function t3() { + const { p1, ...rest } = source('t3.1'); + p1; // $ getALocalSource=p1 + rest; // $ MISSING: getALocalSource=rest +} diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.expected b/javascript/ql/test/library-tests/GetALocalSource/test.expected new file mode 100644 index 00000000000..6efee9a8f1e --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/test.expected @@ -0,0 +1 @@ +| rest-pattern.js:13:5:13:6 | p1 | p1 | diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.ql b/javascript/ql/test/library-tests/GetALocalSource/test.ql new file mode 100644 index 00000000000..7803f6fd495 --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/test.ql @@ -0,0 +1,30 @@ +import javascript + +string nodeName(DataFlow::SourceNode node) { + result = node.getAstNode().(VarRef).getName() + or + result = node.getAstNode().(PropertyPattern).getName() + or + result = node.getAstNode().(PropAccess).getPropertyName() + or + exists(DataFlow::InvokeNode invoke | + node = invoke and + invoke.getCalleeName() = "source" and + result = invoke.getArgument(0).getStringValue() + ) +} + +bindingset[node1, node2] +pragma[inline_late] +predicate sameLine(DataFlow::Node node1, DataFlow::Node node2) { + node1.getLocation().getFile() = node2.getLocation().getFile() and + node1.getLocation().getStartLine() = node2.getLocation().getStartLine() +} + +query predicate getALocalSource(DataFlow::Node node, string name) { + exists(DataFlow::SourceNode sn | + sn = node.getALocalSource() and + name = nodeName(sn) and + not sameLine(node, sn) + ) +} diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.qlref b/javascript/ql/test/library-tests/GetALocalSource/test.qlref new file mode 100644 index 00000000000..ab6773f15f9 --- /dev/null +++ b/javascript/ql/test/library-tests/GetALocalSource/test.qlref @@ -0,0 +1,2 @@ +query: test.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql From 719456e27d7d3f8efcd442848c5fef1df2f21a24 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 11 Apr 2025 08:33:29 +0200 Subject: [PATCH 204/372] JS: Fix missing flow into rest pattern lvalue --- javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll | 5 +++++ .../ql/test/library-tests/GetALocalSource/rest-pattern.js | 6 +++--- .../ql/test/library-tests/GetALocalSource/test.expected | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll b/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll index f86d8806304..46801bd1ad7 100644 --- a/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll +++ b/javascript/ql/lib/semmle/javascript/dataflow/DataFlow.qll @@ -1610,6 +1610,11 @@ module DataFlow { pred = TElementPatternNode(_, element) and succ = lvalueNodeInternal(element) ) + or + exists(Expr rest | + pred = TRestPatternNode(_, rest) and + succ = lvalueNodeInternal(rest) + ) } /** diff --git a/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js index 8eb0c808853..3e0a62755f0 100644 --- a/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js +++ b/javascript/ql/test/library-tests/GetALocalSource/rest-pattern.js @@ -1,15 +1,15 @@ function t1() { const { ...rest } = source('t1.1'); - rest; // $ MISSING: getALocalSource=rest + rest; // $ getALocalSource=rest } function t2() { const [ ...rest ] = source('t2.1'); - rest; // $ MISSING: getALocalSource=rest + rest; // $ getALocalSource=rest } function t3() { const { p1, ...rest } = source('t3.1'); p1; // $ getALocalSource=p1 - rest; // $ MISSING: getALocalSource=rest + rest; // $ getALocalSource=rest } diff --git a/javascript/ql/test/library-tests/GetALocalSource/test.expected b/javascript/ql/test/library-tests/GetALocalSource/test.expected index 6efee9a8f1e..5770e50b8a6 100644 --- a/javascript/ql/test/library-tests/GetALocalSource/test.expected +++ b/javascript/ql/test/library-tests/GetALocalSource/test.expected @@ -1 +1,4 @@ +| rest-pattern.js:3:5:3:8 | rest | rest | +| rest-pattern.js:8:5:8:8 | rest | rest | | rest-pattern.js:13:5:13:6 | p1 | p1 | +| rest-pattern.js:14:5:14:8 | rest | rest | From 208487f23618f3ca7249cba692537d72b18a7d14 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 08:39:47 +0200 Subject: [PATCH 205/372] Added `middleware` test --- .../Security/CWE-918/Request/middleware.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts new file mode 100644 index 00000000000..259e17d289d --- /dev/null +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts @@ -0,0 +1,12 @@ +import { NextRequest, NextResponse } from 'next/server'; + +export async function middleware(req: NextRequest) { + const target = req.nextUrl // $ MISSING : Source[js/request-forgery] + if (target) { + const res = await fetch(target) // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const data = await res.text() + return new NextResponse(data) + } + return NextResponse.next() +} + \ No newline at end of file From 734ad2d767597c57bf71847f3db0034c5619507a Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 08:43:08 +0200 Subject: [PATCH 206/372] Removed legacy `Consistency` check as it is redundant now with inline test expectations. --- .../Security/CWE-918/Consistency.expected | 2 -- .../Security/CWE-918/Consistency.ql | 25 ------------------- 2 files changed, 27 deletions(-) delete mode 100644 javascript/ql/test/query-tests/Security/CWE-918/Consistency.expected delete mode 100644 javascript/ql/test/query-tests/Security/CWE-918/Consistency.ql diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Consistency.expected b/javascript/ql/test/query-tests/Security/CWE-918/Consistency.expected deleted file mode 100644 index c2b63d9c942..00000000000 --- a/javascript/ql/test/query-tests/Security/CWE-918/Consistency.expected +++ /dev/null @@ -1,2 +0,0 @@ -consistencyIssue -resultInWrongFile diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Consistency.ql b/javascript/ql/test/query-tests/Security/CWE-918/Consistency.ql deleted file mode 100644 index 5ae582db491..00000000000 --- a/javascript/ql/test/query-tests/Security/CWE-918/Consistency.ql +++ /dev/null @@ -1,25 +0,0 @@ -import javascript -import semmle.javascript.security.dataflow.RequestForgeryQuery as RequestForgery -import semmle.javascript.security.dataflow.ClientSideRequestForgeryQuery as ClientSideRequestForgery -deprecated import utils.test.ConsistencyChecking - -query predicate resultInWrongFile(DataFlow::Node node) { - exists(string filePattern | - RequestForgery::RequestForgeryFlow::flowTo(node) and - filePattern = ".*serverSide.*" - or - ClientSideRequestForgery::ClientSideRequestForgeryFlow::flowTo(node) and - filePattern = ".*clientSide.*" - | - not node.getFile().getRelativePath().regexpMatch(filePattern) - ) -} - -deprecated class Consistency extends ConsistencyConfiguration { - Consistency() { this = "Consistency" } - - override DataFlow::Node getAnAlert() { - RequestForgery::RequestForgeryFlow::flowTo(result) or - ClientSideRequestForgery::ClientSideRequestForgeryFlow::flowTo(result) - } -} From 6e09a65da07fd6cbaa7b887327fa6d2935e5f086 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 08:43:36 +0200 Subject: [PATCH 207/372] Added support for `NextRequest` `middleware` SSRF. --- javascript/ql/lib/semmle/javascript/frameworks/Next.qll | 8 ++++++-- .../query-tests/Security/CWE-918/Request/middleware.ts | 4 ++-- .../query-tests/Security/CWE-918/RequestForgery.expected | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll index 6333c9442d8..fad4f25e5f5 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll @@ -281,8 +281,12 @@ module NextJS { */ class NextAppRouteHandler extends DataFlow::FunctionNode, Http::Servers::StandardRouteHandler { NextAppRouteHandler() { - exists(Module mod | mod.getFile().getParentContainer() = apiFolder() | - this = mod.getAnExportedValue(any(Http::RequestMethodName m)).getAFunctionValue() and + exists(Module mod | + mod.getFile().getParentContainer() = apiFolder() or + mod.getFile().getBaseName() = ["middleware.ts", "middleware.js"] + | + this = + mod.getAnExportedValue([any(Http::RequestMethodName m), "middleware"]).getAFunctionValue() and ( this.getParameter(0).hasUnderlyingType("next/server", "NextRequest") or diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts index 259e17d289d..e6bb7f8db60 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts @@ -1,9 +1,9 @@ import { NextRequest, NextResponse } from 'next/server'; export async function middleware(req: NextRequest) { - const target = req.nextUrl // $ MISSING : Source[js/request-forgery] + const target = req.nextUrl // $ Source[js/request-forgery] if (target) { - const res = await fetch(target) // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(target) // $ Alert[js/request-forgery] Sink[js/request-forgery] const data = await res.text() return new NextResponse(data) } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index b8436fa6722..cf3b225e322 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -1,6 +1,7 @@ #select | Request/app/api/proxy/route2.serverSide.ts:5:21:5:30 | fetch(url) | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | URL | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | user-provided value | | Request/app/api/proxy/route.serverSide.ts:3:21:3:30 | fetch(url) | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | URL | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | user-provided value | +| Request/middleware.ts:6:25:6:37 | fetch(target) | Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:6:31:6:36 | target | The $@ of this request depends on a $@. | Request/middleware.ts:6:31:6:36 | target | URL | Request/middleware.ts:4:20:4:30 | req.nextUrl | user-provided value | | apollo.serverSide.ts:8:39:8:64 | get(fil ... => {}) | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:8:43:8:50 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:8:43:8:50 | file.url | URL | apollo.serverSide.ts:7:36:7:44 | { files } | user-provided value | | apollo.serverSide.ts:18:37:18:62 | get(fil ... => {}) | apollo.serverSide.ts:17:34:17:42 | { files } | apollo.serverSide.ts:18:41:18:48 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:18:41:18:48 | file.url | URL | apollo.serverSide.ts:17:34:17:42 | { files } | user-provided value | | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | The $@ of this request depends on a $@. | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | endpoint | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | user-provided value | @@ -37,6 +38,8 @@ edges | Request/app/api/proxy/route.serverSide.ts:2:9:2:34 | url | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | provenance | | | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | Request/app/api/proxy/route.serverSide.ts:2:9:2:15 | { url } | provenance | | | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | provenance | | +| Request/middleware.ts:4:11:4:30 | target | Request/middleware.ts:6:31:6:36 | target | provenance | | +| Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:4:11:4:30 | target | provenance | | | apollo.serverSide.ts:7:36:7:44 | files | apollo.serverSide.ts:8:13:8:17 | files | provenance | | | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:7:36:7:44 | files | provenance | | | apollo.serverSide.ts:8:13:8:17 | files | apollo.serverSide.ts:8:28:8:31 | file | provenance | | @@ -111,6 +114,9 @@ nodes | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | semmle.label | await req.json() | | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | semmle.label | req.json() | | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | semmle.label | url | +| Request/middleware.ts:4:11:4:30 | target | semmle.label | target | +| Request/middleware.ts:4:20:4:30 | req.nextUrl | semmle.label | req.nextUrl | +| Request/middleware.ts:6:31:6:36 | target | semmle.label | target | | apollo.serverSide.ts:7:36:7:44 | files | semmle.label | files | | apollo.serverSide.ts:7:36:7:44 | { files } | semmle.label | { files } | | apollo.serverSide.ts:8:13:8:17 | files | semmle.label | files | From db1203acb3a1a80f528b3168e223e99af07fa369 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 08:56:35 +0200 Subject: [PATCH 208/372] Rust: reinstate adding `rust-src` for test toolchains --- rust/ql/test/setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/setup.sh b/rust/ql/test/setup.sh index 1c12456107a..9b2d6b4f344 100755 --- a/rust/ql/test/setup.sh +++ b/rust/ql/test/setup.sh @@ -7,11 +7,12 @@ set -euo pipefail # parallel QL tests unless we do the setup prior to launching the tests. # We do this for each `rust-toolchain.toml` we use in the tests (and the root one in `rust` last, so it becomes the # default). -# Notice that we do not need to explicitly add the rust-std component as it's listed in ql/rust/rust-toolchain.toml. cd "$(dirname "$0")" find . -name rust-toolchain.toml \ - -execdir rustup install \; + -execdir rustup install \; \ + -execdir rustup component add rust-src \; +# no to install rust-src explicitly, it's listedin ql/rust/rust-toolchain.toml rustup install From cc85a09b398c6b58e4f9fb5028a10db8174c2378 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 9 Apr 2025 10:11:06 +0200 Subject: [PATCH 209/372] Rust: Add AI-generated test for path resolution of where clauses --- .../PathResolutionInlineExpectationsTest.qll | 2 +- .../library-tests/path-resolution/main.rs | 71 +++++++++ .../path-resolution/path-resolution.expected | 148 ++++++++++-------- .../test/library-tests/variables/variables.ql | 2 +- 4 files changed, 160 insertions(+), 63 deletions(-) diff --git a/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll b/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll index 54d6023b264..cd82003feac 100644 --- a/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll +++ b/rust/ql/lib/utils/test/PathResolutionInlineExpectationsTest.qll @@ -18,7 +18,7 @@ private module ResolveTest implements TestSig { private predicate commmentAt(string text, string filepath, int line) { exists(Comment c | c.getLocation().hasLocationInfo(filepath, line, _, _, _) and - c.getCommentText() = text + c.getCommentText().trim() = text ) } diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index 467248219a4..d1bf53cc5c2 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -547,6 +547,76 @@ mod m23 { } // I108 } +mod m24 { + trait TraitA { + fn trait_a_method(&self); // I110 + } // I111 + + trait TraitB { + fn trait_b_method(&self); // I112 + } // I113 + + #[rustfmt::skip] + struct GenericStruct { // I114 + data: T, // $ item=I114 + } // I115 + + #[rustfmt::skip] + impl // I1151 + GenericStruct // $ item=I115 item=I1151 + where + T: TraitA // $ item=I111 item=I1151 + { + fn call_trait_a(&self) { + self.data.trait_a_method(); // $ MISSING: item=I110 + } // I116 + } + + #[rustfmt::skip] + impl // I1161 + GenericStruct // $ item=I115 item=I1161 + where + T: TraitB, // $ item=I113 item=I1161 + T: TraitA, // $ item=I111 item=I1161 + { + fn call_both(&self) { + self.data.trait_a_method(); // $ MISSING: item=I110 + self.data.trait_b_method(); // $ MISSING: item=I112 + } // I117 + } + + struct Implementor; // I118 + + #[rustfmt::skip] + impl TraitA for Implementor { // $ item=I111 item=I118 + fn trait_a_method(&self) { + println!("TraitA method called"); + } // I119 + } + + #[rustfmt::skip] + impl TraitB for Implementor { // $ item=I113 item=I118 + fn trait_b_method(&self) { + println!("TraitB method called"); + } // I120 + } + + #[rustfmt::skip] + pub fn f() { + let impl_obj = Implementor; // $ item=I118 + let generic = GenericStruct { data: impl_obj }; // $ item=I115 + + generic.call_trait_a(); // $ MISSING: item=I116 + generic.call_both(); // $ MISSING: item=I117 + + // Access through where clause type parameter constraint + GenericStruct::::call_trait_a(&generic); // $ item=I116 item=I118 + + // Type that satisfies multiple trait bounds in where clause + GenericStruct::::call_both(&generic); // $ item=I117 item=I118 + } // I121 +} + fn main() { my::nested::nested1::nested2::f(); // $ item=I4 my::f(); // $ item=I38 @@ -575,4 +645,5 @@ fn main() { nested_f(); // $ item=I201 m18::m19::m20::g(); // $ item=I103 m23::f(); // $ item=I108 + m24::f(); // $ item=I121 } diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 7fbbca66c39..0cc184be239 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -28,6 +28,7 @@ mod | main.rs:497:5:503:5 | mod m22 | | main.rs:505:5:520:5 | mod m33 | | main.rs:523:1:548:1 | mod m23 | +| main.rs:550:1:618:1 | mod m24 | | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:12:1:12:12 | mod my3 | | my2/mod.rs:14:1:15:10 | mod mymod | @@ -61,7 +62,7 @@ resolvePath | main.rs:30:17:30:21 | super | main.rs:18:5:36:5 | mod m2 | | main.rs:30:17:30:24 | ...::f | main.rs:19:9:21:9 | fn f | | main.rs:33:17:33:17 | f | main.rs:19:9:21:9 | fn f | -| main.rs:40:9:40:13 | super | main.rs:1:1:578:2 | SourceFile | +| main.rs:40:9:40:13 | super | main.rs:1:1:649:2 | SourceFile | | main.rs:40:9:40:17 | ...::m1 | main.rs:13:1:37:1 | mod m1 | | main.rs:40:9:40:21 | ...::m2 | main.rs:18:5:36:5 | mod m2 | | main.rs:40:9:40:24 | ...::g | main.rs:23:9:27:9 | fn g | @@ -73,7 +74,7 @@ resolvePath | main.rs:61:17:61:19 | Foo | main.rs:59:9:59:21 | struct Foo | | main.rs:64:13:64:15 | Foo | main.rs:53:5:53:17 | struct Foo | | main.rs:66:5:66:5 | f | main.rs:55:5:62:5 | fn f | -| main.rs:68:5:68:8 | self | main.rs:1:1:578:2 | SourceFile | +| main.rs:68:5:68:8 | self | main.rs:1:1:649:2 | SourceFile | | main.rs:68:5:68:11 | ...::i | main.rs:71:1:83:1 | fn i | | main.rs:74:13:74:15 | Foo | main.rs:48:1:48:13 | struct Foo | | main.rs:81:17:81:19 | Foo | main.rs:77:9:79:9 | struct Foo | @@ -87,7 +88,7 @@ resolvePath | main.rs:87:57:87:66 | ...::g | my2/nested2.rs:7:9:9:9 | fn g | | main.rs:87:80:87:86 | nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | | main.rs:100:5:100:22 | f_defined_in_macro | main.rs:99:18:99:42 | fn f_defined_in_macro | -| main.rs:117:13:117:17 | super | main.rs:1:1:578:2 | SourceFile | +| main.rs:117:13:117:17 | super | main.rs:1:1:649:2 | SourceFile | | main.rs:117:13:117:21 | ...::m5 | main.rs:103:1:107:1 | mod m5 | | main.rs:118:9:118:9 | f | main.rs:104:5:106:5 | fn f | | main.rs:118:9:118:9 | f | main.rs:110:5:112:5 | fn f | @@ -240,63 +241,88 @@ resolvePath | main.rs:535:7:535:10 | Self | main.rs:531:5:531:13 | struct S | | main.rs:537:11:537:11 | S | main.rs:531:5:531:13 | struct S | | main.rs:545:17:545:17 | S | main.rs:531:5:531:13 | struct S | -| main.rs:551:5:551:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:551:5:551:14 | ...::nested | my.rs:1:1:1:15 | mod nested | -| main.rs:551:5:551:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | -| main.rs:551:5:551:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | -| main.rs:551:5:551:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | -| main.rs:552:5:552:6 | my | main.rs:1:1:1:7 | mod my | -| main.rs:552:5:552:9 | ...::f | my.rs:5:1:7:1 | fn f | -| main.rs:553:5:553:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | -| main.rs:553:5:553:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | -| main.rs:553:5:553:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | -| main.rs:553:5:553:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:554:5:554:5 | f | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:555:5:555:5 | g | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:556:5:556:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | -| main.rs:556:5:556:12 | ...::h | main.rs:50:1:69:1 | fn h | -| main.rs:557:5:557:6 | m1 | main.rs:13:1:37:1 | mod m1 | -| main.rs:557:5:557:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | -| main.rs:557:5:557:13 | ...::g | main.rs:23:9:27:9 | fn g | -| main.rs:558:5:558:6 | m1 | main.rs:13:1:37:1 | mod m1 | -| main.rs:558:5:558:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | -| main.rs:558:5:558:14 | ...::m3 | main.rs:29:9:35:9 | mod m3 | -| main.rs:558:5:558:17 | ...::h | main.rs:30:27:34:13 | fn h | -| main.rs:559:5:559:6 | m4 | main.rs:39:1:46:1 | mod m4 | -| main.rs:559:5:559:9 | ...::i | main.rs:42:5:45:5 | fn i | -| main.rs:560:5:560:5 | h | main.rs:50:1:69:1 | fn h | -| main.rs:561:5:561:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | -| main.rs:562:5:562:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | -| main.rs:563:5:563:5 | j | main.rs:97:1:101:1 | fn j | -| main.rs:564:5:564:6 | m6 | main.rs:109:1:120:1 | mod m6 | -| main.rs:564:5:564:9 | ...::g | main.rs:114:5:119:5 | fn g | -| main.rs:565:5:565:6 | m7 | main.rs:122:1:137:1 | mod m7 | -| main.rs:565:5:565:9 | ...::f | main.rs:129:5:136:5 | fn f | -| main.rs:566:5:566:6 | m8 | main.rs:139:1:193:1 | mod m8 | -| main.rs:566:5:566:9 | ...::g | main.rs:177:5:192:5 | fn g | -| main.rs:567:5:567:6 | m9 | main.rs:195:1:203:1 | mod m9 | -| main.rs:567:5:567:9 | ...::f | main.rs:198:5:202:5 | fn f | -| main.rs:568:5:568:7 | m11 | main.rs:226:1:263:1 | mod m11 | -| main.rs:568:5:568:10 | ...::f | main.rs:231:5:234:5 | fn f | -| main.rs:569:5:569:7 | m15 | main.rs:294:1:348:1 | mod m15 | -| main.rs:569:5:569:10 | ...::f | main.rs:335:5:347:5 | fn f | -| main.rs:570:5:570:7 | m16 | main.rs:350:1:442:1 | mod m16 | -| main.rs:570:5:570:10 | ...::f | main.rs:417:5:441:5 | fn f | -| main.rs:571:5:571:7 | m17 | main.rs:444:1:474:1 | mod m17 | -| main.rs:571:5:571:10 | ...::f | main.rs:468:5:473:5 | fn f | -| main.rs:572:5:572:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | -| main.rs:572:5:572:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | -| main.rs:573:5:573:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | -| main.rs:573:5:573:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | -| main.rs:574:5:574:7 | my3 | my2/mod.rs:12:1:12:12 | mod my3 | -| main.rs:574:5:574:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | -| main.rs:575:5:575:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| main.rs:576:5:576:7 | m18 | main.rs:476:1:494:1 | mod m18 | -| main.rs:576:5:576:12 | ...::m19 | main.rs:481:5:493:5 | mod m19 | -| main.rs:576:5:576:17 | ...::m20 | main.rs:486:9:492:9 | mod m20 | -| main.rs:576:5:576:20 | ...::g | main.rs:487:13:491:13 | fn g | -| main.rs:577:5:577:7 | m23 | main.rs:523:1:548:1 | mod m23 | -| main.rs:577:5:577:10 | ...::f | main.rs:543:5:547:5 | fn f | +| main.rs:561:15:561:15 | T | main.rs:560:26:560:26 | T | +| main.rs:566:9:566:24 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:566:23:566:23 | T | main.rs:565:10:565:10 | T | +| main.rs:568:9:568:9 | T | main.rs:565:10:565:10 | T | +| main.rs:568:12:568:17 | TraitA | main.rs:551:5:553:5 | trait TraitA | +| main.rs:577:9:577:24 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:577:23:577:23 | T | main.rs:576:10:576:10 | T | +| main.rs:579:9:579:9 | T | main.rs:576:10:576:10 | T | +| main.rs:579:12:579:17 | TraitB | main.rs:555:5:557:5 | trait TraitB | +| main.rs:580:9:580:9 | T | main.rs:576:10:576:10 | T | +| main.rs:580:12:580:17 | TraitA | main.rs:551:5:553:5 | trait TraitA | +| main.rs:591:10:591:15 | TraitA | main.rs:551:5:553:5 | trait TraitA | +| main.rs:591:21:591:31 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:598:10:598:15 | TraitB | main.rs:555:5:557:5 | trait TraitB | +| main.rs:598:21:598:31 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:606:24:606:34 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:607:23:607:35 | GenericStruct | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:613:9:613:36 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:613:9:613:50 | ...::call_trait_a | main.rs:570:9:572:9 | fn call_trait_a | +| main.rs:613:25:613:35 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:616:9:616:36 | GenericStruct::<...> | main.rs:559:5:562:5 | struct GenericStruct | +| main.rs:616:9:616:47 | ...::call_both | main.rs:582:9:585:9 | fn call_both | +| main.rs:616:25:616:35 | Implementor | main.rs:588:5:588:23 | struct Implementor | +| main.rs:621:5:621:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:621:5:621:14 | ...::nested | my.rs:1:1:1:15 | mod nested | +| main.rs:621:5:621:23 | ...::nested1 | my/nested.rs:1:1:17:1 | mod nested1 | +| main.rs:621:5:621:32 | ...::nested2 | my/nested.rs:2:5:11:5 | mod nested2 | +| main.rs:621:5:621:35 | ...::f | my/nested.rs:3:9:5:9 | fn f | +| main.rs:622:5:622:6 | my | main.rs:1:1:1:7 | mod my | +| main.rs:622:5:622:9 | ...::f | my.rs:5:1:7:1 | fn f | +| main.rs:623:5:623:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | +| main.rs:623:5:623:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | +| main.rs:623:5:623:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | +| main.rs:623:5:623:32 | ...::f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:624:5:624:5 | f | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:625:5:625:5 | g | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:626:5:626:9 | crate | main.rs:0:0:0:0 | Crate(main@0.0.1) | +| main.rs:626:5:626:12 | ...::h | main.rs:50:1:69:1 | fn h | +| main.rs:627:5:627:6 | m1 | main.rs:13:1:37:1 | mod m1 | +| main.rs:627:5:627:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | +| main.rs:627:5:627:13 | ...::g | main.rs:23:9:27:9 | fn g | +| main.rs:628:5:628:6 | m1 | main.rs:13:1:37:1 | mod m1 | +| main.rs:628:5:628:10 | ...::m2 | main.rs:18:5:36:5 | mod m2 | +| main.rs:628:5:628:14 | ...::m3 | main.rs:29:9:35:9 | mod m3 | +| main.rs:628:5:628:17 | ...::h | main.rs:30:27:34:13 | fn h | +| main.rs:629:5:629:6 | m4 | main.rs:39:1:46:1 | mod m4 | +| main.rs:629:5:629:9 | ...::i | main.rs:42:5:45:5 | fn i | +| main.rs:630:5:630:5 | h | main.rs:50:1:69:1 | fn h | +| main.rs:631:5:631:11 | f_alias | my2/nested2.rs:3:9:5:9 | fn f | +| main.rs:632:5:632:11 | g_alias | my2/nested2.rs:7:9:9:9 | fn g | +| main.rs:633:5:633:5 | j | main.rs:97:1:101:1 | fn j | +| main.rs:634:5:634:6 | m6 | main.rs:109:1:120:1 | mod m6 | +| main.rs:634:5:634:9 | ...::g | main.rs:114:5:119:5 | fn g | +| main.rs:635:5:635:6 | m7 | main.rs:122:1:137:1 | mod m7 | +| main.rs:635:5:635:9 | ...::f | main.rs:129:5:136:5 | fn f | +| main.rs:636:5:636:6 | m8 | main.rs:139:1:193:1 | mod m8 | +| main.rs:636:5:636:9 | ...::g | main.rs:177:5:192:5 | fn g | +| main.rs:637:5:637:6 | m9 | main.rs:195:1:203:1 | mod m9 | +| main.rs:637:5:637:9 | ...::f | main.rs:198:5:202:5 | fn f | +| main.rs:638:5:638:7 | m11 | main.rs:226:1:263:1 | mod m11 | +| main.rs:638:5:638:10 | ...::f | main.rs:231:5:234:5 | fn f | +| main.rs:639:5:639:7 | m15 | main.rs:294:1:348:1 | mod m15 | +| main.rs:639:5:639:10 | ...::f | main.rs:335:5:347:5 | fn f | +| main.rs:640:5:640:7 | m16 | main.rs:350:1:442:1 | mod m16 | +| main.rs:640:5:640:10 | ...::f | main.rs:417:5:441:5 | fn f | +| main.rs:641:5:641:7 | m17 | main.rs:444:1:474:1 | mod m17 | +| main.rs:641:5:641:10 | ...::f | main.rs:468:5:473:5 | fn f | +| main.rs:642:5:642:11 | nested6 | my2/nested2.rs:14:5:18:5 | mod nested6 | +| main.rs:642:5:642:14 | ...::f | my2/nested2.rs:15:9:17:9 | fn f | +| main.rs:643:5:643:11 | nested8 | my2/nested2.rs:22:5:26:5 | mod nested8 | +| main.rs:643:5:643:14 | ...::f | my2/nested2.rs:23:9:25:9 | fn f | +| main.rs:644:5:644:7 | my3 | my2/mod.rs:12:1:12:12 | mod my3 | +| main.rs:644:5:644:10 | ...::f | my2/my3/mod.rs:1:1:5:1 | fn f | +| main.rs:645:5:645:12 | nested_f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| main.rs:646:5:646:7 | m18 | main.rs:476:1:494:1 | mod m18 | +| main.rs:646:5:646:12 | ...::m19 | main.rs:481:5:493:5 | mod m19 | +| main.rs:646:5:646:17 | ...::m20 | main.rs:486:9:492:9 | mod m20 | +| main.rs:646:5:646:20 | ...::g | main.rs:487:13:491:13 | fn g | +| main.rs:647:5:647:7 | m23 | main.rs:523:1:548:1 | mod m23 | +| main.rs:647:5:647:10 | ...::f | main.rs:543:5:547:5 | fn f | +| main.rs:648:5:648:7 | m24 | main.rs:550:1:618:1 | mod m24 | +| main.rs:648:5:648:10 | ...::f | main.rs:604:5:617:5 | fn f | | my2/mod.rs:5:5:5:11 | nested2 | my2/mod.rs:1:1:1:16 | mod nested2 | | my2/mod.rs:5:5:5:20 | ...::nested3 | my2/nested2.rs:1:1:11:1 | mod nested3 | | my2/mod.rs:5:5:5:29 | ...::nested4 | my2/nested2.rs:2:5:10:5 | mod nested4 | @@ -312,7 +338,7 @@ resolvePath | my2/my3/mod.rs:3:5:3:5 | g | my2/mod.rs:3:1:6:1 | fn g | | my2/my3/mod.rs:4:5:4:5 | h | main.rs:50:1:69:1 | fn h | | my2/my3/mod.rs:7:5:7:9 | super | my2/mod.rs:1:1:17:30 | SourceFile | -| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:578:2 | SourceFile | +| my2/my3/mod.rs:7:5:7:16 | ...::super | main.rs:1:1:649:2 | SourceFile | | my2/my3/mod.rs:7:5:7:19 | ...::h | main.rs:50:1:69:1 | fn h | | my2/my3/mod.rs:8:5:8:9 | super | my2/mod.rs:1:1:17:30 | SourceFile | | my2/my3/mod.rs:8:5:8:12 | ...::g | my2/mod.rs:3:1:6:1 | fn g | diff --git a/rust/ql/test/library-tests/variables/variables.ql b/rust/ql/test/library-tests/variables/variables.ql index f7793911dae..121975c0c82 100644 --- a/rust/ql/test/library-tests/variables/variables.ql +++ b/rust/ql/test/library-tests/variables/variables.ql @@ -31,7 +31,7 @@ module VariableAccessTest implements TestSig { private predicate commmentAt(string text, string filepath, int line) { exists(Comment c | c.getLocation().hasLocationInfo(filepath, line, _, _, _) and - c.getCommentText() = text + c.getCommentText().trim() = text ) } From 8674b61e5a886af7bd8f4d1c91cd5ed4670291ca Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 09:26:16 +0200 Subject: [PATCH 210/372] Added SSRF test case with `searchParams` for `NextRequest` --- .../test/query-tests/Security/CWE-918/Request/middleware.ts | 6 ++++++ .../query-tests/Security/CWE-918/RequestForgery.expected | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts index e6bb7f8db60..2e6aa2746d6 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts @@ -2,11 +2,17 @@ import { NextRequest, NextResponse } from 'next/server'; export async function middleware(req: NextRequest) { const target = req.nextUrl // $ Source[js/request-forgery] + const target2 = target.searchParams.get('target'); // $ MISSING: Source[js/request-forgery] if (target) { const res = await fetch(target) // $ Alert[js/request-forgery] Sink[js/request-forgery] const data = await res.text() return new NextResponse(data) } + if (target2) { + const res = await fetch(target2); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const data = await res.text(); + return new NextResponse(data); + } return NextResponse.next() } \ No newline at end of file diff --git a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index cf3b225e322..387a6590fbd 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -1,7 +1,7 @@ #select | Request/app/api/proxy/route2.serverSide.ts:5:21:5:30 | fetch(url) | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | URL | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | user-provided value | | Request/app/api/proxy/route.serverSide.ts:3:21:3:30 | fetch(url) | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | URL | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | user-provided value | -| Request/middleware.ts:6:25:6:37 | fetch(target) | Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:6:31:6:36 | target | The $@ of this request depends on a $@. | Request/middleware.ts:6:31:6:36 | target | URL | Request/middleware.ts:4:20:4:30 | req.nextUrl | user-provided value | +| Request/middleware.ts:7:25:7:37 | fetch(target) | Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:7:31:7:36 | target | The $@ of this request depends on a $@. | Request/middleware.ts:7:31:7:36 | target | URL | Request/middleware.ts:4:20:4:30 | req.nextUrl | user-provided value | | apollo.serverSide.ts:8:39:8:64 | get(fil ... => {}) | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:8:43:8:50 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:8:43:8:50 | file.url | URL | apollo.serverSide.ts:7:36:7:44 | { files } | user-provided value | | apollo.serverSide.ts:18:37:18:62 | get(fil ... => {}) | apollo.serverSide.ts:17:34:17:42 | { files } | apollo.serverSide.ts:18:41:18:48 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:18:41:18:48 | file.url | URL | apollo.serverSide.ts:17:34:17:42 | { files } | user-provided value | | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | The $@ of this request depends on a $@. | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | endpoint | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | user-provided value | @@ -38,7 +38,7 @@ edges | Request/app/api/proxy/route.serverSide.ts:2:9:2:34 | url | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | provenance | | | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | Request/app/api/proxy/route.serverSide.ts:2:9:2:15 | { url } | provenance | | | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | provenance | | -| Request/middleware.ts:4:11:4:30 | target | Request/middleware.ts:6:31:6:36 | target | provenance | | +| Request/middleware.ts:4:11:4:30 | target | Request/middleware.ts:7:31:7:36 | target | provenance | | | Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:4:11:4:30 | target | provenance | | | apollo.serverSide.ts:7:36:7:44 | files | apollo.serverSide.ts:8:13:8:17 | files | provenance | | | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:7:36:7:44 | files | provenance | | @@ -116,7 +116,7 @@ nodes | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | semmle.label | url | | Request/middleware.ts:4:11:4:30 | target | semmle.label | target | | Request/middleware.ts:4:20:4:30 | req.nextUrl | semmle.label | req.nextUrl | -| Request/middleware.ts:6:31:6:36 | target | semmle.label | target | +| Request/middleware.ts:7:31:7:36 | target | semmle.label | target | | apollo.serverSide.ts:7:36:7:44 | files | semmle.label | files | | apollo.serverSide.ts:7:36:7:44 | { files } | semmle.label | { files } | | apollo.serverSide.ts:8:13:8:17 | files | semmle.label | files | From e26695fc511d426c5f84b7c3f7f3606881d62fa4 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Wed, 2 Apr 2025 10:45:18 +0200 Subject: [PATCH 211/372] Rust: Take `where` clauses into account in path resolution --- .../codeql/rust/internal/PathResolution.qll | 20 +++++++++++++------ .../library-tests/path-resolution/main.rs | 6 +++--- .../test/library-tests/type-inference/main.rs | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 31fbf7fe4cf..20d68b76591 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -581,9 +581,21 @@ private class BlockExprItemNode extends ItemNode instanceof BlockExpr { } class TypeParamItemNode extends ItemNode instanceof TypeParam { + private WherePred getAWherePred() { + exists(ItemNode declaringItem | + this = resolveTypeParamPathTypeRepr(result.getTypeRepr()) and + result = declaringItem.getADescendant() and + this = declaringItem.getADescendant() + ) + } + pragma[nomagic] Path getABoundPath() { - result = super.getTypeBoundList().getABound().getTypeRepr().(PathTypeRepr).getPath() + exists(TypeBoundList tbl | result = tbl.getABound().getTypeRepr().(PathTypeRepr).getPath() | + tbl = super.getTypeBoundList() + or + tbl = this.getAWherePred().getTypeBoundList() + ) } pragma[nomagic] @@ -605,11 +617,7 @@ class TypeParamItemNode extends ItemNode instanceof TypeParam { Stages::PathResolutionStage::ref() and exists(this.getABoundPath()) or - exists(ItemNode declaringItem, WherePred wp | - this = resolveTypeParamPathTypeRepr(wp.getTypeRepr()) and - wp = declaringItem.getADescendant() and - this = declaringItem.getADescendant() - ) + exists(this.getAWherePred()) } /** diff --git a/rust/ql/test/library-tests/path-resolution/main.rs b/rust/ql/test/library-tests/path-resolution/main.rs index d1bf53cc5c2..1179f2f7b58 100644 --- a/rust/ql/test/library-tests/path-resolution/main.rs +++ b/rust/ql/test/library-tests/path-resolution/main.rs @@ -568,7 +568,7 @@ mod m24 { T: TraitA // $ item=I111 item=I1151 { fn call_trait_a(&self) { - self.data.trait_a_method(); // $ MISSING: item=I110 + self.data.trait_a_method(); // $ item=I110 } // I116 } @@ -580,8 +580,8 @@ mod m24 { T: TraitA, // $ item=I111 item=I1161 { fn call_both(&self) { - self.data.trait_a_method(); // $ MISSING: item=I110 - self.data.trait_b_method(); // $ MISSING: item=I112 + self.data.trait_a_method(); // $ item=I110 + self.data.trait_b_method(); // $ item=I112 } // I117 } diff --git a/rust/ql/test/library-tests/type-inference/main.rs b/rust/ql/test/library-tests/type-inference/main.rs index f9c03c94710..1972b181c83 100644 --- a/rust/ql/test/library-tests/type-inference/main.rs +++ b/rust/ql/test/library-tests/type-inference/main.rs @@ -623,7 +623,7 @@ mod function_trait_bounds_2 { where T1: Into, { - x.into() + x.into() // $ method=into } pub fn f() { From 678eccb417b32aa38d6b3a0426b448bc4c99612d Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 09:27:54 +0200 Subject: [PATCH 212/372] Added `searchParams.get` as potential source for SSRF --- .../ql/lib/semmle/javascript/frameworks/Next.qll | 12 +++++++++++- .../Security/CWE-918/Request/middleware.ts | 4 ++-- .../Security/CWE-918/RequestForgery.expected | 6 ++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll index fad4f25e5f5..2921b6c4850 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll @@ -318,7 +318,17 @@ module NextJS { ) and kind = "body" or - this = handler.getRequest().getAPropertyRead(["url", "nextUrl"]) and kind = "url" + ( + this = handler.getRequest().getAPropertyRead(["url", "nextUrl"]) + or + this = + handler + .getRequest() + .getAPropertyRead("nextUrl") + .getAPropertyRead("searchParams") + .getAMemberCall("get") + ) and + kind = "url" or this = handler.getRequest().getAPropertyRead("headers") and kind = "headers" } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts index 2e6aa2746d6..3db3a4bae3b 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts @@ -2,14 +2,14 @@ import { NextRequest, NextResponse } from 'next/server'; export async function middleware(req: NextRequest) { const target = req.nextUrl // $ Source[js/request-forgery] - const target2 = target.searchParams.get('target'); // $ MISSING: Source[js/request-forgery] + const target2 = target.searchParams.get('target'); // $ Source[js/request-forgery] if (target) { const res = await fetch(target) // $ Alert[js/request-forgery] Sink[js/request-forgery] const data = await res.text() return new NextResponse(data) } if (target2) { - const res = await fetch(target2); // $ MISSING: Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(target2); // $ Alert[js/request-forgery] Sink[js/request-forgery] const data = await res.text(); return new NextResponse(data); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected index 387a6590fbd..b3d3055cd86 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected +++ b/javascript/ql/test/query-tests/Security/CWE-918/RequestForgery.expected @@ -2,6 +2,7 @@ | Request/app/api/proxy/route2.serverSide.ts:5:21:5:30 | fetch(url) | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route2.serverSide.ts:5:27:5:29 | url | URL | Request/app/api/proxy/route2.serverSide.ts:4:25:4:34 | req.json() | user-provided value | | Request/app/api/proxy/route.serverSide.ts:3:21:3:30 | fetch(url) | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | The $@ of this request depends on a $@. | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | URL | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | user-provided value | | Request/middleware.ts:7:25:7:37 | fetch(target) | Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:7:31:7:36 | target | The $@ of this request depends on a $@. | Request/middleware.ts:7:31:7:36 | target | URL | Request/middleware.ts:4:20:4:30 | req.nextUrl | user-provided value | +| Request/middleware.ts:12:27:12:40 | fetch(target2) | Request/middleware.ts:5:21:5:53 | target. ... arget') | Request/middleware.ts:12:33:12:39 | target2 | The $@ of this request depends on a $@. | Request/middleware.ts:12:33:12:39 | target2 | URL | Request/middleware.ts:5:21:5:53 | target. ... arget') | user-provided value | | apollo.serverSide.ts:8:39:8:64 | get(fil ... => {}) | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:8:43:8:50 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:8:43:8:50 | file.url | URL | apollo.serverSide.ts:7:36:7:44 | { files } | user-provided value | | apollo.serverSide.ts:18:37:18:62 | get(fil ... => {}) | apollo.serverSide.ts:17:34:17:42 | { files } | apollo.serverSide.ts:18:41:18:48 | file.url | The $@ of this request depends on a $@. | apollo.serverSide.ts:18:41:18:48 | file.url | URL | apollo.serverSide.ts:17:34:17:42 | { files } | user-provided value | | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | The $@ of this request depends on a $@. | axiosInterceptors.serverSide.js:11:26:11:40 | userProvidedUrl | endpoint | axiosInterceptors.serverSide.js:19:21:19:28 | req.body | user-provided value | @@ -40,6 +41,8 @@ edges | Request/app/api/proxy/route.serverSide.ts:2:25:2:34 | req.json() | Request/app/api/proxy/route.serverSide.ts:2:19:2:34 | await req.json() | provenance | | | Request/middleware.ts:4:11:4:30 | target | Request/middleware.ts:7:31:7:36 | target | provenance | | | Request/middleware.ts:4:20:4:30 | req.nextUrl | Request/middleware.ts:4:11:4:30 | target | provenance | | +| Request/middleware.ts:5:11:5:53 | target2 | Request/middleware.ts:12:33:12:39 | target2 | provenance | | +| Request/middleware.ts:5:21:5:53 | target. ... arget') | Request/middleware.ts:5:11:5:53 | target2 | provenance | | | apollo.serverSide.ts:7:36:7:44 | files | apollo.serverSide.ts:8:13:8:17 | files | provenance | | | apollo.serverSide.ts:7:36:7:44 | { files } | apollo.serverSide.ts:7:36:7:44 | files | provenance | | | apollo.serverSide.ts:8:13:8:17 | files | apollo.serverSide.ts:8:28:8:31 | file | provenance | | @@ -116,7 +119,10 @@ nodes | Request/app/api/proxy/route.serverSide.ts:3:27:3:29 | url | semmle.label | url | | Request/middleware.ts:4:11:4:30 | target | semmle.label | target | | Request/middleware.ts:4:20:4:30 | req.nextUrl | semmle.label | req.nextUrl | +| Request/middleware.ts:5:11:5:53 | target2 | semmle.label | target2 | +| Request/middleware.ts:5:21:5:53 | target. ... arget') | semmle.label | target. ... arget') | | Request/middleware.ts:7:31:7:36 | target | semmle.label | target | +| Request/middleware.ts:12:33:12:39 | target2 | semmle.label | target2 | | apollo.serverSide.ts:7:36:7:44 | files | semmle.label | files | | apollo.serverSide.ts:7:36:7:44 | { files } | semmle.label | { files } | | apollo.serverSide.ts:8:13:8:17 | files | semmle.label | files | From 2c4b3527b4bee7f97b071614d97b6a544911c5a6 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 09:38:23 +0200 Subject: [PATCH 213/372] Added change note --- javascript/ql/lib/change-notes/2025-04-11-nextrequest.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 javascript/ql/lib/change-notes/2025-04-11-nextrequest.md diff --git a/javascript/ql/lib/change-notes/2025-04-11-nextrequest.md b/javascript/ql/lib/change-notes/2025-04-11-nextrequest.md new file mode 100644 index 00000000000..9db5c34e51b --- /dev/null +++ b/javascript/ql/lib/change-notes/2025-04-11-nextrequest.md @@ -0,0 +1,5 @@ +--- +category: minorAnalysis +--- +* Data passed to the [NextResponse](https://nextjs.org/docs/app/api-reference/functions/next-response) constructor is now treated as a sink for `js/reflected-xss`. +* Data received from [NextRequest](https://nextjs.org/docs/app/api-reference/functions/next-request) and [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) is now treated as a remote user input `source`. From 85940484ab91edf97eca320b927bb017cf384ada Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 11 Apr 2025 09:57:50 +0200 Subject: [PATCH 214/372] Update rust/ql/test/setup.sh --- rust/ql/test/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ql/test/setup.sh b/rust/ql/test/setup.sh index 9b2d6b4f344..f087e7bc32b 100755 --- a/rust/ql/test/setup.sh +++ b/rust/ql/test/setup.sh @@ -14,5 +14,5 @@ find . -name rust-toolchain.toml \ -execdir rustup install \; \ -execdir rustup component add rust-src \; -# no to install rust-src explicitly, it's listedin ql/rust/rust-toolchain.toml +# no to install rust-src explicitly, it's listed in ql/rust/rust-toolchain.toml rustup install From e3f1720f9c532d4afd24cb8de2beb5f173b890c1 Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 10:04:09 +0200 Subject: [PATCH 215/372] Renamed`DecodeLike` to `Decode` and updated `propagatesFlow` --- .../javascript/internal/flow_summaries/Decoders.qll | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll index 7e75d6482c5..2866c892608 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Decoders.qll @@ -13,16 +13,16 @@ private class TextDecoderEntryPoint extends API::EntryPoint { pragma[nomagic] API::Node textDecoderConstructorRef() { result = any(TextDecoderEntryPoint e).getANode() } -class DecodeLike extends SummarizedCallable { - DecodeLike() { this = "TextDecoder#decode" } +class Decode extends SummarizedCallable { + Decode() { this = "TextDecoder#decode" } override InstanceCall getACall() { result = textDecoderConstructorRef().getInstance().getMember("decode").getACall() } override predicate propagatesFlow(string input, string output, boolean preservesValue) { - preservesValue = true and - input = "Argument[0]" and + preservesValue = false and + input = "Argument[0].ArrayElement" and output = "ReturnValue" } } From f675a143d6f62140318b299c4eecd33fa7f0a290 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 10:48:41 +0200 Subject: [PATCH 216/372] ruby: remove redundant cases The CFG handles the negation --- ruby/ql/src/queries/variables/UninitializedLocal.ql | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index aa001ac9bc4..1633e20bee0 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -37,23 +37,12 @@ predicate isGuarded(LocalVariableReadAccess read) { guard.getAstNode() = read.getVariable().getAnAccess() and branch = true or - // guard is `!var` - guard.getAstNode().(NotExpr).getOperand() = read.getVariable().getAnAccess() and - branch = false - or // guard is `var.nil?` exists(MethodCall c | guard.getAstNode() = c | c.getReceiver() = read.getVariable().getAnAccess() and c.getMethodName() = "nil?" ) and branch = false - or - // guard is `!var.nil?` - exists(MethodCall c | guard.getAstNode().(NotExpr).getOperand() = c | - c.getReceiver() = read.getVariable().getAnAccess() and - c.getMethodName() = "nil?" - ) and - branch = true ) } From 4167e960580bc9692734451e202143d10ea85722 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 11:00:22 +0200 Subject: [PATCH 217/372] ruby: more complete impleemntation of `isInBooleanContext` Co-authored-by: Tom Hvitved --- .../queries/variables/UninitializedLocal.ql | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index 1633e20bee0..93e5c9b3adb 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -17,19 +17,37 @@ private import codeql.ruby.dataflow.internal.DataFlowPublic import codeql.ruby.controlflow.internal.Guards as Guards import codeql.ruby.controlflow.CfgNodes -predicate isInBooleanContext(Expr e) { - e = any(ConditionalExpr c).getCondition() +private predicate isInBooleanContext(AstNode n) { + exists(ConditionalExpr i | + n = i.getCondition() + or + isInBooleanContext(i) and + n = i.getBranch(_) + ) or - e = any(ConditionalLoop l).getCondition() + n = any(ConditionalLoop parent).getCondition() or - e = any(LogicalAndExpr n).getAnOperand() + n = any(InClause parent).getCondition() or - e = any(LogicalOrExpr n).getAnOperand() + n = any(LogicalAndExpr op).getAnOperand() or - e = any(NotExpr n).getOperand() + n = any(LogicalOrExpr op).getAnOperand() + or + n = any(NotExpr op).getOperand() + or + n = any(StmtSequence parent | isInBooleanContext(parent)).getLastStmt() + or + exists(CaseExpr c, WhenClause w | + not exists(c.getValue()) and + c.getABranch() = w + | + w.getPattern(_) = n + or + w = n + ) } -predicate isGuarded(LocalVariableReadAccess read) { +private predicate isGuarded(LocalVariableReadAccess read) { exists(AstCfgNode guard, boolean branch | Guards::guardControlsBlock(guard, read.getAControlFlowNode().getBasicBlock(), branch) | @@ -46,7 +64,7 @@ predicate isGuarded(LocalVariableReadAccess read) { ) } -predicate isNilChecked(LocalVariableReadAccess read) { +private predicate isNilChecked(LocalVariableReadAccess read) { exists(MethodCall c | c.getReceiver() = read | c.getMethodName() = "nil?" or From d0dcf897cb82b4f44ccfd3edebeb048346b551cc Mon Sep 17 00:00:00 2001 From: Napalys Klicius Date: Fri, 11 Apr 2025 11:04:08 +0200 Subject: [PATCH 218/372] Update javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll Co-authored-by: Asger F --- .../lib/semmle/javascript/internal/flow_summaries/Strings.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll index 8c8ab1ac4ac..d18e2181965 100644 --- a/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll +++ b/javascript/ql/lib/semmle/javascript/internal/flow_summaries/Strings.qll @@ -108,7 +108,7 @@ class StringFromCharCode extends SummarizedCallable { } override predicate propagatesFlow(string input, string output, boolean preservesValue) { - preservesValue = true and + preservesValue = false and ( input = "Argument[0..]" and output = "ReturnValue" From 92e4f112c01256d7bde118ce3e30c4a7b4b7e418 Mon Sep 17 00:00:00 2001 From: Napalys Klicius Date: Fri, 11 Apr 2025 11:08:40 +0200 Subject: [PATCH 219/372] Update javascript/ql/lib/semmle/javascript/frameworks/Next.qll Co-authored-by: Asger F --- javascript/ql/lib/semmle/javascript/frameworks/Next.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll index 2921b6c4850..b31da84a341 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll @@ -283,7 +283,7 @@ module NextJS { NextAppRouteHandler() { exists(Module mod | mod.getFile().getParentContainer() = apiFolder() or - mod.getFile().getBaseName() = ["middleware.ts", "middleware.js"] + mod.getFile().getStem() = "middleware" | this = mod.getAnExportedValue([any(Http::RequestMethodName m), "middleware"]).getAFunctionValue() and From 11abbf8c4ae5267a17d3b4692c991a5a316c971d Mon Sep 17 00:00:00 2001 From: Napalys Date: Fri, 11 Apr 2025 11:19:12 +0200 Subject: [PATCH 220/372] Now `nextUrl` is of type `parameter` and loosen the restriction for `NextAppRouteHandler` --- .../lib/semmle/javascript/frameworks/Next.qll | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll index b31da84a341..551d325f26a 100644 --- a/javascript/ql/lib/semmle/javascript/frameworks/Next.qll +++ b/javascript/ql/lib/semmle/javascript/frameworks/Next.qll @@ -286,12 +286,7 @@ module NextJS { mod.getFile().getStem() = "middleware" | this = - mod.getAnExportedValue([any(Http::RequestMethodName m), "middleware"]).getAFunctionValue() and - ( - this.getParameter(0).hasUnderlyingType("next/server", "NextRequest") - or - this.getParameter(0).hasUnderlyingType("Request") - ) + mod.getAnExportedValue([any(Http::RequestMethodName m), "middleware"]).getAFunctionValue() ) } @@ -318,18 +313,17 @@ module NextJS { ) and kind = "body" or - ( - this = handler.getRequest().getAPropertyRead(["url", "nextUrl"]) - or - this = - handler - .getRequest() - .getAPropertyRead("nextUrl") - .getAPropertyRead("searchParams") - .getAMemberCall("get") - ) and + this = handler.getRequest().getAPropertyRead(["url", "nextUrl"]) and kind = "url" or + this = + handler + .getRequest() + .getAPropertyRead("nextUrl") + .getAPropertyRead("searchParams") + .getAMemberCall("get") and + kind = "parameter" + or this = handler.getRequest().getAPropertyRead("headers") and kind = "headers" } From a5aef8c6f92fe230cdd44cc7515ff8eac07f181c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 11 Apr 2025 12:03:06 +0200 Subject: [PATCH 221/372] C#: Add some more DotNet autobuilder unit tests. --- .../BuildScripts.cs | 77 ++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs index d277331b12e..6bbe706d954 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs @@ -424,8 +424,7 @@ namespace Semmle.Autobuild.CSharp.Tests return new CSharpAutobuilder(actions, options); } - [Fact] - public void TestDefaultCSharpAutoBuilder() + private void SetupActionForDotnet() { actions.RunProcess["cmd.exe /C dotnet --info"] = 0; actions.RunProcess[@"cmd.exe /C dotnet clean C:\Project\test.csproj"] = 0; @@ -438,20 +437,80 @@ namespace Semmle.Autobuild.CSharp.Tests actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_SCRATCH_DIR"] = "scratch"; actions.EnumerateFiles[@"C:\Project"] = "foo.cs\nbar.cs\ntest.csproj"; actions.EnumerateDirectories[@"C:\Project"] = ""; - var xml = new XmlDocument(); - xml.LoadXml(@" - - Exe - netcoreapp2.1 - + } -"); + private void CreateAndVerifyDotnetScript(XmlDocument xml) + { actions.LoadXml[@"C:\Project\test.csproj"] = xml; var autobuilder = CreateAutoBuilder(true); TestAutobuilderScript(autobuilder, 0, 4); } + [Fact] + public void TestDefaultCSharpAutoBuilder1() + { + SetupActionForDotnet(); + var xml = new XmlDocument(); + xml.LoadXml( + """ + + + Exe + netcoreapp2.1 + + + """); + CreateAndVerifyDotnetScript(xml); + } + + [Fact] + public void TestDefaultCSharpAutoBuilder2() + { + SetupActionForDotnet(); + var xml = new XmlDocument(); + + xml.LoadXml( + """ + + + + + Exe + net9.0 + enable + enable + + + """ + ); + CreateAndVerifyDotnetScript(xml); + } + + [Fact] + public void TestDefaultCSharpAutoBuilder3() + { + SetupActionForDotnet(); + var xml = new XmlDocument(); + + xml.LoadXml( + """ + + + + + Exe + net9.0 + enable + enable + + + + """ + ); + CreateAndVerifyDotnetScript(xml); + } + [Fact] public void TestLinuxCSharpAutoBuilder() { From 6e2cfab7b226e0c845ee36eb1deb31215000b4ce Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 12:46:25 +0200 Subject: [PATCH 222/372] ruby: add test for `for` found during triage --- .../UninitializedLocal/UninitializedLocal.expected | 2 ++ .../variables/UninitializedLocal/UninitializedLocal.rb | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected index e8ab4210760..5d0cdddf964 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected @@ -1,3 +1,5 @@ | UninitializedLocal.rb:12:3:12:3 | m | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:8:7:8:7 | m | m | | UninitializedLocal.rb:34:5:34:5 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:9:27:9 | b | b | | UninitializedLocal.rb:34:23:34:23 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:9:27:9 | b | b | +| UninitializedLocal.rb:73:9:73:9 | i | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:73:9:73:9 | i | i | +| UninitializedLocal.rb:76:5:76:5 | i | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:73:9:73:9 | i | i | diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb index 6682a4bc1e0..9761baac1da 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb @@ -67,4 +67,11 @@ def test_loop end end until a # OK a # OK - given previous until +end + +def test_for + for i in 0..10 #$ SPURIOUS: Alert + i + end + i #$ SPURIOUS: Alert end \ No newline at end of file From b641d5f177637cf4ac6cfbca3a97fb934a7cb5c4 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 13:22:42 +0200 Subject: [PATCH 223/372] ruby: fix FP --- ruby/ql/src/queries/variables/UninitializedLocal.ql | 5 +++-- .../variables/UninitializedLocal/UninitializedLocal.expected | 1 - .../variables/UninitializedLocal/UninitializedLocal.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index 93e5c9b3adb..0e819cf8a90 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -13,9 +13,9 @@ import codeql.ruby.AST import codeql.ruby.dataflow.SSA -private import codeql.ruby.dataflow.internal.DataFlowPublic import codeql.ruby.controlflow.internal.Guards as Guards import codeql.ruby.controlflow.CfgNodes +import codeql.ruby.ast.internal.Variable private predicate isInBooleanContext(AstNode n) { exists(ConditionalExpr i | @@ -72,7 +72,8 @@ private predicate isNilChecked(LocalVariableReadAccess read) { ) } -class RelevantLocalVariableReadAccess extends LocalVariableReadAccess { +class RelevantLocalVariableReadAccess extends LocalVariableReadAccess instanceof TVariableAccessReal +{ RelevantLocalVariableReadAccess() { not isInBooleanContext(this) and not isNilChecked(this) and diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected index 5d0cdddf964..174d0d348a2 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.expected @@ -1,5 +1,4 @@ | UninitializedLocal.rb:12:3:12:3 | m | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:8:7:8:7 | m | m | | UninitializedLocal.rb:34:5:34:5 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:9:27:9 | b | b | | UninitializedLocal.rb:34:23:34:23 | b | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:27:9:27:9 | b | b | -| UninitializedLocal.rb:73:9:73:9 | i | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:73:9:73:9 | i | i | | UninitializedLocal.rb:76:5:76:5 | i | Local variable $@ may be used before it is initialized. | UninitializedLocal.rb:73:9:73:9 | i | i | diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb index 9761baac1da..9f4dc720ed0 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb @@ -70,7 +70,7 @@ def test_loop end def test_for - for i in 0..10 #$ SPURIOUS: Alert + for i in 0..10 # OK - since 0..10 cannot raise i end i #$ SPURIOUS: Alert From bfc494c0e1d08da309bf0c6872b677531ab409b1 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 12:43:51 +0100 Subject: [PATCH 224/372] Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll Co-authored-by: Taus --- .../semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index 1cf67dba1ee..6c096d098cd 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -462,7 +462,7 @@ newtype TPosition = TDirectPosition(int argumentIndex) { exists(any(CallInstruction c).getArgument(argumentIndex)) or - // Handle the rare case where the is a function definition but no call to + // Handle the rare case where there is a function definition but no call to // the function. exists(any(Cpp::Function f).getParameter(argumentIndex)) } or From deef95d3847c899e20deb9cb80794966860f06b6 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 12:43:59 +0100 Subject: [PATCH 225/372] Update cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll Co-authored-by: Taus --- .../semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll index 6c096d098cd..c5024d07dcb 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll @@ -470,7 +470,7 @@ newtype TPosition = Ssa::hasIndirectOperand(any(CallInstruction call).getArgumentOperand(argumentIndex), indirectionIndex) or - // Handle the rare case where the is a function definition but no call to + // Handle the rare case where there is a function definition but no call to // the function. exists(Cpp::Function f, Cpp::Parameter p | p = f.getParameter(argumentIndex) and From 31143b405ebb4cf7c3f55d4db84ac372391c2545 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 11 Apr 2025 13:11:04 +0200 Subject: [PATCH 226/372] C#: Improve auto builder logic to detect Sdk reference. --- .../Semmle.Autobuild.Shared/Project.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs index c318ef09805..37a8feee186 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml; -using Semmle.Util.Logging; namespace Semmle.Autobuild.Shared { @@ -26,6 +25,26 @@ namespace Semmle.Autobuild.Shared private readonly Lazy>> includedProjectsLazy; public override IEnumerable IncludedProjects => includedProjectsLazy.Value; + private static bool HasSdkAttribute(XmlElement xml) => + xml.HasAttribute("Sdk"); + + private static bool AnyElement(XmlNodeList l, Func f) => + l.OfType().Any(f); + + /// + /// According to https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022#reference-a-project-sdk + /// there are three ways to reference a project SDK: + /// 1. As an attribute on the . + /// 2. As a top level element of . + /// 3. As an attribute on an element. + /// + /// Returns true, if the Sdk attribute is used, otherwise false. + /// + private static bool ReferencesSdk(XmlElement xml) => + HasSdkAttribute(xml) || // Case 1 + AnyElement(xml.ChildNodes, e => e.Name == "Sdk") || // Case 2 + AnyElement(xml.GetElementsByTagName("Import"), HasSdkAttribute); // Case 3 + public Project(Autobuilder builder, string path) : base(builder, path) { ToolsVersion = new Version(); @@ -49,7 +68,7 @@ namespace Semmle.Autobuild.Shared if (root?.Name == "Project") { - if (root.HasAttribute("Sdk")) + if (ReferencesSdk(root)) { DotNetProject = true; return; From f349048e42502ac12ea6de07be7d93814297a6ae Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 11 Apr 2025 13:17:41 +0200 Subject: [PATCH 227/372] C#: Add change note. --- csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md diff --git a/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md b/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md new file mode 100644 index 00000000000..1ab0153786f --- /dev/null +++ b/csharp/ql/lib/change-notes/2025-04-11-auto-builder-sdk.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Improved autobuilder logic for detecting whether a project references a SDK (and should be built using `dotnet`). From 51388f24012fbf33d4321e74d2ed2a3c6806e9c1 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Fri, 11 Apr 2025 12:42:12 +0200 Subject: [PATCH 228/372] Do not try running mono when it's not available on the runner --- .../BuildScripts.cs | 35 ++++++++++++++++--- .../Semmle.Autobuild.Shared/MsBuildRule.cs | 20 +++++++---- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs index d277331b12e..db445c591a5 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs @@ -46,6 +46,11 @@ namespace Semmle.Autobuild.CSharp.Tests public IList RunProcessIn { get; } = new List(); public IDictionary RunProcess { get; } = new Dictionary(); + + /// + /// (process-exit code) pairs for commands that are executed during the assembly of the autobuild script. + /// + public IDictionary RunProcessExecuteDuring { get; } = new Dictionary(); public IDictionary RunProcessOut { get; } = new Dictionary(); public IDictionary RunProcessWorkingDirectory { get; } = new Dictionary(); public HashSet CreateDirectories { get; } = new HashSet(); @@ -66,7 +71,7 @@ namespace Semmle.Autobuild.CSharp.Tests if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret)) + if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -81,7 +86,7 @@ namespace Semmle.Autobuild.CSharp.Tests if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret)) + if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -797,11 +802,32 @@ namespace Semmle.Autobuild.CSharp.Tests } [Fact] - public void TestDirsProjLinux() + public void TestDirsProjLinux_WithMono() { + actions.RunProcessExecuteDuring[@"mono --version"] = 0; + actions.RunProcess[@"nuget restore C:\Project/dirs.proj -DisableParallelProcessing"] = 1; actions.RunProcess[@"mono scratch/.nuget/nuget.exe restore C:\Project/dirs.proj -DisableParallelProcessing"] = 0; actions.RunProcess[@"msbuild C:\Project/dirs.proj /t:rebuild"] = 0; + + var autobuilder = TestDirsProjLinux(); + TestAutobuilderScript(autobuilder, 0, 3); + } + + [Fact] + public void TestDirsProjLinux_WithoutMono() + { + actions.RunProcessExecuteDuring[@"mono --version"] = 1; + + actions.RunProcess[@"dotnet msbuild /t:restore C:\Project/dirs.proj"] = 0; + actions.RunProcess[@"dotnet msbuild C:\Project/dirs.proj /t:rebuild"] = 0; + + var autobuilder = TestDirsProjLinux(); + TestAutobuilderScript(autobuilder, 0, 2); + } + + private CSharpAutobuilder TestDirsProjLinux() + { actions.FileExists["csharp.log"] = true; actions.FileExists[@"C:\Project/a/test.csproj"] = true; actions.FileExists[@"C:\Project/dirs.proj"] = true; @@ -830,8 +856,7 @@ namespace Semmle.Autobuild.CSharp.Tests "); actions.LoadXml[@"C:\Project/dirs.proj"] = dirsproj; - var autobuilder = CreateAutoBuilder(false); - TestAutobuilderScript(autobuilder, 0, 3); + return CreateAutoBuilder(false); } [Fact] diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs index 953f0884a44..72ede13da42 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs @@ -10,15 +10,13 @@ namespace Semmle.Autobuild.Shared /// /// Appends a call to msbuild. /// - /// - /// /// - public static CommandBuilder MsBuildCommand(this CommandBuilder cmdBuilder, IAutobuilder builder) + public static CommandBuilder MsBuildCommand(this CommandBuilder cmdBuilder, IAutobuilder builder, bool preferDotnet) { // mono doesn't ship with `msbuild` on Arm-based Macs, but we can fall back to // msbuild that ships with `dotnet` which can be invoked with `dotnet msbuild` // perhaps we should do this on all platforms? - return builder.Actions.IsRunningOnAppleSilicon() + return builder.Actions.IsRunningOnAppleSilicon() || preferDotnet ? cmdBuilder.RunCommand("dotnet").Argument("msbuild") : cmdBuilder.RunCommand("msbuild"); } @@ -75,13 +73,21 @@ namespace Semmle.Autobuild.Shared QuoteArgument(projectOrSolution.FullPath). Argument("-DisableParallelProcessing"). Script; + + BuildScript GetMonoVersionScript() => new CommandBuilder(builder.Actions). + RunCommand("mono"). + Argument("--version"). + Script; + + var preferDotnet = !builder.Actions.IsWindows() && GetMonoVersionScript().Run(builder.Actions, (_, _) => { }, (_, _, _) => { }) != 0; + var nugetRestore = GetNugetRestoreScript(); var msbuildRestoreCommand = new CommandBuilder(builder.Actions). - MsBuildCommand(builder). + MsBuildCommand(builder, preferDotnet). Argument("/t:restore"). QuoteArgument(projectOrSolution.FullPath); - if (builder.Actions.IsRunningOnAppleSilicon()) + if (builder.Actions.IsRunningOnAppleSilicon() || preferDotnet) { // On Apple Silicon, only try package restore with `dotnet msbuild /t:restore` ret &= BuildScript.Try(msbuildRestoreCommand.Script); @@ -119,7 +125,7 @@ namespace Semmle.Autobuild.Shared command.RunCommand("set Platform=&& type NUL", quoteExe: false); } - command.MsBuildCommand(builder); + command.MsBuildCommand(builder, preferDotnet); command.QuoteArgument(projectOrSolution.FullPath); var target = "rebuild"; From 2477233508ef3db2671182f45cf699ec4097dae3 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 15:01:57 +0200 Subject: [PATCH 229/372] ruby: only report on method calls Interviewing a Ruby developer, I learned that dealing with nil is common practice. So alerts are mostly useful, if we can point to a place where this has gone wrong. --- .../variables/UninitializedLocal.qhelp | 9 ++-- .../queries/variables/UninitializedLocal.ql | 3 +- .../variables/examples/UninitializedLocal.rb | 4 +- .../UninitializedLocal/UninitializedLocal.rb | 42 +++++++++---------- 4 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.qhelp b/ruby/ql/src/queries/variables/UninitializedLocal.qhelp index d06bdc7087f..078775e803f 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.qhelp +++ b/ruby/ql/src/queries/variables/UninitializedLocal.qhelp @@ -12,6 +12,8 @@ Consider the following example:

    This will generate an alert on the last access to m, where it is not clear that the programmer intended to read from the local variable. +In fact, the last access to m is a method call, and the value of the local variable is nil, +so this will raise a NoMethodError.

    @@ -19,8 +21,7 @@ This will generate an alert on the last access to m, where it is no

    Ensure that you check the control and data flow in the method carefully. -Check that the variable reference is spelled correctly, perhaps the variable has been renamed and the reference needs to be updated. -Another possibility is that an exception may be raised before the variable is assigned, in which case the read should be protected by a check for nil. +Add a check for nil before the read, or rewrite the code to ensure that the variable is always initialized before being read.

    @@ -28,8 +29,8 @@ Another possibility is that an exception may be raised before the variable is as -
  • Wikipedia: Dead store.
  • - +
  • https://www.rubyguides.com/: Nil.
  • +
  • https://ruby-doc.org/: NoMethodError.
  • diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index 0e819cf8a90..1cd496c86be 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -77,7 +77,8 @@ class RelevantLocalVariableReadAccess extends LocalVariableReadAccess instanceof RelevantLocalVariableReadAccess() { not isInBooleanContext(this) and not isNilChecked(this) and - not isGuarded(this) + not isGuarded(this) and + this = any(MethodCall m).getReceiver() } } diff --git a/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb b/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb index f7c79410ffc..56172f4df70 100644 --- a/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb +++ b/ruby/ql/src/queries/variables/examples/UninitializedLocal.rb @@ -5,10 +5,10 @@ end def foo m # calls m above if false - m = 0 + m = "0" m # reads local variable m else end - m # reads uninitialized local variable m, `nil` + m.strip # reads uninitialized local variable m, `nil`, and crashes m2 # undefined local variable or method 'm2' for main (NameError) end \ No newline at end of file diff --git a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb index 9f4dc720ed0..7c82c8bf69e 100644 --- a/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb +++ b/ruby/ql/test/query-tests/variables/UninitializedLocal/UninitializedLocal.rb @@ -5,57 +5,57 @@ end def foo m # calls m above if false - m = 0 + m = "0" m # reads local variable m else end - m #$ Alert + m.strip #$ Alert m2 # undefined local variable or method 'm2' for main (NameError) end def test_guards - if (a = 3 && a) # OK - a is in a Boolean context - a + if (a = "3" && a) # OK - a is in a Boolean context + a.strip end - if (a = 3) && a # OK - a is assigned in the previous conjunct - a + if (a = "3") && a # OK - a is assigned in the previous conjunct + a.strip end - if !(a = 3) or a # OK - a is assigned in the previous conjunct - a + if !(a = "3") or a # OK - a is assigned in the previous conjunct + a.strip end if false - b = 0 + b = "0" end b.nil? b || 0 # OK - b&.m # OK - safe navigation - b if b # OK + b&.strip # OK - safe navigation + b.strip if b # OK b.close if b && !b.closed # OK b.blowup if b || !b.blownup #$ Alert if false - c = 0 + c = "0" end unless c return end - c # OK - given above unless + c.strip # OK - given above unless if false - d = 0 + d = "0" end if (d.nil?) return end - d # OK - given above check + d.strip # OK - given above check if false - e = 0 + e = "0" end unless (!e.nil?) return end - e # OK - given above unless + e.strip # OK - given above unless end def test_loop @@ -66,12 +66,12 @@ def test_loop set_a end end until a # OK - a # OK - given previous until + a.strip # OK - given previous until end def test_for - for i in 0..10 # OK - since 0..10 cannot raise - i + for i in ["foo", "bar"] # OK - since 0..10 cannot raise + puts i.strip end - i #$ SPURIOUS: Alert + i.strip #$ SPURIOUS: Alert end \ No newline at end of file From 6c01709048a97c36727c6a7538efb478c53f12a9 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 11 Apr 2025 15:15:22 +0200 Subject: [PATCH 230/372] JS: Update more test output --- javascript/ql/test/library-tests/DataFlow/tests.expected | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/javascript/ql/test/library-tests/DataFlow/tests.expected b/javascript/ql/test/library-tests/DataFlow/tests.expected index 3637927d0e2..55c6771eef0 100644 --- a/javascript/ql/test/library-tests/DataFlow/tests.expected +++ b/javascript/ql/test/library-tests/DataFlow/tests.expected @@ -1094,6 +1094,7 @@ flowStep | tst.js:87:11:87:24 | o | tst.js:90:15:90:15 | o | | tst.js:87:11:87:24 | x | tst.js:91:10:91:10 | x | | tst.js:87:13:87:16 | p: x | tst.js:87:11:87:24 | x | +| tst.js:87:22:87:22 | ...o | tst.js:87:11:87:24 | o | | tst.js:88:7:88:18 | y | tst.js:91:14:91:14 | y | | tst.js:88:9:88:12 | q: y | tst.js:88:7:88:18 | y | | tst.js:88:18:88:18 | o | tst.js:88:7:88:14 | { q: y } | @@ -1110,6 +1111,7 @@ flowStep | tst.js:98:11:98:24 | rest | tst.js:101:13:101:16 | rest | | tst.js:98:11:98:24 | x | tst.js:102:10:102:10 | x | | tst.js:98:13:98:13 | x | tst.js:98:11:98:24 | x | +| tst.js:98:19:98:22 | ...rest | tst.js:98:11:98:24 | rest | | tst.js:99:7:99:18 | y | tst.js:102:14:102:14 | y | | tst.js:99:9:99:9 | y | tst.js:99:7:99:18 | y | | tst.js:99:15:99:18 | rest | tst.js:99:7:99:11 | [ y ] | @@ -1264,6 +1266,7 @@ getImmediatePredecessor | tst.js:87:11:87:24 | o | tst.js:90:15:90:15 | o | | tst.js:87:11:87:24 | x | tst.js:91:10:91:10 | x | | tst.js:87:13:87:16 | p: x | tst.js:87:11:87:24 | x | +| tst.js:87:22:87:22 | ...o | tst.js:87:11:87:24 | o | | tst.js:88:7:88:18 | y | tst.js:91:14:91:14 | y | | tst.js:88:9:88:12 | q: y | tst.js:88:7:88:18 | y | | tst.js:88:18:88:18 | o | tst.js:88:7:88:14 | { q: y } | @@ -1279,6 +1282,7 @@ getImmediatePredecessor | tst.js:98:11:98:24 | rest | tst.js:101:13:101:16 | rest | | tst.js:98:11:98:24 | x | tst.js:102:10:102:10 | x | | tst.js:98:13:98:13 | x | tst.js:98:11:98:24 | x | +| tst.js:98:19:98:22 | ...rest | tst.js:98:11:98:24 | rest | | tst.js:99:7:99:18 | y | tst.js:102:14:102:14 | y | | tst.js:99:9:99:9 | y | tst.js:99:7:99:18 | y | | tst.js:99:15:99:18 | rest | tst.js:99:7:99:11 | [ y ] | From dbbd80f4dc8567eb896c253b3decd29f7b4f572f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 15:32:15 +0200 Subject: [PATCH 231/372] Rust: pick correct edition for the files Previously we would unconditionally set the edition to the latest stable according to rust-analyzer (2021 at the moment). Now we ask rust-analyzer itself to pick the correct edition for the file. --- rust/extractor/src/rust_analyzer.rs | 119 ++++++++++++++-------------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/rust/extractor/src/rust_analyzer.rs b/rust/extractor/src/rust_analyzer.rs index 1947dcbe09f..9bd5abaab14 100644 --- a/rust/extractor/src/rust_analyzer.rs +++ b/rust/extractor/src/rust_analyzer.rs @@ -1,5 +1,5 @@ use itertools::Itertools; -use ra_ap_base_db::{EditionedFileId, RootQueryDb, SourceDatabase}; +use ra_ap_base_db::{EditionedFileId, FileText, RootQueryDb, SourceDatabase}; use ra_ap_hir::Semantics; use ra_ap_ide_db::RootDatabase; use ra_ap_load_cargo::{LoadCargoConfig, load_workspace_at}; @@ -7,7 +7,6 @@ use ra_ap_paths::{AbsPath, Utf8PathBuf}; use ra_ap_project_model::ProjectManifest; use ra_ap_project_model::{CargoConfig, ManifestPath}; use ra_ap_span::Edition; -use ra_ap_span::EditionedFileId as SpanEditionedFileId; use ra_ap_span::TextRange; use ra_ap_span::TextSize; use ra_ap_syntax::SourceFile; @@ -54,7 +53,6 @@ impl<'a> RustAnalyzer<'a> { ) -> Option<(RootDatabase, Vfs)> { let progress = |t| (trace!("progress: {}", t)); let manifest = project.manifest_path(); - match load_workspace_at(manifest.as_ref(), config, load_config, &progress) { Ok((db, vfs, _macro_server)) => Some((db, vfs)), Err(err) => { @@ -66,67 +64,70 @@ impl<'a> RustAnalyzer<'a> { pub fn new(vfs: &'a Vfs, semantics: &'a Semantics<'a, RootDatabase>) -> Self { RustAnalyzer::WithSemantics { vfs, semantics } } - pub fn parse(&self, path: &Path) -> ParseResult { - let no_semantics_reason; + fn get_file_data( + &self, + path: &Path, + ) -> Result<(&Semantics, EditionedFileId, FileText), &str> { match self { + RustAnalyzer::WithoutSemantics { reason } => Err(reason), RustAnalyzer::WithSemantics { vfs, semantics } => { - if let Some(file_id) = path_to_file_id(path, vfs) { - if let Ok(input) = std::panic::catch_unwind(|| semantics.db.file_text(file_id)) - { - let file_id = EditionedFileId::new( - semantics.db, - SpanEditionedFileId::current_edition(file_id), - ); - let source_file = semantics.parse(file_id); - let errors = semantics - .db - .parse_errors(file_id) - .into_iter() - .flat_map(|x| x.to_vec()) - .collect(); - - return ParseResult { - ast: source_file, - text: input.text(semantics.db), - errors, - semantics_info: Ok(FileSemanticInformation { file_id, semantics }), - }; - } - debug!( - "No text available for file_id '{:?}', falling back to loading file '{}' from disk.", - file_id, - path.to_string_lossy() - ); - no_semantics_reason = "no text available for the file in the project"; - } else { - no_semantics_reason = "file not found in project"; - } - } - RustAnalyzer::WithoutSemantics { reason } => { - no_semantics_reason = reason; + let file_id = path_to_file_id(path, vfs).ok_or("file not found in project")?; + let input = std::panic::catch_unwind(|| semantics.db.file_text(file_id)) + .or(Err("no text available for the file in the project"))?; + let editioned_file_id = semantics + .attach_first_edition(file_id) + .ok_or("failed to determine rust edition")?; + Ok(( + semantics, + EditionedFileId::new(semantics.db, editioned_file_id), + input, + )) } } - let mut errors = Vec::new(); - let input = match std::fs::read(path) { - Ok(data) => data, - Err(e) => { - errors.push(SyntaxError::new( - format!("Could not read {}: {}", path.to_string_lossy(), e), - TextRange::empty(TextSize::default()), - )); - vec![] - } - }; - let (input, err) = from_utf8_lossy(&input); + } - let parse = ra_ap_syntax::ast::SourceFile::parse(&input, Edition::CURRENT); - errors.extend(parse.errors()); - errors.extend(err); - ParseResult { - ast: parse.tree(), - text: input.as_ref().into(), - errors, - semantics_info: Err(no_semantics_reason), + pub fn parse(&self, path: &Path) -> ParseResult { + match self.get_file_data(path) { + Ok((semantics, file_id, input)) => { + let source_file = semantics.parse(file_id); + let errors = semantics + .db + .parse_errors(file_id) + .into_iter() + .flat_map(|x| x.to_vec()) + .collect(); + + ParseResult { + ast: source_file, + text: input.text(semantics.db), + errors, + semantics_info: Ok(FileSemanticInformation { file_id, semantics }), + } + } + Err(reason) => { + let mut errors = Vec::new(); + let input = match std::fs::read(path) { + Ok(data) => data, + Err(e) => { + errors.push(SyntaxError::new( + format!("Could not read {}: {}", path.to_string_lossy(), e), + TextRange::empty(TextSize::default()), + )); + vec![] + } + }; + let (input, err) = from_utf8_lossy(&input); + + let parse = ra_ap_syntax::ast::SourceFile::parse(&input, Edition::CURRENT); + errors.extend(parse.errors()); + errors.extend(err); + ParseResult { + ast: parse.tree(), + text: input.as_ref().into(), + errors, + semantics_info: Err(reason), + } + } } } } From 662e963a7b513982825ed8c87a91ddb956ff0857 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 10 Apr 2025 21:35:46 +0200 Subject: [PATCH 232/372] Rust: allow shadowing of prelude items --- .../codeql/rust/internal/PathResolution.qll | 2 +- .../test/library-tests/path-resolution/my.rs | 18 ++++++++++++++++++ .../path-resolution/path-resolution.expected | 7 +++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 91d7e87704c..bc9da4906ea 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -178,7 +178,7 @@ abstract class ItemNode extends Locatable { Stages::PathResolutionStage::ref() and result = this.getASuccessorRec(name) or - preludeEdge(this, name, result) + preludeEdge(this, name, result) and not declares(this, _, name) or name = "super" and if this instanceof Module or this instanceof SourceFile diff --git a/rust/ql/test/library-tests/path-resolution/my.rs b/rust/ql/test/library-tests/path-resolution/my.rs index 2dcb1c76aeb..8a94c169f6f 100644 --- a/rust/ql/test/library-tests/path-resolution/my.rs +++ b/rust/ql/test/library-tests/path-resolution/my.rs @@ -16,3 +16,21 @@ mod my4 { } pub use my4::my5::f as nested_f; // $ item=I201 + +type Result< + T, // T +> = ::std::result::Result< + T, // $ item=T + String, +>; // my::Result + +fn int_div( + x: i32, // + y: i32, +) -> Result // $ item=my::Result +{ + if y == 0 { + return Err("Div by zero".to_string()); + } + Ok(x / y) +} diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 1d480f2f5ad..2a27352411e 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -319,6 +319,13 @@ resolvePath | my.rs:18:9:18:11 | my4 | my.rs:14:1:16:1 | mod my4 | | my.rs:18:9:18:16 | ...::my5 | my.rs:15:5:15:16 | mod my5 | | my.rs:18:9:18:19 | ...::f | my/my4/my5/mod.rs:1:1:3:1 | fn f | +| my.rs:22:5:22:9 | std | file:///Users/arthur/.rustup/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/lib.rs:0:0:0:0 | Crate(std@0.0.0) | +| my.rs:22:5:22:17 | ...::result | file://:0:0:0:0 | mod result | +| my.rs:22:5:25:1 | ...::Result::<...> | file://:0:0:0:0 | enum Result | +| my.rs:23:5:23:5 | T | my.rs:21:5:21:5 | T | +| my.rs:30:6:30:16 | Result::<...> | my.rs:20:1:25:2 | type Result<...> | +| my.rs:33:16:33:18 | Err | file://:0:0:0:0 | Err | +| my.rs:35:5:35:6 | Ok | file://:0:0:0:0 | Ok | | my/nested.rs:9:13:9:13 | f | my/nested.rs:3:9:5:9 | fn f | | my/nested.rs:15:9:15:15 | nested2 | my/nested.rs:2:5:11:5 | mod nested2 | | my/nested.rs:15:9:15:18 | ...::f | my/nested.rs:3:9:5:9 | fn f | From b27ae98b548eceb47fe2624147d65f78e0c74716 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 11 Apr 2025 10:59:08 +0200 Subject: [PATCH 233/372] Rust: normalize paths in the rustup folder --- .../path-resolution/path-resolution.expected | 2 +- .../path-resolution/path-resolution.ql | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.expected b/rust/ql/test/library-tests/path-resolution/path-resolution.expected index 2a27352411e..c52ea098004 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.expected +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.expected @@ -319,7 +319,7 @@ resolvePath | my.rs:18:9:18:11 | my4 | my.rs:14:1:16:1 | mod my4 | | my.rs:18:9:18:16 | ...::my5 | my.rs:15:5:15:16 | mod my5 | | my.rs:18:9:18:19 | ...::f | my/my4/my5/mod.rs:1:1:3:1 | fn f | -| my.rs:22:5:22:9 | std | file:///Users/arthur/.rustup/toolchains/1.85-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/lib.rs:0:0:0:0 | Crate(std@0.0.0) | +| my.rs:22:5:22:9 | std | file:///RUSTUP_HOME/toolchain/lib/rustlib/src/rust/library/std/src/lib.rs:0:0:0:0 | Crate(std@0.0.0) | | my.rs:22:5:22:17 | ...::result | file://:0:0:0:0 | mod result | | my.rs:22:5:25:1 | ...::Result::<...> | file://:0:0:0:0 | enum Result | | my.rs:23:5:23:5 | T | my.rs:21:5:21:5 | T | diff --git a/rust/ql/test/library-tests/path-resolution/path-resolution.ql b/rust/ql/test/library-tests/path-resolution/path-resolution.ql index 4fdcf39c6c6..bd522597a2e 100644 --- a/rust/ql/test/library-tests/path-resolution/path-resolution.ql +++ b/rust/ql/test/library-tests/path-resolution/path-resolution.ql @@ -5,6 +5,17 @@ import TestUtils query predicate mod(Module m) { toBeTested(m) } -query predicate resolvePath(Path p, ItemNode i) { +class ItemNodeLoc extends Locatable instanceof ItemNode { + predicate hasLocationInfo( + string filepath, int startline, int startcolumn, int endline, int endcolumn + ) { + exists(string file | + super.getLocation().hasLocationInfo(file, startline, startcolumn, endline, endcolumn) and + filepath = file.regexpReplaceAll("^/.*/.rustup/toolchains/[^/]+/", "/RUSTUP_HOME/toolchain/") + ) + } +} + +query predicate resolvePath(Path p, ItemNodeLoc i) { toBeTested(p) and not p.isInMacroExpansion() and i = resolvePath(p) } From 6a76a40cf4385d2cd1b163a918cc16d795bc6c06 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 16:18:03 +0200 Subject: [PATCH 234/372] ruby: adjust change notes --- .../2025-04-02-adjust-uninitialized-local-alert-message.md | 4 ++-- .../2025-04-02-adjust-uninitialized-local-metadata.md | 2 +- ruby/ql/src/queries/variables/UninitializedLocal.ql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md index 201e6e8928a..87b92ee51ce 100644 --- a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md +++ b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md @@ -1,4 +1,4 @@ --- -category: minorAnalysis +category: majorAnalysis --- -* The query `rb/uninitialized-local-variable` now take various guards into account and should produce fewer false positives. It also now comes with a help file. +* The query `rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call and should produce very few false positives. It also now comes with a help file. diff --git a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md index d6c5f353a53..61c223981d5 100644 --- a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md +++ b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md @@ -1,4 +1,4 @@ --- category: queryMetadata --- -* The query `rb/uninitialized-local-variable` now only produces alerts when it can find local flow; we have adjusted the precision to 'medium'. +* The query `rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call; we have adjusted the precision to 'high'. diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index 1cd496c86be..c5b4fa18d62 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -8,7 +8,7 @@ * @tags quality * reliability * correctness - * @precision medium + * @precision high */ import codeql.ruby.AST From eb0f8e9572cca851f296c9b5cc427a10a4fe18b1 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 16:27:21 +0200 Subject: [PATCH 235/372] ruby: add `rb/uninitialized-local-variable` to quality suite --- ruby/ql/src/codeql-suites/ruby-code-quality.qls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruby/ql/src/codeql-suites/ruby-code-quality.qls b/ruby/ql/src/codeql-suites/ruby-code-quality.qls index 33be91082d0..2111c6979ef 100644 --- a/ruby/ql/src/codeql-suites/ruby-code-quality.qls +++ b/ruby/ql/src/codeql-suites/ruby-code-quality.qls @@ -2,4 +2,5 @@ - include: id: - rb/database-query-in-loop - - rb/useless-assignment-to-local \ No newline at end of file + - rb/useless-assignment-to-local + - rb/uninitialized-local-variable \ No newline at end of file From 60aa3a8d9d90b51440af7402282d942969fc4d5b Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 16:41:51 +0200 Subject: [PATCH 236/372] Rust: fix workspace member aggregation when absolute path is a glob pattern We were interpreting the absolute path of a workspace as a glob pattern, which doesn't work if the path has some special characters (e.g. `[` or `]`). --- rust/extractor/src/rust_analyzer.rs | 6 ++++-- .../{hello-workspace => hello-[workspace]}/Cargo.toml | 0 .../ExtractionErrors.expected | 0 .../ExtractionErrors.qlref | 0 .../ExtractionWarnings.expected | 0 .../ExtractionWarnings.qlref | 0 .../diagnostics.cargo.expected | 0 .../diagnostics.rust-project.expected | 0 .../{hello-workspace => hello-[workspace]}/exe/Cargo.toml | 0 .../exe/src/a_module.rs | 0 .../{hello-workspace => hello-[workspace]}/exe/src/main.rs | 0 .../functions.expected | 0 .../{hello-workspace => hello-[workspace]}/functions.ql | 0 .../{hello-workspace => hello-[workspace]}/lib/Cargo.toml | 0 .../lib/src/a_module/mod.rs | 0 .../{hello-workspace => hello-[workspace]}/lib/src/lib.rs | 0 .../path-resolution.expected | 0 .../path-resolution.ql | 0 .../rust-project.json | 2 +- .../source_archive.expected | 0 .../steps.cargo.expected | 0 .../{hello-workspace => hello-[workspace]}/steps.ql | 0 .../steps.rust-project.expected | 0 .../summary.cargo.expected | 0 .../{hello-workspace => hello-[workspace]}/summary.qlref | 0 .../summary.rust-project.expected | 0 .../test_workspace.py | 0 27 files changed, 5 insertions(+), 3 deletions(-) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionErrors.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionErrors.qlref (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionWarnings.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/ExtractionWarnings.qlref (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/diagnostics.cargo.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/diagnostics.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/exe/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/exe/src/a_module.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/exe/src/main.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/functions.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/functions.ql (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/lib/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/lib/src/a_module/mod.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/lib/src/lib.rs (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/path-resolution.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/path-resolution.ql (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/rust-project.json (99%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/source_archive.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/steps.cargo.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/steps.ql (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/steps.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/summary.cargo.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/summary.qlref (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/summary.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-workspace => hello-[workspace]}/test_workspace.py (100%) diff --git a/rust/extractor/src/rust_analyzer.rs b/rust/extractor/src/rust_analyzer.rs index 1947dcbe09f..d79d20b4142 100644 --- a/rust/extractor/src/rust_analyzer.rs +++ b/rust/extractor/src/rust_analyzer.rs @@ -173,8 +173,10 @@ impl TomlReader { } fn workspace_members_match(workspace_dir: &AbsPath, members: &[String], target: &AbsPath) -> bool { - members.iter().any(|p| { - glob::Pattern::new(workspace_dir.join(p).as_str()).is_ok_and(|p| p.matches(target.as_str())) + target.strip_prefix(workspace_dir).is_some_and(|rel_path| { + members + .iter() + .any(|p| glob::Pattern::new(p).is_ok_and(|p| p.matches(rel_path.as_str()))) }) } diff --git a/rust/ql/integration-tests/hello-workspace/Cargo.toml b/rust/ql/integration-tests/hello-[workspace]/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-workspace/Cargo.toml rename to rust/ql/integration-tests/hello-[workspace]/Cargo.toml diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected b/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected rename to rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref b/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref rename to rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected b/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected rename to rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected diff --git a/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref b/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref similarity index 100% rename from rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref rename to rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref diff --git a/rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected b/rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected rename to rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected diff --git a/rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected b/rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected rename to rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected diff --git a/rust/ql/integration-tests/hello-workspace/exe/Cargo.toml b/rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-workspace/exe/Cargo.toml rename to rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml diff --git a/rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs b/rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs rename to rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs diff --git a/rust/ql/integration-tests/hello-workspace/exe/src/main.rs b/rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/exe/src/main.rs rename to rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs diff --git a/rust/ql/integration-tests/hello-workspace/functions.expected b/rust/ql/integration-tests/hello-[workspace]/functions.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/functions.expected rename to rust/ql/integration-tests/hello-[workspace]/functions.expected diff --git a/rust/ql/integration-tests/hello-workspace/functions.ql b/rust/ql/integration-tests/hello-[workspace]/functions.ql similarity index 100% rename from rust/ql/integration-tests/hello-workspace/functions.ql rename to rust/ql/integration-tests/hello-[workspace]/functions.ql diff --git a/rust/ql/integration-tests/hello-workspace/lib/Cargo.toml b/rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-workspace/lib/Cargo.toml rename to rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml diff --git a/rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs b/rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs rename to rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs diff --git a/rust/ql/integration-tests/hello-workspace/lib/src/lib.rs b/rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs similarity index 100% rename from rust/ql/integration-tests/hello-workspace/lib/src/lib.rs rename to rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs diff --git a/rust/ql/integration-tests/hello-workspace/path-resolution.expected b/rust/ql/integration-tests/hello-[workspace]/path-resolution.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/path-resolution.expected rename to rust/ql/integration-tests/hello-[workspace]/path-resolution.expected diff --git a/rust/ql/integration-tests/hello-workspace/path-resolution.ql b/rust/ql/integration-tests/hello-[workspace]/path-resolution.ql similarity index 100% rename from rust/ql/integration-tests/hello-workspace/path-resolution.ql rename to rust/ql/integration-tests/hello-[workspace]/path-resolution.ql diff --git a/rust/ql/integration-tests/hello-workspace/rust-project.json b/rust/ql/integration-tests/hello-[workspace]/rust-project.json similarity index 99% rename from rust/ql/integration-tests/hello-workspace/rust-project.json rename to rust/ql/integration-tests/hello-[workspace]/rust-project.json index d8c73fa41b6..fae89dcecce 100644 --- a/rust/ql/integration-tests/hello-workspace/rust-project.json +++ b/rust/ql/integration-tests/hello-[workspace]/rust-project.json @@ -21,4 +21,4 @@ "deps": [] } ] -} \ No newline at end of file +} diff --git a/rust/ql/integration-tests/hello-workspace/source_archive.expected b/rust/ql/integration-tests/hello-[workspace]/source_archive.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/source_archive.expected rename to rust/ql/integration-tests/hello-[workspace]/source_archive.expected diff --git a/rust/ql/integration-tests/hello-workspace/steps.cargo.expected b/rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/steps.cargo.expected rename to rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected diff --git a/rust/ql/integration-tests/hello-workspace/steps.ql b/rust/ql/integration-tests/hello-[workspace]/steps.ql similarity index 100% rename from rust/ql/integration-tests/hello-workspace/steps.ql rename to rust/ql/integration-tests/hello-[workspace]/steps.ql diff --git a/rust/ql/integration-tests/hello-workspace/steps.rust-project.expected b/rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/steps.rust-project.expected rename to rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected diff --git a/rust/ql/integration-tests/hello-workspace/summary.cargo.expected b/rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/summary.cargo.expected rename to rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected diff --git a/rust/ql/integration-tests/hello-workspace/summary.qlref b/rust/ql/integration-tests/hello-[workspace]/summary.qlref similarity index 100% rename from rust/ql/integration-tests/hello-workspace/summary.qlref rename to rust/ql/integration-tests/hello-[workspace]/summary.qlref diff --git a/rust/ql/integration-tests/hello-workspace/summary.rust-project.expected b/rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-workspace/summary.rust-project.expected rename to rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected diff --git a/rust/ql/integration-tests/hello-workspace/test_workspace.py b/rust/ql/integration-tests/hello-[workspace]/test_workspace.py similarity index 100% rename from rust/ql/integration-tests/hello-workspace/test_workspace.py rename to rust/ql/integration-tests/hello-[workspace]/test_workspace.py From 63e5f5a555b10e98e3dc55ebc4ba7701fe553d4a Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 16:50:23 +0200 Subject: [PATCH 237/372] Rust: parametrize some integration tests on three editions --- rust/ql/integration-tests/conftest.py | 32 +++++++++++++++++-- .../hello-project/Cargo.toml | 2 +- .../Cargo.toml | 0 .../ExtractionErrors.expected | 0 .../ExtractionErrors.qlref | 0 .../ExtractionWarnings.expected | 0 .../ExtractionWarnings.qlref | 0 .../diagnostics.cargo.expected | 0 .../diagnostics.rust-project.expected | 0 .../exe/Cargo.toml | 2 +- .../exe/src/a_module.rs | 0 .../exe/src/main.rs | 0 .../functions.expected | 0 .../functions.ql | 0 .../lib/Cargo.toml | 2 +- .../lib/src/a_module/mod.rs | 0 .../lib/src/lib.rs | 0 .../path-resolution.expected | 0 .../path-resolution.ql | 0 .../rust-project.json | 0 .../source_archive.expected | 0 .../steps.cargo.expected | 0 .../steps.ql | 0 .../steps.rust-project.expected | 0 .../summary.cargo.expected | 0 .../summary.qlref | 0 .../summary.rust-project.expected | 0 .../test_workspace.py | 1 - 28 files changed, 32 insertions(+), 7 deletions(-) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/Cargo.toml (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionErrors.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionErrors.qlref (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionWarnings.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/ExtractionWarnings.qlref (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/diagnostics.cargo.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/diagnostics.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/exe/Cargo.toml (69%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/exe/src/a_module.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/exe/src/main.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/functions.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/functions.ql (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/lib/Cargo.toml (60%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/lib/src/a_module/mod.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/lib/src/lib.rs (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/path-resolution.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/path-resolution.ql (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/rust-project.json (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/source_archive.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/steps.cargo.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/steps.ql (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/steps.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/summary.cargo.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/summary.qlref (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/summary.rust-project.expected (100%) rename rust/ql/integration-tests/{hello-[workspace] => hello-workspace}/test_workspace.py (99%) diff --git a/rust/ql/integration-tests/conftest.py b/rust/ql/integration-tests/conftest.py index a1fbcf4e18d..578a81a849a 100644 --- a/rust/ql/integration-tests/conftest.py +++ b/rust/ql/integration-tests/conftest.py @@ -2,13 +2,35 @@ import pytest import json import commands import pathlib +import tomllib + + +@pytest.fixture(params=[2018, 2021, 2024]) +def rust_edition(request): + return request.param @pytest.fixture -def cargo(cwd): - assert (cwd / "Cargo.toml").exists() +def cargo(cwd, rust_edition): + manifest_file = cwd / "Cargo.toml" + assert manifest_file.exists() (cwd / "rust-project.json").unlink(missing_ok=True) + def update(file): + contents = file.read_text() + m = tomllib.loads(contents) + if 'package' in m: + # tomllib does not support writing, and we don't want to use further dependencies + # so we just do a dumb search and replace + contents = contents.replace(f'edition = "{m["package"]["edition"]}"', f'edition = "{rust_edition}"') + file.write_text(contents) + if 'members' in m.get('workspace', ()): + for member in m['workspace']['members']: + update(file.parent / member / "Cargo.toml") + + update(manifest_file) + + @pytest.fixture(scope="session") def rust_sysroot_src() -> str: rust_sysroot = pathlib.Path(commands.run("rustc --print sysroot", _capture=True)) @@ -16,15 +38,19 @@ def rust_sysroot_src() -> str: assert ret.exists() return str(ret) + @pytest.fixture -def rust_project(cwd, rust_sysroot_src): +def rust_project(cwd, rust_sysroot_src, rust_edition): project_file = cwd / "rust-project.json" assert project_file.exists() project = json.loads(project_file.read_text()) project["sysroot_src"] = rust_sysroot_src + for c in project["crates"]: + c["edition"] = str(rust_edition) project_file.write_text(json.dumps(project, indent=4)) (cwd / "Cargo.toml").unlink(missing_ok=True) + @pytest.fixture def rust_check_diagnostics(check_diagnostics): check_diagnostics.redact += [ diff --git a/rust/ql/integration-tests/hello-project/Cargo.toml b/rust/ql/integration-tests/hello-project/Cargo.toml index 909b5b525ff..7ad4f694f48 100644 --- a/rust/ql/integration-tests/hello-project/Cargo.toml +++ b/rust/ql/integration-tests/hello-project/Cargo.toml @@ -2,6 +2,6 @@ [package] name = "hello-cargo" version = "0.1.0" -edition = "2021" +edition = "2021" # replaced in test [dependencies] diff --git a/rust/ql/integration-tests/hello-[workspace]/Cargo.toml b/rust/ql/integration-tests/hello-workspace/Cargo.toml similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/Cargo.toml rename to rust/ql/integration-tests/hello-workspace/Cargo.toml diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected b/rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.expected rename to rust/ql/integration-tests/hello-workspace/ExtractionErrors.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref b/rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionErrors.qlref rename to rust/ql/integration-tests/hello-workspace/ExtractionErrors.qlref diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected b/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.expected rename to rust/ql/integration-tests/hello-workspace/ExtractionWarnings.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref b/rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/ExtractionWarnings.qlref rename to rust/ql/integration-tests/hello-workspace/ExtractionWarnings.qlref diff --git a/rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected b/rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/diagnostics.cargo.expected rename to rust/ql/integration-tests/hello-workspace/diagnostics.cargo.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected b/rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/diagnostics.rust-project.expected rename to rust/ql/integration-tests/hello-workspace/diagnostics.rust-project.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml b/rust/ql/integration-tests/hello-workspace/exe/Cargo.toml similarity index 69% rename from rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml rename to rust/ql/integration-tests/hello-workspace/exe/Cargo.toml index b63ccfd5da5..4d9a0e54307 100644 --- a/rust/ql/integration-tests/hello-[workspace]/exe/Cargo.toml +++ b/rust/ql/integration-tests/hello-workspace/exe/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "exe" version = "0.1.0" -edition = "2021" +edition = "2021" # replaced in test [dependencies] lib = { path = "../lib" } diff --git a/rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs b/rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/exe/src/a_module.rs rename to rust/ql/integration-tests/hello-workspace/exe/src/a_module.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs b/rust/ql/integration-tests/hello-workspace/exe/src/main.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/exe/src/main.rs rename to rust/ql/integration-tests/hello-workspace/exe/src/main.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/functions.expected b/rust/ql/integration-tests/hello-workspace/functions.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/functions.expected rename to rust/ql/integration-tests/hello-workspace/functions.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/functions.ql b/rust/ql/integration-tests/hello-workspace/functions.ql similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/functions.ql rename to rust/ql/integration-tests/hello-workspace/functions.ql diff --git a/rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml b/rust/ql/integration-tests/hello-workspace/lib/Cargo.toml similarity index 60% rename from rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml rename to rust/ql/integration-tests/hello-workspace/lib/Cargo.toml index e8fc5405b71..9d59bf133d3 100644 --- a/rust/ql/integration-tests/hello-[workspace]/lib/Cargo.toml +++ b/rust/ql/integration-tests/hello-workspace/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lib" version = "0.1.0" -edition = "2021" +edition = "2021" # replaced in test [dependencies] diff --git a/rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs b/rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/lib/src/a_module/mod.rs rename to rust/ql/integration-tests/hello-workspace/lib/src/a_module/mod.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs b/rust/ql/integration-tests/hello-workspace/lib/src/lib.rs similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/lib/src/lib.rs rename to rust/ql/integration-tests/hello-workspace/lib/src/lib.rs diff --git a/rust/ql/integration-tests/hello-[workspace]/path-resolution.expected b/rust/ql/integration-tests/hello-workspace/path-resolution.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/path-resolution.expected rename to rust/ql/integration-tests/hello-workspace/path-resolution.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/path-resolution.ql b/rust/ql/integration-tests/hello-workspace/path-resolution.ql similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/path-resolution.ql rename to rust/ql/integration-tests/hello-workspace/path-resolution.ql diff --git a/rust/ql/integration-tests/hello-[workspace]/rust-project.json b/rust/ql/integration-tests/hello-workspace/rust-project.json similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/rust-project.json rename to rust/ql/integration-tests/hello-workspace/rust-project.json diff --git a/rust/ql/integration-tests/hello-[workspace]/source_archive.expected b/rust/ql/integration-tests/hello-workspace/source_archive.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/source_archive.expected rename to rust/ql/integration-tests/hello-workspace/source_archive.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected b/rust/ql/integration-tests/hello-workspace/steps.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/steps.cargo.expected rename to rust/ql/integration-tests/hello-workspace/steps.cargo.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/steps.ql b/rust/ql/integration-tests/hello-workspace/steps.ql similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/steps.ql rename to rust/ql/integration-tests/hello-workspace/steps.ql diff --git a/rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected b/rust/ql/integration-tests/hello-workspace/steps.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/steps.rust-project.expected rename to rust/ql/integration-tests/hello-workspace/steps.rust-project.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected b/rust/ql/integration-tests/hello-workspace/summary.cargo.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/summary.cargo.expected rename to rust/ql/integration-tests/hello-workspace/summary.cargo.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/summary.qlref b/rust/ql/integration-tests/hello-workspace/summary.qlref similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/summary.qlref rename to rust/ql/integration-tests/hello-workspace/summary.qlref diff --git a/rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected b/rust/ql/integration-tests/hello-workspace/summary.rust-project.expected similarity index 100% rename from rust/ql/integration-tests/hello-[workspace]/summary.rust-project.expected rename to rust/ql/integration-tests/hello-workspace/summary.rust-project.expected diff --git a/rust/ql/integration-tests/hello-[workspace]/test_workspace.py b/rust/ql/integration-tests/hello-workspace/test_workspace.py similarity index 99% rename from rust/ql/integration-tests/hello-[workspace]/test_workspace.py rename to rust/ql/integration-tests/hello-workspace/test_workspace.py index fe8dbc69141..acf46b70aa6 100644 --- a/rust/ql/integration-tests/hello-[workspace]/test_workspace.py +++ b/rust/ql/integration-tests/hello-workspace/test_workspace.py @@ -1,6 +1,5 @@ import pytest - @pytest.mark.ql_test("steps.ql", expected=".cargo.expected") @pytest.mark.ql_test("summary.qlref", expected=".cargo.expected") def test_cargo(codeql, rust, cargo, check_source_archive, rust_check_diagnostics): From 9dd1062a9c17d645d588ff2e192327f4b9bd42bd Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 11 Apr 2025 17:25:56 +0200 Subject: [PATCH 238/372] Rust: remove fixed inconsistency --- .../CWE-312/CONSISTENCY/ExtractionConsistency.expected | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected diff --git a/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected deleted file mode 100644 index bd41fe2245a..00000000000 --- a/rust/ql/test/query-tests/security/CWE-312/CONSISTENCY/ExtractionConsistency.expected +++ /dev/null @@ -1,3 +0,0 @@ -extractionWarning -| test_logging.rs:90:12:90:30 | expected R_PAREN | -| test_logging.rs:90:12:90:30 | macro expansion failed: the macro '$crate::__private_api::format_args' expands to ERROR but a Expr was expected | \ No newline at end of file From b988be8ff62ca0cfb544e557fae889c65d41ab98 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 21:29:01 +0200 Subject: [PATCH 239/372] ruby: improve help file This has improved autofixes I hope it also helps humans --- .../queries/variables/UninitializedLocal.md | 41 +++++++++++++++++++ .../variables/UninitializedLocal.qhelp | 37 ----------------- .../queries/variables/UninitializedLocal.ql | 13 +++++- 3 files changed, 53 insertions(+), 38 deletions(-) create mode 100644 ruby/ql/src/queries/variables/UninitializedLocal.md delete mode 100644 ruby/ql/src/queries/variables/UninitializedLocal.qhelp diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.md b/ruby/ql/src/queries/variables/UninitializedLocal.md new file mode 100644 index 00000000000..c99b24b1101 --- /dev/null +++ b/ruby/ql/src/queries/variables/UninitializedLocal.md @@ -0,0 +1,41 @@ +# Method call on `nil` + +## Description +In Ruby, it is not necessary to explicitly initialize variables. +If a local variable has not been explicitly initialized, it will have the value `nil`. If this happens unintended, though, the variable will not represent an object with the expected methods, and a method call on the variable will raise a `NoMethodError`. + +## Recommendation + +Ensure that the variable cannot be `nil` at the point hightligted by the alert. +This can be achieved by using a safe navigation or adding a check for `nil`. + +Note: You do not need to explicitly initialize the variable, if you can make the program deal with the possible `nil` value. In particular, initializing the variable to `nil` will have no effect, as this is already the value of the variable. If `nil` is the only possibly default value, you need to handle the `nil` value instead of initializing the variable. + +## Examples + +In the following code, the call to `create_file` may fail and then the call `f.close` will raise a `NoMethodError` since `f` will be `nil` at that point. + +```ruby +def dump(x) + f = create_file + f.puts(x) +ensure + f.close +end +``` + +We can fix this by using safe navigation: +```ruby +def dump(x) + f = create_file + f.puts(x) +ensure + f&.close +end +``` + +## References + +- https://www.rubyguides.com/: [Nil](https://www.rubyguides.com/2018/01/ruby-nil/) +- https://ruby-doc.org/: [NoMethodError](https://ruby-doc.org/core-2.6.5/NoMethodError.html) + diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.qhelp b/ruby/ql/src/queries/variables/UninitializedLocal.qhelp deleted file mode 100644 index 078775e803f..00000000000 --- a/ruby/ql/src/queries/variables/UninitializedLocal.qhelp +++ /dev/null @@ -1,37 +0,0 @@ - - - -

    -In Ruby, raw identifiers like x can be both local variable accesses and method calls. It is a local variable access iff it is syntactically preceded by something that binds it (like an assignment). -Consider the following example: -

    - - - -

    -This will generate an alert on the last access to m, where it is not clear that the programmer intended to read from the local variable. -In fact, the last access to m is a method call, and the value of the local variable is nil, -so this will raise a NoMethodError. -

    - -
    - - -

    -Ensure that you check the control and data flow in the method carefully. -Add a check for nil before the read, or rewrite the code to ensure that the variable is always initialized before being read. -

    - -
    - - - - -
  • https://www.rubyguides.com/: Nil.
  • -
  • https://ruby-doc.org/: NoMethodError.
  • - - -
    -
    diff --git a/ruby/ql/src/queries/variables/UninitializedLocal.ql b/ruby/ql/src/queries/variables/UninitializedLocal.ql index c5b4fa18d62..2f5a4b875aa 100644 --- a/ruby/ql/src/queries/variables/UninitializedLocal.ql +++ b/ruby/ql/src/queries/variables/UninitializedLocal.ql @@ -72,13 +72,24 @@ private predicate isNilChecked(LocalVariableReadAccess read) { ) } +/** + * Holds if `name` is the name of a method defined on `nil`. + * See https://ruby-doc.org/core-2.5.8/NilClass.html + */ +private predicate isNilMethodName(string name) { + name in [ + "inspect", "instance_of?", "is_a?", "kind_of?", "method", "nil?", "rationalize", "to_a", + "to_c", "to_f", "to_h", "to_i", "to_r", "to_s" + ] +} + class RelevantLocalVariableReadAccess extends LocalVariableReadAccess instanceof TVariableAccessReal { RelevantLocalVariableReadAccess() { not isInBooleanContext(this) and not isNilChecked(this) and not isGuarded(this) and - this = any(MethodCall m).getReceiver() + this = any(MethodCall m | not isNilMethodName(m.getMethodName())).getReceiver() } } From 7517272d34dcd965ba31c75eca363d87d38aabf4 Mon Sep 17 00:00:00 2001 From: yoff Date: Fri, 11 Apr 2025 23:01:15 +0200 Subject: [PATCH 240/372] ruby: remove repetitive change note --- .../2025-04-02-adjust-uninitialized-local-metadata.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md diff --git a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md b/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md deleted file mode 100644 index 61c223981d5..00000000000 --- a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-metadata.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: queryMetadata ---- -* The query `rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call; we have adjusted the precision to 'high'. From 64f37ea24c0d18ee96585fb225c917e38c866a2a Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sat, 12 Apr 2025 16:01:55 +0200 Subject: [PATCH 241/372] Docs: Fix typo in code sample --- docs/codeql/ql-language-reference/types.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/ql-language-reference/types.rst b/docs/codeql/ql-language-reference/types.rst index d2d79fe8409..005aab370b2 100644 --- a/docs/codeql/ql-language-reference/types.rst +++ b/docs/codeql/ql-language-reference/types.rst @@ -422,7 +422,7 @@ final extensions leave the extended type unchanged: .. code-block:: ql - from OneTwoTree o + from OneTwoThree o select o, o.getAString() +---+-------------------------+ From 2910cb68cebe062d565caf218f79c4fef3c098df Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:19:47 +0200 Subject: [PATCH 242/372] Swift: extract `ExtracFunctionIsolationExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- .../extractor/translators/ExprTranslator.cpp | 7 +++ swift/extractor/translators/ExprTranslator.h | 2 + swift/ql/.generated.list | 16 ++++-- swift/ql/.gitattributes | 6 ++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../expr/ExtractFunctionIsolationExpr.qll | 20 +++++++ ...xtractFunctionIsolationExprConstructor.qll | 14 +++++ .../ExtractFunctionIsolationExprImpl.qll | 27 +++++++++ .../codeql/swift/generated/ParentChild.qll | 22 ++++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 21 +++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 32 ++++++++++- .../swift/generated/SynthConstructors.qll | 1 + .../expr/ExtractFunctionIsolationExpr.qll | 56 +++++++++++++++++++ swift/ql/lib/swift.dbscheme | 6 ++ .../ExtractFunctionIsolationExpr.expected | 1 + .../ExtractFunctionIsolationExpr.ql | 11 ++++ ...ractFunctionIsolationExpr_getType.expected | 1 + .../ExtractFunctionIsolationExpr_getType.ql | 7 +++ .../extract_function_isolation.swift | 3 + swift/schema.py | 15 +++++ 21 files changed, 262 insertions(+), 9 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql create mode 100644 swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 7d3a670be6a..c300f130c29 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -202,7 +202,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::ConsumeExpr, ConsumeExprTag) MAP(swift::MaterializePackExpr, MaterializePackExprTag) MAP(swift::SingleValueStmtExpr, SingleValueStmtExprTag) - MAP(swift::ExtractFunctionIsolationExpr, void) // TODO swift 6.0 + MAP(swift::ExtractFunctionIsolationExpr, ExtractFunctionIsolationExprTag) MAP(swift::CurrentContextIsolationExpr, void) // TODO swift 6.0 MAP(swift::Decl, DeclTag) MAP(swift::ValueDecl, ValueDeclTag) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index 2da23e9c0af..97a314a33ef 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -671,4 +671,11 @@ codeql::MaterializePackExpr ExprTranslator::translateMaterializePackExpr( return entry; } +codeql::ExtractFunctionIsolationExpr ExprTranslator::translateExtractFunctionIsolationExpr( + const swift::ExtractFunctionIsolationExpr& expr) { + auto entry = createExprEntry(expr); + entry.function_expr = dispatcher.fetchLabel(expr.getFunctionExpr()); + return entry; +} + } // namespace codeql diff --git a/swift/extractor/translators/ExprTranslator.h b/swift/extractor/translators/ExprTranslator.h index 5dec909b1b2..0b0e8cbd304 100644 --- a/swift/extractor/translators/ExprTranslator.h +++ b/swift/extractor/translators/ExprTranslator.h @@ -125,6 +125,8 @@ class ExprTranslator : public AstTranslatorBase { codeql::CopyExpr translateCopyExpr(const swift::CopyExpr& expr); codeql::ConsumeExpr translateConsumeExpr(const swift::ConsumeExpr& expr); codeql::MaterializePackExpr translateMaterializePackExpr(const swift::MaterializePackExpr& expr); + codeql::ExtractFunctionIsolationExpr translateExtractFunctionIsolationExpr( + const swift::ExtractFunctionIsolationExpr& expr); private: void fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry); diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 32734851515..19668fe8c93 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -164,6 +164,7 @@ lib/codeql/swift/elements/expr/ExistentialMetatypeToObjectExpr.qll d594531b0f9ce lib/codeql/swift/elements/expr/ExplicitCastExpr.qll 2298ed1952b7d6454d6da53f79a5460987fea4c30317187799fd425d0a013e4f bc4007c1521fbaa9811d6a893a2eea9901f3b1bff2e89a201d416c067e5b2e32 lib/codeql/swift/elements/expr/ExplicitClosureExpr.qll bdfa54ebd6bf8bb872cad5a04f57a78c63f9a92ab282d845bf654a45da0cad97 1071c526a7d263151ce9de155d43245dddce33d168b6520f49c96908e91fb256 lib/codeql/swift/elements/expr/Expr.qll ae02fbaaf676b1418a047da363a4a61174ba5aba08b229b4f6ba5b3fb96c1edd ff9c4d4d274cceeb178d85a469791833b60a89b06dc4df4678932d6ea7a799ee +lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll 3b557d7e0c8d340e30ff22b22a1f7eb5a7ccb3e278835f1968627c5174cb530a dc25ac7455be2c622e588855a572c49b31e3cdf8900fc83ee79ff40a5e1c4687 lib/codeql/swift/elements/expr/FloatLiteralExpr.qll f80be9eea21297f891761284da66c690706b188aadf824641a27446c1b914789 5c6a0ea847a688a33acb6e12713b9d9f33218148e6a51e80b57b3e0e4543ffae lib/codeql/swift/elements/expr/ForceTryExpr.qll 087b6e8ee24d6956cd63adf3e82d89e37d0482c7ba19c2b69af557d1962fdd62 233e166748af3d0f1efb265cd6b15c9960df841fabd6a8eb54744b53d897b35f lib/codeql/swift/elements/expr/ForceValueExpr.qll 397cfd523b3791684482c55a130629d10fd3d993ffe21e8e2d6e7b0295881e54 4a3ecd15296c661d9ebcccaa75f742fdb10056614e0f0ac6085571951b580d6a @@ -311,6 +312,8 @@ lib/codeql/swift/elements/expr/internal/ErrorExprImpl.qll 819ddf5500b362c2b48ae9 lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprConstructor.qll 338043a69b96c85913ac5ae02efb7fa363bb97ef33f1caab4253f1146f4a0e2b 0e66776ca92ebc6ab5b3cbc2b4e7fca382436279dacd5bf9f742b6e0c2150ab0 lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprImpl.qll 50104bc5721fbd13e1b22639b1a8e1114c0691297c808926c73f5257e55fd4f6 38b634dc13cdbabe0f7195e2a399c7370522b7fc8a56a3a9c53e8928b0742100 lib/codeql/swift/elements/expr/internal/ExplicitClosureExprConstructor.qll fe430a5f87fdb10a4354f699437150bda543ae7b2d09879e50c0498239417a4b f8ea635fe9ab01d48a52f135079a34689a648a4c279bddaf8def56ed014868b7 +lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll 5f940fa3982695f409225cc81dd89140aa35d396ba93ae88a370167e3e1ebdc2 b6c3085b5d7fed62660b57578537fb9ad7bde1a564b832e1eee7845a813e76be +lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll edaad600821c5534b3b2c1a642c9d36b2c1ac406d97334ab7c1e4d934f188614 02e36137fcd5b64d1a89950a01ed129dc28034cf64310d333c06bc581ac9472e lib/codeql/swift/elements/expr/internal/FloatLiteralExprConstructor.qll b6a507af69777dc3e333e1346a3f93b4398551608f6789de562c2b57f1f5bb67 fe2eb2aacb3d4c3d2fa5476199512d5e1ce6aca6d2605dc94445e127ee2f3b08 lib/codeql/swift/elements/expr/internal/ForceTryExprConstructor.qll 159e084ab5e6fdbcd45b0ec0d4915121e8f425d764e8787df053e8a0b8fb6137 ebd9c1eb6c5029eef2ee6bb307e15f1eaf2e5db1fa97565cd04386b584b56674 lib/codeql/swift/elements/expr/internal/ForceValueExprConstructor.qll 1c85f4d1d06f46f8c992ca13e32de8bc2c682d04a550ccec026ea301307ce2ef a89cf5fdd2063318244d42e73ddbe0e235bd76dcf35e54ace58f098d217e94d7 @@ -692,7 +695,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 8a9719dd149f539a01c4c8cbe93a15f221cc1dee388a500adada8facd6a92f57 8a9719dd149f539a01c4c8cbe93a15f221cc1dee388a500adada8facd6a92f57 +lib/codeql/swift/elements.qll 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -709,12 +712,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll bafa2e366c0df25d6c26c4e2e2b84f3e363524d7abcf0f6e31e42879f2bc664a 616160f5664f77346992c2ac39e3229abdf186fe707066d4895ceddd148749a9 +lib/codeql/swift/generated/ParentChild.qll b83a0abc72324c099409e5136f50b9da12cbc27129b7679cc66138d796eddcf7 28cef184087887409504bcab8a7b381982fdafbc4b12e7b90236620b83693dc9 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 4f2ddadd2ced9728aaf4595ccf85cd147468d7ad0a57a21a6cbfd04e3834b386 9653595693da55953d7743fbecce33d16910e3b6737c654311f1e34d27ad7f0b -lib/codeql/swift/generated/Synth.qll 31e318c6e156848c85a2a2664695b48b5e93c57c9bb22fa29d027069907b3ab0 8655ffcf772f55284b93f1d7f8e1b3d497a9744d5f2e0c17bc322c1fdf8bdba8 -lib/codeql/swift/generated/SynthConstructors.qll 3e53c7853096020219c01dae85681fe80b34938d198a0ff359a209dda41c5ed7 3e53c7853096020219c01dae85681fe80b34938d198a0ff359a209dda41c5ed7 +lib/codeql/swift/generated/Raw.qll 6718c8cfed48ea863eea4e112502de92dc369139a9496c61124ac608ac25f8ac 03a7ee490b51fe328eca447a5042ba6ade0c468faf10971a5793b530b5619953 +lib/codeql/swift/generated/Synth.qll faa969292c3db59606356e0343ce36c99f53d545bbbe33103ce1de0b8d532d1f 29850fc05a0c8ba89391ec9469b4e75e2a98d523e0d53b0426ef46cb942c02ae +lib/codeql/swift/generated/SynthConstructors.qll 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -816,6 +819,7 @@ lib/codeql/swift/generated/expr/ExistentialMetatypeToObjectExpr.qll f6eb63b5887d lib/codeql/swift/generated/expr/ExplicitCastExpr.qll 2830522bd17122c26a2392405b2c160ff29ebe8cb0aa8d21498a2b0f05ce9858 bc96f19c0bcb36e78c7f7c48c7d01dbdefaa20564a020e7baf2fc9d8abe734c2 lib/codeql/swift/generated/expr/ExplicitClosureExpr.qll e6fa08fad995b2cafb9d76482cc836e6a0fa24d1e055e848bf2df5acedd12a94 79730347c91ab01c480116c7feba97dafafc030c910e6664519fbc122201cf5b lib/codeql/swift/generated/expr/Expr.qll 29581d27469f6abd06bb1c29cce142e8287f3a6eb7cb251fd14e832e6a6a4e6a 957d3f470d91e757b2921af49651b7c1a1eb111e74ff9ea12577d5df38714c64 +lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll 87e5b3d76a64297787c4e9c63e5278f75f94df64acf6dce2cd12af52f071b90b 185ff557ef4f3efaccc696705282df74dda577063197cc8bc20bc8968993a1ff lib/codeql/swift/generated/expr/FloatLiteralExpr.qll fb226de33de8ede0c3048aa5735f83feafa912d165a793e06e50d0d87165989c 0fb88029e576f444a9623b49294a5fb713bb0f38850e136378107dafcefb98a2 lib/codeql/swift/generated/expr/ForceTryExpr.qll da482d8440c5245dd4ea347e0d6c14cfb455f426055bb4e4c23cacae511a3a52 9c2ec46370708434337802dc62a07f24382cb3ea4499eafcf45ba8b503cbebf9 lib/codeql/swift/generated/expr/ForceValueExpr.qll 3660da045afe79bf7815519134278851a8852ca4a159cf54a2d4f2d413864471 4e7416dc69fb917f6cd304d992a6d0e4e7cd1b4ce16201c86cf3a53a58892635 @@ -1144,6 +1148,8 @@ test/extractor-tests/generated/expr/DynamicTypeExpr/MISSING_SOURCE.txt 35fb32ea5 test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr.ql 426837e6acd80fd5c4f79f756919c99df132f6666aae9d07274c4b95711123bd 451393b79359a46070db84d8d35ad3c7f14cc20eddd3df2a70126575d2200297 test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr_getType.ql 9deff1a2a2271c2dbe44b2aeef42f9adadd73b0e09eb6d71c68ac5bd8d315447 bdc07aec1fa2ced3f8b4c2dcede0354b8943488acf13e559f882f01161172318 test/extractor-tests/generated/expr/ExplicitClosureExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d +test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql 7c4666a86e962726a505e76c57196483c6eb5259463a1cbdb6239f5ccbb33a13 2b5acd61e85a46b1c565104ba6f58b58813ffeba3548dacd776f72db552d5d65 +test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql 487c727c721ff925861b265d9a4f78029f04dba3b94e064529d89c7ee55ac343 3bfdadc09b8672b9030f43c2f0cab6395af803e79ddc17089c43c3da93d69979 test/extractor-tests/generated/expr/FloatLiteralExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d test/extractor-tests/generated/expr/ForceTryExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d test/extractor-tests/generated/expr/ForceValueExpr/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index ab478ec526b..45bfde2b5a8 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -166,6 +166,7 @@ /lib/codeql/swift/elements/expr/ExplicitCastExpr.qll linguist-generated /lib/codeql/swift/elements/expr/ExplicitClosureExpr.qll linguist-generated /lib/codeql/swift/elements/expr/Expr.qll linguist-generated +/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll linguist-generated /lib/codeql/swift/elements/expr/FloatLiteralExpr.qll linguist-generated /lib/codeql/swift/elements/expr/ForceTryExpr.qll linguist-generated /lib/codeql/swift/elements/expr/ForceValueExpr.qll linguist-generated @@ -313,6 +314,8 @@ /lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ExistentialMetatypeToObjectExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ExplicitClosureExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/FloatLiteralExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ForceTryExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/ForceValueExprConstructor.qll linguist-generated @@ -818,6 +821,7 @@ /lib/codeql/swift/generated/expr/ExplicitCastExpr.qll linguist-generated /lib/codeql/swift/generated/expr/ExplicitClosureExpr.qll linguist-generated /lib/codeql/swift/generated/expr/Expr.qll linguist-generated +/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll linguist-generated /lib/codeql/swift/generated/expr/FloatLiteralExpr.qll linguist-generated /lib/codeql/swift/generated/expr/ForceTryExpr.qll linguist-generated /lib/codeql/swift/generated/expr/ForceValueExpr.qll linguist-generated @@ -1146,6 +1150,8 @@ /test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr.ql linguist-generated /test/extractor-tests/generated/expr/EnumIsCaseExpr/EnumIsCaseExpr_getType.ql linguist-generated /test/extractor-tests/generated/expr/ExplicitClosureExpr/MISSING_SOURCE.txt linguist-generated +/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql linguist-generated +/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql linguist-generated /test/extractor-tests/generated/expr/FloatLiteralExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/expr/ForceTryExpr/MISSING_SOURCE.txt linguist-generated /test/extractor-tests/generated/expr/ForceValueExpr/MISSING_SOURCE.txt linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 5d79bdf2d24..3e2080262d1 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -119,6 +119,7 @@ import codeql.swift.elements.expr.ExistentialMetatypeToObjectExpr import codeql.swift.elements.expr.ExplicitCastExpr import codeql.swift.elements.expr.ExplicitClosureExpr import codeql.swift.elements.expr.Expr +import codeql.swift.elements.expr.ExtractFunctionIsolationExpr import codeql.swift.elements.expr.FloatLiteralExpr import codeql.swift.elements.expr.ForceTryExpr import codeql.swift.elements.expr.ForceValueExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll new file mode 100644 index 00000000000..62ef58ee602 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/ExtractFunctionIsolationExpr.qll @@ -0,0 +1,20 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `ExtractFunctionIsolationExpr`. + */ + +private import internal.ExtractFunctionIsolationExprImpl +import codeql.swift.elements.expr.Expr + +/** + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + */ +final class ExtractFunctionIsolationExpr = Impl::ExtractFunctionIsolationExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll new file mode 100644 index 00000000000..a2a52efef60 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `ExtractFunctionIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `ExtractFunctionIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructExtractFunctionIsolationExpr(Raw::ExtractFunctionIsolationExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll new file mode 100644 index 00000000000..dcb7d587494 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ExtractFunctionIsolationExprImpl.qll @@ -0,0 +1,27 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `ExtractFunctionIsolationExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.ExtractFunctionIsolationExpr + +/** + * INTERNAL: This module contains the customizable definition of `ExtractFunctionIsolationExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + */ + class ExtractFunctionIsolationExpr extends Generated::ExtractFunctionIsolationExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 13e75c26239..083c31f67ac 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -1406,6 +1406,26 @@ private module Impl { ) } + private Element getImmediateChildOfExtractFunctionIsolationExpr( + ExtractFunctionIsolationExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n, int nFunctionExpr | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + nFunctionExpr = n + 1 and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + or + index = n and + result = e.getImmediateFunctionExpr() and + partialPredicateCall = "FunctionExpr()" + ) + ) + } + private Element getImmediateChildOfForceValueExpr( ForceValueExpr e, int index, string partialPredicateCall ) { @@ -5238,6 +5258,8 @@ private module Impl { or result = getImmediateChildOfErrorExpr(e, index, partialAccessor) or + result = getImmediateChildOfExtractFunctionIsolationExpr(e, index, partialAccessor) + or result = getImmediateChildOfForceValueExpr(e, index, partialAccessor) or result = getImmediateChildOfIfExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index 820dd7e3a88..f7c919ded6d 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -1346,6 +1346,27 @@ module Raw { Expr getSubExpr() { explicit_cast_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + */ + class ExtractFunctionIsolationExpr extends @extract_function_isolation_expr, Expr { + override string toString() { result = "ExtractFunctionIsolationExpr" } + + /** + * Gets the function expression of this extract function isolation expression. + */ + Expr getFunctionExpr() { extract_function_isolation_exprs(this, result) } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 44759bc72ea..f8cb4713f2a 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -394,6 +394,12 @@ module Synth { * INTERNAL: Do not use. */ TExplicitClosureExpr(Raw::ExplicitClosureExpr id) { constructExplicitClosureExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TExtractFunctionIsolationExpr(Raw::ExtractFunctionIsolationExpr id) { + constructExtractFunctionIsolationExpr(id) + } or /** * INTERNAL: Do not use. */ @@ -1232,9 +1238,9 @@ module Synth { TCaptureListExpr or TClosureExpr or TCollectionExpr or TConsumeExpr or TCopyExpr or TDeclRefExpr or TDefaultArgumentExpr or TDiscardAssignmentExpr or TDotSyntaxBaseIgnoredExpr or TDynamicTypeExpr or TEnumIsCaseExpr or TErrorExpr or - TExplicitCastExpr or TForceValueExpr or TIdentityExpr or TIfExpr or - TImplicitConversionExpr or TInOutExpr or TKeyPathApplicationExpr or TKeyPathDotExpr or - TKeyPathExpr or TLazyInitializationExpr or TLiteralExpr or TLookupExpr or + TExplicitCastExpr or TExtractFunctionIsolationExpr or TForceValueExpr or TIdentityExpr or + TIfExpr or TImplicitConversionExpr or TInOutExpr or TKeyPathApplicationExpr or + TKeyPathDotExpr or TKeyPathExpr or TLazyInitializationExpr or TLiteralExpr or TLookupExpr or TMakeTemporarilyEscapableExpr or TMaterializePackExpr or TObjCSelectorExpr or TOneWayExpr or TOpaqueValueExpr or TOpenExistentialExpr or TOptionalEvaluationExpr or TOtherInitializerRefExpr or TOverloadedDeclRefExpr or TPackElementExpr or @@ -2018,6 +2024,14 @@ module Synth { result = TExplicitClosureExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TExtractFunctionIsolationExpr`, if possible. + */ + TExtractFunctionIsolationExpr convertExtractFunctionIsolationExprFromRaw(Raw::Element e) { + result = TExtractFunctionIsolationExpr(e) + } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TFloatLiteralExpr`, if possible. @@ -3545,6 +3559,8 @@ module Synth { or result = convertExplicitCastExprFromRaw(e) or + result = convertExtractFunctionIsolationExprFromRaw(e) + or result = convertForceValueExprFromRaw(e) or result = convertIdentityExprFromRaw(e) @@ -4690,6 +4706,14 @@ module Synth { e = TExplicitClosureExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TExtractFunctionIsolationExpr` to a raw DB element, if possible. + */ + Raw::Element convertExtractFunctionIsolationExprToRaw(TExtractFunctionIsolationExpr e) { + e = TExtractFunctionIsolationExpr(result) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TFloatLiteralExpr` to a raw DB element, if possible. @@ -6215,6 +6239,8 @@ module Synth { or result = convertExplicitCastExprToRaw(e) or + result = convertExtractFunctionIsolationExprToRaw(e) + or result = convertForceValueExprToRaw(e) or result = convertIdentityExprToRaw(e) diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 0d5dcdaaa6a..259453b63f6 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -90,6 +90,7 @@ import codeql.swift.elements.expr.internal.ErasureExprConstructor import codeql.swift.elements.expr.internal.ErrorExprConstructor import codeql.swift.elements.expr.internal.ExistentialMetatypeToObjectExprConstructor import codeql.swift.elements.expr.internal.ExplicitClosureExprConstructor +import codeql.swift.elements.expr.internal.ExtractFunctionIsolationExprConstructor import codeql.swift.elements.expr.internal.FloatLiteralExprConstructor import codeql.swift.elements.expr.internal.ForceTryExprConstructor import codeql.swift.elements.expr.internal.ForceValueExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll new file mode 100644 index 00000000000..28b942b54da --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/ExtractFunctionIsolationExpr.qll @@ -0,0 +1,56 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `ExtractFunctionIsolationExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.Expr +import codeql.swift.elements.expr.internal.ExprImpl::Impl as ExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `ExtractFunctionIsolationExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * An expression that extracts the function isolation of an expression with `@isolated(any)` + * function type. + * + * For example: + * ``` + * func foo(x: @isolated(any) () -> ()) { + * let isolation = x.isolation + * } + * ``` + * INTERNAL: Do not reference the `Generated::ExtractFunctionIsolationExpr` class directly. + * Use the subclass `ExtractFunctionIsolationExpr`, where the following predicates are available. + */ + class ExtractFunctionIsolationExpr extends Synth::TExtractFunctionIsolationExpr, ExprImpl::Expr { + override string getAPrimaryQlClass() { result = "ExtractFunctionIsolationExpr" } + + /** + * Gets the function expression of this extract function isolation expression. + * + * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the + * behavior of both the `Immediate` and non-`Immediate` versions. + */ + Expr getImmediateFunctionExpr() { + result = + Synth::convertExprFromRaw(Synth::convertExtractFunctionIsolationExprToRaw(this) + .(Raw::ExtractFunctionIsolationExpr) + .getFunctionExpr()) + } + + /** + * Gets the function expression of this extract function isolation expression. + */ + final Expr getFunctionExpr() { + exists(Expr immediate | + immediate = this.getImmediateFunctionExpr() and + if exists(this.getResolveStep()) then result = immediate else result = immediate.resolve() + ) + } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 33db81ad4b6..80ba4a9a104 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -786,6 +786,7 @@ arguments( //dir=expr | @enum_is_case_expr | @error_expr | @explicit_cast_expr +| @extract_function_isolation_expr | @force_value_expr | @identity_expr | @if_expr @@ -994,6 +995,11 @@ explicit_cast_exprs( //dir=expr int sub_expr: @expr_or_none ref ); +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + force_value_exprs( //dir=expr unique int id: @force_value_expr, int sub_expr: @expr_or_none ref diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected new file mode 100644 index 00000000000..aabc59fac99 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.expected @@ -0,0 +1 @@ +| extract_function_isolation.swift:2:21:2:23 | ExtractFunctionIsolationExpr | hasType: | yes | getFunctionExpr: | extract_function_isolation.swift:2:21:2:21 | x | diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql new file mode 100644 index 00000000000..f133b61f9b6 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr.ql @@ -0,0 +1,11 @@ +// generated by codegen/codegen.py, do not edit +import codeql.swift.elements +import TestUtils + +from ExtractFunctionIsolationExpr x, string hasType, Expr getFunctionExpr +where + toBeTested(x) and + not x.isUnknown() and + (if x.hasType() then hasType = "yes" else hasType = "no") and + getFunctionExpr = x.getFunctionExpr() +select x, "hasType:", hasType, "getFunctionExpr:", getFunctionExpr diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected new file mode 100644 index 00000000000..2c6a32f914c --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.expected @@ -0,0 +1 @@ +| extract_function_isolation.swift:2:21:2:23 | ExtractFunctionIsolationExpr | (any Actor)? | diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql new file mode 100644 index 00000000000..b7e9c6a7ba0 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/ExtractFunctionIsolationExpr_getType.ql @@ -0,0 +1,7 @@ +// generated by codegen/codegen.py, do not edit +import codeql.swift.elements +import TestUtils + +from ExtractFunctionIsolationExpr x +where toBeTested(x) and not x.isUnknown() +select x, x.getType() diff --git a/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift new file mode 100644 index 00000000000..fb5dcb52c08 --- /dev/null +++ b/swift/ql/test/extractor-tests/generated/expr/ExtractFunctionIsolationExpr/extract_function_isolation.swift @@ -0,0 +1,3 @@ +func foo(x: @isolated(any) () -> ()) { + let isolation = x.isolation +} diff --git a/swift/schema.py b/swift/schema.py index 7c2cebb594d..59660fd4031 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1425,3 +1425,18 @@ class DiscardStmt(Stmt): ``` """ sub_expr: Expr | child + + +class ExtractFunctionIsolationExpr(Expr): + """ + An expression that extracts the function isolation of an expression with `@isolated(any)` + function type. + + For example: + ``` + func foo(x: @isolated(any) () -> ()) { + let isolation = x.isolation + } + ``` + """ + function_expr: Expr | child From 42ec6b018d757c107963543b8c3b3001b194b12f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:28:10 +0200 Subject: [PATCH 243/372] Swift: add `ExtractFunctionIsolationTree` to control flow --- .../swift/controlflow/internal/ControlFlowGraphImpl.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll index f785bd0f278..601e0eb0ad3 100644 --- a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll +++ b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll @@ -1866,6 +1866,15 @@ module Exprs { } } + private class ExtractFunctionIsolationTree extends AstStandardPostOrderTree { + override ExtractFunctionIsolationExpr ast; + + final override ControlFlowElement getChildNode(int i) { + i = 0 and + result.asAstNode() = ast.getFunctionExpr().getFullyConverted() + } + } + module Conversions { class ConversionOrIdentity = Synth::TIdentityExpr or Synth::TExplicitCastExpr or Synth::TImplicitConversionExpr or From 712142cde967d60bbb6bb1180d7db9f21230e4da Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:48:05 +0200 Subject: [PATCH 244/372] Swift: extract `CurrentContextIsolationExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- .../extractor/translators/ExprTranslator.cpp | 7 +++ swift/extractor/translators/ExprTranslator.h | 2 + swift/ql/.generated.list | 14 ++++-- swift/ql/.gitattributes | 4 ++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../expr/CurrentContextIsolationExpr.qll | 14 ++++++ ...CurrentContextIsolationExprConstructor.qll | 14 ++++++ .../CurrentContextIsolationExprImpl.qll | 21 ++++++++ .../codeql/swift/generated/ParentChild.qll | 17 +++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 15 ++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 44 ++++++++++++---- .../swift/generated/SynthConstructors.qll | 1 + .../expr/CurrentContextIsolationExpr.qll | 50 +++++++++++++++++++ swift/ql/lib/swift.dbscheme | 6 +++ swift/schema.py | 10 ++++ 16 files changed, 207 insertions(+), 15 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index c300f130c29..006c649fad5 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -203,7 +203,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::MaterializePackExpr, MaterializePackExprTag) MAP(swift::SingleValueStmtExpr, SingleValueStmtExprTag) MAP(swift::ExtractFunctionIsolationExpr, ExtractFunctionIsolationExprTag) - MAP(swift::CurrentContextIsolationExpr, void) // TODO swift 6.0 + MAP(swift::CurrentContextIsolationExpr, CurrentContextIsolationExprTag) MAP(swift::Decl, DeclTag) MAP(swift::ValueDecl, ValueDeclTag) MAP(swift::TypeDecl, TypeDeclTag) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index 97a314a33ef..915d26b3373 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -678,4 +678,11 @@ codeql::ExtractFunctionIsolationExpr ExprTranslator::translateExtractFunctionIso return entry; } +codeql::CurrentContextIsolationExpr ExprTranslator::translateCurrentContextIsolationExpr( + const swift::CurrentContextIsolationExpr& expr) { + auto entry = createExprEntry(expr); + entry.actor = dispatcher.fetchLabel(expr.getActor()); + return entry; +} + } // namespace codeql diff --git a/swift/extractor/translators/ExprTranslator.h b/swift/extractor/translators/ExprTranslator.h index 0b0e8cbd304..ff3db137b3b 100644 --- a/swift/extractor/translators/ExprTranslator.h +++ b/swift/extractor/translators/ExprTranslator.h @@ -127,6 +127,8 @@ class ExprTranslator : public AstTranslatorBase { codeql::MaterializePackExpr translateMaterializePackExpr(const swift::MaterializePackExpr& expr); codeql::ExtractFunctionIsolationExpr translateExtractFunctionIsolationExpr( const swift::ExtractFunctionIsolationExpr& expr); + codeql::CurrentContextIsolationExpr translateCurrentContextIsolationExpr( + const swift::CurrentContextIsolationExpr& expr); private: void fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry); diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 19668fe8c93..8dd1a1ba407 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -143,6 +143,7 @@ lib/codeql/swift/elements/expr/ConsumeExpr.qll cf1551b82e4dd28555778f4092a90f917 lib/codeql/swift/elements/expr/CopyExpr.qll ff680438de3b2105d4fd69f48879eaa954436e63809b045f766d50454436f88a 1e0781d35da6d31bdd66110e3ce4d5dce46cf7b9e4b285ed5f544c8d40945639 lib/codeql/swift/elements/expr/CovariantFunctionConversionExpr.qll 4acc70bae3a6d31798a505be6604e1bee00770b7d385ea44550d4c0e5db35477 d6f852d2d11a78ea7c188379ad474db8d77494e3a3621dca1b7d963e083374d3 lib/codeql/swift/elements/expr/CovariantReturnConversionExpr.qll d6856a3986eb1421c0676d046432657a52e4c77775fd7c437090cfa8ade3ee29 b8229608a404e5f310a329568a26994eca0361f0653aefdb495351fbefaa5a97 +lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll 1500722bc7ae42c524d1b1cf578befcea69bea5c7a24280af07c911dbdb31e8c 567366f4d3642e183dff1d8bfad3bea433fd6ea37b841faaaa25c21ca0654289 lib/codeql/swift/elements/expr/DeclRefExpr.qll 4d7eb8f70aa18d35cde805a310b836d702c8c9da55e9676f8db3338dc57e8034 c6136ccf37e8128640d9df423713b7646309e51c3eda5c6d2807fdb0cc0733e2 lib/codeql/swift/elements/expr/DefaultArgumentExpr.qll d655cc4c69db37dc20c477e72df9bb53e18dcc65ffefe61a1bca1854bc006210 a8af422bfdcf56ac37a322d707252ed34b08acf58608065ff3bd214137583b13 lib/codeql/swift/elements/expr/DerivedToBaseExpr.qll d42b72fe5c4a36830c9c7b6c929992fb18dabeedda448159822770256593f274 fc6240a71dbd554f8bcc86c2ad0b05f2112578223e9a180beeb0223bf9cc76be @@ -285,6 +286,8 @@ lib/codeql/swift/elements/expr/internal/CovariantFunctionConversionExprConstruct lib/codeql/swift/elements/expr/internal/CovariantFunctionConversionExprImpl.qll 499b77c2820d42739843665a7574e47e630d3afd125cb4cbb4952d7fe6fde867 fe7d197f25786e329235756a85a90faec82273e097896224bd64f8fb4a804bd9 lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprConstructor.qll 5328580363441c1d76c8ba2654448207f581bc9af4b612b78c2522dceb1accea 687f9b1a9c57f0364893df2812472de0d32e5faed37d34ca429fcea2f9fa2857 lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprImpl.qll 750189e344195f715d09e93e772d5cf3a611a6d1895b7e4a88db4abfe0a5dc8a 8f646de70cb489f46bcc295e4b4a3bd7b8f03e3691c444c1f80b34453b65274c +lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll 153c80058a025e57375acb36938a44aa0b959772e2864e83e4fb48e9aacf63d2 bea25c65c5a16be09765ab7fe9db37190c18f778878a16cbec92c47f9d25159d +lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll 56b1efc50878f99474c7e5dc5525d7ba98f857112b5fe29926feb2f112d4416c efde63d7e72635f8027b04990eb40bf494fc14215e6ab08316c73b6caa0e49fb lib/codeql/swift/elements/expr/internal/DeclRefExprConstructor.qll 70bd400520a0c5f29494c320184468d36075cf24feb1f6393fc430b47a2cd336 0d3419d85b0a62cc3c8f0f0cb3a4e9a09d250f2e8b99fb11b96e18f584f817a7 lib/codeql/swift/elements/expr/internal/DefaultArgumentExprConstructor.qll 31f4def20cb3b60b48eae9b24022f853dc490c2282368fbd8f89e2c689963f86 45dd0dc08a1c4729178b80c4027ad98cba5258ea31e11f0936a8fa9bde8d3b3b lib/codeql/swift/elements/expr/internal/DerivedToBaseExprConstructor.qll d258b88fff4f115e9b4c7ef4cb26623787732cf0d7cf9b59da273d8ebcdb9460 a0a3615be242c3b52624423d685bea3b1f57ebedb2dba51059acc33e2da49844 @@ -695,7 +698,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 0853da5629624f0be83b603afa04e2280d4feb65f4c1c764ff21d979342f91d4 +lib/codeql/swift/elements.qll 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -712,12 +715,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll b83a0abc72324c099409e5136f50b9da12cbc27129b7679cc66138d796eddcf7 28cef184087887409504bcab8a7b381982fdafbc4b12e7b90236620b83693dc9 +lib/codeql/swift/generated/ParentChild.qll 6208de45f7dbf7713f91c710c6bcca1e14800cb025bdc054ea21df5f23ad9075 c6450faaf5d027fd3f43372588b893855cc72d61eab1a6efa7d9266c00a84aa2 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 6718c8cfed48ea863eea4e112502de92dc369139a9496c61124ac608ac25f8ac 03a7ee490b51fe328eca447a5042ba6ade0c468faf10971a5793b530b5619953 -lib/codeql/swift/generated/Synth.qll faa969292c3db59606356e0343ce36c99f53d545bbbe33103ce1de0b8d532d1f 29850fc05a0c8ba89391ec9469b4e75e2a98d523e0d53b0426ef46cb942c02ae -lib/codeql/swift/generated/SynthConstructors.qll 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 73ed3d8d2b059c705c6887a373fb40ce2d66d176dde4d573f099d7e5dbcf4f74 +lib/codeql/swift/generated/Raw.qll 855cacf92f587700c5408b9e17bb360dbcc57656d936148d96a3d4f747593e47 13fde0d5c2644691d6e89f9b62d528a0bdc01c32e1990769c53b65fb4b87526e +lib/codeql/swift/generated/Synth.qll 96e48b93040580edb77d94f1c3b5974899808d507fab2f3c2eab0d50367a3d3f 7e6b50a342e45cb8b3ed53150dbcdb75be07264885fde15d19fd98ae61d1ba05 +lib/codeql/swift/generated/SynthConstructors.qll 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -797,6 +800,7 @@ lib/codeql/swift/generated/expr/ConsumeExpr.qll 86c90b17fb5fded8852088703418132f lib/codeql/swift/generated/expr/CopyExpr.qll 026c323ebb0ac57814041a73b6c5933501902f744f6d2e971dbc2b39bb987be3 be20d88f5d6f8771a1d0d0af6316ccfd51994dcfaee2a2ee47cb7ef132f8e6b7 lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll 53f906b1ff6c3994829881098d070a92df2ee86242f7636401acfa4c8a0a1e9c 98a5f7949f02f5fc2aee38e2eed2feef677b6f2daa2d244fe790baca347a9db3 lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll 68bf0f1a97f6a1bd2a99c60fa09d930cbd427679bbe0f41ae4394b1ad4ba126d c1063eb981345c73b871292218b40308ee5c12babc80b5d63b337eb67628d7a9 +lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll d5d82951e4aff875c5229daec9f18a3261fb236e326234eadccd7ee5c87a83e0 c76f2fa71e422cbe2dfa39588d1dcaa4e50266fc3102a446fb76386f198601ee lib/codeql/swift/generated/expr/DeclRefExpr.qll 9a696dc79181a2ebe76e2ad47edc27baac49a9c8ed38e164e5c8c61a81c23865 adcde2929271268d08550848d8c04911aec790af10609e387ea07e80bee0de6f lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll a9bd89e69f35b04932a89be8099cdb0a4ce65df579d3b88d4cf6f5c328b9f327 16d22db992c2fae4abec569e10be32526883610eea7f90f19c73297168fa63fb lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll 2b744875e4d12988992222cec5e5c16d65b98dca45a375c436ac5811dff4c19f 536407ce6e380d80bf8fd9d16498a773fba828cf7fa2d43f88a7ec38312f953f diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index 45bfde2b5a8..66bb4123005 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -145,6 +145,7 @@ /lib/codeql/swift/elements/expr/CopyExpr.qll linguist-generated /lib/codeql/swift/elements/expr/CovariantFunctionConversionExpr.qll linguist-generated /lib/codeql/swift/elements/expr/CovariantReturnConversionExpr.qll linguist-generated +/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll linguist-generated /lib/codeql/swift/elements/expr/DeclRefExpr.qll linguist-generated /lib/codeql/swift/elements/expr/DefaultArgumentExpr.qll linguist-generated /lib/codeql/swift/elements/expr/DerivedToBaseExpr.qll linguist-generated @@ -287,6 +288,8 @@ /lib/codeql/swift/elements/expr/internal/CovariantFunctionConversionExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/CovariantReturnConversionExprImpl.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/DeclRefExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/DefaultArgumentExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/DerivedToBaseExprConstructor.qll linguist-generated @@ -799,6 +802,7 @@ /lib/codeql/swift/generated/expr/CopyExpr.qll linguist-generated /lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll linguist-generated /lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll linguist-generated +/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll linguist-generated /lib/codeql/swift/generated/expr/DeclRefExpr.qll linguist-generated /lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll linguist-generated /lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 3e2080262d1..5db89ec9577 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -98,6 +98,7 @@ import codeql.swift.elements.expr.ConsumeExpr import codeql.swift.elements.expr.CopyExpr import codeql.swift.elements.expr.CovariantFunctionConversionExpr import codeql.swift.elements.expr.CovariantReturnConversionExpr +import codeql.swift.elements.expr.CurrentContextIsolationExpr import codeql.swift.elements.expr.DeclRefExpr import codeql.swift.elements.expr.DefaultArgumentExpr import codeql.swift.elements.expr.DerivedToBaseExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll new file mode 100644 index 00000000000..09bfc59e362 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/CurrentContextIsolationExpr.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `CurrentContextIsolationExpr`. + */ + +private import internal.CurrentContextIsolationExprImpl +import codeql.swift.elements.expr.Expr + +/** + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + */ +final class CurrentContextIsolationExpr = Impl::CurrentContextIsolationExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll new file mode 100644 index 00000000000..00e2e626e15 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `CurrentContextIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `CurrentContextIsolationExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructCurrentContextIsolationExpr(Raw::CurrentContextIsolationExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll new file mode 100644 index 00000000000..8c4b71eb04f --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/CurrentContextIsolationExprImpl.qll @@ -0,0 +1,21 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `CurrentContextIsolationExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.CurrentContextIsolationExpr + +/** + * INTERNAL: This module contains the customizable definition of `CurrentContextIsolationExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + */ + class CurrentContextIsolationExpr extends Generated::CurrentContextIsolationExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 083c31f67ac..2e0b69ca8e0 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -1267,6 +1267,21 @@ private module Impl { ) } + private Element getImmediateChildOfCurrentContextIsolationExpr( + CurrentContextIsolationExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n | + b = 0 and + bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and + n = bExpr and + ( + none() + or + result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfDeclRefExpr( DeclRefExpr e, int index, string partialPredicateCall ) { @@ -5244,6 +5259,8 @@ private module Impl { or result = getImmediateChildOfCopyExpr(e, index, partialAccessor) or + result = getImmediateChildOfCurrentContextIsolationExpr(e, index, partialAccessor) + or result = getImmediateChildOfDeclRefExpr(e, index, partialAccessor) or result = getImmediateChildOfDefaultArgumentExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index f7c919ded6d..a28175b1e74 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -1215,6 +1215,21 @@ module Raw { Expr getSubExpr() { copy_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + */ + class CurrentContextIsolationExpr extends @current_context_isolation_expr, Expr { + override string toString() { result = "CurrentContextIsolationExpr" } + + /** + * Gets the actor of this current context isolation expression. + */ + Expr getActor() { current_context_isolation_exprs(this, result) } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index f8cb4713f2a..9e34c778512 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -310,6 +310,12 @@ module Synth { TCovariantReturnConversionExpr(Raw::CovariantReturnConversionExpr id) { constructCovariantReturnConversionExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TCurrentContextIsolationExpr(Raw::CurrentContextIsolationExpr id) { + constructCurrentContextIsolationExpr(id) + } or /** * INTERNAL: Do not use. */ @@ -1236,15 +1242,15 @@ module Synth { class TExpr = TAnyTryExpr or TAppliedPropertyWrapperExpr or TApplyExpr or TAssignExpr or TBindOptionalExpr or TCaptureListExpr or TClosureExpr or TCollectionExpr or TConsumeExpr or TCopyExpr or - TDeclRefExpr or TDefaultArgumentExpr or TDiscardAssignmentExpr or - TDotSyntaxBaseIgnoredExpr or TDynamicTypeExpr or TEnumIsCaseExpr or TErrorExpr or - TExplicitCastExpr or TExtractFunctionIsolationExpr or TForceValueExpr or TIdentityExpr or - TIfExpr or TImplicitConversionExpr or TInOutExpr or TKeyPathApplicationExpr or - TKeyPathDotExpr or TKeyPathExpr or TLazyInitializationExpr or TLiteralExpr or TLookupExpr or - TMakeTemporarilyEscapableExpr or TMaterializePackExpr or TObjCSelectorExpr or TOneWayExpr or - TOpaqueValueExpr or TOpenExistentialExpr or TOptionalEvaluationExpr or - TOtherInitializerRefExpr or TOverloadedDeclRefExpr or TPackElementExpr or - TPackExpansionExpr or TPropertyWrapperValuePlaceholderExpr or + TCurrentContextIsolationExpr or TDeclRefExpr or TDefaultArgumentExpr or + TDiscardAssignmentExpr or TDotSyntaxBaseIgnoredExpr or TDynamicTypeExpr or + TEnumIsCaseExpr or TErrorExpr or TExplicitCastExpr or TExtractFunctionIsolationExpr or + TForceValueExpr or TIdentityExpr or TIfExpr or TImplicitConversionExpr or TInOutExpr or + TKeyPathApplicationExpr or TKeyPathDotExpr or TKeyPathExpr or TLazyInitializationExpr or + TLiteralExpr or TLookupExpr or TMakeTemporarilyEscapableExpr or TMaterializePackExpr or + TObjCSelectorExpr or TOneWayExpr or TOpaqueValueExpr or TOpenExistentialExpr or + TOptionalEvaluationExpr or TOtherInitializerRefExpr or TOverloadedDeclRefExpr or + TPackElementExpr or TPackExpansionExpr or TPropertyWrapperValuePlaceholderExpr or TRebindSelfInInitializerExpr or TSequenceExpr or TSingleValueStmtExpr or TSuperRefExpr or TTapExpr or TTupleElementExpr or TTupleExpr or TTypeExpr or TUnresolvedDeclRefExpr or TUnresolvedDotExpr or TUnresolvedMemberExpr or TUnresolvedPatternExpr or @@ -1884,6 +1890,14 @@ module Synth { result = TCovariantReturnConversionExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TCurrentContextIsolationExpr`, if possible. + */ + TCurrentContextIsolationExpr convertCurrentContextIsolationExprFromRaw(Raw::Element e) { + result = TCurrentContextIsolationExpr(e) + } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TDeclRefExpr`, if possible. @@ -3543,6 +3557,8 @@ module Synth { or result = convertCopyExprFromRaw(e) or + result = convertCurrentContextIsolationExprFromRaw(e) + or result = convertDeclRefExprFromRaw(e) or result = convertDefaultArgumentExprFromRaw(e) @@ -4566,6 +4582,14 @@ module Synth { e = TCovariantReturnConversionExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TCurrentContextIsolationExpr` to a raw DB element, if possible. + */ + Raw::Element convertCurrentContextIsolationExprToRaw(TCurrentContextIsolationExpr e) { + e = TCurrentContextIsolationExpr(result) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TDeclRefExpr` to a raw DB element, if possible. @@ -6223,6 +6247,8 @@ module Synth { or result = convertCopyExprToRaw(e) or + result = convertCurrentContextIsolationExprToRaw(e) + or result = convertDeclRefExprToRaw(e) or result = convertDefaultArgumentExprToRaw(e) diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 259453b63f6..635e9cbb5bb 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -71,6 +71,7 @@ import codeql.swift.elements.expr.internal.ConsumeExprConstructor import codeql.swift.elements.expr.internal.CopyExprConstructor import codeql.swift.elements.expr.internal.CovariantFunctionConversionExprConstructor import codeql.swift.elements.expr.internal.CovariantReturnConversionExprConstructor +import codeql.swift.elements.expr.internal.CurrentContextIsolationExprConstructor import codeql.swift.elements.expr.internal.DeclRefExprConstructor import codeql.swift.elements.expr.internal.DefaultArgumentExprConstructor import codeql.swift.elements.expr.internal.DerivedToBaseExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll new file mode 100644 index 00000000000..32a89535543 --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/CurrentContextIsolationExpr.qll @@ -0,0 +1,50 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `CurrentContextIsolationExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.Expr +import codeql.swift.elements.expr.internal.ExprImpl::Impl as ExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `CurrentContextIsolationExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + * This is synthesized by the type checker and does not have any way to be expressed explicitly in + * the source. + * INTERNAL: Do not reference the `Generated::CurrentContextIsolationExpr` class directly. + * Use the subclass `CurrentContextIsolationExpr`, where the following predicates are available. + */ + class CurrentContextIsolationExpr extends Synth::TCurrentContextIsolationExpr, ExprImpl::Expr { + override string getAPrimaryQlClass() { result = "CurrentContextIsolationExpr" } + + /** + * Gets the actor of this current context isolation expression. + * + * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the + * behavior of both the `Immediate` and non-`Immediate` versions. + */ + Expr getImmediateActor() { + result = + Synth::convertExprFromRaw(Synth::convertCurrentContextIsolationExprToRaw(this) + .(Raw::CurrentContextIsolationExpr) + .getActor()) + } + + /** + * Gets the actor of this current context isolation expression. + */ + final Expr getActor() { + exists(Expr immediate | + immediate = this.getImmediateActor() and + if exists(this.getResolveStep()) then result = immediate else result = immediate.resolve() + ) + } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 80ba4a9a104..0928a72ec71 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -778,6 +778,7 @@ arguments( //dir=expr | @collection_expr | @consume_expr | @copy_expr +| @current_context_isolation_expr | @decl_ref_expr | @default_argument_expr | @discard_assignment_expr @@ -915,6 +916,11 @@ copy_exprs( //dir=expr int sub_expr: @expr_or_none ref ); +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + decl_ref_exprs( //dir=expr unique int id: @decl_ref_expr, int decl: @decl_or_none ref diff --git a/swift/schema.py b/swift/schema.py index 59660fd4031..9a777f6c7c7 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1440,3 +1440,13 @@ class ExtractFunctionIsolationExpr(Expr): ``` """ function_expr: Expr | child + + +@qltest.skip +class CurrentContextIsolationExpr(Expr): + """ + An expression that extracts the actor isolation of the current context, of type `(any Actor)?`. + This is synthesized by the type checker and does not have any way to be expressed explicitly in + the source. + """ + actor: Expr From b575c894638ca2eff26b509796ebc57c852ab0a9 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 09:50:37 +0200 Subject: [PATCH 245/372] Swift: add `CurrentContextIsolationTree` to control flow --- .../swift/controlflow/internal/ControlFlowGraphImpl.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll index 601e0eb0ad3..3d2b33e8890 100644 --- a/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll +++ b/swift/ql/lib/codeql/swift/controlflow/internal/ControlFlowGraphImpl.qll @@ -1875,6 +1875,15 @@ module Exprs { } } + private class CurrentContextIsolationTree extends AstStandardPostOrderTree { + override CurrentContextIsolationExpr ast; + + final override ControlFlowElement getChildNode(int i) { + i = 0 and + result.asAstNode() = ast.getActor().getFullyConverted() + } + } + module Conversions { class ConversionOrIdentity = Synth::TIdentityExpr or Synth::TExplicitCastExpr or Synth::TImplicitConversionExpr or From ad0f9f1e7347130a852eba90e14225370314db9c Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:06:31 +0200 Subject: [PATCH 246/372] Swift: mark `ErrorUnionType` as type-check only --- swift/extractor/infra/SwiftTagTraits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 006c649fad5..0c79134a978 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -335,7 +335,7 @@ MAP(swift::TypeBase, TypeTag) MAP(swift::PackExpansionType, PackExpansionTypeTag) MAP(swift::PackElementType, PackElementTypeTag) MAP(swift::TypeVariableType, void) // created during type checking and only used for constraint checking - MAP(swift::ErrorUnionType, void) // TODO swift 6.0 + MAP(swift::ErrorUnionType, void) // created during type checking and only used for constraint checking MAP(swift::SugarType, SugarTypeTag) MAP(swift::ParenType, ParenTypeTag) MAP(swift::TypeAliasType, TypeAliasTypeTag) From 947354393314bdb91104850e94ff98bbac5bfb25 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:20:00 +0200 Subject: [PATCH 247/372] Swift: extract `ActorIsolationErasureExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- swift/ql/.generated.list | 14 +++++---- swift/ql/.gitattributes | 4 +++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../expr/ActorIsolationErasureExpr.qll | 13 ++++++++ .../ActorIsolationErasureExprConstructor.qll | 14 +++++++++ .../ActorIsolationErasureExprImpl.qll | 20 +++++++++++++ .../codeql/swift/generated/ParentChild.qll | 19 ++++++++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 9 ++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 30 +++++++++++++++++-- .../swift/generated/SynthConstructors.qll | 1 + .../expr/ActorIsolationErasureExpr.qll | 27 +++++++++++++++++ swift/ql/lib/swift.dbscheme | 5 ++++ swift/schema.py | 7 +++++ 14 files changed, 158 insertions(+), 8 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 0c79134a978..d1f4c4c915c 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -175,7 +175,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::LinearFunctionExtractOriginalExpr, LinearFunctionExtractOriginalExprTag) MAP(swift::LinearToDifferentiableFunctionExpr, LinearToDifferentiableFunctionExprTag) MAP(swift::ABISafeConversionExpr, AbiSafeConversionExprTag) // different acronym convention - MAP(swift::ActorIsolationErasureExpr, void) // TODO swift 6.0 + MAP(swift::ActorIsolationErasureExpr, ActorIsolationErasureExprTag) MAP(swift::UnreachableExpr, void) // TODO swift 6.0 MAP(swift::ExplicitCastExpr, ExplicitCastExprTag) MAP(swift::CheckedCastExpr, CheckedCastExprTag) diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 8dd1a1ba407..14134c8c89a 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -111,6 +111,7 @@ lib/codeql/swift/elements/decl/internal/SubscriptDeclConstructor.qll 67882596f38 lib/codeql/swift/elements/decl/internal/TopLevelCodeDeclConstructor.qll 3924b6e5bee007fd62ae4b2352e38ae20292dbdab65fd1724ca9cd698bfc88f4 28ac8627c75cd787e6dca1a8bfed4c36edbfd13cdad19a08905a49d56b815ad7 lib/codeql/swift/elements/decl/internal/TypeAliasDeclConstructor.qll 1dc3d7ef11adf5fb9b4be1c824b8a49393137071584ed44224a2f47b3a0b8a4a 2e1e8222b851376b0d7843a93fb6affeac7f8ee52867623b1e2fa99c1ac37dbb lib/codeql/swift/elements/expr/AbiSafeConversionExpr.qll 62c6b231898c42a7756cae20ed9b3818958872cb581cca6f1db0b28e4cff9b93 b90f7496229e76a40ac66e8a3d0ac2f14c65d729ebeea796cb34f395f2858b32 +lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll bbbc615255877e7fd95199710449fa696d68d81a4cfb985240d0cfbf124d9d37 526e7b4f2b5af5f2c8172b5d2c76c1f7198025e02c9e1068f92fa6c78cddeb81 lib/codeql/swift/elements/expr/AnyHashableErasureExpr.qll 3388c1ad2c9d984fb0a0368ef9090f03cc5bbd63088024308a056cabfb9c93c9 49e3450180b8a4626911fc83bd64d17e486fad6b50f33b55b9322faef1ced39f lib/codeql/swift/elements/expr/AnyTryExpr.qll 1edad5f25c3e36412e4d93b3a5f6d1886670c353837c7bd9477351136ea4d743 58f5a8d11b5b5aea41cc5c513e2f594bc418e979f27aa0a44ddc3340aba50f95 lib/codeql/swift/elements/expr/AppliedPropertyWrapperExpr.qll 83c08f24e715393c8e9a9434ab53556f38965a750ee1c8b145df03435e8bf41c ad70842a93f26d70b1a9400039c4446b75302a3005e3b44905cefd44c57c46af @@ -241,6 +242,8 @@ lib/codeql/swift/elements/expr/UnresolvedTypeConversionExpr.qll e259a187d70ea6b6 lib/codeql/swift/elements/expr/VarargExpansionExpr.qll c7d7574caaac88fd73e69e82a84ca924e078eece0fd85a476b4a831e23b425f9 27213c88f864b7f8fd73edf8951e04a5ae7a57140a387df7c03dc1544ced723b lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprConstructor.qll de9d2daf68b754e783374d017116606c8cd0710dbf8989d3606939e977dc672c 63c5ddb9da56da2c9637d7a0a6d9d069f745b4c095b07c9494a0b3a7e11be95b lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprImpl.qll 6b2c51a5a5dd17044c6f5510048a9a2187aac9d35a70541faa9400406e35bc1e 448c23eec2ef44bd90e6c1636e3e881ca3447198eb68b8261412f42c4995b766 +lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll da71e5e88434f620484b792075c4966758721b46a20834c296ae77be587a8952 aafac69f37c3fd8b7d0973ca616bba30833b00d64639c3d6b7fb2e86d212406d +lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll e9b2498761c33cd765566978dbb789637e04549bdb967a1948cb6518435bfa7b 3d7b115e8d40fe1ab1fe7375493d991e51b4689b8565dde4beb6181ce7ea44ba lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprConstructor.qll a1a1b5b5cb85202756826d5858b336fa2c06859020084695f6182dff999993ed bc9aab20cb809516512ddca305e2d107c2b2d2f5850620fe53af021145bde247 lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprImpl.qll c1a0516ad5176f00347f7a5187f3c521746066235eb3f3bdd6f1ec068180d9f1 cb0d36379fff2483e30e54e75d8b63dc92669e8a129c8fcb24495cfad6456cfc lib/codeql/swift/elements/expr/internal/AnyTryExprImpl.qll 8225177728e36e4cdab514d060052b7174e99146ddfeb1a0cacbaab5bcd7f7a4 074ee2100466303ee268fbe50a3c4d4f93d920b24e17e1a2c60c9f7d3e7b46c2 @@ -698,7 +701,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 913ca9d6eda0972ab2e1922c40cc5f3519bcdfc36db70873b4802822852eac44 +lib/codeql/swift/elements.qll 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -715,12 +718,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll 6208de45f7dbf7713f91c710c6bcca1e14800cb025bdc054ea21df5f23ad9075 c6450faaf5d027fd3f43372588b893855cc72d61eab1a6efa7d9266c00a84aa2 +lib/codeql/swift/generated/ParentChild.qll 2411882684c204243d9ea793ea8c9d02355e31f606ffc43cf8882e985d799c3d e7ab1c802ea38c0c048d43482852916b62df36b58e6033f87002ec362f11ea61 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 855cacf92f587700c5408b9e17bb360dbcc57656d936148d96a3d4f747593e47 13fde0d5c2644691d6e89f9b62d528a0bdc01c32e1990769c53b65fb4b87526e -lib/codeql/swift/generated/Synth.qll 96e48b93040580edb77d94f1c3b5974899808d507fab2f3c2eab0d50367a3d3f 7e6b50a342e45cb8b3ed53150dbcdb75be07264885fde15d19fd98ae61d1ba05 -lib/codeql/swift/generated/SynthConstructors.qll 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 6367ac382b6516cdf793922702acd6187c7e873eac9f4c215955a67825ab6bf4 +lib/codeql/swift/generated/Raw.qll 7ae3ca2a8c219aeeb7be1fb2b8f4be74ce8e6ce728bc97c259693ebd3c7bf8a5 8d0713432ec6355d9a9bd208c35e3751cee173996d9bea032796042bf39014e9 +lib/codeql/swift/generated/Synth.qll a009cd58c63421832a02bad44551350b1af97fcedd6c13e920df5f66ea30d4ad f2107a40928c833da54e5f6e4bc58d4db6a982d144c59c66e449baee3d4b5848 +lib/codeql/swift/generated/SynthConstructors.qll 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -768,6 +771,7 @@ lib/codeql/swift/generated/decl/TypeDecl.qll 92f74709cce7e9f0f713598d3b20b730475 lib/codeql/swift/generated/decl/ValueDecl.qll d3b9c241fd6cb1ce8274435c0242775c28c08f6a47caae01ad1ecd38897b2cd5 bc81291b1394b47972d7b75b6a767ed847f881932a7d9345d28d161a55b66bd1 lib/codeql/swift/generated/decl/VarDecl.qll 8978a73fa2d7a9f952b68a2638788eda857e62502311a33fa6de1dad49a6cb1c b8b6c8cf6773056c3a90494754b0a257dcae494c03d933f138ece7f531fb9158 lib/codeql/swift/generated/expr/AbiSafeConversionExpr.qll 9d8f0f895a5e1abb89bed9671a9b398e48eca4664eb10b4b41263eb2a29bb2cf 4f65b8e62876664a357433f886baccaf40e4bf7e9ca7eebeb9f5d999354578f9 +lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll 0ebade7950363d63a3d0e86877174e763522ba5119253ec6b9dbf6506ab7ab6d a5a94ef22d198b7325c8dda3ca380c600f4f0147534fc1b12e57fd19e4e63961 lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll e9040afb7bf3d2d79fe931aa98f565bf1b8ad4ba56a9f2ee579e61afa7c50719 1e6e4fa2519522a117b7ca05c060f060376974a4148cbad38bb238ac432509c6 lib/codeql/swift/generated/expr/AnyTryExpr.qll 32b5df81d686959183af42c0ba30976360f3062bd6279b88d8578ac010740b24 b8a78d4e06d7160b83b31bbd033e4697f607bd6ea294f2e0dbbe96a0c665014d lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll a272cddf6e161406a886a779939a88b4536eace5579ac6930f1b5f7c234c6525 1c93e30d1850fb3be09cc250f4e645b8c36878c7ea3d028bc06a3255f764605d diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index 66bb4123005..b0508b65d75 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -113,6 +113,7 @@ /lib/codeql/swift/elements/decl/internal/TopLevelCodeDeclConstructor.qll linguist-generated /lib/codeql/swift/elements/decl/internal/TypeAliasDeclConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/AbiSafeConversionExpr.qll linguist-generated +/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll linguist-generated /lib/codeql/swift/elements/expr/AnyHashableErasureExpr.qll linguist-generated /lib/codeql/swift/elements/expr/AnyTryExpr.qll linguist-generated /lib/codeql/swift/elements/expr/AppliedPropertyWrapperExpr.qll linguist-generated @@ -243,6 +244,8 @@ /lib/codeql/swift/elements/expr/VarargExpansionExpr.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AbiSafeConversionExprImpl.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AnyHashableErasureExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/AnyTryExprImpl.qll linguist-generated @@ -770,6 +773,7 @@ /lib/codeql/swift/generated/decl/ValueDecl.qll linguist-generated /lib/codeql/swift/generated/decl/VarDecl.qll linguist-generated /lib/codeql/swift/generated/expr/AbiSafeConversionExpr.qll linguist-generated +/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll linguist-generated /lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll linguist-generated /lib/codeql/swift/generated/expr/AnyTryExpr.qll linguist-generated /lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 5db89ec9577..56dcd06aa13 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -66,6 +66,7 @@ import codeql.swift.elements.decl.TypeDecl import codeql.swift.elements.decl.ValueDecl import codeql.swift.elements.decl.VarDecl import codeql.swift.elements.expr.AbiSafeConversionExpr +import codeql.swift.elements.expr.ActorIsolationErasureExpr import codeql.swift.elements.expr.AnyHashableErasureExpr import codeql.swift.elements.expr.AnyTryExpr import codeql.swift.elements.expr.AppliedPropertyWrapperExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll new file mode 100644 index 00000000000..d49275490b8 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/ActorIsolationErasureExpr.qll @@ -0,0 +1,13 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `ActorIsolationErasureExpr`. + */ + +private import internal.ActorIsolationErasureExprImpl +import codeql.swift.elements.expr.ImplicitConversionExpr + +/** + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + */ +final class ActorIsolationErasureExpr = Impl::ActorIsolationErasureExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll new file mode 100644 index 00000000000..26690bc64de --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `ActorIsolationErasureExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `ActorIsolationErasureExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructActorIsolationErasureExpr(Raw::ActorIsolationErasureExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll new file mode 100644 index 00000000000..0cbc16f0908 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/ActorIsolationErasureExprImpl.qll @@ -0,0 +1,20 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `ActorIsolationErasureExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.ActorIsolationErasureExpr + +/** + * INTERNAL: This module contains the customizable definition of `ActorIsolationErasureExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + */ + class ActorIsolationErasureExpr extends Generated::ActorIsolationErasureExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 2e0b69ca8e0..859db4a32f1 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -2148,6 +2148,23 @@ private module Impl { ) } + private Element getImmediateChildOfActorIsolationErasureExpr( + ActorIsolationErasureExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bImplicitConversionExpr, int n | + b = 0 and + bImplicitConversionExpr = + b + 1 + + max(int i | i = -1 or exists(getImmediateChildOfImplicitConversionExpr(e, i, _)) | i) and + n = bImplicitConversionExpr and + ( + none() + or + result = getImmediateChildOfImplicitConversionExpr(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfAnyHashableErasureExpr( AnyHashableErasureExpr e, int index, string partialPredicateCall ) { @@ -5345,6 +5362,8 @@ private module Impl { or result = getImmediateChildOfAbiSafeConversionExpr(e, index, partialAccessor) or + result = getImmediateChildOfActorIsolationErasureExpr(e, index, partialAccessor) + or result = getImmediateChildOfAnyHashableErasureExpr(e, index, partialAccessor) or result = getImmediateChildOfArchetypeToSuperExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index a28175b1e74..ccd0e205555 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -1937,6 +1937,15 @@ module Raw { override string toString() { result = "AbiSafeConversionExpr" } } + /** + * INTERNAL: Do not use. + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + */ + class ActorIsolationErasureExpr extends @actor_isolation_erasure_expr, ImplicitConversionExpr { + override string toString() { result = "ActorIsolationErasureExpr" } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 9e34c778512..8e76dc24e0d 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -192,6 +192,12 @@ module Synth { * INTERNAL: Do not use. */ TAbiSafeConversionExpr(Raw::AbiSafeConversionExpr id) { constructAbiSafeConversionExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TActorIsolationErasureExpr(Raw::ActorIsolationErasureExpr id) { + constructActorIsolationErasureExpr(id) + } or /** * INTERNAL: Do not use. */ @@ -1266,8 +1272,8 @@ module Synth { * INTERNAL: Do not use. */ class TImplicitConversionExpr = - TAbiSafeConversionExpr or TAnyHashableErasureExpr or TArchetypeToSuperExpr or - TArrayToPointerExpr or TBridgeFromObjCExpr or TBridgeToObjCExpr or + TAbiSafeConversionExpr or TActorIsolationErasureExpr or TAnyHashableErasureExpr or + TArchetypeToSuperExpr or TArrayToPointerExpr or TBridgeFromObjCExpr or TBridgeToObjCExpr or TClassMetatypeToObjectExpr or TCollectionUpcastConversionExpr or TConditionalBridgeFromObjCExpr or TCovariantFunctionConversionExpr or TCovariantReturnConversionExpr or TDerivedToBaseExpr or TDestructureTupleExpr or @@ -1710,6 +1716,14 @@ module Synth { result = TAbiSafeConversionExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TActorIsolationErasureExpr`, if possible. + */ + TActorIsolationErasureExpr convertActorIsolationErasureExprFromRaw(Raw::Element e) { + result = TActorIsolationErasureExpr(e) + } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TAnyHashableErasureExpr`, if possible. @@ -3675,6 +3689,8 @@ module Synth { TImplicitConversionExpr convertImplicitConversionExprFromRaw(Raw::Element e) { result = convertAbiSafeConversionExprFromRaw(e) or + result = convertActorIsolationErasureExprFromRaw(e) + or result = convertAnyHashableErasureExprFromRaw(e) or result = convertArchetypeToSuperExprFromRaw(e) @@ -4402,6 +4418,14 @@ module Synth { e = TAbiSafeConversionExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TActorIsolationErasureExpr` to a raw DB element, if possible. + */ + Raw::Element convertActorIsolationErasureExprToRaw(TActorIsolationErasureExpr e) { + e = TActorIsolationErasureExpr(result) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TAnyHashableErasureExpr` to a raw DB element, if possible. @@ -6365,6 +6389,8 @@ module Synth { Raw::Element convertImplicitConversionExprToRaw(TImplicitConversionExpr e) { result = convertAbiSafeConversionExprToRaw(e) or + result = convertActorIsolationErasureExprToRaw(e) + or result = convertAnyHashableErasureExprToRaw(e) or result = convertArchetypeToSuperExprToRaw(e) diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 635e9cbb5bb..27c0949bce9 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -45,6 +45,7 @@ import codeql.swift.elements.decl.internal.SubscriptDeclConstructor import codeql.swift.elements.decl.internal.TopLevelCodeDeclConstructor import codeql.swift.elements.decl.internal.TypeAliasDeclConstructor import codeql.swift.elements.expr.internal.AbiSafeConversionExprConstructor +import codeql.swift.elements.expr.internal.ActorIsolationErasureExprConstructor import codeql.swift.elements.expr.internal.AnyHashableErasureExprConstructor import codeql.swift.elements.expr.internal.AppliedPropertyWrapperExprConstructor import codeql.swift.elements.expr.internal.ArchetypeToSuperExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll new file mode 100644 index 00000000000..0811908bbab --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/ActorIsolationErasureExpr.qll @@ -0,0 +1,27 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `ActorIsolationErasureExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.internal.ImplicitConversionExprImpl::Impl as ImplicitConversionExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `ActorIsolationErasureExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A conversion that erases the actor isolation of an expression with `@isolated(any)` function + * type. + * INTERNAL: Do not reference the `Generated::ActorIsolationErasureExpr` class directly. + * Use the subclass `ActorIsolationErasureExpr`, where the following predicates are available. + */ + class ActorIsolationErasureExpr extends Synth::TActorIsolationErasureExpr, + ImplicitConversionExprImpl::ImplicitConversionExpr + { + override string getAPrimaryQlClass() { result = "ActorIsolationErasureExpr" } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 0928a72ec71..3a26c579e52 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -1034,6 +1034,7 @@ if_exprs( //dir=expr @implicit_conversion_expr = @abi_safe_conversion_expr +| @actor_isolation_erasure_expr | @any_hashable_erasure_expr | @archetype_to_super_expr | @array_to_pointer_expr @@ -1318,6 +1319,10 @@ abi_safe_conversion_exprs( //dir=expr unique int id: @abi_safe_conversion_expr ); +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + any_hashable_erasure_exprs( //dir=expr unique int id: @any_hashable_erasure_expr ); diff --git a/swift/schema.py b/swift/schema.py index 9a777f6c7c7..0fb770406e3 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1450,3 +1450,10 @@ class CurrentContextIsolationExpr(Expr): the source. """ actor: Expr + + +class ActorIsolationErasureExpr(ImplicitConversionExpr): + """ + A conversion that erases the actor isolation of an expression with `@isolated(any)` function + type. + """ From fa6deaf87a4fd41813348a2539e02517fb23ab62 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:34:53 +0200 Subject: [PATCH 248/372] Swift: extract `UnreachableExpr` --- swift/extractor/infra/SwiftTagTraits.h | 2 +- swift/ql/.generated.list | 14 ++++++---- swift/ql/.gitattributes | 4 +++ swift/ql/lib/codeql/swift/elements.qll | 1 + .../swift/elements/expr/UnreachableExpr.qll | 12 +++++++++ .../internal/UnreachableExprConstructor.qll | 14 ++++++++++ .../expr/internal/UnreachableExprImpl.qll | 19 ++++++++++++++ .../codeql/swift/generated/ParentChild.qll | 19 ++++++++++++++ swift/ql/lib/codeql/swift/generated/Raw.qll | 8 ++++++ swift/ql/lib/codeql/swift/generated/Synth.qll | 23 +++++++++++++++- .../swift/generated/SynthConstructors.qll | 1 + .../swift/generated/expr/UnreachableExpr.qll | 26 +++++++++++++++++++ swift/ql/lib/swift.dbscheme | 5 ++++ swift/schema.py | 6 +++++ 14 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll create mode 100644 swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll create mode 100644 swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index d1f4c4c915c..6c7e2309e84 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -176,7 +176,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::LinearToDifferentiableFunctionExpr, LinearToDifferentiableFunctionExprTag) MAP(swift::ABISafeConversionExpr, AbiSafeConversionExprTag) // different acronym convention MAP(swift::ActorIsolationErasureExpr, ActorIsolationErasureExprTag) - MAP(swift::UnreachableExpr, void) // TODO swift 6.0 + MAP(swift::UnreachableExpr, UnreachableExprTag) MAP(swift::ExplicitCastExpr, ExplicitCastExprTag) MAP(swift::CheckedCastExpr, CheckedCastExprTag) MAP(swift::ForcedCheckedCastExpr, ForcedCheckedCastExprTag) diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 14134c8c89a..61bc11662f5 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -232,6 +232,7 @@ lib/codeql/swift/elements/expr/TupleExpr.qll 11efe0f2737b561a392bbd684c7c1cc2e29 lib/codeql/swift/elements/expr/TypeExpr.qll c3f7272b77aadd8a4a0e5c7e3876bba6bba45343415c8ce96de26e1e898d11c0 91cd440b768e4d9aa60a165ddb62ecdcad85eb4a676ab0d60ca8777e753bffc7 lib/codeql/swift/elements/expr/UnderlyingToOpaqueExpr.qll f319daff97d13a5cacf2efcd1f2b77e58ec9b9a30413ddb30cc0333197cbef9f 9c6a97a66a452a6167b26f48b0f31a42e2c528fcd30e76c9f4dd146f6609b5d3 lib/codeql/swift/elements/expr/UnevaluatedInstanceExpr.qll 7eca15f753e81d99a275ca1d29986d5209d8ffea4034746945227fedc1b74c38 714c9a7a09f525187f53a4c9599a141a32ec6071c405c2a425dc2cfb6f2457e6 +lib/codeql/swift/elements/expr/UnreachableExpr.qll 930822d66d99422603725161f55fec7b861ef33aa8fe57afbdbea2a68a764fcb e8005f5ac66a97e614f3792e8053b0fb6d6bb1f99bc1d0f7d0d0b41e703efe9c lib/codeql/swift/elements/expr/UnresolvedDeclRefExpr.qll 356dacb2b2ece20366a2d4b809210aeedcec31b8362a204854a77a192a01c0e1 7705b39752be30ab6bff12ccc690ed3b0fd843978721558e18f5f57e65f1f688 lib/codeql/swift/elements/expr/UnresolvedDotExpr.qll 97c05188380cb890049db519d70168c3ca69c356fd15efd1ec52555519518a68 01455fb6e2c57941b209d844b65a0e6778d2d8d3db6081fb96c375c528574c41 lib/codeql/swift/elements/expr/UnresolvedMemberChainResultExpr.qll 2a5747bdd60c30b9b32552ef48a1ba94bfa4c593896d7e1ba1992403680d10af c92cfd85209a0314b99a2f8549c73eb878ab251453330298da72aa9d2208e7ac @@ -410,6 +411,8 @@ lib/codeql/swift/elements/expr/internal/UnderlyingToOpaqueExprConstructor.qll 8b lib/codeql/swift/elements/expr/internal/UnderlyingToOpaqueExprImpl.qll cf2637b44a96fce2d8e618469692305181490a28f3b2698b6f9db2d58e7c474d 9b062defb7c19e217bea6e5bd65ccf28e1ff25fb1e784405eb92406806a3349c lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprConstructor.qll 4560f4737cb47512b8348fd2a37599227df4a05bfad84873f6666d121a524e0a b49bfdfa550330bab087c5a6b7a3885fd22360e557adf984ce7a35534d882510 lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprImpl.qll 35107b79b01c1304167ce211e081991a2a8e05e9831da7d6523363d59a9dbb7a bc4811a0b40380b1a065f64dbd4b4f756e80cb11ee3b5c4f6ce035c5629db852 +lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll 53ff660f143f073f2675c37e2a471b79b82864051a3f5305faf33cd642904d3e 35d37b022f6c6f0b1d6483a2698c2e08f0bd545fd573edbf642815ad7d34bafd +lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll 3c305339fb8eef3b521638164290d630fc166106006a634c7ccec2198a4cb035 7ff8f246f567689305a44b04e990f31cb696ad2533dbb8c40f1cf82e3e8100ff lib/codeql/swift/elements/expr/internal/UnresolvedDeclRefExprConstructor.qll 344072439e0d95d1148d361ff764c17eaa47e5c0be82a3320cd9ab3868ac415f 25553a602da130b30e69ae9844e9be9da73ee579ba74c3bb84a9aa8e24801b46 lib/codeql/swift/elements/expr/internal/UnresolvedDotExprConstructor.qll 2945ae07a65a7262e97cb28d35b9c3a9dfee662f2af54a8d9aba5f0c49216190 297485aa44da7ce69c7e33bc3ffde66bee79615fa947159b76e6ed73d1886b25 lib/codeql/swift/elements/expr/internal/UnresolvedMemberChainResultExprConstructor.qll 1086b09aa950efd4e8ed1ce4723f6a6e6b43bbc147085375f589654f2dc04008 8adf6b2f415b69b8eb235c7e76eb5f0e5320939a0904d0b6823b28293eaa3b57 @@ -701,7 +704,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898 lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4 lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633 -lib/codeql/swift/elements.qll 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 397f257159ffcad583f3944333f99406289ee2ef85c6da781d72dc52a59477e4 +lib/codeql/swift/elements.qll 9648ab501b413dc327513d9ed1d6e620a9eab6096e1130dc7e78cd6a2b6b549b 9648ab501b413dc327513d9ed1d6e620a9eab6096e1130dc7e78cd6a2b6b549b lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99 lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119 @@ -718,12 +721,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f -lib/codeql/swift/generated/ParentChild.qll 2411882684c204243d9ea793ea8c9d02355e31f606ffc43cf8882e985d799c3d e7ab1c802ea38c0c048d43482852916b62df36b58e6033f87002ec362f11ea61 +lib/codeql/swift/generated/ParentChild.qll 7c9537f74a4c5a02622ce28c3de4b0ce02a7027d2e9aea9a860ece6a1e2ec340 49c1993b2a96df66903bffde78d63d8f4c68b2d604c419b20d88b63406366156 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 7ae3ca2a8c219aeeb7be1fb2b8f4be74ce8e6ce728bc97c259693ebd3c7bf8a5 8d0713432ec6355d9a9bd208c35e3751cee173996d9bea032796042bf39014e9 -lib/codeql/swift/generated/Synth.qll a009cd58c63421832a02bad44551350b1af97fcedd6c13e920df5f66ea30d4ad f2107a40928c833da54e5f6e4bc58d4db6a982d144c59c66e449baee3d4b5848 -lib/codeql/swift/generated/SynthConstructors.qll 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 4d984e2e839c082b9bc70d3b6166303d81eae9baa4cef5e072a792405a014cc8 +lib/codeql/swift/generated/Raw.qll 522f8500ce46d62fca22730ade5fa4716452adece25ffc36c50582b653f2fe6f 4d870e0695fff541c1a14eadc8ba51960a264ba2e6e53d0ccc32b34c7fd2cadd +lib/codeql/swift/generated/Synth.qll a14dddab40979df82d30b2d73407fe0058a803ed6e1a882cd9a6ae5ffd240526 0879d2476a42123b46eee216d4ea03523e0c04fe0b68d9a68e0046253edb1bc9 +lib/codeql/swift/generated/SynthConstructors.qll f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022 @@ -895,6 +898,7 @@ lib/codeql/swift/generated/expr/TupleExpr.qll 860dde65c440ffa74648c663126194182c lib/codeql/swift/generated/expr/TypeExpr.qll 1f38f463b11b9f10878dab7266f05f455a0802e6d7464d81d4c05855d41adc64 b3c3f6b61b466be86a8cc0cea18d85b7a23b1f8dcf876ef2a050ef69778df32b lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll 3d68175d73056e6f5afea5040ad2f9a8447adf078c490bb06769008857ee2ca7 f0ec8f0bf7271289b8be32038e60c2b1053d6563354c8bced53a42fef6292152 lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll bac438970bc12eef2ace318b97d37ef58ab7a9c2c43c3f4515780f65cdc5de70 11810cdd753c744f3ee274fce889d272c3c94b6087c124cdd09e99188eb3f926 +lib/codeql/swift/generated/expr/UnreachableExpr.qll ab17ea1f01eb1b22b1012b57582b170936244c98f42374e0e21b9d468db9249c 93a2a3685a9f8d4eab06cf700bc6465915e29b49249a14fe6aa68d1af96c86ca lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll b6a72b3052829ac56f16b72baa7fc62926e8dde781ab9fa29b2cb7d87b5e287d df8fe19e9487c3ae83a19f38d98fd365add5b010ccab2f8699e4a2b841bb00a0 lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll 78a6d4cf27b3b6012b9880cae52604c49e7300d1b02e9f7a9157705078423d7a 79ca200646616ddb17fb72112469985b18718cba676e3bd94d8bcb234627ea93 lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll 8277a5c54c868441217beab4b5f7f4bb937098611ce1e1fb098ad39f17660970 15996c1c571579db3e2ea861fa850294d916dde6ba437cabc6f18d18bcc6b785 diff --git a/swift/ql/.gitattributes b/swift/ql/.gitattributes index b0508b65d75..32c1865ff30 100644 --- a/swift/ql/.gitattributes +++ b/swift/ql/.gitattributes @@ -234,6 +234,7 @@ /lib/codeql/swift/elements/expr/TypeExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnderlyingToOpaqueExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnevaluatedInstanceExpr.qll linguist-generated +/lib/codeql/swift/elements/expr/UnreachableExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnresolvedDeclRefExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnresolvedDotExpr.qll linguist-generated /lib/codeql/swift/elements/expr/UnresolvedMemberChainResultExpr.qll linguist-generated @@ -412,6 +413,8 @@ /lib/codeql/swift/elements/expr/internal/UnderlyingToOpaqueExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnevaluatedInstanceExprImpl.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll linguist-generated +/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnresolvedDeclRefExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnresolvedDotExprConstructor.qll linguist-generated /lib/codeql/swift/elements/expr/internal/UnresolvedMemberChainResultExprConstructor.qll linguist-generated @@ -897,6 +900,7 @@ /lib/codeql/swift/generated/expr/TypeExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll linguist-generated +/lib/codeql/swift/generated/expr/UnreachableExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll linguist-generated /lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll linguist-generated diff --git a/swift/ql/lib/codeql/swift/elements.qll b/swift/ql/lib/codeql/swift/elements.qll index 56dcd06aa13..53d630d9f19 100644 --- a/swift/ql/lib/codeql/swift/elements.qll +++ b/swift/ql/lib/codeql/swift/elements.qll @@ -187,6 +187,7 @@ import codeql.swift.elements.expr.TupleExpr import codeql.swift.elements.expr.TypeExpr import codeql.swift.elements.expr.UnderlyingToOpaqueExpr import codeql.swift.elements.expr.UnevaluatedInstanceExpr +import codeql.swift.elements.expr.UnreachableExpr import codeql.swift.elements.expr.UnresolvedDeclRefExpr import codeql.swift.elements.expr.UnresolvedDotExpr import codeql.swift.elements.expr.UnresolvedMemberChainResultExpr diff --git a/swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll b/swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll new file mode 100644 index 00000000000..23c79595be1 --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/UnreachableExpr.qll @@ -0,0 +1,12 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the public class `UnreachableExpr`. + */ + +private import internal.UnreachableExprImpl +import codeql.swift.elements.expr.ImplicitConversionExpr + +/** + * A conversion from the uninhabited type to any other type. It's never evaluated. + */ +final class UnreachableExpr = Impl::UnreachableExpr; diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll new file mode 100644 index 00000000000..8689ded006e --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprConstructor.qll @@ -0,0 +1,14 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module defines the hook used internally to tweak the characteristic predicate of + * `UnreachableExpr` synthesized instances. + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.Raw + +/** + * The characteristic predicate of `UnreachableExpr` synthesized instances. + * INTERNAL: Do not use. + */ +predicate constructUnreachableExpr(Raw::UnreachableExpr id) { any() } diff --git a/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll new file mode 100644 index 00000000000..35dda80350c --- /dev/null +++ b/swift/ql/lib/codeql/swift/elements/expr/internal/UnreachableExprImpl.qll @@ -0,0 +1,19 @@ +// generated by codegen/codegen.py, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `UnreachableExpr`. + * + * INTERNAL: Do not use. + */ + +private import codeql.swift.generated.expr.UnreachableExpr + +/** + * INTERNAL: This module contains the customizable definition of `UnreachableExpr` and should not + * be referenced directly. + */ +module Impl { + /** + * A conversion from the uninhabited type to any other type. It's never evaluated. + */ + class UnreachableExpr extends Generated::UnreachableExpr { } +} diff --git a/swift/ql/lib/codeql/swift/generated/ParentChild.qll b/swift/ql/lib/codeql/swift/generated/ParentChild.qll index 859db4a32f1..2925620f24f 100644 --- a/swift/ql/lib/codeql/swift/generated/ParentChild.qll +++ b/swift/ql/lib/codeql/swift/generated/ParentChild.qll @@ -3108,6 +3108,23 @@ private module Impl { ) } + private Element getImmediateChildOfUnreachableExpr( + UnreachableExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bImplicitConversionExpr, int n | + b = 0 and + bImplicitConversionExpr = + b + 1 + + max(int i | i = -1 or exists(getImmediateChildOfImplicitConversionExpr(e, i, _)) | i) and + n = bImplicitConversionExpr and + ( + none() + or + result = getImmediateChildOfImplicitConversionExpr(e, index - b, partialPredicateCall) + ) + ) + } + private Element getImmediateChildOfUnresolvedMemberChainResultExpr( UnresolvedMemberChainResultExpr e, int index, string partialPredicateCall ) { @@ -5470,6 +5487,8 @@ private module Impl { or result = getImmediateChildOfUnevaluatedInstanceExpr(e, index, partialAccessor) or + result = getImmediateChildOfUnreachableExpr(e, index, partialAccessor) + or result = getImmediateChildOfUnresolvedMemberChainResultExpr(e, index, partialAccessor) or result = getImmediateChildOfUnresolvedTypeConversionExpr(e, index, partialAccessor) diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index ccd0e205555..2e0e08599ce 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -2462,6 +2462,14 @@ module Raw { override string toString() { result = "UnevaluatedInstanceExpr" } } + /** + * INTERNAL: Do not use. + * A conversion from the uninhabited type to any other type. It's never evaluated. + */ + class UnreachableExpr extends @unreachable_expr, ImplicitConversionExpr { + override string toString() { result = "UnreachableExpr" } + } + /** * INTERNAL: Do not use. */ diff --git a/swift/ql/lib/codeql/swift/generated/Synth.qll b/swift/ql/lib/codeql/swift/generated/Synth.qll index 8e76dc24e0d..ce6eca080af 100644 --- a/swift/ql/lib/codeql/swift/generated/Synth.qll +++ b/swift/ql/lib/codeql/swift/generated/Synth.qll @@ -678,6 +678,10 @@ module Synth { TUnevaluatedInstanceExpr(Raw::UnevaluatedInstanceExpr id) { constructUnevaluatedInstanceExpr(id) } or + /** + * INTERNAL: Do not use. + */ + TUnreachableExpr(Raw::UnreachableExpr id) { constructUnreachableExpr(id) } or /** * INTERNAL: Do not use. */ @@ -1283,7 +1287,8 @@ module Synth { TLinearFunctionExpr or TLinearFunctionExtractOriginalExpr or TLinearToDifferentiableFunctionExpr or TLoadExpr or TMetatypeConversionExpr or TPointerToPointerExpr or TProtocolMetatypeToObjectExpr or TStringToPointerExpr or - TUnderlyingToOpaqueExpr or TUnevaluatedInstanceExpr or TUnresolvedTypeConversionExpr; + TUnderlyingToOpaqueExpr or TUnevaluatedInstanceExpr or TUnreachableExpr or + TUnresolvedTypeConversionExpr; /** * INTERNAL: Do not use. @@ -2494,6 +2499,12 @@ module Synth { result = TUnevaluatedInstanceExpr(e) } + /** + * INTERNAL: Do not use. + * Converts a raw element to a synthesized `TUnreachableExpr`, if possible. + */ + TUnreachableExpr convertUnreachableExprFromRaw(Raw::Element e) { result = TUnreachableExpr(e) } + /** * INTERNAL: Do not use. * Converts a raw element to a synthesized `TUnresolvedDeclRefExpr`, if possible. @@ -3751,6 +3762,8 @@ module Synth { or result = convertUnevaluatedInstanceExprFromRaw(e) or + result = convertUnreachableExprFromRaw(e) + or result = convertUnresolvedTypeConversionExprFromRaw(e) } @@ -5194,6 +5207,12 @@ module Synth { e = TUnevaluatedInstanceExpr(result) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TUnreachableExpr` to a raw DB element, if possible. + */ + Raw::Element convertUnreachableExprToRaw(TUnreachableExpr e) { e = TUnreachableExpr(result) } + /** * INTERNAL: Do not use. * Converts a synthesized `TUnresolvedDeclRefExpr` to a raw DB element, if possible. @@ -6451,6 +6470,8 @@ module Synth { or result = convertUnevaluatedInstanceExprToRaw(e) or + result = convertUnreachableExprToRaw(e) + or result = convertUnresolvedTypeConversionExprToRaw(e) } diff --git a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll index 27c0949bce9..1da3dcbc013 100644 --- a/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll +++ b/swift/ql/lib/codeql/swift/generated/SynthConstructors.qll @@ -154,6 +154,7 @@ import codeql.swift.elements.expr.internal.TupleExprConstructor import codeql.swift.elements.expr.internal.TypeExprConstructor import codeql.swift.elements.expr.internal.UnderlyingToOpaqueExprConstructor import codeql.swift.elements.expr.internal.UnevaluatedInstanceExprConstructor +import codeql.swift.elements.expr.internal.UnreachableExprConstructor import codeql.swift.elements.expr.internal.UnresolvedDeclRefExprConstructor import codeql.swift.elements.expr.internal.UnresolvedDotExprConstructor import codeql.swift.elements.expr.internal.UnresolvedMemberChainResultExprConstructor diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll new file mode 100644 index 00000000000..5737d6b9172 --- /dev/null +++ b/swift/ql/lib/codeql/swift/generated/expr/UnreachableExpr.qll @@ -0,0 +1,26 @@ +// generated by codegen/codegen.py, do not edit +/** + * This module provides the generated definition of `UnreachableExpr`. + * INTERNAL: Do not import directly. + */ + +private import codeql.swift.generated.Synth +private import codeql.swift.generated.Raw +import codeql.swift.elements.expr.internal.ImplicitConversionExprImpl::Impl as ImplicitConversionExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `UnreachableExpr` and should not + * be referenced directly. + */ +module Generated { + /** + * A conversion from the uninhabited type to any other type. It's never evaluated. + * INTERNAL: Do not reference the `Generated::UnreachableExpr` class directly. + * Use the subclass `UnreachableExpr`, where the following predicates are available. + */ + class UnreachableExpr extends Synth::TUnreachableExpr, + ImplicitConversionExprImpl::ImplicitConversionExpr + { + override string getAPrimaryQlClass() { result = "UnreachableExpr" } + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 3a26c579e52..be2357fd002 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -1065,6 +1065,7 @@ if_exprs( //dir=expr | @string_to_pointer_expr | @underlying_to_opaque_expr | @unevaluated_instance_expr +| @unreachable_expr | @unresolved_type_conversion_expr ; @@ -1643,6 +1644,10 @@ unevaluated_instance_exprs( //dir=expr unique int id: @unevaluated_instance_expr ); +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + unresolved_member_chain_result_exprs( //dir=expr unique int id: @unresolved_member_chain_result_expr ); diff --git a/swift/schema.py b/swift/schema.py index 0fb770406e3..d99a00c2e67 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1457,3 +1457,9 @@ class ActorIsolationErasureExpr(ImplicitConversionExpr): A conversion that erases the actor isolation of an expression with `@isolated(any)` function type. """ + + +class UnreachableExpr(ImplicitConversionExpr): + """ + A conversion from the uninhabited type to any other type. It's never evaluated. + """ From 1316e08365900be11720b4d1150ceb7aaf86ee5d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 10:56:52 +0200 Subject: [PATCH 249/372] Swift: add upgrade/downgrade scripts --- .../downgrade.ql | 40 + .../old.dbscheme | 2815 +++++++++++++++++ .../swift.dbscheme | 2793 ++++++++++++++++ .../upgrade.properties | 11 + .../old.dbscheme | 2793 ++++++++++++++++ .../swift.dbscheme | 2815 +++++++++++++++++ .../upgrade.properties | 2 + 7 files changed, 11269 insertions(+) create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme create mode 100644 swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties create mode 100644 swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme create mode 100644 swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme create mode 100644 swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql new file mode 100644 index 00000000000..bab33cc0962 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/downgrade.ql @@ -0,0 +1,40 @@ +class Element extends @element { + string toString() { none() } +} + +predicate removedClass(Element e, string name, Element child) { + current_context_isolation_exprs(e, child) and name = "CurrentContextIsolationExpr" + or + extract_function_isolation_exprs(e, child) and name = "ExtractFunctionIsolationExpr" + or + ( + actor_isolation_erasure_exprs(e) and name = "ActorIsolationErasureExpr" + or + unreachable_exprs(e) and name = "UnreachableExpr" + ) and + implicit_conversion_exprs(e, child) +} + +query predicate new_unspecified_elements(Element e, string property, string error) { + unspecified_elements(e, property, error) + or + exists(string name | + removedClass(e, name, _) and + property = "" and + error = name + " nodes removed during database downgrade. Please update your CodeQL code." + ) +} + +query predicate new_unspecified_element_children(Element e, int index, Element child) { + unspecified_element_children(e, index, child) + or + removedClass(e, _, child) and index = 0 +} + +query predicate new_implicit_conversion_exprs(Element e, Element child) { + implicit_conversion_exprs(e, child) and not removedClass(e, _, _) +} + +query predicate new_expr_types(Element e, Element type) { + expr_types(e, type) and not removedClass(e, _, _) +} diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme new file mode 100644 index 00000000000..be2357fd002 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme new file mode 100644 index 00000000000..33db81ad4b6 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme @@ -0,0 +1,2793 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties new file mode 100644 index 00000000000..60c3adffe85 --- /dev/null +++ b/swift/downgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties @@ -0,0 +1,11 @@ +description: Remove `ExtracFunctionIsolationExpr`, `CurrentContextIsolationExpr`, `ActorIsolationErasureExpr` and `UnreachableExpr`. +compatibility: backwards + +current_context_isolation_exprs.rel: delete +extract_function_isolation_exprs.rel: delete +actor_isolation_erasure_exprs.rel: delete +unreachable_exprs.rel: delete +unspecified_elements.rel: run downgrade.ql new_unspecified_elements +unspecified_element_children.rel: run downgrade.ql new_unspecified_element_children +implicit_conversion_exprs.rel: run downgrade.ql new_implicit_conversion_exprs +expr_types.rel: run downgrade.ql new_expr_types diff --git a/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme new file mode 100644 index 00000000000..33db81ad4b6 --- /dev/null +++ b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/old.dbscheme @@ -0,0 +1,2793 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme new file mode 100644 index 00000000000..be2357fd002 --- /dev/null +++ b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/swift.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties new file mode 100644 index 00000000000..f09284fb3d4 --- /dev/null +++ b/swift/ql/lib/upgrades/33db81ad4b606ff9a476c8dabeb9fffbf61aa829/upgrade.properties @@ -0,0 +1,2 @@ +description: Add `ExtracFunctionIsolationExpr`, `CurrentContextIsolationExpr`, `ActorIsolationErasureExpr` and `UnreachableExpr`. +compatibility: full From cef3cd9b54e9194128c839af696fd84f0bc05a51 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 10 Apr 2025 14:58:23 +0100 Subject: [PATCH 250/372] Rust: Add tests for std::io sources. --- .../dataflow/sources/TaintSources.expected | 2 +- .../library-tests/dataflow/sources/test.rs | 149 ++++++++++++++++++ 2 files changed, 150 insertions(+), 1 deletion(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 8448ee78372..6edfbb562da 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -22,4 +22,4 @@ | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:112:35:112:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:119:31:119:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:203:16:203:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | +| test.rs:352:16:352:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index e4c6b2736d7..3e5e5556870 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -198,6 +198,155 @@ async fn test_hyper_http(case: i64) -> Result<(), Box> { Ok(()) } +use std::io::Read; +use std::io::BufRead; + +fn test_io_fs() -> std::io::Result<()> { + // --- stdin --- + + { + let mut buffer = [0u8; 100]; + let _bytes = std::io::stdin().read(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = [0; 100]; + std::io::stdin().read_exact(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + for byte in std::io::stdin().bytes() { // $ MISSING: Alert[rust/summary/taint-sources] + sink(byte); // $ MISSING: hasTaintFlow + } + + // --- file --- + + let mut file = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + + { + let mut buffer = [0u8; 100]; + let _bytes = file.read(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let _bytes = file.read_to_end(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let _bytes = file.read_to_string(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = [0; 100]; + file.read_exact(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + for byte in file.bytes() { + sink(byte); // $ MISSING: hasTaintFlow + } + + // --- BufReader --- + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let data = reader.fill_buf()?; + sink(&data); // $ MISSING: hasTaintFlow + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let data = reader.buffer(); + sink(&data); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + reader.read_line(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + reader.read_until(b',', &mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = Vec::::new(); + let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ MISSING: Alert[rust/summary/taint-sources] + while let Some(chunk) = reader_split.next() { + sink(chunk.unwrap()); // $ MISSING: hasTaintFlow + } + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + for line in reader.lines() { + sink(line); // $ MISSING: Alert[rust/summary/taint-sources] + } + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let line = reader.lines().nth(1).unwrap(); + sink(line.unwrap().clone()); // $ MISSING: hasTaintFlow + } + + { + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let lines: Vec<_> = reader.lines().collect(); + sink(lines[1].as_ref().unwrap().clone()); // $ MISSING: hasTaintFlow + } + + // --- misc operations --- + + { + let mut buffer = String::new(); + let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file2 = std::fs::File::open("another_file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = file1.chain(file2); + reader.read_to_string(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = file1.take(100); + reader.read_to_string(&mut buffer)?; + sink(&buffer); // $ MISSING: hasTaintFlow + } + + { + let mut buffer = String::new(); + let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(&buffer); // $ MISSING: hasTaintFlow + } + + Ok(()) +} + #[tokio::main] async fn main() -> Result<(), Box> { let case = std::env::args().nth(1).unwrap_or(String::from("1")).parse::().unwrap(); // $ Alert[rust/summary/taint-sources] From 258c1afe27d7c108b931df752efe90a4ba11bb1c Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 10:06:49 +0100 Subject: [PATCH 251/372] Rust: Add tests for std::fs sources. --- .../dataflow/sources/TaintSources.expected | 2 +- .../library-tests/dataflow/sources/test.rs | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 6edfbb562da..312842134d5 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -22,4 +22,4 @@ | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:112:35:112:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:119:31:119:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | -| test.rs:352:16:352:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | +| test.rs:386:16:386:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index 3e5e5556870..fa6f3ec37b1 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -198,6 +198,40 @@ async fn test_hyper_http(case: i64) -> Result<(), Box> { Ok(()) } +use std::fs; + +fn test_fs() -> Result<(), Box> { + { + let buffer: Vec = std::fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(buffer); // $ MISSING: hasTaintFlow + } + + { + let buffer: Vec = fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(buffer); // $ MISSING: hasTaintFlow + } + + { + let buffer = fs::read_to_string("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(buffer); // $ MISSING: hasTaintFlow + } + + for entry in fs::read_dir("directory")? { + let e = entry?; + let path = e.path(); // $ MISSING: Alert[rust/summary/taint-sources] + let file_name = e.file_name(); // $ MISSING: Alert[rust/summary/taint-sources] + sink(path); // $ MISSING: hasTaintFlow + sink(file_name); // $ MISSING: hasTaintFlow + } + + { + let target = fs::read_link("symlink.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + sink(target); // $ MISSING: hasTaintFlow + } + + Ok(()) +} + use std::io::Read; use std::io::BufRead; From 4f9f550ba62863e9c1ce3a681e5ffcc6190b3d30 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:18:37 +0100 Subject: [PATCH 252/372] Rust: Add source models for fs. --- rust/ql/lib/codeql/rust/Concepts.qll | 26 +++++++++++++++ .../rust/frameworks/stdlib/fs.model.yml | 10 ++++-- .../dataflow/sources/TaintSources.expected | 10 ++++++ .../library-tests/dataflow/sources/test.rs | 32 +++++++++---------- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index 723cde6913a..10bf4d86998 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -102,6 +102,32 @@ class ModeledEnvironmentSource extends EnvironmentSource::Range { ModeledEnvironmentSource() { sourceNode(this, "environment-source") } } +/** + * A data flow source corresponding to a file access. + */ +final class FileSource = FileSource::Range; + +/** + * An externally modeled source for data from a file access. + */ +class ModeledFileSource extends FileSource::Range { + ModeledFileSource() { sourceNode(this, "file") } +} + +/** + * Provides a class for modeling new sources for file accesses. + */ +module FileSource { + /** + * A data flow source corresponding to a file access. + */ + abstract class Range extends ThreatModelSource::Range { + override string getThreatModel() { result = "file" } + + override string getSourceType() { result = "FileSource" } + } +} + /** * A data flow source corresponding to the program's database reads. */ diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml index c7fa7279330..436ff2002ba 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/fs.model.yml @@ -2,7 +2,14 @@ extensions: - addsTo: pack: codeql/rust-all extensible: sourceModel - data: [] + data: + - ["lang:std", "crate::fs::read", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "crate::fs::read_to_string", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "crate::fs::read_link", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "::path", "ReturnValue", "file", "manual"] + - ["lang:std", "::file_name", "ReturnValue", "file", "manual"] + - ["lang:std", "::open", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] + - ["lang:std", "::open_buffered", "ReturnValue.Field[crate::result::Result::Ok(0)]", "file", "manual"] - addsTo: pack: codeql/rust-all extensible: sinkModel @@ -34,7 +41,6 @@ extensions: - ["lang:std", "::create_new", "Argument[0]", "path-injection", "manual"] - ["lang:std", "::open", "Argument[0]", "path-injection", "manual"] - ["lang:std", "::open_buffered", "Argument[0]", "path-injection", "manual"] - - addsTo: pack: codeql/rust-all extensible: summaryModel diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 312842134d5..5f02eb71845 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -22,4 +22,14 @@ | test.rs:80:24:80:35 | ...::get | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:112:35:112:46 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | | test.rs:119:31:119:42 | send_request | Flow source 'RemoteSource' of type remote (DEFAULT). | +| test.rs:205:31:205:43 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:210:31:210:38 | ...::read | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:215:22:215:39 | ...::read_to_string | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:221:22:221:25 | path | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:222:27:222:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:228:22:228:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:271:20:271:38 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:360:25:360:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:361:25:361:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:369:25:369:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:386:16:386:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index fa6f3ec37b1..ed33e584128 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -202,31 +202,31 @@ use std::fs; fn test_fs() -> Result<(), Box> { { - let buffer: Vec = std::fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(buffer); // $ MISSING: hasTaintFlow + let buffer: Vec = std::fs::read("file.bin")?; // $ Alert[rust/summary/taint-sources] + sink(buffer); // $ hasTaintFlow="file.bin" } { - let buffer: Vec = fs::read("file.bin")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(buffer); // $ MISSING: hasTaintFlow + let buffer: Vec = fs::read("file.bin")?; // $ Alert[rust/summary/taint-sources] + sink(buffer); // $ hasTaintFlow="file.bin" } { - let buffer = fs::read_to_string("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(buffer); // $ MISSING: hasTaintFlow + let buffer = fs::read_to_string("file.txt")?; // $ Alert[rust/summary/taint-sources] + sink(buffer); // $ hasTaintFlow="file.txt" } for entry in fs::read_dir("directory")? { let e = entry?; - let path = e.path(); // $ MISSING: Alert[rust/summary/taint-sources] - let file_name = e.file_name(); // $ MISSING: Alert[rust/summary/taint-sources] - sink(path); // $ MISSING: hasTaintFlow - sink(file_name); // $ MISSING: hasTaintFlow + let path = e.path(); // $ Alert[rust/summary/taint-sources] + let file_name = e.file_name(); // $ Alert[rust/summary/taint-sources] + sink(path); // $ hasTaintFlow + sink(file_name); // $ hasTaintFlow } { - let target = fs::read_link("symlink.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] - sink(target); // $ MISSING: hasTaintFlow + let target = fs::read_link("symlink.txt")?; // $ Alert[rust/summary/taint-sources] + sink(target); // $ hasTaintFlow="symlink.txt" } Ok(()) @@ -268,7 +268,7 @@ fn test_io_fs() -> std::io::Result<()> { // --- file --- - let mut file = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] { let mut buffer = [0u8; 100]; @@ -357,8 +357,8 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); - let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] - let mut file2 = std::fs::File::open("another_file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file1 = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] + let mut file2 = std::fs::File::open("another_file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.chain(file2); reader.read_to_string(&mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow @@ -366,7 +366,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); - let mut file1 = std::fs::File::open("file.txt")?; // $ MISSING: Alert[rust/summary/taint-sources] + let mut file1 = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.take(100); reader.read_to_string(&mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow From 7a9ea52bc79a693c749dca09e512add9568260dc Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 17:00:36 +0100 Subject: [PATCH 253/372] Rust: Add source models for io. --- rust/ql/lib/codeql/rust/Concepts.qll | 26 +++++++++++++++++ .../rust/frameworks/stdlib/io.model.yml | 6 ++++ .../dataflow/sources/TaintSources.expected | 14 ++++++++++ .../library-tests/dataflow/sources/test.rs | 28 +++++++++---------- 4 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index 10bf4d86998..544a87e11f1 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -128,6 +128,32 @@ module FileSource { } } +/** + * A data flow source corresponding to standard input. + */ +final class StdInSource = StdInSource::Range; + +/** + * An externally modeled source for data from standard input. + */ +class ModeledStdInSourceSource extends StdInSource::Range { + ModeledStdInSourceSource() { sourceNode(this, "stdin") } +} + +/** + * Provides a class for modeling new sources for standard input. + */ +module StdInSource { + /** + * A data flow source corresponding to standard input. + */ + abstract class Range extends ThreatModelSource::Range { + override string getThreatModel() { result = "stdin" } + + override string getSourceType() { result = "StdInSource" } + } +} + /** * A data flow source corresponding to the program's database reads. */ diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml new file mode 100644 index 00000000000..91eab1cab89 --- /dev/null +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/rust-all + extensible: sourceModel + data: + - ["lang:std", "crate::io::stdio::stdin", "ReturnValue", "stdin", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected index 5f02eb71845..ba7eeae0008 100644 --- a/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected +++ b/rust/ql/test/library-tests/dataflow/sources/TaintSources.expected @@ -28,8 +28,22 @@ | test.rs:221:22:221:25 | path | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:222:27:222:35 | file_name | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:228:22:228:34 | ...::read_link | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:243:22:243:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:249:22:249:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:255:22:255:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:261:9:261:22 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:265:17:265:30 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:271:20:271:38 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:304:50:304:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:310:50:310:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:317:50:317:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:324:50:324:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:331:56:331:69 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:338:50:338:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:345:50:345:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | +| test.rs:351:50:351:63 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:360:25:360:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:361:25:361:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | | test.rs:369:25:369:43 | ...::open | Flow source 'FileSource' of type file (DEFAULT). | +| test.rs:377:22:377:35 | ...::stdin | Flow source 'StdInSource' of type stdin (DEFAULT). | | test.rs:386:16:386:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). | diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index ed33e584128..f6aa9676778 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -240,29 +240,29 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = [0u8; 100]; - let _bytes = std::io::stdin().read(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().read(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = Vec::::new(); - let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = String::new(); - let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = [0; 100]; - std::io::stdin().read_exact(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + std::io::stdin().read_exact(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } - for byte in std::io::stdin().bytes() { // $ MISSING: Alert[rust/summary/taint-sources] + for byte in std::io::stdin().bytes() { // $ Alert[rust/summary/taint-sources] sink(byte); // $ MISSING: hasTaintFlow } @@ -301,54 +301,54 @@ fn test_io_fs() -> std::io::Result<()> { // --- BufReader --- { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.fill_buf()?; sink(&data); // $ MISSING: hasTaintFlow } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.buffer(); sink(&data); // $ MISSING: hasTaintFlow } { let mut buffer = String::new(); - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_line(&mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = Vec::::new(); - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_until(b',', &mut buffer)?; sink(&buffer); // $ MISSING: hasTaintFlow } { let mut buffer = Vec::::new(); - let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader_split = std::io::BufReader::new(std::io::stdin()).split(b','); // $ Alert[rust/summary/taint-sources] while let Some(chunk) = reader_split.next() { sink(chunk.unwrap()); // $ MISSING: hasTaintFlow } } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] for line in reader.lines() { sink(line); // $ MISSING: Alert[rust/summary/taint-sources] } } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let line = reader.lines().nth(1).unwrap(); sink(line.unwrap().clone()); // $ MISSING: hasTaintFlow } { - let mut reader = std::io::BufReader::new(std::io::stdin()); // $ MISSING: Alert[rust/summary/taint-sources] + let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let lines: Vec<_> = reader.lines().collect(); sink(lines[1].as_ref().unwrap().clone()); // $ MISSING: hasTaintFlow } @@ -374,7 +374,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); - let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ MISSING: Alert[rust/summary/taint-sources] + let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] sink(&buffer); // $ MISSING: hasTaintFlow } From b961c5961da1158d79db48da7f1248d8ea11b10b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 14 Apr 2025 09:53:06 +0000 Subject: [PATCH 254/372] Release preparation for version 2.21.1 --- actions/ql/lib/CHANGELOG.md | 4 ++++ actions/ql/lib/change-notes/released/0.4.7.md | 3 +++ actions/ql/lib/codeql-pack.release.yml | 2 +- actions/ql/lib/qlpack.yml | 2 +- actions/ql/src/CHANGELOG.md | 6 ++++++ .../0.5.4.md} | 9 +++++---- actions/ql/src/codeql-pack.release.yml | 2 +- actions/ql/src/qlpack.yml | 2 +- cpp/ql/lib/CHANGELOG.md | 7 +++++++ .../4.2.0.md} | 7 ++++--- cpp/ql/lib/codeql-pack.release.yml | 2 +- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/CHANGELOG.md | 4 ++++ cpp/ql/src/change-notes/released/1.3.8.md | 3 +++ cpp/ql/src/codeql-pack.release.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md | 4 ++++ .../Solorigate/lib/change-notes/released/1.7.38.md | 3 +++ .../Solorigate/lib/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/src/CHANGELOG.md | 4 ++++ .../Solorigate/src/change-notes/released/1.7.38.md | 3 +++ .../Solorigate/src/codeql-pack.release.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/CHANGELOG.md | 7 +++++++ ...3-08-blazor-parameter-passing-string-literal.md | 4 ---- .../5.1.4.md} | 8 +++++--- csharp/ql/lib/codeql-pack.release.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/CHANGELOG.md | 7 +++++++ .../src/change-notes/2025-03-26-dotnet-models.md | 4 ---- .../1.1.1.md} | 8 +++++--- csharp/ql/src/codeql-pack.release.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/CHANGELOG.md | 4 ++++ .../change-notes/released/1.0.21.md | 3 +++ go/ql/consistency-queries/codeql-pack.release.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/CHANGELOG.md | 6 ++++++ .../4.2.3.md} | 7 ++++--- go/ql/lib/codeql-pack.release.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/CHANGELOG.md | 4 ++++ go/ql/src/change-notes/released/1.1.12.md | 3 +++ go/ql/src/codeql-pack.release.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/lib/CHANGELOG.md | 7 +++++++ .../change-notes/2025-04-01-jakarta-persistence.md | 4 ---- .../7.1.3.md} | 8 +++++--- java/ql/lib/codeql-pack.release.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/CHANGELOG.md | 4 ++++ java/ql/src/change-notes/released/1.4.1.md | 3 +++ java/ql/src/codeql-pack.release.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/CHANGELOG.md | 14 ++++++++++++++ .../ql/lib/change-notes/2025-04-02-mkdirp.md | 4 ---- .../ql/lib/change-notes/2025-04-02-rimraf.md | 4 ---- .../ql/lib/change-notes/2025-04-07-open-package.md | 4 ---- .../ql/lib/change-notes/2025-04-07-typed-arrays.md | 4 ---- .../ql/lib/change-notes/2025-04-07-websocket.md | 5 ----- .../ql/lib/change-notes/2025-04-09-make-dir.md | 4 ---- .../ql/lib/change-notes/2025-04-11-nextrequest.md | 5 ----- javascript/ql/lib/change-notes/released/2.6.1.md | 13 +++++++++++++ javascript/ql/lib/codeql-pack.release.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/CHANGELOG.md | 11 +++++++++++ ...2025-04-02-name-resolution-independent-fixes.md | 4 ---- .../ql/src/change-notes/2025-04-09-web-response.md | 4 ---- .../2025-04-10-json-array-trailing-comma.md | 4 ---- javascript/ql/src/change-notes/released/1.5.3.md | 10 ++++++++++ javascript/ql/src/codeql-pack.release.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/CHANGELOG.md | 4 ++++ misc/suite-helpers/change-notes/released/1.0.21.md | 3 +++ misc/suite-helpers/codeql-pack.release.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/CHANGELOG.md | 4 ++++ python/ql/lib/change-notes/released/4.0.5.md | 3 +++ python/ql/lib/codeql-pack.release.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/CHANGELOG.md | 6 ++++++ .../1.4.7.md} | 6 +++--- python/ql/src/codeql-pack.release.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/CHANGELOG.md | 6 ++++++ .../4.1.4.md} | 7 ++++--- ruby/ql/lib/codeql-pack.release.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/CHANGELOG.md | 7 +++++++ .../change-notes/2025-04-04-refine-deadstore.md | 4 ---- .../1.2.0.md} | 8 +++++--- ruby/ql/src/codeql-pack.release.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- rust/ql/lib/CHANGELOG.md | 4 ++++ rust/ql/lib/change-notes/released/0.1.6.md | 3 +++ rust/ql/lib/codeql-pack.release.yml | 2 +- rust/ql/lib/qlpack.yml | 2 +- rust/ql/src/CHANGELOG.md | 4 ++++ rust/ql/src/change-notes/released/0.1.6.md | 3 +++ rust/ql/src/codeql-pack.release.yml | 2 +- rust/ql/src/qlpack.yml | 2 +- shared/controlflow/CHANGELOG.md | 4 ++++ shared/controlflow/change-notes/released/2.0.5.md | 3 +++ shared/controlflow/codeql-pack.release.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/CHANGELOG.md | 4 ++++ shared/dataflow/change-notes/released/2.0.5.md | 3 +++ shared/dataflow/codeql-pack.release.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/CHANGELOG.md | 4 ++++ shared/mad/change-notes/released/1.0.21.md | 3 +++ shared/mad/codeql-pack.release.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/CHANGELOG.md | 4 ++++ .../rangeanalysis/change-notes/released/1.0.21.md | 3 +++ shared/rangeanalysis/codeql-pack.release.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/CHANGELOG.md | 4 ++++ shared/regex/change-notes/released/1.0.21.md | 3 +++ shared/regex/codeql-pack.release.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/CHANGELOG.md | 6 ++++++ .../1.1.0.md} | 7 ++++--- shared/ssa/codeql-pack.release.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/CHANGELOG.md | 4 ++++ .../threat-models/change-notes/released/1.0.21.md | 3 +++ shared/threat-models/codeql-pack.release.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/CHANGELOG.md | 4 ++++ shared/tutorial/change-notes/released/1.0.21.md | 3 +++ shared/tutorial/codeql-pack.release.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/CHANGELOG.md | 4 ++++ shared/typeflow/change-notes/released/1.0.21.md | 3 +++ shared/typeflow/codeql-pack.release.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typeinference/CHANGELOG.md | 4 ++++ .../typeinference/change-notes/released/0.0.2.md | 3 +++ shared/typeinference/codeql-pack.release.yml | 2 +- shared/typeinference/qlpack.yml | 2 +- shared/typetracking/CHANGELOG.md | 4 ++++ shared/typetracking/change-notes/released/2.0.5.md | 3 +++ shared/typetracking/codeql-pack.release.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/CHANGELOG.md | 4 ++++ shared/typos/change-notes/released/1.0.21.md | 3 +++ shared/typos/codeql-pack.release.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/CHANGELOG.md | 4 ++++ shared/util/change-notes/released/2.0.8.md | 3 +++ shared/util/codeql-pack.release.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/CHANGELOG.md | 4 ++++ shared/xml/change-notes/released/1.0.21.md | 3 +++ shared/xml/codeql-pack.release.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/CHANGELOG.md | 4 ++++ shared/yaml/change-notes/released/1.0.21.md | 3 +++ shared/yaml/codeql-pack.release.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/CHANGELOG.md | 4 ++++ swift/ql/lib/change-notes/released/4.1.4.md | 3 +++ swift/ql/lib/codeql-pack.release.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/CHANGELOG.md | 4 ++++ swift/ql/src/change-notes/released/1.1.1.md | 3 +++ swift/ql/src/codeql-pack.release.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 170 files changed, 424 insertions(+), 167 deletions(-) create mode 100644 actions/ql/lib/change-notes/released/0.4.7.md rename actions/ql/src/change-notes/{2025-02-04-suggest-actions-permissions.md => released/0.5.4.md} (83%) rename cpp/ql/lib/change-notes/{2025-03-31-calling-convention.md => released/4.2.0.md} (91%) create mode 100644 cpp/ql/src/change-notes/released/1.3.8.md create mode 100644 csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.38.md create mode 100644 csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.38.md delete mode 100644 csharp/ql/lib/change-notes/2025-03-08-blazor-parameter-passing-string-literal.md rename csharp/ql/lib/change-notes/{2025-03-21-string-interpolation.md => released/5.1.4.md} (56%) delete mode 100644 csharp/ql/src/change-notes/2025-03-26-dotnet-models.md rename csharp/ql/src/change-notes/{2025-04-02-simple-type-enum.md => released/1.1.1.md} (57%) create mode 100644 go/ql/consistency-queries/change-notes/released/1.0.21.md rename go/ql/lib/change-notes/{2025-03-27-database-local-source-models.md => released/4.2.3.md} (76%) create mode 100644 go/ql/src/change-notes/released/1.1.12.md delete mode 100644 java/ql/lib/change-notes/2025-04-01-jakarta-persistence.md rename java/ql/lib/change-notes/{2025-04-09-enum-type-exclusion.md => released/7.1.3.md} (56%) create mode 100644 java/ql/src/change-notes/released/1.4.1.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-02-mkdirp.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-02-rimraf.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-07-open-package.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-07-websocket.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-09-make-dir.md delete mode 100644 javascript/ql/lib/change-notes/2025-04-11-nextrequest.md create mode 100644 javascript/ql/lib/change-notes/released/2.6.1.md delete mode 100644 javascript/ql/src/change-notes/2025-04-02-name-resolution-independent-fixes.md delete mode 100644 javascript/ql/src/change-notes/2025-04-09-web-response.md delete mode 100644 javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md create mode 100644 javascript/ql/src/change-notes/released/1.5.3.md create mode 100644 misc/suite-helpers/change-notes/released/1.0.21.md create mode 100644 python/ql/lib/change-notes/released/4.0.5.md rename python/ql/src/change-notes/{2025-03-27-modernize-mixed-tuple-returns-query.md => released/1.4.7.md} (79%) rename ruby/ql/lib/change-notes/{2025-04-07-implicit-super-args.md => released/4.1.4.md} (80%) delete mode 100644 ruby/ql/src/change-notes/2025-04-04-refine-deadstore.md rename ruby/ql/src/change-notes/{2025-04-02-adjust-uninitialized-local-alert-message.md => released/1.2.0.md} (54%) create mode 100644 rust/ql/lib/change-notes/released/0.1.6.md create mode 100644 rust/ql/src/change-notes/released/0.1.6.md create mode 100644 shared/controlflow/change-notes/released/2.0.5.md create mode 100644 shared/dataflow/change-notes/released/2.0.5.md create mode 100644 shared/mad/change-notes/released/1.0.21.md create mode 100644 shared/rangeanalysis/change-notes/released/1.0.21.md create mode 100644 shared/regex/change-notes/released/1.0.21.md rename shared/ssa/change-notes/{2025-04-03-definitionext-deprecation.md => released/1.1.0.md} (91%) create mode 100644 shared/threat-models/change-notes/released/1.0.21.md create mode 100644 shared/tutorial/change-notes/released/1.0.21.md create mode 100644 shared/typeflow/change-notes/released/1.0.21.md create mode 100644 shared/typeinference/change-notes/released/0.0.2.md create mode 100644 shared/typetracking/change-notes/released/2.0.5.md create mode 100644 shared/typos/change-notes/released/1.0.21.md create mode 100644 shared/util/change-notes/released/2.0.8.md create mode 100644 shared/xml/change-notes/released/1.0.21.md create mode 100644 shared/yaml/change-notes/released/1.0.21.md create mode 100644 swift/ql/lib/change-notes/released/4.1.4.md create mode 100644 swift/ql/src/change-notes/released/1.1.1.md diff --git a/actions/ql/lib/CHANGELOG.md b/actions/ql/lib/CHANGELOG.md index 6b69ddec1aa..dff1b84f1ad 100644 --- a/actions/ql/lib/CHANGELOG.md +++ b/actions/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.7 + +No user-facing changes. + ## 0.4.6 ### Bug Fixes diff --git a/actions/ql/lib/change-notes/released/0.4.7.md b/actions/ql/lib/change-notes/released/0.4.7.md new file mode 100644 index 00000000000..e9bb7a76bcb --- /dev/null +++ b/actions/ql/lib/change-notes/released/0.4.7.md @@ -0,0 +1,3 @@ +## 0.4.7 + +No user-facing changes. diff --git a/actions/ql/lib/codeql-pack.release.yml b/actions/ql/lib/codeql-pack.release.yml index 2b842473675..c5db8c0b276 100644 --- a/actions/ql/lib/codeql-pack.release.yml +++ b/actions/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.4.6 +lastReleaseVersion: 0.4.7 diff --git a/actions/ql/lib/qlpack.yml b/actions/ql/lib/qlpack.yml index aecd3607345..361f8bf995d 100644 --- a/actions/ql/lib/qlpack.yml +++ b/actions/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-all -version: 0.4.7-dev +version: 0.4.7 library: true warnOnImplicitThis: true dependencies: diff --git a/actions/ql/src/CHANGELOG.md b/actions/ql/src/CHANGELOG.md index c2b0d353f18..4d8755d009e 100644 --- a/actions/ql/src/CHANGELOG.md +++ b/actions/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.5.4 + +### Bug Fixes + +* Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. + ## 0.5.3 ### Bug Fixes diff --git a/actions/ql/src/change-notes/2025-02-04-suggest-actions-permissions.md b/actions/ql/src/change-notes/released/0.5.4.md similarity index 83% rename from actions/ql/src/change-notes/2025-02-04-suggest-actions-permissions.md rename to actions/ql/src/change-notes/released/0.5.4.md index c775b70274f..d34090f9955 100644 --- a/actions/ql/src/change-notes/2025-02-04-suggest-actions-permissions.md +++ b/actions/ql/src/change-notes/released/0.5.4.md @@ -1,4 +1,5 @@ ---- -category: fix ---- -* Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. \ No newline at end of file +## 0.5.4 + +### Bug Fixes + +* Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. diff --git a/actions/ql/src/codeql-pack.release.yml b/actions/ql/src/codeql-pack.release.yml index 2164e038a5d..cd3f72e2513 100644 --- a/actions/ql/src/codeql-pack.release.yml +++ b/actions/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.5.3 +lastReleaseVersion: 0.5.4 diff --git a/actions/ql/src/qlpack.yml b/actions/ql/src/qlpack.yml index f6eb8be1138..6e59f29dd11 100644 --- a/actions/ql/src/qlpack.yml +++ b/actions/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-queries -version: 0.5.4-dev +version: 0.5.4 library: false warnOnImplicitThis: true groups: [actions, queries] diff --git a/cpp/ql/lib/CHANGELOG.md b/cpp/ql/lib/CHANGELOG.md index e958516a5a4..12e0280ec55 100644 --- a/cpp/ql/lib/CHANGELOG.md +++ b/cpp/ql/lib/CHANGELOG.md @@ -1,3 +1,10 @@ +## 4.2.0 + +### New Features + +* Calling conventions explicitly specified on function declarations (`__cdecl`, `__stdcall`, `__fastcall`, etc.) are now represented as specifiers of those declarations. +* A new class `CallingConventionSpecifier` extending the `Specifier` class was introduced, which represents explicitly specified calling conventions. + ## 4.1.0 ### New Features diff --git a/cpp/ql/lib/change-notes/2025-03-31-calling-convention.md b/cpp/ql/lib/change-notes/released/4.2.0.md similarity index 91% rename from cpp/ql/lib/change-notes/2025-03-31-calling-convention.md rename to cpp/ql/lib/change-notes/released/4.2.0.md index 12d9547eb03..00f9dee720d 100644 --- a/cpp/ql/lib/change-notes/2025-03-31-calling-convention.md +++ b/cpp/ql/lib/change-notes/released/4.2.0.md @@ -1,5 +1,6 @@ ---- -category: feature ---- +## 4.2.0 + +### New Features + * Calling conventions explicitly specified on function declarations (`__cdecl`, `__stdcall`, `__fastcall`, etc.) are now represented as specifiers of those declarations. * A new class `CallingConventionSpecifier` extending the `Specifier` class was introduced, which represents explicitly specified calling conventions. diff --git a/cpp/ql/lib/codeql-pack.release.yml b/cpp/ql/lib/codeql-pack.release.yml index d5b1bf88d10..9fc6933b429 100644 --- a/cpp/ql/lib/codeql-pack.release.yml +++ b/cpp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.1.0 +lastReleaseVersion: 4.2.0 diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index 5ee964c4b50..6ce41fd3e93 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 4.1.1-dev +version: 4.2.0 groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/CHANGELOG.md b/cpp/ql/src/CHANGELOG.md index ab79d5cb46e..300c4ce9064 100644 --- a/cpp/ql/src/CHANGELOG.md +++ b/cpp/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.8 + +No user-facing changes. + ## 1.3.7 ### Minor Analysis Improvements diff --git a/cpp/ql/src/change-notes/released/1.3.8.md b/cpp/ql/src/change-notes/released/1.3.8.md new file mode 100644 index 00000000000..c7f5b27e47e --- /dev/null +++ b/cpp/ql/src/change-notes/released/1.3.8.md @@ -0,0 +1,3 @@ +## 1.3.8 + +No user-facing changes. diff --git a/cpp/ql/src/codeql-pack.release.yml b/cpp/ql/src/codeql-pack.release.yml index 2f4b67be43f..898725a6deb 100644 --- a/cpp/ql/src/codeql-pack.release.yml +++ b/cpp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.3.7 +lastReleaseVersion: 1.3.8 diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index 67293337da9..b6f5c9ad642 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.3.8-dev +version: 1.3.8 groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md index 38009248e96..1edcbdb24a9 100644 --- a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.38 + +No user-facing changes. + ## 1.7.37 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.38.md b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.38.md new file mode 100644 index 00000000000..a72e85a7f2d --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.7.38.md @@ -0,0 +1,3 @@ +## 1.7.38 + +No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml index 4d975f78ff6..a51e8a3b31e 100644 --- a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.37 +lastReleaseVersion: 1.7.38 diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index eefe4e2fe57..fbd64509040 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.38-dev +version: 1.7.38 groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md index 38009248e96..1edcbdb24a9 100644 --- a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.38 + +No user-facing changes. + ## 1.7.37 No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.38.md b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.38.md new file mode 100644 index 00000000000..a72e85a7f2d --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.7.38.md @@ -0,0 +1,3 @@ +## 1.7.38 + +No user-facing changes. diff --git a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml index 4d975f78ff6..a51e8a3b31e 100644 --- a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.7.37 +lastReleaseVersion: 1.7.38 diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index a03f987c8c7..179247e4ef5 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.38-dev +version: 1.7.38 groups: - csharp - solorigate diff --git a/csharp/ql/lib/CHANGELOG.md b/csharp/ql/lib/CHANGELOG.md index 9b5f38e0ca5..a048eceacd5 100644 --- a/csharp/ql/lib/CHANGELOG.md +++ b/csharp/ql/lib/CHANGELOG.md @@ -1,3 +1,10 @@ +## 5.1.4 + +### Minor Analysis Improvements + +* The *alignment* and *format* clauses in string interpolation expressions are now extracted. That is, in `$"Hello {name,align:format}"` *name*, *align* and *format* are extracted as children of the string interpolation *insert* `{name,align:format}`. +* Blazor support can now better recognize when a property being set is specified with a string literal, rather than referenced in a `nameof` expression. + ## 5.1.3 ### Minor Analysis Improvements diff --git a/csharp/ql/lib/change-notes/2025-03-08-blazor-parameter-passing-string-literal.md b/csharp/ql/lib/change-notes/2025-03-08-blazor-parameter-passing-string-literal.md deleted file mode 100644 index 66ebd26f653..00000000000 --- a/csharp/ql/lib/change-notes/2025-03-08-blazor-parameter-passing-string-literal.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Blazor support can now better recognize when a property being set is specified with a string literal, rather than referenced in a `nameof` expression. \ No newline at end of file diff --git a/csharp/ql/lib/change-notes/2025-03-21-string-interpolation.md b/csharp/ql/lib/change-notes/released/5.1.4.md similarity index 56% rename from csharp/ql/lib/change-notes/2025-03-21-string-interpolation.md rename to csharp/ql/lib/change-notes/released/5.1.4.md index 3507d35b513..f99e1c2ca61 100644 --- a/csharp/ql/lib/change-notes/2025-03-21-string-interpolation.md +++ b/csharp/ql/lib/change-notes/released/5.1.4.md @@ -1,4 +1,6 @@ ---- -category: minorAnalysis ---- +## 5.1.4 + +### Minor Analysis Improvements + * The *alignment* and *format* clauses in string interpolation expressions are now extracted. That is, in `$"Hello {name,align:format}"` *name*, *align* and *format* are extracted as children of the string interpolation *insert* `{name,align:format}`. +* Blazor support can now better recognize when a property being set is specified with a string literal, rather than referenced in a `nameof` expression. diff --git a/csharp/ql/lib/codeql-pack.release.yml b/csharp/ql/lib/codeql-pack.release.yml index 8ffbc76d58a..bdf3511eb7a 100644 --- a/csharp/ql/lib/codeql-pack.release.yml +++ b/csharp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 5.1.3 +lastReleaseVersion: 5.1.4 diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index 647655511ea..9d39196e6f6 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 5.1.4-dev +version: 5.1.4 groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index 125e6162253..7b5bee18298 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.1.1 + +### Minor Analysis Improvements + +* Enums and `System.DateTimeOffset` are now treated as *simple* types, which means that they are considered to have a sanitizing effect. This impacts many queries, among others the `cs/log-forging` query. +* The MaD models for the .NET 9 Runtime have been re-generated after a fix related to `out`/`ref` parameters. + ## 1.1.0 ### New Queries diff --git a/csharp/ql/src/change-notes/2025-03-26-dotnet-models.md b/csharp/ql/src/change-notes/2025-03-26-dotnet-models.md deleted file mode 100644 index 3986145c5af..00000000000 --- a/csharp/ql/src/change-notes/2025-03-26-dotnet-models.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* The MaD models for the .NET 9 Runtime have been re-generated after a fix related to `out`/`ref` parameters. diff --git a/csharp/ql/src/change-notes/2025-04-02-simple-type-enum.md b/csharp/ql/src/change-notes/released/1.1.1.md similarity index 57% rename from csharp/ql/src/change-notes/2025-04-02-simple-type-enum.md rename to csharp/ql/src/change-notes/released/1.1.1.md index ac93bd31b3e..34d5e39c244 100644 --- a/csharp/ql/src/change-notes/2025-04-02-simple-type-enum.md +++ b/csharp/ql/src/change-notes/released/1.1.1.md @@ -1,4 +1,6 @@ ---- -category: minorAnalysis ---- +## 1.1.1 + +### Minor Analysis Improvements + * Enums and `System.DateTimeOffset` are now treated as *simple* types, which means that they are considered to have a sanitizing effect. This impacts many queries, among others the `cs/log-forging` query. +* The MaD models for the .NET 9 Runtime have been re-generated after a fix related to `out`/`ref` parameters. diff --git a/csharp/ql/src/codeql-pack.release.yml b/csharp/ql/src/codeql-pack.release.yml index 2ac15439f56..1a19084be3f 100644 --- a/csharp/ql/src/codeql-pack.release.yml +++ b/csharp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.0 +lastReleaseVersion: 1.1.1 diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index d6f04fe6575..f87c44597d3 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.1.1-dev +version: 1.1.1 groups: - csharp - queries diff --git a/go/ql/consistency-queries/CHANGELOG.md b/go/ql/consistency-queries/CHANGELOG.md index b20db016231..4ede7cf63b2 100644 --- a/go/ql/consistency-queries/CHANGELOG.md +++ b/go/ql/consistency-queries/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/go/ql/consistency-queries/change-notes/released/1.0.21.md b/go/ql/consistency-queries/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/go/ql/consistency-queries/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/go/ql/consistency-queries/codeql-pack.release.yml b/go/ql/consistency-queries/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/go/ql/consistency-queries/codeql-pack.release.yml +++ b/go/ql/consistency-queries/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 78d52739d9e..8cba3ce7a4f 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.21-dev +version: 1.0.21 groups: - go - queries diff --git a/go/ql/lib/CHANGELOG.md b/go/ql/lib/CHANGELOG.md index 27ad374e374..9193892f389 100644 --- a/go/ql/lib/CHANGELOG.md +++ b/go/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.2.3 + +### Minor Analysis Improvements + +* Local source models for APIs reading from databases have been added for `github.com/gogf/gf/database/gdb` and `github.com/uptrace/bun`. + ## 4.2.2 ### Minor Analysis Improvements diff --git a/go/ql/lib/change-notes/2025-03-27-database-local-source-models.md b/go/ql/lib/change-notes/released/4.2.3.md similarity index 76% rename from go/ql/lib/change-notes/2025-03-27-database-local-source-models.md rename to go/ql/lib/change-notes/released/4.2.3.md index 95f08d00b9c..e85de0badf8 100644 --- a/go/ql/lib/change-notes/2025-03-27-database-local-source-models.md +++ b/go/ql/lib/change-notes/released/4.2.3.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 4.2.3 + +### Minor Analysis Improvements + * Local source models for APIs reading from databases have been added for `github.com/gogf/gf/database/gdb` and `github.com/uptrace/bun`. diff --git a/go/ql/lib/codeql-pack.release.yml b/go/ql/lib/codeql-pack.release.yml index 18bc0770993..5bf06624029 100644 --- a/go/ql/lib/codeql-pack.release.yml +++ b/go/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.2.2 +lastReleaseVersion: 4.2.3 diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index 34ba33332a2..4306f3f8b43 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 4.2.3-dev +version: 4.2.3 groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/CHANGELOG.md b/go/ql/src/CHANGELOG.md index ff91b3d9ce8..46bb7c9055f 100644 --- a/go/ql/src/CHANGELOG.md +++ b/go/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.12 + +No user-facing changes. + ## 1.1.11 ### Minor Analysis Improvements diff --git a/go/ql/src/change-notes/released/1.1.12.md b/go/ql/src/change-notes/released/1.1.12.md new file mode 100644 index 00000000000..2d7f915e29b --- /dev/null +++ b/go/ql/src/change-notes/released/1.1.12.md @@ -0,0 +1,3 @@ +## 1.1.12 + +No user-facing changes. diff --git a/go/ql/src/codeql-pack.release.yml b/go/ql/src/codeql-pack.release.yml index 121f8cf035d..f5b135d0193 100644 --- a/go/ql/src/codeql-pack.release.yml +++ b/go/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.11 +lastReleaseVersion: 1.1.12 diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index 3e3b248716d..0804625f085 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.12-dev +version: 1.1.12 groups: - go - queries diff --git a/java/ql/lib/CHANGELOG.md b/java/ql/lib/CHANGELOG.md index 4e5f40cbc84..8061e31bc38 100644 --- a/java/ql/lib/CHANGELOG.md +++ b/java/ql/lib/CHANGELOG.md @@ -1,3 +1,10 @@ +## 7.1.3 + +### Minor Analysis Improvements + +* Enum-typed values are now assumed to be safe by most queries. This means that queries may return fewer results where an enum value is used in a sensitive context, e.g. pasted into a query string. +* All existing modelling and support for `javax.persistence` now applies to `jakarta.persistence` as well. + ## 7.1.2 ### Minor Analysis Improvements diff --git a/java/ql/lib/change-notes/2025-04-01-jakarta-persistence.md b/java/ql/lib/change-notes/2025-04-01-jakarta-persistence.md deleted file mode 100644 index 0a5759ec3db..00000000000 --- a/java/ql/lib/change-notes/2025-04-01-jakarta-persistence.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* All existing modelling and support for `javax.persistence` now applies to `jakarta.persistence` as well. diff --git a/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md b/java/ql/lib/change-notes/released/7.1.3.md similarity index 56% rename from java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md rename to java/ql/lib/change-notes/released/7.1.3.md index 9b120e84ff7..7ae2a7da4a7 100644 --- a/java/ql/lib/change-notes/2025-04-09-enum-type-exclusion.md +++ b/java/ql/lib/change-notes/released/7.1.3.md @@ -1,4 +1,6 @@ ---- -category: minorAnalysis ---- +## 7.1.3 + +### Minor Analysis Improvements + * Enum-typed values are now assumed to be safe by most queries. This means that queries may return fewer results where an enum value is used in a sensitive context, e.g. pasted into a query string. +* All existing modelling and support for `javax.persistence` now applies to `jakarta.persistence` as well. diff --git a/java/ql/lib/codeql-pack.release.yml b/java/ql/lib/codeql-pack.release.yml index 547681cc440..8c4f0b31433 100644 --- a/java/ql/lib/codeql-pack.release.yml +++ b/java/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 7.1.2 +lastReleaseVersion: 7.1.3 diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index 1037ae7708a..d1e431b431d 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 7.1.3-dev +version: 7.1.3 groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index d27571c724d..b81d3ca7bf9 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.1 + +No user-facing changes. + ## 1.4.0 ### New Queries diff --git a/java/ql/src/change-notes/released/1.4.1.md b/java/ql/src/change-notes/released/1.4.1.md new file mode 100644 index 00000000000..38987aa49cd --- /dev/null +++ b/java/ql/src/change-notes/released/1.4.1.md @@ -0,0 +1,3 @@ +## 1.4.1 + +No user-facing changes. diff --git a/java/ql/src/codeql-pack.release.yml b/java/ql/src/codeql-pack.release.yml index b8b2e97d508..43ccf4467be 100644 --- a/java/ql/src/codeql-pack.release.yml +++ b/java/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.4.0 +lastReleaseVersion: 1.4.1 diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index e7c3a7da88e..1a1ed7fac40 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.4.1-dev +version: 1.4.1 groups: - java - queries diff --git a/javascript/ql/lib/CHANGELOG.md b/javascript/ql/lib/CHANGELOG.md index 995666b2916..b4d80c515da 100644 --- a/javascript/ql/lib/CHANGELOG.md +++ b/javascript/ql/lib/CHANGELOG.md @@ -1,3 +1,17 @@ +## 2.6.1 + +### Minor Analysis Improvements + +* Data passed to the [NextResponse](https://nextjs.org/docs/app/api-reference/functions/next-response) constructor is now treated as a sink for `js/reflected-xss`. +* Data received from [NextRequest](https://nextjs.org/docs/app/api-reference/functions/next-request) and [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) is now treated as a remote user input `source`. +* Added support for the `make-dir` package. +* Added support for the `open` package. +* Added taint propagation for `Uint8Array`, `ArrayBuffer`, `SharedArrayBuffer` and `TextDecoder.decode()`. +* Improved detection of `WebSocket` and `SockJS` usage. +* Added data received from `WebSocket` clients as a remote flow source. +* Added support for additional `mkdirp` methods as sinks in path-injection queries. +* Added support for additional `rimraf` methods as sinks in path-injection queries. + ## 2.6.0 ### New Features diff --git a/javascript/ql/lib/change-notes/2025-04-02-mkdirp.md b/javascript/ql/lib/change-notes/2025-04-02-mkdirp.md deleted file mode 100644 index 132bbf0cbe4..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-02-mkdirp.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added support for additional `mkdirp` methods as sinks in path-injection queries. diff --git a/javascript/ql/lib/change-notes/2025-04-02-rimraf.md b/javascript/ql/lib/change-notes/2025-04-02-rimraf.md deleted file mode 100644 index 3d0521643d5..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-02-rimraf.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added support for additional `rimraf` methods as sinks in path-injection queries. diff --git a/javascript/ql/lib/change-notes/2025-04-07-open-package.md b/javascript/ql/lib/change-notes/2025-04-07-open-package.md deleted file mode 100644 index a4c02f0d6d9..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-07-open-package.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added support for the `open` package. diff --git a/javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md b/javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md deleted file mode 100644 index f09e6831743..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-07-typed-arrays.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added taint propagation for `Uint8Array`, `ArrayBuffer`, `SharedArrayBuffer` and `TextDecoder.decode()`. diff --git a/javascript/ql/lib/change-notes/2025-04-07-websocket.md b/javascript/ql/lib/change-notes/2025-04-07-websocket.md deleted file mode 100644 index 1d6cdb8e6b1..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-07-websocket.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -category: minorAnalysis ---- -* Improved detection of `WebSocket` and `SockJS` usage. -* Added data received from `WebSocket` clients as a remote flow source. diff --git a/javascript/ql/lib/change-notes/2025-04-09-make-dir.md b/javascript/ql/lib/change-notes/2025-04-09-make-dir.md deleted file mode 100644 index fd056bbc98d..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-09-make-dir.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Added support for the `make-dir` package. diff --git a/javascript/ql/lib/change-notes/2025-04-11-nextrequest.md b/javascript/ql/lib/change-notes/2025-04-11-nextrequest.md deleted file mode 100644 index 9db5c34e51b..00000000000 --- a/javascript/ql/lib/change-notes/2025-04-11-nextrequest.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -category: minorAnalysis ---- -* Data passed to the [NextResponse](https://nextjs.org/docs/app/api-reference/functions/next-response) constructor is now treated as a sink for `js/reflected-xss`. -* Data received from [NextRequest](https://nextjs.org/docs/app/api-reference/functions/next-request) and [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) is now treated as a remote user input `source`. diff --git a/javascript/ql/lib/change-notes/released/2.6.1.md b/javascript/ql/lib/change-notes/released/2.6.1.md new file mode 100644 index 00000000000..9356c1ea56e --- /dev/null +++ b/javascript/ql/lib/change-notes/released/2.6.1.md @@ -0,0 +1,13 @@ +## 2.6.1 + +### Minor Analysis Improvements + +* Data passed to the [NextResponse](https://nextjs.org/docs/app/api-reference/functions/next-response) constructor is now treated as a sink for `js/reflected-xss`. +* Data received from [NextRequest](https://nextjs.org/docs/app/api-reference/functions/next-request) and [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) is now treated as a remote user input `source`. +* Added support for the `make-dir` package. +* Added support for the `open` package. +* Added taint propagation for `Uint8Array`, `ArrayBuffer`, `SharedArrayBuffer` and `TextDecoder.decode()`. +* Improved detection of `WebSocket` and `SockJS` usage. +* Added data received from `WebSocket` clients as a remote flow source. +* Added support for additional `mkdirp` methods as sinks in path-injection queries. +* Added support for additional `rimraf` methods as sinks in path-injection queries. diff --git a/javascript/ql/lib/codeql-pack.release.yml b/javascript/ql/lib/codeql-pack.release.yml index 29308d70232..d9d6a8bbe18 100644 --- a/javascript/ql/lib/codeql-pack.release.yml +++ b/javascript/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.6.0 +lastReleaseVersion: 2.6.1 diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index 80004cfa6a0..5b5e10e0c0d 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.6.1-dev +version: 2.6.1 groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/CHANGELOG.md b/javascript/ql/src/CHANGELOG.md index fef8edd5c80..32be26faf9c 100644 --- a/javascript/ql/src/CHANGELOG.md +++ b/javascript/ql/src/CHANGELOG.md @@ -1,3 +1,14 @@ +## 1.5.3 + +### Minor Analysis Improvements + +* Data passed to the [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) constructor is now treated as a sink for `js/reflected-xss`. +* Slightly improved detection of DOM element references, leading to XSS results being detected in more cases. + +### Bug Fixes + +* Fixed a bug that would prevent extraction of `tsconfig.json` files when it contained an array literal with a trailing comma. + ## 1.5.2 ### Bug Fixes diff --git a/javascript/ql/src/change-notes/2025-04-02-name-resolution-independent-fixes.md b/javascript/ql/src/change-notes/2025-04-02-name-resolution-independent-fixes.md deleted file mode 100644 index 4773744a984..00000000000 --- a/javascript/ql/src/change-notes/2025-04-02-name-resolution-independent-fixes.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Slightly improved detection of DOM element references, leading to XSS results being detected in more cases. diff --git a/javascript/ql/src/change-notes/2025-04-09-web-response.md b/javascript/ql/src/change-notes/2025-04-09-web-response.md deleted file mode 100644 index 3afebf1b6a7..00000000000 --- a/javascript/ql/src/change-notes/2025-04-09-web-response.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* Data passed to the [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) constructor is now treated as a sink for `js/reflected-xss`. diff --git a/javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md b/javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md deleted file mode 100644 index 7a0acd541e1..00000000000 --- a/javascript/ql/src/change-notes/2025-04-10-json-array-trailing-comma.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: fix ---- -* Fixed a bug that would prevent extraction of `tsconfig.json` files when it contained an array literal with a trailing comma. diff --git a/javascript/ql/src/change-notes/released/1.5.3.md b/javascript/ql/src/change-notes/released/1.5.3.md new file mode 100644 index 00000000000..3642084aaa8 --- /dev/null +++ b/javascript/ql/src/change-notes/released/1.5.3.md @@ -0,0 +1,10 @@ +## 1.5.3 + +### Minor Analysis Improvements + +* Data passed to the [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) constructor is now treated as a sink for `js/reflected-xss`. +* Slightly improved detection of DOM element references, leading to XSS results being detected in more cases. + +### Bug Fixes + +* Fixed a bug that would prevent extraction of `tsconfig.json` files when it contained an array literal with a trailing comma. diff --git a/javascript/ql/src/codeql-pack.release.yml b/javascript/ql/src/codeql-pack.release.yml index 7eb901bae56..232224b0e26 100644 --- a/javascript/ql/src/codeql-pack.release.yml +++ b/javascript/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.5.2 +lastReleaseVersion: 1.5.3 diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 3a5ecb85b4f..1239092b279 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.5.3-dev +version: 1.5.3 groups: - javascript - queries diff --git a/misc/suite-helpers/CHANGELOG.md b/misc/suite-helpers/CHANGELOG.md index 03ff9963412..74c5e6933ed 100644 --- a/misc/suite-helpers/CHANGELOG.md +++ b/misc/suite-helpers/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/misc/suite-helpers/change-notes/released/1.0.21.md b/misc/suite-helpers/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/misc/suite-helpers/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/misc/suite-helpers/codeql-pack.release.yml b/misc/suite-helpers/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/misc/suite-helpers/codeql-pack.release.yml +++ b/misc/suite-helpers/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index 28a36682869..fa098c1e805 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.21-dev +version: 1.0.21 groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/CHANGELOG.md b/python/ql/lib/CHANGELOG.md index 8ea99e00e05..1d7bcb46b1e 100644 --- a/python/ql/lib/CHANGELOG.md +++ b/python/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.5 + +No user-facing changes. + ## 4.0.4 ### Minor Analysis Improvements diff --git a/python/ql/lib/change-notes/released/4.0.5.md b/python/ql/lib/change-notes/released/4.0.5.md new file mode 100644 index 00000000000..dda2a2d3bf4 --- /dev/null +++ b/python/ql/lib/change-notes/released/4.0.5.md @@ -0,0 +1,3 @@ +## 4.0.5 + +No user-facing changes. diff --git a/python/ql/lib/codeql-pack.release.yml b/python/ql/lib/codeql-pack.release.yml index b207094e2b3..b08843b96ce 100644 --- a/python/ql/lib/codeql-pack.release.yml +++ b/python/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.0.4 +lastReleaseVersion: 4.0.5 diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index 020415470fe..a269f6ea946 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 4.0.5-dev +version: 4.0.5 groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/CHANGELOG.md b/python/ql/src/CHANGELOG.md index 33e8046917e..4b1ca7a734b 100644 --- a/python/ql/src/CHANGELOG.md +++ b/python/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.4.7 + +### Minor Analysis Improvements + +- The `py/mixed-tuple-returns` query no longer flags instances where the tuple is passed into the function as an argument, as this led to too many false positives. + ## 1.4.6 ### Minor Analysis Improvements diff --git a/python/ql/src/change-notes/2025-03-27-modernize-mixed-tuple-returns-query.md b/python/ql/src/change-notes/released/1.4.7.md similarity index 79% rename from python/ql/src/change-notes/2025-03-27-modernize-mixed-tuple-returns-query.md rename to python/ql/src/change-notes/released/1.4.7.md index 57cf5c69a13..bc5ef332ab0 100644 --- a/python/ql/src/change-notes/2025-03-27-modernize-mixed-tuple-returns-query.md +++ b/python/ql/src/change-notes/released/1.4.7.md @@ -1,5 +1,5 @@ ---- -category: minorAnalysis ---- +## 1.4.7 + +### Minor Analysis Improvements - The `py/mixed-tuple-returns` query no longer flags instances where the tuple is passed into the function as an argument, as this led to too many false positives. diff --git a/python/ql/src/codeql-pack.release.yml b/python/ql/src/codeql-pack.release.yml index 3b00bbce928..163362bd632 100644 --- a/python/ql/src/codeql-pack.release.yml +++ b/python/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.4.6 +lastReleaseVersion: 1.4.7 diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index 2d3896cc57f..88b09575d0c 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.4.7-dev +version: 1.4.7 groups: - python - queries diff --git a/ruby/ql/lib/CHANGELOG.md b/ruby/ql/lib/CHANGELOG.md index 5eabfa99ba6..527d5c3fd17 100644 --- a/ruby/ql/lib/CHANGELOG.md +++ b/ruby/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.1.4 + +### Minor Analysis Improvements + +* Calls to `super` without explict arguments now have their implicit arguments generated. For example, in `def foo(x, y) { super } end` the call to `super` becomes `super(x, y)`. + ## 4.1.3 No user-facing changes. diff --git a/ruby/ql/lib/change-notes/2025-04-07-implicit-super-args.md b/ruby/ql/lib/change-notes/released/4.1.4.md similarity index 80% rename from ruby/ql/lib/change-notes/2025-04-07-implicit-super-args.md rename to ruby/ql/lib/change-notes/released/4.1.4.md index 7570dffb740..1b944c56640 100644 --- a/ruby/ql/lib/change-notes/2025-04-07-implicit-super-args.md +++ b/ruby/ql/lib/change-notes/released/4.1.4.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 4.1.4 + +### Minor Analysis Improvements + * Calls to `super` without explict arguments now have their implicit arguments generated. For example, in `def foo(x, y) { super } end` the call to `super` becomes `super(x, y)`. diff --git a/ruby/ql/lib/codeql-pack.release.yml b/ruby/ql/lib/codeql-pack.release.yml index cdfb1853324..de92bc2ecc3 100644 --- a/ruby/ql/lib/codeql-pack.release.yml +++ b/ruby/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.1.3 +lastReleaseVersion: 4.1.4 diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index 639f6fb35f1..4bc89e7863a 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 4.1.4-dev +version: 4.1.4 groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/CHANGELOG.md b/ruby/ql/src/CHANGELOG.md index 7877bdb6a79..b06acc1c9df 100644 --- a/ruby/ql/src/CHANGELOG.md +++ b/ruby/ql/src/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.2.0 + +### Major Analysis Improvements + +* The query `rb/useless-assignment-to-local` now comes with query help and has been tweaked to produce fewer false positives. +* The query `rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call and should produce very few false positives. It also now comes with a help file. + ## 1.1.15 No user-facing changes. diff --git a/ruby/ql/src/change-notes/2025-04-04-refine-deadstore.md b/ruby/ql/src/change-notes/2025-04-04-refine-deadstore.md deleted file mode 100644 index c0bff9adf21..00000000000 --- a/ruby/ql/src/change-notes/2025-04-04-refine-deadstore.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: majorAnalysis ---- -* The query `rb/useless-assignment-to-local` now comes with query help and has been tweaked to produce fewer false positives. diff --git a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md b/ruby/ql/src/change-notes/released/1.2.0.md similarity index 54% rename from ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md rename to ruby/ql/src/change-notes/released/1.2.0.md index 87b92ee51ce..61491d76fde 100644 --- a/ruby/ql/src/change-notes/2025-04-02-adjust-uninitialized-local-alert-message.md +++ b/ruby/ql/src/change-notes/released/1.2.0.md @@ -1,4 +1,6 @@ ---- -category: majorAnalysis ---- +## 1.2.0 + +### Major Analysis Improvements + +* The query `rb/useless-assignment-to-local` now comes with query help and has been tweaked to produce fewer false positives. * The query `rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call and should produce very few false positives. It also now comes with a help file. diff --git a/ruby/ql/src/codeql-pack.release.yml b/ruby/ql/src/codeql-pack.release.yml index 9ec2e68cbd3..75430e73d1c 100644 --- a/ruby/ql/src/codeql-pack.release.yml +++ b/ruby/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.15 +lastReleaseVersion: 1.2.0 diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index ca0617aa13e..6003cc96ddf 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.1.16-dev +version: 1.2.0 groups: - ruby - queries diff --git a/rust/ql/lib/CHANGELOG.md b/rust/ql/lib/CHANGELOG.md index 85c1fc61056..2755640d9ea 100644 --- a/rust/ql/lib/CHANGELOG.md +++ b/rust/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.6 + +No user-facing changes. + ## 0.1.5 No user-facing changes. diff --git a/rust/ql/lib/change-notes/released/0.1.6.md b/rust/ql/lib/change-notes/released/0.1.6.md new file mode 100644 index 00000000000..b856f15fe69 --- /dev/null +++ b/rust/ql/lib/change-notes/released/0.1.6.md @@ -0,0 +1,3 @@ +## 0.1.6 + +No user-facing changes. diff --git a/rust/ql/lib/codeql-pack.release.yml b/rust/ql/lib/codeql-pack.release.yml index 157cff8108d..d271632b3dd 100644 --- a/rust/ql/lib/codeql-pack.release.yml +++ b/rust/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.5 +lastReleaseVersion: 0.1.6 diff --git a/rust/ql/lib/qlpack.yml b/rust/ql/lib/qlpack.yml index 603ede342c7..5a7ba107f7a 100644 --- a/rust/ql/lib/qlpack.yml +++ b/rust/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-all -version: 0.1.6-dev +version: 0.1.6 groups: rust extractor: rust dbscheme: rust.dbscheme diff --git a/rust/ql/src/CHANGELOG.md b/rust/ql/src/CHANGELOG.md index 85c1fc61056..2755640d9ea 100644 --- a/rust/ql/src/CHANGELOG.md +++ b/rust/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.6 + +No user-facing changes. + ## 0.1.5 No user-facing changes. diff --git a/rust/ql/src/change-notes/released/0.1.6.md b/rust/ql/src/change-notes/released/0.1.6.md new file mode 100644 index 00000000000..b856f15fe69 --- /dev/null +++ b/rust/ql/src/change-notes/released/0.1.6.md @@ -0,0 +1,3 @@ +## 0.1.6 + +No user-facing changes. diff --git a/rust/ql/src/codeql-pack.release.yml b/rust/ql/src/codeql-pack.release.yml index 157cff8108d..d271632b3dd 100644 --- a/rust/ql/src/codeql-pack.release.yml +++ b/rust/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.5 +lastReleaseVersion: 0.1.6 diff --git a/rust/ql/src/qlpack.yml b/rust/ql/src/qlpack.yml index 4b0296c0af8..f7afd1d4c99 100644 --- a/rust/ql/src/qlpack.yml +++ b/rust/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-queries -version: 0.1.6-dev +version: 0.1.6 groups: - rust - queries diff --git a/shared/controlflow/CHANGELOG.md b/shared/controlflow/CHANGELOG.md index 06ae926fe11..ce221ede189 100644 --- a/shared/controlflow/CHANGELOG.md +++ b/shared/controlflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.5 + +No user-facing changes. + ## 2.0.4 No user-facing changes. diff --git a/shared/controlflow/change-notes/released/2.0.5.md b/shared/controlflow/change-notes/released/2.0.5.md new file mode 100644 index 00000000000..8bce5b7ca75 --- /dev/null +++ b/shared/controlflow/change-notes/released/2.0.5.md @@ -0,0 +1,3 @@ +## 2.0.5 + +No user-facing changes. diff --git a/shared/controlflow/codeql-pack.release.yml b/shared/controlflow/codeql-pack.release.yml index 0f306f8bd3b..6c269316f27 100644 --- a/shared/controlflow/codeql-pack.release.yml +++ b/shared/controlflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.4 +lastReleaseVersion: 2.0.5 diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index 5b1c8278c8a..91c33675bab 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 2.0.5-dev +version: 2.0.5 groups: shared library: true dependencies: diff --git a/shared/dataflow/CHANGELOG.md b/shared/dataflow/CHANGELOG.md index 19d6b3ed909..ac1750c1e2f 100644 --- a/shared/dataflow/CHANGELOG.md +++ b/shared/dataflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.5 + +No user-facing changes. + ## 2.0.4 No user-facing changes. diff --git a/shared/dataflow/change-notes/released/2.0.5.md b/shared/dataflow/change-notes/released/2.0.5.md new file mode 100644 index 00000000000..8bce5b7ca75 --- /dev/null +++ b/shared/dataflow/change-notes/released/2.0.5.md @@ -0,0 +1,3 @@ +## 2.0.5 + +No user-facing changes. diff --git a/shared/dataflow/codeql-pack.release.yml b/shared/dataflow/codeql-pack.release.yml index 0f306f8bd3b..6c269316f27 100644 --- a/shared/dataflow/codeql-pack.release.yml +++ b/shared/dataflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.4 +lastReleaseVersion: 2.0.5 diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 86a58593efd..82b137f996d 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 2.0.5-dev +version: 2.0.5 groups: shared library: true dependencies: diff --git a/shared/mad/CHANGELOG.md b/shared/mad/CHANGELOG.md index 428eb375a90..609a9cdaff6 100644 --- a/shared/mad/CHANGELOG.md +++ b/shared/mad/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/mad/change-notes/released/1.0.21.md b/shared/mad/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/mad/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/mad/codeql-pack.release.yml b/shared/mad/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/mad/codeql-pack.release.yml +++ b/shared/mad/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index 0c7d0f8fb14..bd73c23bb12 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/CHANGELOG.md b/shared/rangeanalysis/CHANGELOG.md index 8ca74122cc4..2757232c21a 100644 --- a/shared/rangeanalysis/CHANGELOG.md +++ b/shared/rangeanalysis/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/rangeanalysis/change-notes/released/1.0.21.md b/shared/rangeanalysis/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/rangeanalysis/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/rangeanalysis/codeql-pack.release.yml b/shared/rangeanalysis/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/rangeanalysis/codeql-pack.release.yml +++ b/shared/rangeanalysis/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index 258e34f4416..76a9eeb5196 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true dependencies: diff --git a/shared/regex/CHANGELOG.md b/shared/regex/CHANGELOG.md index 06d3215edb5..3ab9e968cc0 100644 --- a/shared/regex/CHANGELOG.md +++ b/shared/regex/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/regex/change-notes/released/1.0.21.md b/shared/regex/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/regex/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/regex/codeql-pack.release.yml b/shared/regex/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/regex/codeql-pack.release.yml +++ b/shared/regex/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index fb48dd895fe..b32c38cae91 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true dependencies: diff --git a/shared/ssa/CHANGELOG.md b/shared/ssa/CHANGELOG.md index fb40fb4db74..cb86b03f5bf 100644 --- a/shared/ssa/CHANGELOG.md +++ b/shared/ssa/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.1.0 + +### Deprecated APIs + +* All references to the `DefinitionExt` and `PhiReadNode` classes in the SSA library have been deprecated. The concept of phi-read nodes is now strictly an internal implementation detail. Their sole use-case is to improve the structure of the use-use flow relation for data flow, and this use-case remains supported by the `DataFlowIntegration` module. + ## 1.0.20 No user-facing changes. diff --git a/shared/ssa/change-notes/2025-04-03-definitionext-deprecation.md b/shared/ssa/change-notes/released/1.1.0.md similarity index 91% rename from shared/ssa/change-notes/2025-04-03-definitionext-deprecation.md rename to shared/ssa/change-notes/released/1.1.0.md index 0f0db7c81a1..1eedd5d911c 100644 --- a/shared/ssa/change-notes/2025-04-03-definitionext-deprecation.md +++ b/shared/ssa/change-notes/released/1.1.0.md @@ -1,4 +1,5 @@ ---- -category: deprecated ---- +## 1.1.0 + +### Deprecated APIs + * All references to the `DefinitionExt` and `PhiReadNode` classes in the SSA library have been deprecated. The concept of phi-read nodes is now strictly an internal implementation detail. Their sole use-case is to improve the structure of the use-use flow relation for data flow, and this use-case remains supported by the `DataFlowIntegration` module. diff --git a/shared/ssa/codeql-pack.release.yml b/shared/ssa/codeql-pack.release.yml index 7af2d1347ff..2ac15439f56 100644 --- a/shared/ssa/codeql-pack.release.yml +++ b/shared/ssa/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.1.0 diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index c5e5a147085..1fa4f9cd719 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.0.21-dev +version: 1.1.0 groups: shared library: true dependencies: diff --git a/shared/threat-models/CHANGELOG.md b/shared/threat-models/CHANGELOG.md index b20db016231..4ede7cf63b2 100644 --- a/shared/threat-models/CHANGELOG.md +++ b/shared/threat-models/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/threat-models/change-notes/released/1.0.21.md b/shared/threat-models/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/threat-models/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/threat-models/codeql-pack.release.yml b/shared/threat-models/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/threat-models/codeql-pack.release.yml +++ b/shared/threat-models/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index 2698ba75fe4..ca7ab6760c8 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.21-dev +version: 1.0.21 library: true groups: shared dataExtensions: diff --git a/shared/tutorial/CHANGELOG.md b/shared/tutorial/CHANGELOG.md index 2f7a36a4d8b..24702110474 100644 --- a/shared/tutorial/CHANGELOG.md +++ b/shared/tutorial/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/tutorial/change-notes/released/1.0.21.md b/shared/tutorial/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/tutorial/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/tutorial/codeql-pack.release.yml b/shared/tutorial/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/tutorial/codeql-pack.release.yml +++ b/shared/tutorial/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 239783afe11..0735fce8bb1 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/CHANGELOG.md b/shared/typeflow/CHANGELOG.md index 4c72a93118e..3d66ee2aafa 100644 --- a/shared/typeflow/CHANGELOG.md +++ b/shared/typeflow/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/typeflow/change-notes/released/1.0.21.md b/shared/typeflow/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/typeflow/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/typeflow/codeql-pack.release.yml b/shared/typeflow/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/typeflow/codeql-pack.release.yml +++ b/shared/typeflow/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index 243dbbefacc..b918a6647d4 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true dependencies: diff --git a/shared/typeinference/CHANGELOG.md b/shared/typeinference/CHANGELOG.md index 59b60bad0f3..7668a5ba39d 100644 --- a/shared/typeinference/CHANGELOG.md +++ b/shared/typeinference/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2 + +No user-facing changes. + ## 0.0.1 No user-facing changes. diff --git a/shared/typeinference/change-notes/released/0.0.2.md b/shared/typeinference/change-notes/released/0.0.2.md new file mode 100644 index 00000000000..5ab250998ed --- /dev/null +++ b/shared/typeinference/change-notes/released/0.0.2.md @@ -0,0 +1,3 @@ +## 0.0.2 + +No user-facing changes. diff --git a/shared/typeinference/codeql-pack.release.yml b/shared/typeinference/codeql-pack.release.yml index c6933410b71..55dc06fbd76 100644 --- a/shared/typeinference/codeql-pack.release.yml +++ b/shared/typeinference/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.0.1 +lastReleaseVersion: 0.0.2 diff --git a/shared/typeinference/qlpack.yml b/shared/typeinference/qlpack.yml index 4606888741a..e53d74a0f0b 100644 --- a/shared/typeinference/qlpack.yml +++ b/shared/typeinference/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeinference -version: 0.0.2-dev +version: 0.0.2 groups: shared library: true dependencies: diff --git a/shared/typetracking/CHANGELOG.md b/shared/typetracking/CHANGELOG.md index c31f7b82d8b..cb26fd51732 100644 --- a/shared/typetracking/CHANGELOG.md +++ b/shared/typetracking/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.5 + +No user-facing changes. + ## 2.0.4 No user-facing changes. diff --git a/shared/typetracking/change-notes/released/2.0.5.md b/shared/typetracking/change-notes/released/2.0.5.md new file mode 100644 index 00000000000..8bce5b7ca75 --- /dev/null +++ b/shared/typetracking/change-notes/released/2.0.5.md @@ -0,0 +1,3 @@ +## 2.0.5 + +No user-facing changes. diff --git a/shared/typetracking/codeql-pack.release.yml b/shared/typetracking/codeql-pack.release.yml index 0f306f8bd3b..6c269316f27 100644 --- a/shared/typetracking/codeql-pack.release.yml +++ b/shared/typetracking/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.4 +lastReleaseVersion: 2.0.5 diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 387f2df0850..3a49c131870 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 2.0.5-dev +version: 2.0.5 groups: shared library: true dependencies: diff --git a/shared/typos/CHANGELOG.md b/shared/typos/CHANGELOG.md index 4365eb52a38..236eb0d974a 100644 --- a/shared/typos/CHANGELOG.md +++ b/shared/typos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/typos/change-notes/released/1.0.21.md b/shared/typos/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/typos/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/typos/codeql-pack.release.yml b/shared/typos/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/typos/codeql-pack.release.yml +++ b/shared/typos/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index b84e528b13a..9f9eb31e03f 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/CHANGELOG.md b/shared/util/CHANGELOG.md index fa3c9ff7fb4..17de0802307 100644 --- a/shared/util/CHANGELOG.md +++ b/shared/util/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.8 + +No user-facing changes. + ## 2.0.7 No user-facing changes. diff --git a/shared/util/change-notes/released/2.0.8.md b/shared/util/change-notes/released/2.0.8.md new file mode 100644 index 00000000000..4d6867c721b --- /dev/null +++ b/shared/util/change-notes/released/2.0.8.md @@ -0,0 +1,3 @@ +## 2.0.8 + +No user-facing changes. diff --git a/shared/util/codeql-pack.release.yml b/shared/util/codeql-pack.release.yml index 08d5e959449..7ffb2d9f65b 100644 --- a/shared/util/codeql-pack.release.yml +++ b/shared/util/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 2.0.7 +lastReleaseVersion: 2.0.8 diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index cec325c5327..8f17062384d 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 2.0.8-dev +version: 2.0.8 groups: shared library: true dependencies: null diff --git a/shared/xml/CHANGELOG.md b/shared/xml/CHANGELOG.md index 5551a042e15..a9a8e312ea2 100644 --- a/shared/xml/CHANGELOG.md +++ b/shared/xml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/xml/change-notes/released/1.0.21.md b/shared/xml/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/xml/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/xml/codeql-pack.release.yml b/shared/xml/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/xml/codeql-pack.release.yml +++ b/shared/xml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index ddd183347db..36d5e9aaf98 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true dependencies: diff --git a/shared/yaml/CHANGELOG.md b/shared/yaml/CHANGELOG.md index 2aff70a053b..430e21d3e50 100644 --- a/shared/yaml/CHANGELOG.md +++ b/shared/yaml/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.21 + +No user-facing changes. + ## 1.0.20 No user-facing changes. diff --git a/shared/yaml/change-notes/released/1.0.21.md b/shared/yaml/change-notes/released/1.0.21.md new file mode 100644 index 00000000000..aeb4f416f69 --- /dev/null +++ b/shared/yaml/change-notes/released/1.0.21.md @@ -0,0 +1,3 @@ +## 1.0.21 + +No user-facing changes. diff --git a/shared/yaml/codeql-pack.release.yml b/shared/yaml/codeql-pack.release.yml index 7af2d1347ff..81b5ecacf44 100644 --- a/shared/yaml/codeql-pack.release.yml +++ b/shared/yaml/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.0.20 +lastReleaseVersion: 1.0.21 diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index bfb8003b745..2a582f48a94 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.21-dev +version: 1.0.21 groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/CHANGELOG.md b/swift/ql/lib/CHANGELOG.md index d11c1a7a776..32abbe5cc8e 100644 --- a/swift/ql/lib/CHANGELOG.md +++ b/swift/ql/lib/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.1.4 + +No user-facing changes. + ## 4.1.3 No user-facing changes. diff --git a/swift/ql/lib/change-notes/released/4.1.4.md b/swift/ql/lib/change-notes/released/4.1.4.md new file mode 100644 index 00000000000..d2d878b3429 --- /dev/null +++ b/swift/ql/lib/change-notes/released/4.1.4.md @@ -0,0 +1,3 @@ +## 4.1.4 + +No user-facing changes. diff --git a/swift/ql/lib/codeql-pack.release.yml b/swift/ql/lib/codeql-pack.release.yml index cdfb1853324..de92bc2ecc3 100644 --- a/swift/ql/lib/codeql-pack.release.yml +++ b/swift/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 4.1.3 +lastReleaseVersion: 4.1.4 diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index a8937945393..a4a4492d599 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 4.1.4-dev +version: 4.1.4 groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/CHANGELOG.md b/swift/ql/src/CHANGELOG.md index ee24a514d14..6b5f800619e 100644 --- a/swift/ql/src/CHANGELOG.md +++ b/swift/ql/src/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.1 + +No user-facing changes. + ## 1.1.0 ### New Queries diff --git a/swift/ql/src/change-notes/released/1.1.1.md b/swift/ql/src/change-notes/released/1.1.1.md new file mode 100644 index 00000000000..7fb56d36610 --- /dev/null +++ b/swift/ql/src/change-notes/released/1.1.1.md @@ -0,0 +1,3 @@ +## 1.1.1 + +No user-facing changes. diff --git a/swift/ql/src/codeql-pack.release.yml b/swift/ql/src/codeql-pack.release.yml index 2ac15439f56..1a19084be3f 100644 --- a/swift/ql/src/codeql-pack.release.yml +++ b/swift/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.0 +lastReleaseVersion: 1.1.1 diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index 65d542ab524..a99b65317ee 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.1.1-dev +version: 1.1.1 groups: - swift - queries From 91daca1a6babb9bef353f8c54626c6b4c15bd696 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Mon, 14 Apr 2025 13:51:30 +0200 Subject: [PATCH 255/372] Improve code quality based on PR review --- .../BuildScripts.cs | 17 +++++++------ .../BuildScripts.cs | 4 ++++ .../Semmle.Autobuild.Shared/MsBuildRule.cs | 7 +----- csharp/extractor/Semmle.Util/BuildActions.cs | 24 +++++++++++++++++++ 4 files changed, 37 insertions(+), 15 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs index db445c591a5..eb75af79082 100644 --- a/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs @@ -46,11 +46,6 @@ namespace Semmle.Autobuild.CSharp.Tests public IList RunProcessIn { get; } = new List(); public IDictionary RunProcess { get; } = new Dictionary(); - - /// - /// (process-exit code) pairs for commands that are executed during the assembly of the autobuild script. - /// - public IDictionary RunProcessExecuteDuring { get; } = new Dictionary(); public IDictionary RunProcessOut { get; } = new Dictionary(); public IDictionary RunProcessWorkingDirectory { get; } = new Dictionary(); public HashSet CreateDirectories { get; } = new HashSet(); @@ -71,7 +66,7 @@ namespace Semmle.Autobuild.CSharp.Tests if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) + if (!RunProcess.TryGetValue(pattern, out var ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -86,7 +81,7 @@ namespace Semmle.Autobuild.CSharp.Tests if (wd != workingDirectory) throw new ArgumentException($"Unexpected RunProcessWorkingDirectory, got {wd ?? "null"} expected {workingDirectory ?? "null"} in {pattern}"); - if (!RunProcess.TryGetValue(pattern, out var ret) && !RunProcessExecuteDuring.TryGetValue(pattern, out ret)) + if (!RunProcess.TryGetValue(pattern, out var ret)) throw new ArgumentException("Missing RunProcess " + pattern); return ret; @@ -167,6 +162,10 @@ namespace Semmle.Autobuild.CSharp.Tests bool IBuildActions.IsRunningOnAppleSilicon() => IsRunningOnAppleSilicon; + public bool IsMonoInstalled { get; set; } + + bool IBuildActions.IsMonoInstalled() => IsMonoInstalled; + public string PathCombine(params string[] parts) { return string.Join(IsWindows ? '\\' : '/', parts.Where(p => !string.IsNullOrWhiteSpace(p))); @@ -804,7 +803,7 @@ namespace Semmle.Autobuild.CSharp.Tests [Fact] public void TestDirsProjLinux_WithMono() { - actions.RunProcessExecuteDuring[@"mono --version"] = 0; + actions.IsMonoInstalled = true; actions.RunProcess[@"nuget restore C:\Project/dirs.proj -DisableParallelProcessing"] = 1; actions.RunProcess[@"mono scratch/.nuget/nuget.exe restore C:\Project/dirs.proj -DisableParallelProcessing"] = 0; @@ -817,7 +816,7 @@ namespace Semmle.Autobuild.CSharp.Tests [Fact] public void TestDirsProjLinux_WithoutMono() { - actions.RunProcessExecuteDuring[@"mono --version"] = 1; + actions.IsMonoInstalled = false; actions.RunProcess[@"dotnet msbuild /t:restore C:\Project/dirs.proj"] = 0; actions.RunProcess[@"dotnet msbuild C:\Project/dirs.proj /t:rebuild"] = 0; diff --git a/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs b/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs index c74692bed75..afa4ea4b41c 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs @@ -150,6 +150,10 @@ namespace Semmle.Autobuild.Cpp.Tests bool IBuildActions.IsRunningOnAppleSilicon() => IsRunningOnAppleSilicon; + public bool IsMonoInstalled { get; set; } + + bool IBuildActions.IsMonoInstalled() => IsMonoInstalled; + string IBuildActions.PathCombine(params string[] parts) { return string.Join(IsWindows ? '\\' : '/', parts.Where(p => !string.IsNullOrWhiteSpace(p))); diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs index 72ede13da42..4295f71df9d 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs @@ -74,12 +74,7 @@ namespace Semmle.Autobuild.Shared Argument("-DisableParallelProcessing"). Script; - BuildScript GetMonoVersionScript() => new CommandBuilder(builder.Actions). - RunCommand("mono"). - Argument("--version"). - Script; - - var preferDotnet = !builder.Actions.IsWindows() && GetMonoVersionScript().Run(builder.Actions, (_, _) => { }, (_, _, _) => { }) != 0; + var preferDotnet = !builder.Actions.IsWindows() && !builder.Actions.IsMonoInstalled(); var nugetRestore = GetNugetRestoreScript(); var msbuildRestoreCommand = new CommandBuilder(builder.Actions). diff --git a/csharp/extractor/Semmle.Util/BuildActions.cs b/csharp/extractor/Semmle.Util/BuildActions.cs index 507af96d13c..38210402945 100644 --- a/csharp/extractor/Semmle.Util/BuildActions.cs +++ b/csharp/extractor/Semmle.Util/BuildActions.cs @@ -125,6 +125,11 @@ namespace Semmle.Util /// True if we are running on Apple Silicon. bool IsRunningOnAppleSilicon(); + /// + /// Checks if Mono is installed. + /// + bool IsMonoInstalled(); + /// /// Combine path segments, Path.Combine(). /// @@ -261,6 +266,25 @@ namespace Semmle.Util } } + bool IBuildActions.IsMonoInstalled() + { + var thisBuildActions = (IBuildActions)this; + + if (thisBuildActions.IsWindows()) + { + return false; + } + + try + { + return 0 == thisBuildActions.RunProcess("mono", "--version", workingDirectory: null, env: null); + } + catch (Exception) + { + return false; + } + } + string IBuildActions.PathCombine(params string[] parts) => Path.Combine(parts); void IBuildActions.WriteAllText(string filename, string contents) => File.WriteAllText(filename, contents); From 8d571672e9256ce021f556bebe167f32b7ef4043 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 13:54:43 +0200 Subject: [PATCH 256/372] C#: Convert cs/missing-access-control to inline expectations test. --- .../MVCTests/MissingAccessControl.expected | 2 +- .../MVCTests/MissingAccessControl.qlref | 5 ++- .../MVCTests/ProfileController.cs | 35 ++++++++++++------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected index 87fc29167be..b0cd401adf0 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected @@ -1 +1 @@ -| ProfileController.cs:9:25:9:31 | Delete1 | This action is missing an authorization check. | +| ProfileController.cs:10:25:10:31 | Delete1 | This action is missing an authorization check. | diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref index a4173778d9f..304adda3428 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.qlref @@ -1 +1,4 @@ -Security Features/CWE-285/MissingAccessControl.ql +query: Security Features/CWE-285/MissingAccessControl.ql +postprocess: + - utils/test/PrettyPrintModels.ql + - utils/test/InlineExpectationsTestQuery.ql diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs index 8fb88eacd3e..071dd9e9839 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs @@ -1,19 +1,23 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; -public class ProfileController : Controller { +public class ProfileController : Controller +{ private void doThings() { } private bool isAuthorized() { return false; } // BAD: This is a Delete method, but no auth is specified. - public ActionResult Delete1(int id) { + public ActionResult Delete1(int id) // $ Alert + { doThings(); return View(); } // GOOD: isAuthorized is checked. - public ActionResult Delete2(int id) { - if (!isAuthorized()) { + public ActionResult Delete2(int id) + { + if (!isAuthorized()) + { return null; } doThings(); @@ -22,7 +26,8 @@ public class ProfileController : Controller { // GOOD: The Authorize attribute is used. [Authorize] - public ActionResult Delete3(int id) { + public ActionResult Delete3(int id) + { doThings(); return View(); } @@ -30,27 +35,33 @@ public class ProfileController : Controller { } [Authorize] -public class AuthBaseController : Controller { +public class AuthBaseController : Controller +{ protected void doThings() { } } -public class SubController : AuthBaseController { +public class SubController : AuthBaseController +{ // GOOD: The Authorize attribute is used on the base class. - public ActionResult Delete4(int id) { + public ActionResult Delete4(int id) + { doThings(); return View(); } } [Authorize] -public class AuthBaseGenericController : Controller { +public class AuthBaseGenericController : Controller +{ protected void doThings() { } } -public class SubGenericController : AuthBaseGenericController { +public class SubGenericController : AuthBaseGenericController +{ // GOOD: The Authorize attribute is used on the base class. - public ActionResult Delete5(int id) { + public ActionResult Delete5(int id) + { doThings(); return View(); } -} \ No newline at end of file +} From 2e7e276806a82a12ed0d2310cc7fbd138490a3c5 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 14:18:30 +0200 Subject: [PATCH 257/372] C#: Add test case for authorization attribute that extends Authorize. --- .../MVCTests/MissingAccessControl.expected | 6 +++++- .../MissingAccessControl/MVCTests/ProfileController.cs | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected index b0cd401adf0..539a53c2193 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected @@ -1 +1,5 @@ -| ProfileController.cs:10:25:10:31 | Delete1 | This action is missing an authorization check. | +#select +| ProfileController.cs:12:25:12:31 | Delete1 | This action is missing an authorization check. | +| ProfileController.cs:39:25:39:31 | Delete4 | This action is missing an authorization check. | +testFailures +| ProfileController.cs:39:25:39:31 | This action is missing an authorization check. | Unexpected result: Alert | diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs index 071dd9e9839..9c20313b84b 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs @@ -1,6 +1,8 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; +public class RequirePermissionAttribute : AuthorizeAttribute { } + public class ProfileController : Controller { private void doThings() { } @@ -32,6 +34,13 @@ public class ProfileController : Controller return View(); } + // GOOD: The RequirePermission attribute is used (which extends AuthorizeAttribute). + [RequirePermission] + public ActionResult Delete4(int id) + { + doThings(); + return View(); + } } [Authorize] From c15d1ab3bdd92f57a4a0901508dcd312fef21216 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 14:25:31 +0200 Subject: [PATCH 258/372] C#: Consider an attribute to be authorization like, if it extends an attribute that has an authorization like name. --- .../security/auth/MissingFunctionLevelAccessControlQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll index f43d42b8714..0e3074065f4 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/auth/MissingFunctionLevelAccessControlQuery.qll @@ -81,7 +81,7 @@ predicate hasAuthViaXml(ActionMethod m) { /** Holds if the given action has an attribute that indications authorization. */ predicate hasAuthViaAttribute(ActionMethod m) { - exists(Attribute attr | attr.getType().getName().toLowerCase().matches("%auth%") | + exists(Attribute attr | attr.getType().getABaseType*().getName().toLowerCase().matches("%auth%") | attr = m.getOverridee*().getAnAttribute() or attr = getAnUnboundBaseType*(m.getDeclaringType()).getAnAttribute() ) From f11aec35921acb2443b6dbe80bc8a067a96f6ad7 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 14 Apr 2025 14:26:51 +0200 Subject: [PATCH 259/372] C#: Update test expected output. --- .../MVCTests/MissingAccessControl.expected | 4 ---- 1 file changed, 4 deletions(-) diff --git a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected index 539a53c2193..513fab4804a 100644 --- a/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected +++ b/csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/MissingAccessControl.expected @@ -1,5 +1 @@ -#select | ProfileController.cs:12:25:12:31 | Delete1 | This action is missing an authorization check. | -| ProfileController.cs:39:25:39:31 | Delete4 | This action is missing an authorization check. | -testFailures -| ProfileController.cs:39:25:39:31 | This action is missing an authorization check. | Unexpected result: Alert | From 1c11c5562ae5ca6eb948e884b62c958f853306e7 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Mon, 14 Apr 2025 14:50:46 +0200 Subject: [PATCH 260/372] Swift: add change note --- swift/ql/lib/change-notes/2025-04-14-new-entities.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 swift/ql/lib/change-notes/2025-04-14-new-entities.md diff --git a/swift/ql/lib/change-notes/2025-04-14-new-entities.md b/swift/ql/lib/change-notes/2025-04-14-new-entities.md new file mode 100644 index 00000000000..a0555d9cbda --- /dev/null +++ b/swift/ql/lib/change-notes/2025-04-14-new-entities.md @@ -0,0 +1,6 @@ +--- +category: minorAnalysis +--- +* Added AST nodes `ActorIsolationErasureExpr`, `CurrentContextIsolationExpr`, + `ExtracFunctionIsolationExpr` and `UnreachableExpr` that correspond to new nodes + added by Swift 6.0. From a70536f002d5de3e8c8a57bf62b7c678d165a7ce Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Mon, 14 Apr 2025 14:54:56 +0200 Subject: [PATCH 261/372] Improve code quality --- csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs index 4295f71df9d..748a22fb9d3 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/MsBuildRule.cs @@ -16,7 +16,9 @@ namespace Semmle.Autobuild.Shared // mono doesn't ship with `msbuild` on Arm-based Macs, but we can fall back to // msbuild that ships with `dotnet` which can be invoked with `dotnet msbuild` // perhaps we should do this on all platforms? - return builder.Actions.IsRunningOnAppleSilicon() || preferDotnet + // Similarly, there's no point in trying to rely on mono if it's not installed. + // In which case we can still fall back to `dotnet msbuild`. + return preferDotnet ? cmdBuilder.RunCommand("dotnet").Argument("msbuild") : cmdBuilder.RunCommand("msbuild"); } @@ -74,7 +76,7 @@ namespace Semmle.Autobuild.Shared Argument("-DisableParallelProcessing"). Script; - var preferDotnet = !builder.Actions.IsWindows() && !builder.Actions.IsMonoInstalled(); + var preferDotnet = builder.Actions.IsRunningOnAppleSilicon() || !builder.Actions.IsWindows() && !builder.Actions.IsMonoInstalled(); var nugetRestore = GetNugetRestoreScript(); var msbuildRestoreCommand = new CommandBuilder(builder.Actions). @@ -82,7 +84,7 @@ namespace Semmle.Autobuild.Shared Argument("/t:restore"). QuoteArgument(projectOrSolution.FullPath); - if (builder.Actions.IsRunningOnAppleSilicon() || preferDotnet) + if (preferDotnet) { // On Apple Silicon, only try package restore with `dotnet msbuild /t:restore` ret &= BuildScript.Try(msbuildRestoreCommand.Script); From 24bcd041b8825ef8b6c1349c11eb36ec7c1ad437 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:05:23 +0100 Subject: [PATCH 262/372] Rust: Add flow models for io. --- .../rust/frameworks/stdlib/io.model.yml | 32 +++++++++++++++++ .../library-tests/dataflow/sources/test.rs | 34 +++++++++---------- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml index 91eab1cab89..3cdbb911b5b 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/io.model.yml @@ -4,3 +4,35 @@ extensions: extensible: sourceModel data: - ["lang:std", "crate::io::stdio::stdin", "ReturnValue", "stdin", "manual"] + - addsTo: + pack: codeql/rust-all + extensible: summaryModel + data: + - ["lang:std", "::new", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["lang:std", "::fill_buf", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:std", "::buffer", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read_to_string", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", ":::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read_to_end", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::Read::read_exact", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::read_line", "Argument[self]", "Argument[0].Reference", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::read_until", "Argument[self]", "Argument[1].Reference", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::split", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::BufRead::lines", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::chain", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::chain", "Argument[0]", "ReturnValue", "taint", "manual"] + - ["lang:std", "crate::io::Read::take", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:std", "::lock", "Argument[self]", "ReturnValue", "taint", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/sources/test.rs b/rust/ql/test/library-tests/dataflow/sources/test.rs index f6aa9676778..2ec0b8964ca 100644 --- a/rust/ql/test/library-tests/dataflow/sources/test.rs +++ b/rust/ql/test/library-tests/dataflow/sources/test.rs @@ -241,7 +241,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = [0u8; 100]; let _bytes = std::io::stdin().read(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { @@ -253,17 +253,17 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = String::new(); let _bytes = std::io::stdin().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { let mut buffer = [0; 100]; std::io::stdin().read_exact(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } for byte in std::io::stdin().bytes() { // $ Alert[rust/summary/taint-sources] - sink(byte); // $ MISSING: hasTaintFlow + sink(byte); // $ hasTaintFlow } // --- file --- @@ -273,29 +273,29 @@ fn test_io_fs() -> std::io::Result<()> { { let mut buffer = [0u8; 100]; let _bytes = file.read(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = Vec::::new(); let _bytes = file.read_to_end(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = String::new(); let _bytes = file.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = [0; 100]; file.read_exact(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } for byte in file.bytes() { - sink(byte); // $ MISSING: hasTaintFlow + sink(byte); // $ hasTaintFlow="file.txt" } // --- BufReader --- @@ -303,27 +303,27 @@ fn test_io_fs() -> std::io::Result<()> { { let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.fill_buf()?; - sink(&data); // $ MISSING: hasTaintFlow + sink(&data); // $ hasTaintFlow } { let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] let data = reader.buffer(); - sink(&data); // $ MISSING: hasTaintFlow + sink(&data); // $ hasTaintFlow } { let mut buffer = String::new(); let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_line(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { let mut buffer = Vec::::new(); let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] reader.read_until(b',', &mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } { @@ -337,7 +337,7 @@ fn test_io_fs() -> std::io::Result<()> { { let mut reader = std::io::BufReader::new(std::io::stdin()); // $ Alert[rust/summary/taint-sources] for line in reader.lines() { - sink(line); // $ MISSING: Alert[rust/summary/taint-sources] + sink(line); // $ hasTaintFlow } } @@ -361,7 +361,7 @@ fn test_io_fs() -> std::io::Result<()> { let mut file2 = std::fs::File::open("another_file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.chain(file2); reader.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" hasTaintFlow="another_file.txt" } { @@ -369,13 +369,13 @@ fn test_io_fs() -> std::io::Result<()> { let mut file1 = std::fs::File::open("file.txt")?; // $ Alert[rust/summary/taint-sources] let mut reader = file1.take(100); reader.read_to_string(&mut buffer)?; - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow="file.txt" } { let mut buffer = String::new(); let _bytes = std::io::stdin().lock().read_to_string(&mut buffer)?; // $ Alert[rust/summary/taint-sources] - sink(&buffer); // $ MISSING: hasTaintFlow + sink(&buffer); // $ hasTaintFlow } Ok(()) From a8b552200a1ca973e7608b44db94359cc551f26f Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:03:04 +0100 Subject: [PATCH 263/372] Rust: Impact on dataflow/local test. --- .../dataflow/local/DataFlowStep.expected | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index fcd4d278610..2721ef7092d 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -1940,8 +1940,25 @@ storeStep | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:proc_macro::_::::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:proc_macro::_::::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:proc_macro::_::::decode | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_:::::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_:::::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_:::::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_:::::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_string | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::advance_slices | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::advance_slices | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::advance_slices | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::advance_slices | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_string | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::::read_to_string | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::BufRead::read_line | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::BufRead::read_line | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read_exact | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read_exact | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read_to_end | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read_to_end | +| file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:std::_::crate::io::Read::read_to_string | &ref | file://:0:0:0:0 | [post] [summary param] 0 in lang:std::_::crate::io::Read::read_to_string | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference.Reference in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference.Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | | file://:0:0:0:0 | [summary] to write: Argument[0].Reference.Reference in lang:proc_macro::_::::decode | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Reference in lang:proc_macro::_::::decode | @@ -1957,6 +1974,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0].Reference in lang:core::_::::map_split | &ref | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0] in lang:core::_::::map_split | | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0].Reference in lang:std::_::::wait_while | &ref | file://:0:0:0:0 | [summary] to write: Argument[1].Parameter[0] in lang:std::_::::wait_while | | file://:0:0:0:0 | [summary] to write: Argument[1].Reference in lang:core::_::<_ as crate::clone::uninit::CopySpec>::clone_one | &ref | file://:0:0:0:0 | [post] [summary param] 1 in lang:core::_::<_ as crate::clone::uninit::CopySpec>::clone_one | +| file://:0:0:0:0 | [summary] to write: Argument[1].Reference in lang:std::_::crate::io::BufRead::read_until | &ref | file://:0:0:0:0 | [post] [summary param] 1 in lang:std::_::crate::io::BufRead::read_until | | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0].Reference in lang:core::_::crate::cmp::max_by | &ref | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0] in lang:core::_::crate::cmp::max_by | | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0].Reference in lang:core::_::crate::cmp::max_by_key | &ref | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0] in lang:core::_::crate::cmp::max_by_key | | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0].Reference in lang:core::_::crate::cmp::min_by | &ref | file://:0:0:0:0 | [summary] to write: Argument[2].Parameter[0] in lang:core::_::crate::cmp::min_by | @@ -2178,6 +2196,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::or_else | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::or_else | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::parse | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::parse | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::<&[u8] as crate::io::BufRead>::fill_buf | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::<&[u8] as crate::io::BufRead>::fill_buf | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::fill_buf | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::fill_buf | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::canonicalize | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::canonicalize | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::wait | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:std::_::::wait_timeout | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:std::_::::wait_timeout | From bdd5717c09e426b15352223ca74d905e9a02642b Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:39:40 +0100 Subject: [PATCH 264/372] Rust: Remove the models output from the dataflow/local test. --- .../dataflow/local/DataFlowStep.expected | 1062 ----------------- .../dataflow/local/DataFlowStep.ql | 2 - 2 files changed, 1064 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index fcd4d278610..029f00cf82b 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -860,1068 +860,6 @@ localStep | main.rs:565:13:565:33 | result_questionmark(...) | main.rs:565:9:565:9 | _ | | main.rs:577:36:577:41 | ...::new(...) | main.rs:577:36:577:41 | MacroExpr | | main.rs:577:36:577:41 | [post] MacroExpr | main.rs:577:36:577:41 | [post] ...::new(...) | -models -| 1 | Sink: lang:std; crate::io::stdio::_print; log-injection; Argument[0] | -| 2 | Summary: lang:alloc; <&&str as crate::string::SpecToString>::spec_to_string; Argument[self].Reference.Reference; ReturnValue; value | -| 3 | Summary: lang:alloc; <&str as crate::string::SpecToString>::spec_to_string; Argument[self].Reference; ReturnValue; value | -| 4 | Summary: lang:alloc; <_ as crate::borrow::ToOwned>::clone_into; Argument[self]; Argument[0].Reference; value | -| 5 | Summary: lang:alloc; <_ as crate::borrow::ToOwned>::to_owned; Argument[self]; ReturnValue; value | -| 6 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 7 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 8 | Summary: lang:alloc; ::add_assign; Argument[0]; Argument[self].Reference; value | -| 9 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 10 | Summary: lang:alloc; ::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 11 | Summary: lang:alloc; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 12 | Summary: lang:alloc; ::as_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 13 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 14 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 15 | Summary: lang:alloc; ::deref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 16 | Summary: lang:alloc; ::deref_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 17 | Summary: lang:alloc; ::allocator; Argument[0].Field[1]; ReturnValue.Reference; value | -| 18 | Summary: lang:alloc; ::as_mut_ptr; Argument[0].Reference.Reference; ReturnValue.Reference; value | -| 19 | Summary: lang:alloc; ::as_ptr; Argument[0].Reference.Reference; ReturnValue.Reference; value | -| 20 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 21 | Summary: lang:alloc; ::into_inner; Argument[0].Reference; ReturnValue; value | -| 22 | Summary: lang:alloc; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | -| 23 | Summary: lang:alloc; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 24 | Summary: lang:alloc; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 25 | Summary: lang:alloc; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 26 | Summary: lang:alloc; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 27 | Summary: lang:alloc; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 28 | Summary: lang:alloc; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 29 | Summary: lang:alloc; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 30 | Summary: lang:alloc; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | -| 31 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | -| 32 | Summary: lang:alloc; ::get_or_insert_with; Argument[0]; Argument[1].Parameter[0]; value | -| 33 | Summary: lang:alloc; ::clone; Argument[self].Reference; ReturnValue; value | -| 34 | Summary: lang:alloc; ::left_kv; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 35 | Summary: lang:alloc; ::right_kv; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 36 | Summary: lang:alloc; ::clone; Argument[self].Reference; ReturnValue; value | -| 37 | Summary: lang:alloc; ::ascend; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 38 | Summary: lang:alloc; ::choose_parent_kv; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 39 | Summary: lang:alloc; ::find_lower_bound_edge; Argument[0]; ReturnValue.Field[1]; value | -| 40 | Summary: lang:alloc; ::find_upper_bound_edge; Argument[0]; ReturnValue.Field[1]; value | -| 41 | Summary: lang:alloc; ::search_tree_for_bifurcation; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 42 | Summary: lang:alloc; ::visit_nodes_in_order; Argument[0].ReturnValue; ReturnValue; value | -| 43 | Summary: lang:alloc; ::get_or_insert_with; Argument[0]; Argument[1].Parameter[0]; value | -| 44 | Summary: lang:alloc; ::split_off; Argument[self].Reference; ReturnValue; value | -| 45 | Summary: lang:alloc; ::retain; Argument[self].Element; Argument[0].Parameter[0].Reference; value | -| 46 | Summary: lang:alloc; ::retain_mut; Argument[self].Element; Argument[0].Parameter[0].Reference; value | -| 47 | Summary: lang:alloc; ::rfold; Argument[0]; ReturnValue; value | -| 48 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 49 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 50 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 51 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 52 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 53 | Summary: lang:alloc; ::rfold; Argument[0]; ReturnValue; value | -| 54 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 55 | Summary: lang:alloc; ::try_rfold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 56 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 57 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 58 | Summary: lang:alloc; ::try_fold; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 59 | Summary: lang:alloc; ::borrow; Argument[self]; ReturnValue; value | -| 60 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 61 | Summary: lang:alloc; ::index; Argument[self]; ReturnValue; value | -| 62 | Summary: lang:alloc; ::as_c_str; Argument[self].Reference; ReturnValue.Reference; value | -| 63 | Summary: lang:alloc; ::into_vec; Argument[self].Field[1]; ReturnValue; value | -| 64 | Summary: lang:alloc; ::nul_position; Argument[self].Field[0]; ReturnValue; value | -| 65 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 66 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 67 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 68 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 69 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 70 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | -| 71 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 72 | Summary: lang:alloc; ::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 73 | Summary: lang:alloc; ::as_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 74 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 75 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 76 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | -| 77 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | -| 78 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 79 | Summary: lang:alloc; ::from; Argument[0]; ReturnValue; value | -| 80 | Summary: lang:alloc; ::add; Argument[self]; ReturnValue; value | -| 81 | Summary: lang:alloc; ::from_str; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 82 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 83 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 84 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 85 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 86 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 87 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 88 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | -| 89 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 90 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | -| 91 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | -| 92 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 93 | Summary: lang:alloc; ::from; Argument[0].Field[0]; ReturnValue; value | -| 94 | Summary: lang:alloc; ::push_within_capacity; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 95 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | -| 96 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 97 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 98 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 99 | Summary: lang:alloc; ::as_into_iter; Argument[self]; ReturnValue; value | -| 100 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 101 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 102 | Summary: lang:alloc; <{766}::StringError as crate::error::Error>::description; Argument[self].Field[0]; ReturnValue.Reference; value | -| 103 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 104 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[1].ReturnValue; Argument[0].Reference; value | -| 105 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 106 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[1].ReturnValue; Argument[0].Reference; value | -| 107 | Summary: lang:core; <&_ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 108 | Summary: lang:core; <&_ as crate::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | -| 109 | Summary: lang:core; <&_ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 110 | Summary: lang:core; <&mut _ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 111 | Summary: lang:core; <&mut _ as crate::borrow::BorrowMut>::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 112 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[0]; ReturnValue; value | -| 113 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 114 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 115 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[0]; ReturnValue; value | -| 116 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 117 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 118 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[0]; ReturnValue; value | -| 119 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 120 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 121 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[0]; ReturnValue; value | -| 122 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 123 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 124 | Summary: lang:core; <&mut _ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 125 | Summary: lang:core; <&mut _ as crate::ops::deref::DerefMut>::deref_mut; Argument[self].Reference; ReturnValue; value | -| 126 | Summary: lang:core; <[_] as crate::convert::AsMut>::as_mut; Argument[self]; ReturnValue; value | -| 127 | Summary: lang:core; <[_] as crate::convert::AsRef>::as_ref; Argument[self]; ReturnValue; value | -| 128 | Summary: lang:core; <[_] as crate::slice::SlicePattern>::as_slice; Argument[self]; ReturnValue; value | -| 129 | Summary: lang:core; <[_]>::align_to; Argument[self]; ReturnValue.Field[0]; value | -| 130 | Summary: lang:core; <[_]>::align_to_mut; Argument[self]; ReturnValue.Field[0]; value | -| 131 | Summary: lang:core; <[_]>::as_simd; Argument[self]; ReturnValue.Field[0]; value | -| 132 | Summary: lang:core; <[_]>::as_simd_mut; Argument[self]; ReturnValue.Field[0]; value | -| 133 | Summary: lang:core; <[_]>::partition_dedup; Argument[self]; ReturnValue.Field[0]; value | -| 134 | Summary: lang:core; <[_]>::partition_dedup_by; Argument[self]; ReturnValue.Field[0]; value | -| 135 | Summary: lang:core; <[_]>::partition_dedup_by_key; Argument[self]; ReturnValue.Field[0]; value | -| 136 | Summary: lang:core; <[u8]>::trim_ascii; Argument[self]; ReturnValue; value | -| 137 | Summary: lang:core; <[u8]>::trim_ascii_end; Argument[self]; ReturnValue; value | -| 138 | Summary: lang:core; <[u8]>::trim_ascii_start; Argument[self]; ReturnValue; value | -| 139 | Summary: lang:core; <_ as crate::array::SpecArrayClone>::clone; Argument[0].Reference; ReturnValue; value | -| 140 | Summary: lang:core; <_ as crate::async_iter::async_iter::IntoAsyncIterator>::into_async_iter; Argument[self]; ReturnValue; value | -| 141 | Summary: lang:core; <_ as crate::borrow::Borrow>::borrow; Argument[self]; ReturnValue; value | -| 142 | Summary: lang:core; <_ as crate::borrow::BorrowMut>::borrow_mut; Argument[self]; ReturnValue; value | -| 143 | Summary: lang:core; <_ as crate::clone::uninit::CopySpec>::clone_one; Argument[0]; Argument[1].Reference; value | -| 144 | Summary: lang:core; <_ as crate::convert::From>::from; Argument[0]; ReturnValue; value | -| 145 | Summary: lang:core; <_ as crate::future::into_future::IntoFuture>::into_future; Argument[self]; ReturnValue; value | -| 146 | Summary: lang:core; <_ as crate::iter::adapters::step_by::SpecRangeSetup>::setup; Argument[0]; ReturnValue; value | -| 147 | Summary: lang:core; <_ as crate::iter::traits::collect::IntoIterator>::into_iter; Argument[self]; ReturnValue; value | -| 148 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[0]; Argument[self].Reference.Parameter[0]; value | -| 149 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[self].Reference.ReturnValue; ReturnValue; value | -| 150 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 151 | Summary: lang:core; ::select_unpredictable; Argument[0]; ReturnValue; value | -| 152 | Summary: lang:core; ::select_unpredictable; Argument[1]; ReturnValue; value | -| 153 | Summary: lang:core; ::then; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 154 | Summary: lang:core; ::then_some; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 155 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 156 | Summary: lang:core; ::to_ascii_lowercase; Argument[self].Reference; ReturnValue; value | -| 157 | Summary: lang:core; ::to_ascii_uppercase; Argument[self].Reference; ReturnValue; value | -| 158 | Summary: lang:core; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | -| 159 | Summary: lang:core; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 160 | Summary: lang:core; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 161 | Summary: lang:core; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 162 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 163 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 164 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 165 | Summary: lang:core; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 166 | Summary: lang:core; ::index; Argument[self]; ReturnValue; value | -| 167 | Summary: lang:core; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 168 | Summary: lang:core; ::index_mut; Argument[self]; ReturnValue; value | -| 169 | Summary: lang:core; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | -| 170 | Summary: lang:core; ::update; Argument[0].ReturnValue; ReturnValue; value | -| 171 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 172 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 173 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 174 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 175 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 176 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 177 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 178 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 179 | Summary: lang:core; ::get_or_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 180 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 181 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 182 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue; ReturnValue; value | -| 183 | Summary: lang:core; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 184 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 185 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 186 | Summary: lang:core; ::then; Argument[0]; ReturnValue; value | -| 187 | Summary: lang:core; ::then; Argument[self]; ReturnValue; value | -| 188 | Summary: lang:core; ::then_with; Argument[0].ReturnValue; ReturnValue; value | -| 189 | Summary: lang:core; ::then_with; Argument[self]; ReturnValue; value | -| 190 | Summary: lang:core; ::from; Argument[0]; ReturnValue; value | -| 191 | Summary: lang:core; ::provide_ref; Argument[self]; ReturnValue; value | -| 192 | Summary: lang:core; ::provide_ref_with; Argument[self]; ReturnValue; value | -| 193 | Summary: lang:core; ::provide_value; Argument[self]; ReturnValue; value | -| 194 | Summary: lang:core; ::provide_value_with; Argument[self]; ReturnValue; value | -| 195 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 196 | Summary: lang:core; ::with_copy; Argument[0].ReturnValue; ReturnValue; value | -| 197 | Summary: lang:core; ::align; Argument[self]; ReturnValue; value | -| 198 | Summary: lang:core; ::alternate; Argument[self]; ReturnValue; value | -| 199 | Summary: lang:core; ::debug_as_hex; Argument[self]; ReturnValue; value | -| 200 | Summary: lang:core; ::fill; Argument[self]; ReturnValue; value | -| 201 | Summary: lang:core; ::precision; Argument[self]; ReturnValue; value | -| 202 | Summary: lang:core; ::sign; Argument[self]; ReturnValue; value | -| 203 | Summary: lang:core; ::sign_aware_zero_pad; Argument[self]; ReturnValue; value | -| 204 | Summary: lang:core; ::width; Argument[self]; ReturnValue; value | -| 205 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 206 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 207 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 208 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 209 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 210 | Summary: lang:core; ::key; Argument[self]; ReturnValue; value | -| 211 | Summary: lang:core; ::key_with; Argument[self]; ReturnValue; value | -| 212 | Summary: lang:core; ::value; Argument[self]; ReturnValue; value | -| 213 | Summary: lang:core; ::value_with; Argument[self]; ReturnValue; value | -| 214 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 215 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 216 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 217 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 218 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 219 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 220 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 221 | Summary: lang:core; ::into_inner; Argument[self].Field[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 222 | Summary: lang:core; ::clear; Argument[self]; ReturnValue; value | -| 223 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 224 | Summary: lang:core; ::advance; Argument[self]; ReturnValue; value | -| 225 | Summary: lang:core; ::advance_unchecked; Argument[self]; ReturnValue; value | -| 226 | Summary: lang:core; ::ensure_init; Argument[self]; ReturnValue; value | -| 227 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 228 | Summary: lang:core; ::fold; Argument[0].Field[0]; ReturnValue; value | -| 229 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 230 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 231 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 232 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 233 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 234 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 235 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 236 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 237 | Summary: lang:core; ::rfold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 238 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 239 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 240 | Summary: lang:core; ::try_rfold; Argument[self].Field[0]; ReturnValue; value | -| 241 | Summary: lang:core; ::fold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 242 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 243 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 244 | Summary: lang:core; ::try_fold; Argument[self].Field[0]; ReturnValue; value | -| 245 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 246 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 247 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 248 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 249 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 250 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 251 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 252 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 253 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 254 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 255 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 256 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 257 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 258 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 259 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 260 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 261 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 262 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 263 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 264 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 265 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 266 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 267 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 268 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 269 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 270 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 271 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 272 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 273 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 274 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 275 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 276 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 277 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 278 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 279 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 280 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 281 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 282 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 283 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 284 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 285 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 286 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 287 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 288 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 289 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 290 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 291 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 292 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 293 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 294 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 295 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 296 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 297 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 298 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 299 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 300 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 301 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 302 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 303 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 304 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 305 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 306 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 307 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 308 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 309 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 310 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 311 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 312 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 313 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 314 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 315 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 316 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 317 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 318 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 319 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 320 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 321 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 322 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 323 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 324 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 325 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 326 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 327 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 328 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 329 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 330 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 331 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 332 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 333 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 334 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 335 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 336 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 337 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 338 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 339 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 340 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 341 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 342 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 343 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 344 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 345 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 346 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 347 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 348 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 349 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 350 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 351 | Summary: lang:core; ::fold; Argument[0]; Argument[1].Parameter[0]; value | -| 352 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 353 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 354 | Summary: lang:core; ::try_fold; Argument[0]; Argument[1].Parameter[0]; value | -| 355 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 356 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 357 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 358 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 359 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 360 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 361 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 362 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 363 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 364 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 365 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 366 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 367 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 368 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 369 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 370 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 371 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 372 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 373 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 374 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 375 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 376 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 377 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 378 | Summary: lang:core; ::spec_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 379 | Summary: lang:core; ::spec_rfold; Argument[0]; ReturnValue; value | -| 380 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 381 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 382 | Summary: lang:core; ::spec_try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 383 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 384 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 385 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 386 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 387 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 388 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 389 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 390 | Summary: lang:core; ::rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 391 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 392 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 393 | Summary: lang:core; ::try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 394 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 395 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 396 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 397 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 398 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 399 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 400 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 401 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 402 | Summary: lang:core; ::spec_fold; Argument[0].Field[0]; ReturnValue; value | -| 403 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 404 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 405 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 406 | Summary: lang:core; ::rfold; Argument[0].ReturnValue; ReturnValue; value | -| 407 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 408 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 409 | Summary: lang:core; ::rfold; Argument[self].Field[0]; ReturnValue; value | -| 410 | Summary: lang:core; ::rfold; Argument[self]; ReturnValue; value | -| 411 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 412 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 413 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 414 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 415 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 416 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 417 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 418 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 419 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 420 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 421 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 422 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 423 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 424 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 425 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 426 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 427 | Summary: lang:core; ::nth_back; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 428 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 429 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 430 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 431 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 432 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 433 | Summary: lang:core; ::to_canonical; Argument[self].Reference; ReturnValue; value | -| 434 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 435 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 436 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 437 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 438 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 439 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 440 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 441 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 442 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 443 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 444 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 445 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 446 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 447 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 448 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 449 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 450 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 451 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 452 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 453 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 454 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 455 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 456 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 457 | Summary: lang:core; ::from_mut_unchecked; Argument[0]; ReturnValue; value | -| 458 | Summary: lang:core; ::new_unchecked; Argument[0]; ReturnValue; value | -| 459 | Summary: lang:core; ::get; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 460 | Summary: lang:core; ::get_mut; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 461 | Summary: lang:core; ::get_unchecked; Argument[0]; ReturnValue; value | -| 462 | Summary: lang:core; ::get_unchecked_mut; Argument[0]; ReturnValue; value | -| 463 | Summary: lang:core; ::index; Argument[0]; ReturnValue; value | -| 464 | Summary: lang:core; ::index_mut; Argument[0]; ReturnValue; value | -| 465 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 466 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 467 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 468 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 469 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 470 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 471 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 472 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 473 | Summary: lang:core; ::wrap_mut_1; Argument[0]; ReturnValue; value | -| 474 | Summary: lang:core; ::wrap_mut_2; Argument[0]; ReturnValue; value | -| 475 | Summary: lang:core; ::clone; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 476 | Summary: lang:core; ::from; Argument[0].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 477 | Summary: lang:core; ::from; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 478 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 479 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 480 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 481 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 482 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 483 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 484 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 485 | Summary: lang:core; ::cloned; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 486 | Summary: lang:core; ::copied; Argument[self].Field[crate::option::Option::Some(0)].Reference; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 487 | Summary: lang:core; ::expect; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 488 | Summary: lang:core; ::flatten; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 489 | Summary: lang:core; ::get_or_insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 490 | Summary: lang:core; ::get_or_insert; Argument[0]; ReturnValue.Reference; value | -| 491 | Summary: lang:core; ::get_or_insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 492 | Summary: lang:core; ::get_or_insert_default; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 493 | Summary: lang:core; ::get_or_insert_with; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 494 | Summary: lang:core; ::insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 495 | Summary: lang:core; ::insert; Argument[0]; ReturnValue.Reference; value | -| 496 | Summary: lang:core; ::insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 497 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 498 | Summary: lang:core; ::is_none_or; Argument[0].ReturnValue; ReturnValue; value | -| 499 | Summary: lang:core; ::is_none_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 500 | Summary: lang:core; ::is_some_and; Argument[0].ReturnValue; ReturnValue; value | -| 501 | Summary: lang:core; ::is_some_and; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 502 | Summary: lang:core; ::map; Argument[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 503 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 504 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 505 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 506 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 507 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 508 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 509 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 510 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 511 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 512 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 513 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 514 | Summary: lang:core; ::ok_or; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 515 | Summary: lang:core; ::ok_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 516 | Summary: lang:core; ::ok_or_else; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 517 | Summary: lang:core; ::ok_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 518 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 519 | Summary: lang:core; ::or; Argument[self]; ReturnValue; value | -| 520 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 521 | Summary: lang:core; ::or_else; Argument[self]; ReturnValue; value | -| 522 | Summary: lang:core; ::replace; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 523 | Summary: lang:core; ::replace; Argument[self].Reference; ReturnValue; value | -| 524 | Summary: lang:core; ::take; Argument[self].Reference; ReturnValue; value | -| 525 | Summary: lang:core; ::take_if; Argument[self].Reference.Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0].Reference; value | -| 526 | Summary: lang:core; ::take_if; Argument[self].Reference; ReturnValue; value | -| 527 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 528 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; value | -| 529 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 530 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 531 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 532 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 533 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 534 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 535 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 536 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[0].Field[crate::option::Option::Some(0)]; value | -| 537 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[1]; ReturnValue.Field[1].Field[crate::option::Option::Some(0)]; value | -| 538 | Summary: lang:core; ::xor; Argument[0]; ReturnValue; value | -| 539 | Summary: lang:core; ::xor; Argument[self]; ReturnValue; value | -| 540 | Summary: lang:core; ::zip; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 541 | Summary: lang:core; ::zip; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 542 | Summary: lang:core; ::zip_with; Argument[0].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[1]; value | -| 543 | Summary: lang:core; ::zip_with; Argument[1].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 544 | Summary: lang:core; ::zip_with; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 545 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 546 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 547 | Summary: lang:core; ::max; Argument[0]; ReturnValue; value | -| 548 | Summary: lang:core; ::max; Argument[1]; ReturnValue; value | -| 549 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 550 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 551 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 552 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 553 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 554 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 555 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 556 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 557 | Summary: lang:core; ::and; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 558 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 559 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 560 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 561 | Summary: lang:core; ::as_deref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 562 | Summary: lang:core; ::as_deref_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 563 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 564 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 565 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 566 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 567 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 568 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 569 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 570 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Ok(0)].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 571 | Summary: lang:core; ::err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 572 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 573 | Summary: lang:core; ::expect_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 574 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 575 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 576 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 577 | Summary: lang:core; ::inspect_err; Argument[self]; ReturnValue; value | -| 578 | Summary: lang:core; ::into_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 579 | Summary: lang:core; ::into_ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 580 | Summary: lang:core; ::is_err_and; Argument[0].ReturnValue; ReturnValue; value | -| 581 | Summary: lang:core; ::is_err_and; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 582 | Summary: lang:core; ::is_ok_and; Argument[0].ReturnValue; ReturnValue; value | -| 583 | Summary: lang:core; ::is_ok_and; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 584 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 585 | Summary: lang:core; ::map_err; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 586 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 587 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 588 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 589 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 590 | Summary: lang:core; ::map_or; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 591 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 592 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 593 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 594 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 595 | Summary: lang:core; ::ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 596 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 597 | Summary: lang:core; ::or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 598 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 599 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 600 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 601 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; value | -| 602 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; value | -| 603 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 604 | Summary: lang:core; ::unwrap_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 605 | Summary: lang:core; ::unwrap_err_unchecked; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 606 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 607 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 608 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 609 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 610 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)].Reference; ReturnValue; value | -| 611 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 612 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 613 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 614 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 615 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 616 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 617 | Summary: lang:core; ::collect; Argument[self].Element; ReturnValue.Element; value | -| 618 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 619 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 620 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 621 | Summary: lang:core; ::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 622 | Summary: lang:core; ::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 623 | Summary: lang:core; ::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 624 | Summary: lang:core; ::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 625 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 626 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 627 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 628 | Summary: lang:core; ::call; Argument[0].Field[0]; ReturnValue; value | -| 629 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 630 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 631 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 632 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 633 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 634 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 635 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 636 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 637 | Summary: lang:core; ::matching; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 638 | Summary: lang:core; ::matching; Argument[1]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 639 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 640 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 641 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 642 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 643 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 644 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 645 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 646 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 647 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 648 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 649 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 650 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 651 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 652 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 653 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 654 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 655 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 656 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 657 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 658 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 659 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 660 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 661 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 662 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 663 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 664 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 665 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 666 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 667 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 668 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 669 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 670 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 671 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 672 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 673 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 674 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 675 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 676 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 677 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 678 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 679 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 680 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 681 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 682 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 683 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 684 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 685 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 686 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 687 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 688 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 689 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 690 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 691 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 692 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 693 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 694 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 695 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 696 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 697 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 698 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 699 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 700 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 701 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 702 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 703 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 704 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 705 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 706 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 707 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 708 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 709 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 710 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 711 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 712 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 713 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 714 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 715 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 716 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 717 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 718 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 719 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 720 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 721 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 722 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 723 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 724 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 725 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 726 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 727 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 728 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 729 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 730 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 731 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 732 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 733 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 734 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 735 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 736 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 737 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 738 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 739 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 740 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 741 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 742 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 743 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 744 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 745 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 746 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 747 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 748 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 749 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 750 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 751 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 752 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 753 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 754 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 755 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 756 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 757 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 758 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 759 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 760 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 761 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 762 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 763 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 764 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 765 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 766 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 767 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 768 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 769 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 770 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 771 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 772 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 773 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 774 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 775 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 776 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 777 | Summary: lang:core; ::as_mut; Argument[self]; ReturnValue; value | -| 778 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 779 | Summary: lang:core; ::as_str; Argument[self]; ReturnValue; value | -| 780 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 781 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 782 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 783 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 784 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 785 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 786 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 787 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 788 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 789 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 790 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 791 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 792 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 793 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 794 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 795 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 796 | Summary: lang:core; ::index; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 797 | Summary: lang:core; ::index_mut; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 798 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 799 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 800 | Summary: lang:core; crate::array::drain::drain_array_with; Argument[1].ReturnValue; ReturnValue; value | -| 801 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | -| 802 | Summary: lang:core; crate::cmp::max; Argument[1]; ReturnValue; value | -| 803 | Summary: lang:core; crate::cmp::max_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 804 | Summary: lang:core; crate::cmp::max_by; Argument[0]; ReturnValue; value | -| 805 | Summary: lang:core; crate::cmp::max_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 806 | Summary: lang:core; crate::cmp::max_by; Argument[1]; ReturnValue; value | -| 807 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 808 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; ReturnValue; value | -| 809 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 810 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; ReturnValue; value | -| 811 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | -| 812 | Summary: lang:core; crate::cmp::min; Argument[1]; ReturnValue; value | -| 813 | Summary: lang:core; crate::cmp::min_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 814 | Summary: lang:core; crate::cmp::min_by; Argument[0]; ReturnValue; value | -| 815 | Summary: lang:core; crate::cmp::min_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 816 | Summary: lang:core; crate::cmp::min_by; Argument[1]; ReturnValue; value | -| 817 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 818 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; ReturnValue; value | -| 819 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 820 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; ReturnValue; value | -| 821 | Summary: lang:core; crate::cmp::minmax; Argument[0]; ReturnValue.Element; value | -| 822 | Summary: lang:core; crate::cmp::minmax; Argument[1]; ReturnValue.Element; value | -| 823 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 824 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; ReturnValue.Element; value | -| 825 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 826 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; ReturnValue.Element; value | -| 827 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 828 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; ReturnValue.Element; value | -| 829 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 830 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; ReturnValue.Element; value | -| 831 | Summary: lang:core; crate::contracts::build_check_ensures; Argument[0]; ReturnValue; value | -| 832 | Summary: lang:core; crate::convert::identity; Argument[0]; ReturnValue; value | -| 833 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | -| 834 | Summary: lang:core; crate::intrinsics::contract_check_ensures; Argument[0]; Argument[1].Parameter[0]; value | -| 835 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[1]; ReturnValue; value | -| 836 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[2]; ReturnValue; value | -| 837 | Summary: lang:core; crate::iter::traits::iterator::Iterator::collect; Argument[self].Element; ReturnValue.Element; value | -| 838 | Summary: lang:core; crate::iter::traits::iterator::Iterator::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 839 | Summary: lang:core; crate::iter::traits::iterator::Iterator::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 840 | Summary: lang:core; crate::iter::traits::iterator::Iterator::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 841 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 842 | Summary: lang:core; crate::mem::copy; Argument[0].Reference; ReturnValue; value | -| 843 | Summary: lang:core; crate::mem::replace; Argument[0].Reference; ReturnValue; value | -| 844 | Summary: lang:core; crate::mem::replace; Argument[1]; Argument[0].Reference; value | -| 845 | Summary: lang:core; crate::mem::take; Argument[0].Reference; ReturnValue; value | -| 846 | Summary: lang:core; crate::num::flt2dec::strategy::dragon::mul_pow10; Argument[0]; ReturnValue; value | -| 847 | Summary: lang:core; crate::num::flt2dec::to_exact_exp_str; Argument[5].Element; Argument[0].Parameter[1].Reference; value | -| 848 | Summary: lang:core; crate::num::flt2dec::to_exact_fixed_str; Argument[4].Element; Argument[0].Parameter[1].Reference; value | -| 849 | Summary: lang:core; crate::num::flt2dec::to_shortest_exp_str; Argument[5]; Argument[0].Parameter[1]; value | -| 850 | Summary: lang:core; crate::num::flt2dec::to_shortest_str; Argument[4]; Argument[0].Parameter[1]; value | -| 851 | Summary: lang:core; crate::panic::abort_unwind; Argument[0].ReturnValue; ReturnValue; value | -| 852 | Summary: lang:core; crate::ptr::from_mut; Argument[0]; ReturnValue; value | -| 853 | Summary: lang:core; crate::ptr::from_ref; Argument[0]; ReturnValue; value | -| 854 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | -| 855 | Summary: lang:core; crate::ptr::read_unaligned; Argument[0].Reference; ReturnValue; value | -| 856 | Summary: lang:core; crate::ptr::read_volatile; Argument[0].Reference; ReturnValue; value | -| 857 | Summary: lang:core; crate::ptr::replace; Argument[0].Reference; ReturnValue; value | -| 858 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | -| 859 | Summary: lang:core; crate::ptr::write_unaligned; Argument[1]; Argument[0].Reference; value | -| 860 | Summary: lang:core; crate::ptr::write_volatile; Argument[1]; Argument[0].Reference; value | -| 861 | Summary: lang:core; crate::slice::sort::shared::find_existing_run; Argument[1].ReturnValue; ReturnValue.Field[1]; value | -| 862 | Summary: lang:core; crate::slice::sort::shared::smallsort::sort4_stable; Argument[0].Reference; Argument[2].Parameter[1].Reference; value | -| 863 | Summary: lang:core; crate::str::validations::next_code_point; Argument[0].Element; ReturnValue; value | -| 864 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_lower; Argument[0]; ReturnValue.Element; value | -| 865 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_upper; Argument[0]; ReturnValue.Element; value | -| 866 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 867 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 868 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 869 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; ReturnValue.Reference; value | -| 870 | Summary: lang:proc_macro; <&str as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 871 | Summary: lang:proc_macro; <&str as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 872 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 873 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 874 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 875 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 876 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 877 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 878 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 879 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 880 | Summary: lang:proc_macro; ::into_token_stream; Argument[self]; ReturnValue; value | -| 881 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 882 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 883 | Summary: lang:proc_macro; ::take; Argument[self].Reference; ReturnValue; value | -| 884 | Summary: lang:proc_macro; ::clone; Argument[self].Reference; ReturnValue; value | -| 885 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 886 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 887 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 888 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 889 | Summary: lang:proc_macro; ::next; Argument[self].Field[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 890 | Summary: lang:proc_macro; ::error; Argument[self]; ReturnValue; value | -| 891 | Summary: lang:proc_macro; ::help; Argument[self]; ReturnValue; value | -| 892 | Summary: lang:proc_macro; ::note; Argument[self]; ReturnValue; value | -| 893 | Summary: lang:proc_macro; ::span_error; Argument[self]; ReturnValue; value | -| 894 | Summary: lang:proc_macro; ::span_help; Argument[self]; ReturnValue; value | -| 895 | Summary: lang:proc_macro; ::span_note; Argument[self]; ReturnValue; value | -| 896 | Summary: lang:proc_macro; ::span_warning; Argument[self]; ReturnValue; value | -| 897 | Summary: lang:proc_macro; ::warning; Argument[self]; ReturnValue; value | -| 898 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 899 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 900 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 901 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 902 | Summary: lang:proc_macro; ::into_spans; Argument[self]; ReturnValue; value | -| 903 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 904 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 905 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 906 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 907 | Summary: lang:proc_macro; ::decode; Argument[0].Element; ReturnValue; value | -| 908 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 909 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 910 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 911 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1].ReturnValue; ReturnValue; value | -| 912 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1]; Argument[1].Parameter[0]; value | -| 913 | Summary: lang:proc_macro; crate::bridge::client::state::with; Argument[0].ReturnValue; ReturnValue; value | -| 914 | Summary: lang:std; <&[u8] as crate::io::BufRead>::consume; Argument[self].Element; Argument[self].Reference.Reference; value | -| 915 | Summary: lang:std; <&[u8] as crate::io::BufRead>::fill_buf; Argument[self].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 916 | Summary: lang:std; <&[u8] as crate::io::Read>::read_buf_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 917 | Summary: lang:std; <&[u8] as crate::io::Read>::read_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 918 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_end; Argument[self].Element; Argument[self].Reference.Reference; value | -| 919 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_string; Argument[self].Element; Argument[self].Reference.Reference; value | -| 920 | Summary: lang:std; <&[u8] as crate::io::copy::BufferedReaderSpec>::copy_to; Argument[self].Element; Argument[self].Reference.Reference; value | -| 921 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 922 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 923 | Summary: lang:std; ::pretty; Argument[self]; ReturnValue; value | -| 924 | Summary: lang:std; ::show_backtrace; Argument[self]; ReturnValue; value | -| 925 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 926 | Summary: lang:std; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 927 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 928 | Summary: lang:std; ::deref; Argument[self].Element; ReturnValue.Reference; value | -| 929 | Summary: lang:std; ::deref_mut; Argument[self].Element; ReturnValue.Reference; value | -| 930 | Summary: lang:std; ::as_os_str; Argument[self]; ReturnValue; value | -| 931 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 932 | Summary: lang:std; ::recursive; Argument[self]; ReturnValue; value | -| 933 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 934 | Summary: lang:std; ::set_created; Argument[self]; ReturnValue; value | -| 935 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 936 | Summary: lang:std; ::set_accessed; Argument[self]; ReturnValue; value | -| 937 | Summary: lang:std; ::set_modified; Argument[self]; ReturnValue; value | -| 938 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 939 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 940 | Summary: lang:std; ::custom_flags; Argument[self]; ReturnValue; value | -| 941 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 942 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 943 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 944 | Summary: lang:std; ::append; Argument[self]; ReturnValue; value | -| 945 | Summary: lang:std; ::create; Argument[self]; ReturnValue; value | -| 946 | Summary: lang:std; ::create_new; Argument[self]; ReturnValue; value | -| 947 | Summary: lang:std; ::read; Argument[self]; ReturnValue; value | -| 948 | Summary: lang:std; ::truncate; Argument[self]; ReturnValue; value | -| 949 | Summary: lang:std; ::write; Argument[self]; ReturnValue; value | -| 950 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 951 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 952 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 953 | Summary: lang:std; ::error; Argument[self].Field[1]; ReturnValue.Reference; value | -| 954 | Summary: lang:std; ::into_error; Argument[self].Field[1]; ReturnValue; value | -| 955 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 956 | Summary: lang:std; ::into_parts; Argument[self].Field[0]; ReturnValue.Field[1]; value | -| 957 | Summary: lang:std; ::into_parts; Argument[self].Field[1]; ReturnValue.Field[0]; value | -| 958 | Summary: lang:std; ::from; Argument[0].Field[1]; ReturnValue; value | -| 959 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 960 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 961 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 962 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 963 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 964 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 965 | Summary: lang:std; ::as_fd; Argument[self].Reference; ReturnValue; value | -| 966 | Summary: lang:std; ::new; Argument[0].ReturnValue; ReturnValue; value | -| 967 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 968 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 969 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 970 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 971 | Summary: lang:std; ::as_path; Argument[self]; ReturnValue; value | -| 972 | Summary: lang:std; ::arg0; Argument[self]; ReturnValue; value | -| 973 | Summary: lang:std; ::gid; Argument[self]; ReturnValue; value | -| 974 | Summary: lang:std; ::groups; Argument[self]; ReturnValue; value | -| 975 | Summary: lang:std; ::pre_exec; Argument[self]; ReturnValue; value | -| 976 | Summary: lang:std; ::process_group; Argument[self]; ReturnValue; value | -| 977 | Summary: lang:std; ::uid; Argument[self]; ReturnValue; value | -| 978 | Summary: lang:std; ::arg; Argument[self]; ReturnValue; value | -| 979 | Summary: lang:std; ::args; Argument[self]; ReturnValue; value | -| 980 | Summary: lang:std; ::current_dir; Argument[self]; ReturnValue; value | -| 981 | Summary: lang:std; ::env; Argument[self]; ReturnValue; value | -| 982 | Summary: lang:std; ::env_clear; Argument[self]; ReturnValue; value | -| 983 | Summary: lang:std; ::env_remove; Argument[self]; ReturnValue; value | -| 984 | Summary: lang:std; ::envs; Argument[self]; ReturnValue; value | -| 985 | Summary: lang:std; ::stderr; Argument[self]; ReturnValue; value | -| 986 | Summary: lang:std; ::stdin; Argument[self]; ReturnValue; value | -| 987 | Summary: lang:std; ::stdout; Argument[self]; ReturnValue; value | -| 988 | Summary: lang:std; ::report; Argument[self]; ReturnValue; value | -| 989 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 990 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 991 | Summary: lang:std; ::is_leader; Argument[self].Field[0]; ReturnValue; value | -| 992 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 993 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 994 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 995 | Summary: lang:std; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 996 | Summary: lang:std; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 997 | Summary: lang:std; ::wait; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 998 | Summary: lang:std; ::wait_timeout; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 999 | Summary: lang:std; ::wait_timeout_ms; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1000 | Summary: lang:std; ::wait_timeout_while; Argument[0].Reference; Argument[2].Parameter[0].Reference; value | -| 1001 | Summary: lang:std; ::wait_timeout_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1002 | Summary: lang:std; ::wait_while; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 1003 | Summary: lang:std; ::wait_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1004 | Summary: lang:std; ::timed_out; Argument[self].Field[0]; ReturnValue; value | -| 1005 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1006 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1007 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1008 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1009 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1010 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1011 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1012 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1013 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1014 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1015 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1016 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1017 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1018 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1019 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1020 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1021 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1022 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1023 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1024 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1025 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1026 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1027 | Summary: lang:std; ::as_file_desc; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1028 | Summary: lang:std; ::into_raw; Argument[self].Field[0]; ReturnValue; value | -| 1029 | Summary: lang:std; ::index; Argument[self]; ReturnValue; value | -| 1030 | Summary: lang:std; ::into_string; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1031 | Summary: lang:std; ::name; Argument[self]; ReturnValue; value | -| 1032 | Summary: lang:std; ::no_hooks; Argument[self]; ReturnValue; value | -| 1033 | Summary: lang:std; ::stack_size; Argument[self]; ReturnValue; value | -| 1034 | Summary: lang:std; ::as_u64; Argument[self].Field[0]; ReturnValue; value | -| 1035 | Summary: lang:std; ::try_with; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1036 | Summary: lang:std; ::with; Argument[0].ReturnValue; ReturnValue; value | -| 1037 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1038 | Summary: lang:std; ::duration; Argument[self].Field[0]; ReturnValue; value | -| 1039 | Summary: lang:std; ::as_raw_fd; Argument[self].Reference; ReturnValue; value | -| 1040 | Summary: lang:std; ::from_raw_fd; Argument[0]; ReturnValue; value | -| 1041 | Summary: lang:std; ::into_raw_fd; Argument[self]; ReturnValue; value | -| 1042 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::as_str; Argument[self].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 1043 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::get; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1044 | Summary: lang:std; <{491}::RewrapBox as crate::panic::PanicPayload>::get; Argument[self].Field[0].Reference; ReturnValue.Reference; value | -| 1045 | Summary: lang:std; crate::backtrace::helper::lazy_resolve; Argument[0]; ReturnValue; value | -| 1046 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1047 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue; ReturnValue; value | -| 1048 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1049 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1050 | Summary: lang:std; crate::io::default_read_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1051 | Summary: lang:std; crate::io::default_write_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1052 | Summary: lang:std; crate::sys::backtrace::__rust_begin_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1053 | Summary: lang:std; crate::sys::backtrace::__rust_end_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1054 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_path_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1055 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1056 | Summary: lang:std; crate::sys::pal::unix::cvt; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1057 | Summary: lang:std; crate::sys_common::ignore_notfound; Argument[0].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1058 | Summary: lang:std; crate::thread::current::set_current; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1059 | Summary: lang:std; crate::thread::current::try_with_current; Argument[0].ReturnValue; ReturnValue; value | -| 1060 | Summary: lang:std; crate::thread::with_current_name; Argument[0].ReturnValue; ReturnValue; value | -| 1061 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value | storeStep | file://:0:0:0:0 | [summary] to write: Argument[0].Field[crate::option::Option::Some(0)] in lang:core::_::::zip_with | Some | file://:0:0:0:0 | [post] [summary param] 0 in lang:core::_::::zip_with | | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0].Reference in lang:alloc::_::::retain | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0] in lang:alloc::_::::retain | diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql index 6d81896d229..396a4b7caa8 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql @@ -6,8 +6,6 @@ private predicate provenance(string model) { RustDataFlow::simpleLocalFlowStep(_ private module Tm = TranslateModels; -query predicate models = Tm::models/2; - query predicate localStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { // Local flow steps that don't originate from a flow summary. RustDataFlow::simpleLocalFlowStep(nodeFrom, nodeTo, "") From 32f191cd9d0f48d61f605933c5a6de9dca5babf9 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 13:21:59 -0700 Subject: [PATCH 265/372] Docs: Remove public preview notice for Actions support Ready for GA. --- docs/codeql/reusables/supported-versions-compilers.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index 7d5a9bdb34a..bbefaf79cce 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, .NET 9","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``" - GitHub Actions [12]_,"Not applicable",Not applicable,"``.github/workflows/*.yml``, ``.github/workflows/*.yaml``, ``**/action.yml``, ``**/action.yaml``" + GitHub Actions,"Not applicable",Not applicable,"``.github/workflows/*.yml``, ``.github/workflows/*.yaml``, ``**/action.yml``, ``**/action.yaml``" Go (aka Golang), "Go up to 1.24", "Go 1.11 or more recent", ``.go`` Java,"Java 7 to 24 [5]_","javac (OpenJDK and Oracle JDK), @@ -41,4 +41,3 @@ .. [9] Requires glibc 2.17. .. [10] Support for the analysis of Swift requires macOS. .. [11] TypeScript analysis is performed by running the JavaScript extractor with TypeScript enabled. This is the default. - .. [12] Support for GitHub Actions is in public preview. From eeb938a76de013fcacda6ccf0708f72e1c911125 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 13:25:54 -0700 Subject: [PATCH 266/372] Docs: Minor fixes for Actions query help --- actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md | 2 +- actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md b/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md index cc35402b804..5d2c6115097 100644 --- a/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md +++ b/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.md @@ -109,7 +109,7 @@ An attacker could craft a malicious artifact that writes dangerous environment v ### Exploitation -An attacker is be able to run arbitrary code by injecting environment variables such as `LD_PRELOAD`, `BASH_ENV`, etc. +An attacker would be able to run arbitrary code by injecting environment variables such as `LD_PRELOAD`, `BASH_ENV`, etc. ## References diff --git a/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md b/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md index 6c681856a7b..c33b89fdcec 100644 --- a/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md +++ b/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md @@ -2,11 +2,11 @@ ## Description -Secrets derived from other secrets are not know to the workflow runner and therefore not masked unless explicitly registered. +Secrets derived from other secrets are not known to the workflow runner, and therefore are not masked unless explicitly registered. ## Recommendations -Avoid defining non-plain secrets. For example, do not define a new secret containing a JSON object and then read properties out of it from the workflow since these read values will not be masked by the workflow runner. +Avoid defining non-plain secrets. For example, do not define a new secret containing a JSON object and then read properties out of it from the workflow, since these read values will not be masked by the workflow runner. ## Examples From 93fbb9fe6155de2d0ca44448ae930f3b3597b5d5 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 14:39:31 -0700 Subject: [PATCH 267/372] Actions: Update description of missing permissions query --- actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql b/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql index aedf65bc564..a8bd8a5f93d 100644 --- a/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql +++ b/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql @@ -1,6 +1,6 @@ /** * @name Workflow does not contain permissions - * @description Workflows should contain permissions to provide a clear understanding has permissions to run the workflow. + * @description Workflows should contain explicit permissions to restrict the scope of the default GITHUB_TOKEN. * @kind problem * @security-severity 5.0 * @problem.severity warning From 6eb060f16a2a16075ffa50bc28d16b8da553a394 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 14:41:08 -0700 Subject: [PATCH 268/372] Actions: Add security-severity to excessive secrets exposure query Same value as missing actions permissions, both providing warnings to follow the principle of least privilege within a workflow. --- actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql b/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql index a83685207bc..1a01033c567 100644 --- a/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql +++ b/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql @@ -3,6 +3,7 @@ * @description All organization and repository secrets are passed to the workflow runner. * @kind problem * @precision high + * @security-severity 5.0 * @problem.severity warning * @id actions/excessive-secrets-exposure * @tags actions From f9103f8ddc3b09a80ec8a5dbffaee3f54f38e493 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Mon, 14 Apr 2025 14:48:33 -0700 Subject: [PATCH 269/372] Actions: Add change note for missing severity --- ...025-04-14-excessive-secrets-exposure-security-severity.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md diff --git a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md new file mode 100644 index 00000000000..9beaabecbe6 --- /dev/null +++ b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md @@ -0,0 +1,5 @@ +--- +category: fix +--- +* Assigned a `security-severity` to the query `actions + excessive-secrets-exposure`. \ No newline at end of file From 0b10d34cae0ca325a93e5c90b25186d4779754a4 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 10:53:40 +0200 Subject: [PATCH 270/372] C#: Add change note. --- .../2025-04-15-missing-function-level-access-control.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md diff --git a/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md b/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md new file mode 100644 index 00000000000..dbea56dbeb8 --- /dev/null +++ b/csharp/ql/src/change-notes/2025-04-15-missing-function-level-access-control.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Improved detection of authorization checks in the `cs/web/missing-function-level-access-control` query. The query now recognizes authorization attributes inherited from base classes and interfaces. From 033bade0ab815ca92c71cccec6ec7b9a921bb59f Mon Sep 17 00:00:00 2001 From: idrissrio Date: Mon, 14 Apr 2025 09:14:36 +0200 Subject: [PATCH 271/372] C++: add isVLA() to ArrayType to identify variable-length arrays --- cpp/ql/lib/semmle/code/cpp/Type.qll | 5 +++++ cpp/ql/lib/semmlecode.cpp.dbscheme | 2 ++ 2 files changed, 7 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/Type.qll b/cpp/ql/lib/semmle/code/cpp/Type.qll index 9c33dbec1b5..fbc894a7e07 100644 --- a/cpp/ql/lib/semmle/code/cpp/Type.qll +++ b/cpp/ql/lib/semmle/code/cpp/Type.qll @@ -1369,6 +1369,11 @@ class ArrayType extends DerivedType { override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() } // No such thing as a const array type override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConst() } + + /** + * Holds if this array is a variable-length array (VLA). + */ + predicate isVla() { type_is_vla(underlyingElement(this)) } } /** diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index e594389175c..0f0a390468a 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -2178,6 +2178,8 @@ variable_vla( int decl: @stmt_vla_decl ref ); +type_is_vla(unique int type_id: @derivedtype ref) + if_initialization( unique int if_stmt: @stmt_if ref, int init_id: @stmt ref From 15ba9e0c66583233647868ff44abc525afcf0f67 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Mon, 14 Apr 2025 09:20:15 +0200 Subject: [PATCH 272/372] C++: add change note for VLAs --- cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md diff --git a/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md b/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md new file mode 100644 index 00000000000..e7e6cfb849e --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-14-variable-length-arrays.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs). \ No newline at end of file From ae07272c44a8d226f1278ad5271c04f17b5efab7 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Tue, 15 Apr 2025 11:08:58 +0200 Subject: [PATCH 273/372] C++: add upgrade and downgrade scripts --- .../old.dbscheme | 2446 +++++++++++++++++ .../semmlecode.cpp.dbscheme | 2444 ++++++++++++++++ .../upgrade.properties | 3 + .../old.dbscheme | 2444 ++++++++++++++++ .../semmlecode.cpp.dbscheme | 2446 +++++++++++++++++ .../upgrade.properties | 2 + 6 files changed, 9785 insertions(+) create mode 100644 cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme create mode 100644 cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme create mode 100644 cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties create mode 100644 cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme create mode 100644 cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme create mode 100644 cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties diff --git a/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme new file mode 100644 index 00000000000..0f0a390468a --- /dev/null +++ b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme new file mode 100644 index 00000000000..e594389175c --- /dev/null +++ b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme @@ -0,0 +1,2444 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties new file mode 100644 index 00000000000..92a9acc1327 --- /dev/null +++ b/cpp/downgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties @@ -0,0 +1,3 @@ +description: Add a new predicate `isVla()` to the `ArrayType` class +compatibility: full +type_is_vla.rel: delete \ No newline at end of file diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme new file mode 100644 index 00000000000..e594389175c --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/old.dbscheme @@ -0,0 +1,2444 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme new file mode 100644 index 00000000000..0f0a390468a --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/semmlecode.cpp.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties new file mode 100644 index 00000000000..f6105ce157b --- /dev/null +++ b/cpp/ql/lib/upgrades/e594389175c098d7225683d0fd8cefcc47d84bc1/upgrade.properties @@ -0,0 +1,2 @@ +description: Add a new predicate `isVla()` to the `ArrayType` class +compatibility: backwards \ No newline at end of file From bfe9cdfed5220d337d79b024851e9c473e73c992 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 14 Apr 2025 19:53:01 +0100 Subject: [PATCH 274/372] Rust: Add model for str.trim and as_bytes. --- .../rust/frameworks/stdlib/lang-core.model.yml | 2 ++ .../CWE-328/WeakSensitiveDataHashing.expected | 14 ++++++++++++++ rust/ql/test/query-tests/security/CWE-328/test.rs | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index 69c5a1f3ba4..d0e77aec0ee 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -26,6 +26,8 @@ extensions: - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] + - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all extensible: sourceModel diff --git a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected index 69e03bcca1c..fed05470397 100644 --- a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected +++ b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected @@ -12,6 +12,8 @@ | test.rs:62:9:62:24 | ...::digest | test.rs:62:26:62:37 | password_arr | test.rs:62:9:62:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:62:26:62:37 | password_arr | Sensitive data (password) | | test.rs:64:9:64:24 | ...::digest | test.rs:64:26:64:37 | password_vec | test.rs:64:9:64:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:64:26:64:37 | password_vec | Sensitive data (password) | | test.rs:77:9:77:33 | ...::new_with_prefix | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:77:35:77:42 | password | Sensitive data (password) | +| test.rs:81:9:81:24 | ...::digest | test.rs:81:26:81:33 | password | test.rs:81:9:81:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:81:26:81:33 | password | Sensitive data (password) | +| test.rs:83:9:83:24 | ...::digest | test.rs:83:26:83:33 | password | test.rs:83:9:83:24 | ...::digest | $@ is used in a hashing algorithm (MD5) that is insecure for password hashing, since it is not a computationally expensive hash function. | test.rs:83:26:83:33 | password | Sensitive data (password) | edges | test.rs:14:26:14:39 | credit_card_no | test.rs:14:9:14:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | | test.rs:15:26:15:33 | password | test.rs:15:9:15:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | @@ -26,10 +28,16 @@ edges | test.rs:62:26:62:37 | password_arr | test.rs:62:9:62:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | | test.rs:64:26:64:37 | password_vec | test.rs:64:9:64:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | provenance | MaD:2 Sink:MaD:2 | +| test.rs:81:26:81:33 | password | test.rs:81:26:81:40 | password.trim() [&ref] | provenance | MaD:5 | +| test.rs:81:26:81:40 | password.trim() [&ref] | test.rs:81:9:81:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | +| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() [&ref] | provenance | MaD:4 | +| test.rs:83:26:83:44 | password.as_bytes() [&ref] | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | models | 1 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::digest; hasher-input; Argument[0] | | 2 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::new_with_prefix; hasher-input; Argument[0] | | 3 | Sink: repo:https://github.com/stainless-steel/md5:md5; crate::compute; hasher-input; Argument[0] | +| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue.Reference; taint | +| 5 | Summary: lang:core; ::trim; Argument[self]; ReturnValue.Reference; taint | nodes | test.rs:14:9:14:24 | ...::digest | semmle.label | ...::digest | | test.rs:14:26:14:39 | credit_card_no | semmle.label | credit_card_no | @@ -57,4 +65,10 @@ nodes | test.rs:64:26:64:37 | password_vec | semmle.label | password_vec | | test.rs:77:9:77:33 | ...::new_with_prefix | semmle.label | ...::new_with_prefix | | test.rs:77:35:77:42 | password | semmle.label | password | +| test.rs:81:9:81:24 | ...::digest | semmle.label | ...::digest | +| test.rs:81:26:81:33 | password | semmle.label | password | +| test.rs:81:26:81:40 | password.trim() [&ref] | semmle.label | password.trim() [&ref] | +| test.rs:83:9:83:24 | ...::digest | semmle.label | ...::digest | +| test.rs:83:26:83:33 | password | semmle.label | password | +| test.rs:83:26:83:44 | password.as_bytes() [&ref] | semmle.label | password.as_bytes() [&ref] | subpaths diff --git a/rust/ql/test/query-tests/security/CWE-328/test.rs b/rust/ql/test/query-tests/security/CWE-328/test.rs index bb7316b3dce..56b6fe7821d 100644 --- a/rust/ql/test/query-tests/security/CWE-328/test.rs +++ b/rust/ql/test/query-tests/security/CWE-328/test.rs @@ -78,9 +78,9 @@ fn test_hash_code_patterns( // hash transformed data _ = md5::Md5::digest(harmless.trim()); - _ = md5::Md5::digest(password.trim()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password.trim()); // $ Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(harmless.as_bytes()); - _ = md5::Md5::digest(password.as_bytes()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] + _ = md5::Md5::digest(password.as_bytes()); // $ Alert[rust/weak-sensitive-data-hashing] _ = md5::Md5::digest(std::str::from_utf8(harmless_arr).unwrap()); _ = md5::Md5::digest(std::str::from_utf8(password_arr).unwrap()); // $ MISSING: Alert[rust/weak-sensitive-data-hashing] } From 9170993cf03b4aafdae85c9ee8c86694725ad1ed Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 15 Apr 2025 12:46:31 +0200 Subject: [PATCH 275/372] C#: Adjust comments and remove compilation warnings. --- csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs index 37a8feee186..32c5cdeca28 100644 --- a/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs +++ b/csharp/autobuilder/Semmle.Autobuild.Shared/Project.cs @@ -34,9 +34,9 @@ namespace Semmle.Autobuild.Shared /// /// According to https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022#reference-a-project-sdk /// there are three ways to reference a project SDK: - /// 1. As an attribute on the . - /// 2. As a top level element of . - /// 3. As an attribute on an element. + /// 1. As an attribute on the <Project/>. + /// 2. As a top level element of <Project>. + /// 3. As an attribute on an <Import> element. /// /// Returns true, if the Sdk attribute is used, otherwise false. /// From c06f340bd8972a995752880abaa9f6ef9762e8f0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:42:22 +0100 Subject: [PATCH 276/372] Rust: Make str / String models consistent. --- .../codeql/rust/frameworks/stdlib/lang-alloc.model.yml | 2 ++ .../lib/codeql/rust/frameworks/stdlib/lang-core.model.yml | 4 +++- .../security/CWE-328/WeakSensitiveDataHashing.expected | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml index fba9ae5fea3..549a7afdad3 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -9,6 +9,8 @@ extensions: - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:alloc", "<_ as crate::string::ToString>::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:alloc", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] + - ["lang:alloc", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all extensible: sourceModel diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index d0e77aec0ee..fe34df88551 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -25,9 +25,11 @@ extensions: - ["lang:core", "crate::ptr::write_unaligned", "Argument[1]", "Argument[0].Reference", "value", "manual"] - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str + - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] - addsTo: pack: codeql/rust-all extensible: sourceModel diff --git a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected index fed05470397..d2ea36bbebf 100644 --- a/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected +++ b/rust/ql/test/query-tests/security/CWE-328/WeakSensitiveDataHashing.expected @@ -30,13 +30,13 @@ edges | test.rs:77:35:77:42 | password | test.rs:77:9:77:33 | ...::new_with_prefix | provenance | MaD:2 Sink:MaD:2 | | test.rs:81:26:81:33 | password | test.rs:81:26:81:40 | password.trim() [&ref] | provenance | MaD:5 | | test.rs:81:26:81:40 | password.trim() [&ref] | test.rs:81:9:81:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | -| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() [&ref] | provenance | MaD:4 | -| test.rs:83:26:83:44 | password.as_bytes() [&ref] | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | +| test.rs:83:26:83:33 | password | test.rs:83:26:83:44 | password.as_bytes() | provenance | MaD:4 | +| test.rs:83:26:83:44 | password.as_bytes() | test.rs:83:9:83:24 | ...::digest | provenance | MaD:1 Sink:MaD:1 | models | 1 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::digest; hasher-input; Argument[0] | | 2 | Sink: repo:https://github.com/RustCrypto/traits:digest; <_ as crate::digest::Digest>::new_with_prefix; hasher-input; Argument[0] | | 3 | Sink: repo:https://github.com/stainless-steel/md5:md5; crate::compute; hasher-input; Argument[0] | -| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue.Reference; taint | +| 4 | Summary: lang:core; ::as_bytes; Argument[self]; ReturnValue; taint | | 5 | Summary: lang:core; ::trim; Argument[self]; ReturnValue.Reference; taint | nodes | test.rs:14:9:14:24 | ...::digest | semmle.label | ...::digest | @@ -70,5 +70,5 @@ nodes | test.rs:81:26:81:40 | password.trim() [&ref] | semmle.label | password.trim() [&ref] | | test.rs:83:9:83:24 | ...::digest | semmle.label | ...::digest | | test.rs:83:26:83:33 | password | semmle.label | password | -| test.rs:83:26:83:44 | password.as_bytes() [&ref] | semmle.label | password.as_bytes() [&ref] | +| test.rs:83:26:83:44 | password.as_bytes() | semmle.label | password.as_bytes() | subpaths From 40a5db6736f3f9212414e2d3786272b800f6a245 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:52:23 +0100 Subject: [PATCH 277/372] Rust: Other tests affected. --- .../ql/test/library-tests/dataflow/local/DataFlowStep.expected | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index fcd4d278610..cf138a824d5 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -2162,6 +2162,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Err(0)].Reference in lang:core::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Err(0)] in lang:core::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::search_tree_for_bifurcation | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::search_tree_for_bifurcation | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::from_str | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::from_str | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:alloc::_::::parse | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::parse | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::try_insert | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::try_insert | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::ok_or | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::ok_or | | file://:0:0:0:0 | [summary] to write: ReturnValue.Field[crate::result::Result::Ok(0)] in lang:core::_::::ok_or_else | Ok | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::ok_or_else | @@ -2231,6 +2232,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow_mut | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow_mut | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::trim | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::trim | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::as_ref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::as_ref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:alloc::_::::borrow | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:alloc::_::::borrow | @@ -2254,6 +2256,7 @@ storeStep | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::insert | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::insert | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::deref | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::deref | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::deref_mut | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::deref_mut | +| file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::trim | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::trim | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::index | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::index | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:core::_::::index_mut | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:core::_::::index_mut | | file://:0:0:0:0 | [summary] to write: ReturnValue.Reference in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | &ref | file://:0:0:0:0 | [summary] to write: ReturnValue in lang:proc_macro::_::<&[u8] as crate::bridge::rpc::DecodeMut>::decode | From 202040fad44e0b722bbe36a156dceeb1a606a3bb Mon Sep 17 00:00:00 2001 From: idrissrio Date: Tue, 15 Apr 2025 13:36:24 +0200 Subject: [PATCH 278/372] C++: update stats file --- cpp/ql/lib/semmlecode.cpp.dbscheme.stats | 2528 +++++++++++----------- 1 file changed, 1272 insertions(+), 1256 deletions(-) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 5f0f1543837..585e8f31e0a 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -18,15 +18,15 @@ @location_default - 31650404 + 31650363 @location_stmt - 5202910 + 5202903 @location_expr - 17958942 + 17958919 @diagnostic @@ -42,35 +42,35 @@ @macro_expansion - 40298943 + 40299208 @other_macro_reference - 314182 + 314184 @function - 3356850 + 3356874 @fun_decl - 3388814 + 3388838 @var_decl - 6734234 + 6734225 @type_decl - 1890757 + 1890777 @namespace_decl - 425651 + 425650 @using_declaration - 333243 + 333244 @using_directive @@ -86,15 +86,15 @@ @parameter - 4798833 + 4798867 @membervariable - 1441780 + 1441778 @globalvariable - 425546 + 425545 @localvariable @@ -334,7 +334,7 @@ @type_with_specifiers - 725883 + 725882 @array @@ -342,11 +342,11 @@ @routineptr - 862680 + 862686 @reference - 1024847 + 1024846 @gnu_vector @@ -370,15 +370,15 @@ @usertype - 4992117 + 4987434 @mangledname - 5808009 + 5807194 @type_mention - 5507865 + 5507858 @concept_template @@ -386,7 +386,7 @@ @routinetype - 762063 + 762068 @ptrtomember @@ -394,7 +394,7 @@ @specifier - 7131 + 8341 @gnuattribute @@ -402,11 +402,11 @@ @stdattribute - 346325 + 346324 @declspec - 326925 + 326924 @msattribute @@ -422,7 +422,7 @@ @attribute_arg_constant_expr - 89599 + 89600 @attribute_arg_expr @@ -442,15 +442,15 @@ @derivation - 599880 + 599885 @frienddecl - 883302 + 883308 @comment - 11290145 + 11290131 @namespace @@ -462,15 +462,15 @@ @namequalifier - 3258064 + 3258067 @value - 14099266 + 14099248 @initialiser - 2336673 + 2336670 @address_of @@ -478,19 +478,19 @@ @indirect - 399728 + 399727 @array_to_pointer - 1951449 + 1951447 @parexpr - 4895384 + 4895377 @arithnegexpr - 585843 + 585842 @unaryplusexpr @@ -506,7 +506,7 @@ @postincrexpr - 84817 + 84816 @postdecrexpr @@ -514,7 +514,7 @@ @preincrexpr - 96451 + 96450 @predecrexpr @@ -522,7 +522,7 @@ @conditionalexpr - 896445 + 896444 @addexpr @@ -530,7 +530,7 @@ @subexpr - 466249 + 466248 @mulexpr @@ -538,7 +538,7 @@ @divexpr - 60351 + 60352 @remexpr @@ -546,7 +546,7 @@ @paddexpr - 118344 + 118343 @psubexpr @@ -558,7 +558,7 @@ @lshiftexpr - 610849 + 610848 @rshiftexpr @@ -566,7 +566,7 @@ @andexpr - 536666 + 536665 @orexpr @@ -578,15 +578,15 @@ @eqexpr - 641622 + 641621 @neexpr - 411385 + 411384 @gtexpr - 110847 + 110846 @ltexpr @@ -594,7 +594,7 @@ @geexpr - 80994 + 80993 @leexpr @@ -602,7 +602,7 @@ @assignexpr - 1277660 + 1277658 @assignaddexpr @@ -658,7 +658,7 @@ @orlogicalexpr - 1203319 + 1203317 @commaexpr @@ -666,11 +666,11 @@ @subscriptexpr - 433959 + 433958 @callexpr - 302410 + 302370 @vastartexpr @@ -690,15 +690,15 @@ @varaccess - 8226118 + 8226107 @runtime_sizeof - 397856 + 397855 @runtime_alignof - 61478 + 61479 @expr_stmt @@ -706,11 +706,11 @@ @routineexpr - 6144464 + 6144489 @type_operand - 1532455 + 1532453 @offsetofexpr @@ -718,11 +718,11 @@ @typescompexpr - 765413 + 765411 @literal - 6101418 + 6101411 @aggregateliteral @@ -730,11 +730,11 @@ @c_style_cast - 6024777 + 6024778 @temp_init - 1075849 + 1076139 @errorexpr @@ -742,11 +742,11 @@ @reference_to - 2194465 + 2194481 @ref_indirect - 2657383 + 2657402 @vacuous_destructor_call @@ -806,11 +806,11 @@ @thisaccess - 1525361 + 1525359 @new_expr - 58256 + 58257 @delete_expr @@ -818,19 +818,19 @@ @throw_expr - 26214 + 26159 @condition_decl - 438290 + 438294 @braced_init_list - 2334 + 2335 @type_id - 60404 + 60405 @sizeof_pack @@ -922,7 +922,7 @@ @uuidof - 27728 + 27727 @delete_array_expr @@ -938,7 +938,7 @@ @ctordirectinit - 142247 + 142248 @ctorvirtualinit @@ -946,7 +946,7 @@ @ctorfieldinit - 259362 + 259364 @ctordelegatinginit @@ -962,11 +962,11 @@ @dtorfielddestruct - 50222 + 50223 @static_cast - 335478 + 335479 @reinterpret_cast @@ -986,7 +986,7 @@ @param_ref - 177918 + 177993 @noopexpr @@ -1090,7 +1090,7 @@ @noexceptexpr - 30759 + 30772 @builtinshufflevector @@ -1262,7 +1262,7 @@ @reuseexpr - 907876 + 907883 @istriviallycopyassignable @@ -1382,11 +1382,11 @@ @stmt_expr - 2026088 + 2026085 @stmt_if - 987521 + 987520 @stmt_while @@ -1394,7 +1394,7 @@ @stmt_goto - 151172 + 151171 @stmt_label @@ -1402,11 +1402,11 @@ @stmt_return - 1515834 + 1515845 @stmt_block - 1897791 + 1897789 @stmt_end_test_while @@ -1418,11 +1418,11 @@ @stmt_switch_case - 896207 + 896214 @stmt_switch - 441450 + 441453 @stmt_asm @@ -1430,11 +1430,11 @@ @stmt_decl - 770893 + 770895 @stmt_empty - 460245 + 460249 @stmt_continue @@ -1442,11 +1442,11 @@ @stmt_break - 140999 + 140998 @stmt_try_block - 29027 + 28973 @stmt_microsoft_try @@ -1470,7 +1470,7 @@ @stmt_handler - 47521 + 47475 @stmt_constexpr_if @@ -1490,7 +1490,7 @@ @ppd_if - 511549 + 511548 @ppd_ifdef @@ -1498,7 +1498,7 @@ @ppd_ifndef - 154178 + 154177 @ppd_elif @@ -1506,19 +1506,19 @@ @ppd_else - 241109 + 241108 @ppd_endif - 846303 + 846302 @ppd_plain_include - 401967 + 408579 @ppd_define - 3130381 + 3130376 @ppd_undef @@ -1558,7 +1558,7 @@ @ppd_warning - 6 + 13 @link_target @@ -1640,7 +1640,7 @@ compilation_args - 1298224 + 1298229 id @@ -1985,7 +1985,7 @@ 2 3 - 16269 + 16270 3 @@ -2221,7 +2221,7 @@ seconds - 17489 + 17407 @@ -2267,7 +2267,7 @@ 2 3 - 203 + 149 3 @@ -2277,7 +2277,7 @@ 4 5 - 7667 + 7721 @@ -2323,8 +2323,8 @@ 12 - 1291 - 1292 + 1285 + 1286 13 @@ -2381,13 +2381,13 @@ 13 - 714 - 715 + 718 + 719 13 - 787 - 788 + 769 + 770 13 @@ -2404,27 +2404,27 @@ 1 2 - 10891 + 10837 2 3 - 3806 + 3617 3 4 - 1463 + 1368 4 - 662 - 1314 + 10 + 1327 - 689 - 690 - 13 + 10 + 694 + 257 @@ -2440,7 +2440,7 @@ 1 2 - 17489 + 17407 @@ -2461,12 +2461,12 @@ 2 3 - 3048 + 2980 3 - 5 - 27 + 4 + 13 @@ -2730,11 +2730,11 @@ cpu_seconds - 11921 + 12083 elapsed_seconds - 243 + 257 @@ -2780,17 +2780,17 @@ 1 2 - 9916 + 10241 2 3 - 1354 + 1246 3 - 42 - 650 + 35 + 596 @@ -2806,12 +2806,12 @@ 1 2 - 11054 + 11365 2 3 - 867 + 717 @@ -2827,66 +2827,61 @@ 1 2 - 40 + 67 2 3 - 27 - - - 5 - 6 13 - 7 - 8 + 3 + 4 13 - 9 - 10 - 27 + 6 + 7 + 13 - 10 - 11 - 13 + 11 + 12 + 54 20 21 - 27 - - - 24 - 25 13 - 46 - 47 + 31 + 32 13 - 128 - 129 + 43 + 44 13 - 275 - 276 + 127 + 128 13 - 306 - 307 + 265 + 266 13 - 331 - 332 + 321 + 322 + 13 + + + 330 + 331 13 @@ -2903,61 +2898,61 @@ 1 2 - 40 + 67 2 3 - 27 - - - 5 - 6 13 - 7 - 8 + 3 + 4 13 - 9 - 10 - 40 + 6 + 7 + 13 + + + 11 + 12 + 54 20 21 - 27 - - - 24 - 25 13 - 46 - 47 + 31 + 32 13 - 122 - 123 + 43 + 44 13 - 166 - 167 + 120 + 121 13 - 248 - 249 + 171 + 172 13 - 252 - 253 + 233 + 234 + 13 + + + 267 + 268 13 @@ -4730,11 +4725,11 @@ locations_default - 31650404 + 31650363 id - 31650404 + 31650363 container @@ -4742,7 +4737,7 @@ startLine - 7709299 + 7709289 startColumn @@ -4750,7 +4745,7 @@ endLine - 7708627 + 7708617 endColumn @@ -4768,7 +4763,7 @@ 1 2 - 31650404 + 31650363 @@ -4784,7 +4779,7 @@ 1 2 - 31650404 + 31650363 @@ -4800,7 +4795,7 @@ 1 2 - 31650404 + 31650363 @@ -4816,7 +4811,7 @@ 1 2 - 31650404 + 31650363 @@ -4832,7 +4827,7 @@ 1 2 - 31650404 + 31650363 @@ -5233,27 +5228,27 @@ 1 2 - 5187073 + 5187066 2 3 - 787640 + 787639 3 4 - 633853 + 633852 4 10 - 618380 + 618379 10 414 - 482352 + 482351 @@ -5269,17 +5264,17 @@ 1 2 - 5247619 + 5247612 2 3 - 1198817 + 1198816 3 5 - 636005 + 636004 5 @@ -5305,7 +5300,7 @@ 1 2 - 5929506 + 5929498 2 @@ -5315,7 +5310,7 @@ 3 5 - 581379 + 581378 5 @@ -5341,12 +5336,12 @@ 1 2 - 7561432 + 7558596 2 82 - 147867 + 150692 @@ -5362,17 +5357,17 @@ 1 2 - 5256096 + 5256089 2 3 - 764364 + 764363 3 4 - 626991 + 626990 4 @@ -5685,7 +5680,7 @@ 2521 - 56781 + 56782 807 @@ -5778,27 +5773,27 @@ 1 2 - 5183440 + 5183433 2 3 - 792888 + 792752 3 4 - 630623 + 630892 4 9 - 579630 + 579495 9 412 - 522044 + 522043 @@ -5814,27 +5809,27 @@ 1 2 - 5242910 + 5242903 2 3 - 1200970 + 1200968 3 5 - 638831 + 638830 5 54 - 579495 + 579629 54 312 - 46418 + 46284 @@ -5850,12 +5845,12 @@ 1 2 - 7548112 + 7545276 2 7 - 160515 + 163340 @@ -5871,22 +5866,22 @@ 1 2 - 5929640 + 5929632 2 3 - 579092 + 578956 3 5 - 581379 + 581513 5 42 - 578957 + 578956 42 @@ -5907,27 +5902,27 @@ 1 2 - 5253136 + 5253129 2 3 - 768938 + 768803 3 4 - 623761 + 624030 4 10 - 600619 + 600484 10 225 - 462170 + 462169 @@ -6257,11 +6252,11 @@ locations_stmt - 5202910 + 5202903 id - 5202910 + 5202903 container @@ -6269,7 +6264,7 @@ startLine - 272852 + 272851 startColumn @@ -6295,7 +6290,7 @@ 1 2 - 5202910 + 5202903 @@ -6311,7 +6306,7 @@ 1 2 - 5202910 + 5202903 @@ -6327,7 +6322,7 @@ 1 2 - 5202910 + 5202903 @@ -6343,7 +6338,7 @@ 1 2 - 5202910 + 5202903 @@ -6359,7 +6354,7 @@ 1 2 - 5202910 + 5202903 @@ -8249,11 +8244,11 @@ locations_expr - 17958942 + 17958919 id - 17958942 + 17958919 container @@ -8261,7 +8256,7 @@ startLine - 262020 + 262019 startColumn @@ -8269,7 +8264,7 @@ endLine - 261992 + 261991 endColumn @@ -8287,7 +8282,7 @@ 1 2 - 17958942 + 17958919 @@ -8303,7 +8298,7 @@ 1 2 - 17958942 + 17958919 @@ -8319,7 +8314,7 @@ 1 2 - 17958942 + 17958919 @@ -8335,7 +8330,7 @@ 1 2 - 17958942 + 17958919 @@ -8351,7 +8346,7 @@ 1 2 - 17958942 + 17958919 @@ -8995,7 +8990,7 @@ 3 4 - 37688 + 37687 4 @@ -9634,7 +9629,7 @@ 2 3 - 68220 + 68219 3 @@ -10176,11 +10171,11 @@ numlines - 860969 + 860968 element_id - 859623 + 859622 num_lines @@ -10206,7 +10201,7 @@ 1 2 - 858278 + 858277 2 @@ -10227,7 +10222,7 @@ 1 2 - 858278 + 858277 2 @@ -10248,7 +10243,7 @@ 1 2 - 859354 + 859353 2 @@ -11260,7 +11255,7 @@ containerparent - 99502 + 99503 parent @@ -11268,7 +11263,7 @@ child - 99502 + 99503 @@ -11333,7 +11328,7 @@ 1 2 - 99502 + 99503 @@ -11343,7 +11338,7 @@ fileannotations - 5387460 + 5387479 id @@ -11355,7 +11350,7 @@ name - 75307 + 75308 value @@ -11675,7 +11670,7 @@ 1 2 - 75307 + 75308 @@ -11797,7 +11792,7 @@ 51 58 - 3887 + 3888 58 @@ -11838,7 +11833,7 @@ 1 2 - 50665 + 50666 2 @@ -11919,7 +11914,7 @@ 113 145 - 3887 + 3888 145 @@ -11934,15 +11929,15 @@ inmacroexpansion - 149742415 + 149742219 id - 24596921 + 24596888 inv - 3698101 + 3698096 @@ -11956,32 +11951,32 @@ 1 3 - 2167550 + 2167547 3 5 - 1469288 + 1469286 5 6 - 1617557 + 1617555 6 7 - 6574000 + 6573991 7 8 - 8708728 + 8708717 8 9 - 3552858 + 3552853 9 @@ -12007,12 +12002,12 @@ 2 3 - 743635 + 743634 3 4 - 479645 + 479644 4 @@ -12022,7 +12017,7 @@ 7 8 - 282496 + 282495 8 @@ -12042,12 +12037,12 @@ 11 337 - 306935 + 306934 339 423 - 281412 + 281411 423 @@ -12062,15 +12057,15 @@ affectedbymacroexpansion - 48676789 + 48676725 id - 7035609 + 7035600 inv - 3798618 + 3798613 @@ -12084,12 +12079,12 @@ 1 2 - 3842147 + 3842142 2 3 - 764600 + 764599 3 @@ -12099,7 +12094,7 @@ 4 5 - 771826 + 771825 5 @@ -12109,12 +12104,12 @@ 12 50 - 555612 + 555611 50 9900 - 205477 + 205476 @@ -12145,22 +12140,22 @@ 9 12 - 342529 + 342528 12 13 - 455467 + 455466 13 14 - 225833 + 225832 14 15 - 407558 + 407557 15 @@ -12180,12 +12175,12 @@ 18 20 - 343850 + 343849 20 25 - 285057 + 285056 25 @@ -12200,19 +12195,19 @@ macroinvocations - 40601028 + 40601294 id - 40601028 + 40601294 macro_id - 109906 + 109907 location - 1070092 + 1070096 kind @@ -12230,7 +12225,7 @@ 1 2 - 40601028 + 40601294 @@ -12246,7 +12241,7 @@ 1 2 - 40601028 + 40601294 @@ -12262,7 +12257,7 @@ 1 2 - 40601028 + 40601294 @@ -12406,32 +12401,32 @@ 1 2 - 426609 + 426610 2 3 - 252746 + 252707 3 4 - 113185 + 113199 4 6 - 77475 + 77502 6 11 - 82758 + 82759 11 42 - 80455 + 80456 42 @@ -12452,12 +12447,12 @@ 1 2 - 1009645 + 1009649 2 367 - 60446 + 60447 @@ -12473,7 +12468,7 @@ 1 2 - 1070092 + 1070096 @@ -12492,8 +12487,8 @@ 13 - 2974746 - 2974747 + 2974755 + 2974756 13 @@ -12546,15 +12541,15 @@ macroparent - 35810829 + 35811023 id - 35810829 + 35811023 parent_id - 28059915 + 28060082 @@ -12568,7 +12563,7 @@ 1 2 - 35810829 + 35811023 @@ -12584,17 +12579,17 @@ 1 2 - 21857859 + 21858004 2 3 - 5174257 + 5174275 3 91 - 1027798 + 1027802 @@ -12604,15 +12599,15 @@ macrolocationbind - 5543856 + 5543848 id - 3882187 + 3882182 location - 2758860 + 2758856 @@ -12626,17 +12621,17 @@ 1 2 - 3056762 + 3056758 2 3 - 469909 + 469908 3 7 - 314962 + 314961 7 @@ -12657,12 +12652,12 @@ 1 2 - 2198775 + 2198772 2 3 - 239730 + 239729 3 @@ -12682,11 +12677,11 @@ macro_argument_unexpanded - 103251986 + 103252337 invocation - 31225989 + 31226086 argument_index @@ -12694,7 +12689,7 @@ text - 440264 + 440266 @@ -12708,22 +12703,22 @@ 1 2 - 9979439 + 9979461 2 3 - 12505023 + 12505068 3 4 - 6395493 + 6395516 4 67 - 2346032 + 2346040 @@ -12739,22 +12734,22 @@ 1 2 - 10213680 + 10213703 2 3 - 12526522 + 12526567 3 4 - 6195580 + 6195602 4 67 - 2290205 + 2290213 @@ -12779,7 +12774,7 @@ 645273 - 2305009 + 2305008 40 @@ -12852,7 +12847,7 @@ 9 15 - 36847 + 36848 15 @@ -12862,7 +12857,7 @@ 27 57 - 34124 + 34125 57 @@ -12888,17 +12883,17 @@ 1 2 - 311893 + 311894 2 3 - 115271 + 115272 3 9 - 13099 + 13100 @@ -12908,11 +12903,11 @@ macro_argument_expanded - 103251986 + 103252337 invocation - 31225989 + 31226086 argument_index @@ -12920,7 +12915,7 @@ text - 266686 + 266687 @@ -12934,22 +12929,22 @@ 1 2 - 9979439 + 9979461 2 3 - 12505023 + 12505068 3 4 - 6395493 + 6395516 4 67 - 2346032 + 2346040 @@ -12965,22 +12960,22 @@ 1 2 - 13763081 + 13763116 2 3 - 10789713 + 10789751 3 4 - 5403974 + 5403993 4 9 - 1269220 + 1269224 @@ -13005,7 +13000,7 @@ 645273 - 2305009 + 2305008 40 @@ -13119,7 +13114,7 @@ 2 3 - 114038 + 114039 3 @@ -13134,15 +13129,15 @@ functions - 3356850 + 3356874 id - 3356850 + 3356874 name - 466655 + 466658 kind @@ -13160,7 +13155,7 @@ 1 2 - 3356850 + 3356874 @@ -13176,7 +13171,7 @@ 1 2 - 3356850 + 3356874 @@ -13192,12 +13187,12 @@ 1 2 - 372696 + 372699 2 3 - 31834 + 31835 3 @@ -13223,7 +13218,7 @@ 1 2 - 465409 + 465412 2 @@ -13340,15 +13335,15 @@ function_entry_point - 1438631 + 1438642 id - 1433905 + 1433916 entry_point - 1438631 + 1438642 @@ -13362,7 +13357,7 @@ 1 2 - 1429867 + 1429877 2 @@ -13383,7 +13378,7 @@ 1 2 - 1438631 + 1438642 @@ -13393,15 +13388,15 @@ function_return_type - 3363165 + 3363190 id - 3356850 + 3356874 return_type - 631801 + 631806 @@ -13415,7 +13410,7 @@ 1 2 - 3351050 + 3351074 2 @@ -13436,7 +13431,7 @@ 1 2 - 436968 + 436971 2 @@ -13742,33 +13737,33 @@ function_deleted - 94415 + 94416 id - 94415 + 94416 function_defaulted - 55394 + 55395 id - 55394 + 55395 function_prototyped - 3352726 + 3352750 id - 3352726 + 3352750 @@ -13848,15 +13843,15 @@ member_function_this_type - 674420 + 674425 id - 674420 + 674425 this_type - 233542 + 233544 @@ -13870,7 +13865,7 @@ 1 2 - 674420 + 674425 @@ -13896,7 +13891,7 @@ 3 4 - 36517 + 36518 4 @@ -13921,27 +13916,27 @@ fun_decls - 3392723 + 3392748 id - 3388814 + 3388838 function - 3232260 + 3232283 type_id - 600783 + 600787 name - 462015 + 462018 location - 932365 + 932372 @@ -13955,7 +13950,7 @@ 1 2 - 3388814 + 3388838 @@ -13971,7 +13966,7 @@ 1 2 - 3385420 + 3385444 2 @@ -13992,7 +13987,7 @@ 1 2 - 3388814 + 3388838 @@ -14008,7 +14003,7 @@ 1 2 - 3388814 + 3388838 @@ -14024,12 +14019,12 @@ 1 2 - 3101869 + 3101892 2 7 - 130390 + 130391 @@ -14045,7 +14040,7 @@ 1 2 - 3221906 + 3221929 2 @@ -14066,7 +14061,7 @@ 1 2 - 3232260 + 3232283 @@ -14082,12 +14077,12 @@ 1 2 - 3146937 + 3146959 2 6 - 85322 + 85323 @@ -14103,12 +14098,12 @@ 1 2 - 397056 + 397059 2 3 - 127253 + 127254 3 @@ -14134,17 +14129,17 @@ 1 2 - 415401 + 415404 2 3 - 112732 + 112733 3 6 - 52284 + 52285 6 @@ -14165,7 +14160,7 @@ 1 2 - 472627 + 472630 2 @@ -14196,17 +14191,17 @@ 1 2 - 441307 + 441310 2 3 - 90220 + 90221 3 6 - 51382 + 51383 6 @@ -14227,7 +14222,7 @@ 1 2 - 347650 + 347652 2 @@ -14237,7 +14232,7 @@ 3 6 - 37591 + 37592 6 @@ -14263,12 +14258,12 @@ 1 2 - 369345 + 369348 2 3 - 32049 + 32050 3 @@ -14278,7 +14273,7 @@ 9 4900 - 25003 + 25004 @@ -14294,7 +14289,7 @@ 1 2 - 427516 + 427519 2 @@ -14315,7 +14310,7 @@ 1 2 - 355512 + 355514 2 @@ -14346,17 +14341,17 @@ 1 2 - 736887 + 736892 2 3 - 90263 + 90264 3 13 - 70629 + 70630 13 @@ -14377,17 +14372,17 @@ 1 2 - 777787 + 777793 2 4 - 73250 + 73251 4 66 - 71016 + 71017 66 @@ -14408,7 +14403,7 @@ 1 2 - 854388 + 854395 2 @@ -14434,7 +14429,7 @@ 1 2 - 884763 + 884769 2 @@ -14449,11 +14444,11 @@ fun_def - 1592178 + 1592190 id - 1592178 + 1592190 @@ -14482,15 +14477,15 @@ fun_decl_specifiers - 1763135 + 2464552 id - 1197760 + 1197759 name - 218 + 327 @@ -14504,17 +14499,22 @@ 1 2 - 640797 + 267558 2 3 - 548552 + 596777 3 4 - 8410 + 330256 + + + 4 + 5 + 3167 @@ -14537,6 +14537,16 @@ 2862 54 + + 6284 + 6285 + 54 + + + 6559 + 6560 + 54 + 6738 6739 @@ -14676,26 +14686,26 @@ fun_decl_empty_throws - 435235 + 435234 fun_decl - 435235 + 435234 fun_decl_noexcept - 178851 + 178852 fun_decl - 178851 + 178852 constant - 178336 + 178251 @@ -14709,7 +14719,7 @@ 1 2 - 178851 + 178852 @@ -14725,12 +14735,12 @@ 1 2 - 177863 + 177692 2 4 - 472 + 558 @@ -14740,11 +14750,11 @@ fun_decl_empty_noexcept - 1063866 + 1063865 fun_decl - 1063866 + 1063865 @@ -14861,7 +14871,7 @@ constraint - 30949 + 30948 @@ -15000,7 +15010,7 @@ 1 2 - 30949 + 30948 @@ -15010,11 +15020,11 @@ param_decl_bind - 4870837 + 4870873 id - 4870837 + 4870873 index @@ -15022,7 +15032,7 @@ fun_decl - 2664643 + 2664662 @@ -15036,7 +15046,7 @@ 1 2 - 4870837 + 4870873 @@ -15052,7 +15062,7 @@ 1 2 - 4870837 + 4870873 @@ -15230,22 +15240,22 @@ 1 2 - 1370794 + 1370804 2 3 - 667761 + 667766 3 4 - 448997 + 449001 4 21 - 177090 + 177091 @@ -15261,22 +15271,22 @@ 1 2 - 1370794 + 1370804 2 3 - 667761 + 667766 3 4 - 448997 + 449001 4 21 - 177090 + 177091 @@ -15286,27 +15296,27 @@ var_decls - 6739212 + 6739203 id - 6734234 + 6734225 variable - 6565781 + 6565772 type_id - 1513120 + 1513118 name - 829081 + 829080 location - 3605468 + 3605463 @@ -15320,7 +15330,7 @@ 1 2 - 6734234 + 6734225 @@ -15336,7 +15346,7 @@ 1 2 - 6729256 + 6729247 2 @@ -15357,7 +15367,7 @@ 1 2 - 6734234 + 6734225 @@ -15373,7 +15383,7 @@ 1 2 - 6734234 + 6734225 @@ -15389,7 +15399,7 @@ 1 2 - 6408495 + 6408486 2 @@ -15410,7 +15420,7 @@ 1 2 - 6551250 + 6551241 2 @@ -15431,7 +15441,7 @@ 1 2 - 6548559 + 6548550 2 @@ -15452,7 +15462,7 @@ 1 2 - 6434731 + 6434723 2 @@ -15473,7 +15483,7 @@ 1 2 - 890165 + 890164 2 @@ -15488,7 +15498,7 @@ 5 12 - 116518 + 116517 12 @@ -15509,7 +15519,7 @@ 1 2 - 909406 + 909405 2 @@ -15545,12 +15555,12 @@ 1 2 - 1159933 + 1159932 2 3 - 207741 + 207740 3 @@ -15576,12 +15586,12 @@ 1 2 - 1026327 + 1026326 2 3 - 228596 + 228595 3 @@ -15612,7 +15622,7 @@ 1 2 - 457999 + 457998 2 @@ -15627,7 +15637,7 @@ 4 7 - 65390 + 65389 7 @@ -15658,7 +15668,7 @@ 2 3 - 156344 + 156343 3 @@ -15694,7 +15704,7 @@ 1 2 - 640176 + 640175 2 @@ -15725,7 +15735,7 @@ 1 2 - 487734 + 487733 2 @@ -15761,7 +15771,7 @@ 1 2 - 3120828 + 3120824 2 @@ -15787,7 +15797,7 @@ 1 2 - 3145719 + 3145715 2 @@ -15813,7 +15823,7 @@ 1 2 - 3312961 + 3312957 2 @@ -15839,7 +15849,7 @@ 1 2 - 3594435 + 3594430 2 @@ -15854,11 +15864,11 @@ var_def - 3747415 + 3747410 id - 3747415 + 3747410 @@ -16008,19 +16018,19 @@ type_decls - 1890757 + 1890777 id - 1890757 + 1890777 type_id - 1849357 + 1849364 location - 1485512 + 1485517 @@ -16034,7 +16044,7 @@ 1 2 - 1890757 + 1890777 @@ -16050,7 +16060,7 @@ 1 2 - 1890757 + 1890777 @@ -16066,12 +16076,12 @@ 1 2 - 1819567 + 1819574 2 24 - 29789 + 29790 @@ -16087,7 +16097,7 @@ 1 2 - 1820895 + 1820902 2 @@ -16108,7 +16118,7 @@ 1 2 - 1408984 + 1408989 2 @@ -16129,12 +16139,12 @@ 1 2 - 1410326 + 1410331 2 651 - 75185 + 75186 @@ -16144,22 +16154,22 @@ type_def - 1297357 + 1297362 id - 1297357 + 1297362 type_decl_top - 652212 + 652211 type_decl - 652212 + 652211 @@ -16239,11 +16249,11 @@ namespace_decls - 425651 + 425650 id - 425651 + 425650 namespace_id @@ -16251,11 +16261,11 @@ location - 425651 + 425650 bodylocation - 425651 + 425650 @@ -16269,7 +16279,7 @@ 1 2 - 425651 + 425650 @@ -16285,7 +16295,7 @@ 1 2 - 425651 + 425650 @@ -16301,7 +16311,7 @@ 1 2 - 425651 + 425650 @@ -16515,7 +16525,7 @@ 1 2 - 425651 + 425650 @@ -16531,7 +16541,7 @@ 1 2 - 425651 + 425650 @@ -16547,7 +16557,7 @@ 1 2 - 425651 + 425650 @@ -16563,7 +16573,7 @@ 1 2 - 425651 + 425650 @@ -16579,7 +16589,7 @@ 1 2 - 425651 + 425650 @@ -16595,7 +16605,7 @@ 1 2 - 425651 + 425650 @@ -16605,11 +16615,11 @@ usings - 338567 + 338568 id - 338567 + 338568 element_id @@ -16635,7 +16645,7 @@ 1 2 - 338567 + 338568 @@ -16651,7 +16661,7 @@ 1 2 - 338567 + 338568 @@ -16667,7 +16677,7 @@ 1 2 - 338567 + 338568 @@ -16683,7 +16693,7 @@ 1 2 - 55420 + 55421 2 @@ -16709,7 +16719,7 @@ 1 2 - 55420 + 55421 2 @@ -16886,7 +16896,7 @@ using_container - 732094 + 732097 parent @@ -16894,7 +16904,7 @@ child - 338567 + 338568 @@ -16964,7 +16974,7 @@ 2 3 - 154259 + 154260 3 @@ -17597,15 +17607,15 @@ params - 4808499 + 4808534 id - 4798833 + 4798867 function - 2659144 + 2659163 index @@ -17613,7 +17623,7 @@ type_id - 862079 + 862085 @@ -17627,7 +17637,7 @@ 1 2 - 4798833 + 4798867 @@ -17643,7 +17653,7 @@ 1 2 - 4798833 + 4798867 @@ -17659,7 +17669,7 @@ 1 2 - 4789510 + 4789545 2 @@ -17680,22 +17690,22 @@ 1 2 - 1392103 + 1392113 2 3 - 661145 + 661149 3 4 - 439589 + 439592 4 21 - 166306 + 166307 @@ -17711,22 +17721,22 @@ 1 2 - 1392103 + 1392113 2 3 - 661145 + 661149 3 4 - 439589 + 439592 4 21 - 166306 + 166307 @@ -17742,17 +17752,17 @@ 1 2 - 1481035 + 1481046 2 3 - 669909 + 669914 3 4 - 403844 + 403847 4 @@ -18016,12 +18026,12 @@ 1 2 - 449169 + 449172 2 3 - 180011 + 180012 3 @@ -18031,7 +18041,7 @@ 4 6 - 77761 + 77762 6 @@ -18041,7 +18051,7 @@ 15 3702 - 36388 + 36389 @@ -18057,12 +18067,12 @@ 1 2 - 492088 + 492092 2 3 - 152343 + 152345 3 @@ -18072,12 +18082,12 @@ 4 6 - 69383 + 69384 6 18 - 66247 + 66248 18 @@ -18098,17 +18108,17 @@ 1 2 - 634465 + 634470 2 3 - 187744 + 187746 3 17 - 39868 + 39869 @@ -18196,11 +18206,11 @@ membervariables - 1444238 + 1444236 id - 1441780 + 1441778 type_id @@ -18208,7 +18218,7 @@ name - 617367 + 617366 @@ -18222,7 +18232,7 @@ 1 2 - 1439432 + 1439430 2 @@ -18243,7 +18253,7 @@ 1 2 - 1441780 + 1441778 @@ -18290,7 +18300,7 @@ 1 2 - 348935 + 348934 2 @@ -18326,12 +18336,12 @@ 2 3 - 118296 + 118295 3 5 - 56308 + 56307 5 @@ -18352,7 +18362,7 @@ 1 2 - 502840 + 502839 2 @@ -18372,15 +18382,15 @@ globalvariables - 425557 + 425556 id - 425546 + 425545 type_id - 1634 + 1633 name @@ -18398,7 +18408,7 @@ 1 2 - 425535 + 425534 2 @@ -18419,7 +18429,7 @@ 1 2 - 425546 + 425545 @@ -18435,7 +18445,7 @@ 1 2 - 1147 + 1146 2 @@ -18471,7 +18481,7 @@ 1 2 - 1179 + 1178 2 @@ -18507,12 +18517,12 @@ 1 2 - 399362 + 399363 2 1044 - 5652 + 5651 @@ -18528,12 +18538,12 @@ 1 2 - 404349 + 404350 2 15 - 665 + 664 @@ -18606,7 +18616,7 @@ 2 3 - 7925 + 7926 3 @@ -18647,7 +18657,7 @@ 1 2 - 38830 + 38831 2 @@ -18678,7 +18688,7 @@ 1 2 - 63261 + 63262 2 @@ -18812,11 +18822,11 @@ orphaned_variables - 55893 + 55894 var - 55893 + 55894 function @@ -18834,7 +18844,7 @@ 1 2 - 55893 + 55894 @@ -19578,7 +19588,7 @@ 1 2 - 329601 + 329600 2 @@ -19599,7 +19609,7 @@ 1 2 - 329601 + 329600 2 @@ -19652,7 +19662,7 @@ 1 2 - 329601 + 329600 2 @@ -20439,15 +20449,15 @@ derivedtypes - 3188505 + 3188501 id - 3188505 + 3188501 name - 1506662 + 1506660 kind @@ -20455,7 +20465,7 @@ type_id - 2055212 + 2055209 @@ -20469,7 +20479,7 @@ 1 2 - 3188505 + 3188501 @@ -20485,7 +20495,7 @@ 1 2 - 3188505 + 3188501 @@ -20501,7 +20511,7 @@ 1 2 - 3188505 + 3188501 @@ -20517,12 +20527,12 @@ 1 2 - 1369020 + 1369018 2 10 - 113827 + 113826 10 @@ -20543,7 +20553,7 @@ 1 2 - 1506662 + 1506660 @@ -20559,7 +20569,7 @@ 1 2 - 1369154 + 1369153 2 @@ -20708,7 +20718,7 @@ 1 2 - 1388260 + 1388258 2 @@ -20739,7 +20749,7 @@ 1 2 - 1389875 + 1389873 2 @@ -20770,7 +20780,7 @@ 1 2 - 1390144 + 1390142 2 @@ -20795,11 +20805,11 @@ pointerishsize - 2366958 + 2366955 id - 2366958 + 2366955 size @@ -20821,7 +20831,7 @@ 1 2 - 2366958 + 2366955 @@ -20837,7 +20847,7 @@ 1 2 - 2366958 + 2366955 @@ -21317,15 +21327,15 @@ typedefbase - 2175691 + 2175706 id - 2175691 + 2175706 type_id - 905385 + 905391 @@ -21339,7 +21349,7 @@ 1 2 - 2175691 + 2175706 @@ -21355,7 +21365,7 @@ 1 2 - 730529 + 730534 2 @@ -21380,19 +21390,19 @@ decltypes - 175625 + 175649 id - 15417 + 15374 expr - 161560 + 161629 base_type - 11309 + 11280 parentheses_would_change_meaning @@ -21410,27 +21420,27 @@ 1 2 - 2185 + 2137 2 3 - 6656 + 6659 3 4 - 2161 + 2162 4 5 - 1055 + 1056 5 9 - 1212 + 1213 9 @@ -21456,7 +21466,7 @@ 1 2 - 15417 + 15374 @@ -21472,7 +21482,7 @@ 1 2 - 15417 + 15374 @@ -21488,16 +21498,16 @@ 1 2 - 148024 + 148087 2 3 - 13057 + 13063 3 - 5 + 4 478 @@ -21514,16 +21524,16 @@ 1 2 - 148024 + 148087 2 3 - 13057 + 13063 3 - 5 + 4 478 @@ -21540,7 +21550,7 @@ 1 2 - 161560 + 161629 @@ -21556,12 +21566,12 @@ 1 2 - 9799 + 9787 2 3 - 1336 + 1320 3 @@ -21582,12 +21592,12 @@ 1 2 - 981 + 965 2 3 - 5518 + 5504 3 @@ -21597,17 +21607,17 @@ 4 5 - 1113 + 1114 5 8 - 948 + 949 8 41 - 857 + 858 42 @@ -21628,7 +21638,7 @@ 1 2 - 11309 + 11280 @@ -21647,8 +21657,8 @@ 8 - 1867 - 1868 + 1861 + 1862 8 @@ -21689,8 +21699,8 @@ 8 - 1369 - 1370 + 1365 + 1366 8 @@ -21701,15 +21711,15 @@ usertypes - 4992117 + 4987434 id - 4992117 + 4987434 name - 1074915 + 1074810 kind @@ -21727,7 +21737,7 @@ 1 2 - 4992117 + 4987434 @@ -21743,7 +21753,7 @@ 1 2 - 4992117 + 4987434 @@ -21759,22 +21769,22 @@ 1 2 - 742932 + 743259 2 3 - 197244 + 196974 3 7 - 86104 + 85996 7 - 29574 - 48633 + 30181 + 48579 @@ -21790,12 +21800,12 @@ 1 2 - 1007695 + 1008457 2 10 - 67220 + 66353 @@ -21839,8 +21849,8 @@ 13 - 4522 - 4523 + 4581 + 4582 13 @@ -21849,23 +21859,23 @@ 13 - 20080 - 20081 + 20064 + 20065 13 - 82457 - 82458 + 82095 + 82096 13 - 85575 - 85576 + 85548 + 85549 13 - 151140 - 151141 + 151139 + 151140 13 @@ -21905,8 +21915,8 @@ 13 - 832 - 833 + 771 + 772 13 @@ -21915,8 +21925,8 @@ 13 - 3087 - 3088 + 3066 + 3067 13 @@ -21925,8 +21935,8 @@ 13 - 10837 - 10838 + 10829 + 10830 13 @@ -21935,8 +21945,8 @@ 13 - 51364 - 51365 + 51345 + 51346 13 @@ -21947,11 +21957,11 @@ usertypesize - 1631914 + 1632137 id - 1631914 + 1632137 size @@ -21973,7 +21983,7 @@ 1 2 - 1631914 + 1632137 @@ -21989,7 +21999,7 @@ 1 2 - 1631914 + 1632137 @@ -22049,7 +22059,7 @@ 1733 - 92713 + 92729 67 @@ -22125,8 +22135,8 @@ 13 - 107899 - 107900 + 107915 + 107916 13 @@ -22247,11 +22257,11 @@ usertype_alias_kind - 2175733 + 2175749 id - 2175691 + 2175706 alias_kind @@ -22269,7 +22279,7 @@ 1 2 - 2175648 + 2175663 2 @@ -22305,11 +22315,11 @@ nontype_template_parameters - 966305 + 966312 id - 966305 + 966312 @@ -22389,15 +22399,15 @@ mangled_name - 7780866 + 7776179 id - 7780866 + 7776179 mangled_name - 5325726 + 5325040 is_complete @@ -22415,7 +22425,7 @@ 1 2 - 7780866 + 7776179 @@ -22431,7 +22441,7 @@ 1 2 - 7780866 + 7776179 @@ -22447,17 +22457,17 @@ 1 2 - 4731594 + 4731503 2 3 - 459569 + 459353 3 - 8985 - 134562 + 9032 + 134183 @@ -22473,7 +22483,7 @@ 1 2 - 5325726 + 5325040 @@ -22492,8 +22502,8 @@ 13 - 570981 - 570982 + 570633 + 570634 13 @@ -22513,8 +22523,8 @@ 13 - 391611 - 391612 + 391559 + 391560 13 @@ -22525,59 +22535,59 @@ is_pod_class - 747542 + 747547 id - 747542 + 747547 is_standard_layout_class - 1344636 + 1344858 id - 1344636 + 1344858 is_complete - 1611052 + 1611274 id - 1611052 + 1611274 is_class_template - 292182 + 292183 id - 292182 + 292183 class_instantiation - 1327526 + 1327030 to - 1323611 + 1323128 from - 91713 + 91605 @@ -22591,12 +22601,12 @@ 1 2 - 1320861 + 1320392 2 8 - 2750 + 2736 @@ -22612,42 +22622,42 @@ 1 2 - 26741 + 26728 2 3 - 16676 + 16622 3 4 - 9130 + 9103 4 5 - 5987 + 5974 5 7 - 7667 + 7694 7 10 - 6922 + 6949 10 17 - 7423 + 7356 17 53 - 6922 + 6936 53 @@ -22662,11 +22672,11 @@ class_template_argument - 3502880 + 3501700 type_id - 1631792 + 1631215 index @@ -22674,7 +22684,7 @@ arg_type - 1034653 + 1034467 @@ -22688,27 +22698,27 @@ 1 2 - 679139 + 678884 2 3 - 490293 + 490105 3 4 - 308844 + 308751 4 7 - 124144 + 124118 7 113 - 29369 + 29356 @@ -22724,22 +22734,22 @@ 1 2 - 713697 + 713442 2 3 - 505642 + 505454 3 4 - 306907 + 306813 4 113 - 105544 + 105504 @@ -22779,12 +22789,12 @@ 643 - 6821 + 6819 121 - 11332 - 120452 + 11329 + 120409 54 @@ -22829,8 +22839,8 @@ 121 - 10038 - 43717 + 10035 + 43710 40 @@ -22847,26 +22857,26 @@ 1 2 - 648834 + 649080 2 3 - 212417 + 212187 3 4 - 62194 + 62153 4 11 - 78830 + 78667 11 - 11558 + 11553 32377 @@ -22883,12 +22893,12 @@ 1 2 - 912540 + 912381 2 3 - 98879 + 98852 3 @@ -22903,11 +22913,11 @@ class_template_argument_value - 643229 + 643234 type_id - 259534 + 259536 index @@ -22915,7 +22925,7 @@ arg_value - 643057 + 643062 @@ -22929,12 +22939,12 @@ 1 2 - 196466 + 196467 2 3 - 54690 + 54691 3 @@ -22955,7 +22965,7 @@ 1 2 - 186541 + 186543 2 @@ -23098,7 +23108,7 @@ 1 2 - 642886 + 642890 2 @@ -23119,7 +23129,7 @@ 1 2 - 643057 + 643062 @@ -23129,15 +23139,15 @@ is_proxy_class_for - 61259 + 62059 id - 61259 + 62059 templ_param_id - 60135 + 58631 @@ -23151,7 +23161,7 @@ 1 2 - 61259 + 62059 @@ -23167,12 +23177,12 @@ 1 2 - 59620 + 57710 2 - 21 - 514 + 79 + 921 @@ -23182,11 +23192,11 @@ type_mentions - 5507865 + 5507858 id - 5507865 + 5507858 type_id @@ -23194,7 +23204,7 @@ location - 5462043 + 5462036 kind @@ -23212,7 +23222,7 @@ 1 2 - 5507865 + 5507858 @@ -23228,7 +23238,7 @@ 1 2 - 5507865 + 5507858 @@ -23244,7 +23254,7 @@ 1 2 - 5507865 + 5507858 @@ -23295,7 +23305,7 @@ 27 8555 - 19716 + 19715 @@ -23346,7 +23356,7 @@ 27 8555 - 19716 + 19715 @@ -23378,7 +23388,7 @@ 1 2 - 5416221 + 5416214 2 @@ -23399,7 +23409,7 @@ 1 2 - 5416221 + 5416214 2 @@ -23420,7 +23430,7 @@ 1 2 - 5462043 + 5462036 @@ -23478,26 +23488,26 @@ is_function_template - 1418399 + 1418397 id - 1418399 + 1418397 function_instantiation - 1226957 + 1226965 to - 1226957 + 1226965 from - 230191 + 230193 @@ -23511,7 +23521,7 @@ 1 2 - 1226957 + 1226965 @@ -23527,7 +23537,7 @@ 1 2 - 140013 + 140014 2 @@ -23557,11 +23567,11 @@ function_template_argument - 3133404 + 3133426 function_id - 1832637 + 1832651 index @@ -23569,7 +23579,7 @@ arg_type - 375790 + 375792 @@ -23583,22 +23593,22 @@ 1 2 - 987399 + 987407 2 3 - 521002 + 521006 3 4 - 216658 + 216659 4 15 - 107577 + 107578 @@ -23614,17 +23624,17 @@ 1 2 - 1011544 + 1011551 2 3 - 518596 + 518600 3 4 - 213908 + 213910 4 @@ -23767,12 +23777,12 @@ 1 2 - 220396 + 220397 2 3 - 33209 + 33210 3 @@ -23782,7 +23792,7 @@ 4 6 - 28569 + 28570 6 @@ -23813,7 +23823,7 @@ 1 2 - 323848 + 323851 2 @@ -23823,7 +23833,7 @@ 3 15 - 11427 + 11428 @@ -23833,11 +23843,11 @@ function_template_argument_value - 570967 + 570971 function_id - 248149 + 248151 index @@ -23845,7 +23855,7 @@ arg_value - 567573 + 567577 @@ -23859,7 +23869,7 @@ 1 2 - 190923 + 190925 2 @@ -23885,7 +23895,7 @@ 1 2 - 182202 + 182203 2 @@ -24038,7 +24048,7 @@ 1 2 - 564179 + 564183 2 @@ -24059,7 +24069,7 @@ 1 2 - 567573 + 567577 @@ -24163,11 +24173,11 @@ variable_template_argument - 525811 + 525810 variable_id - 267211 + 267210 index @@ -24175,7 +24185,7 @@ arg_type - 257120 + 257119 @@ -24220,12 +24230,12 @@ 1 2 - 122169 + 122168 2 3 - 99296 + 99295 3 @@ -25274,7 +25284,7 @@ concept_id - 81869 + 81870 index @@ -25296,12 +25306,12 @@ 1 2 - 49813 + 49814 2 3 - 26451 + 26452 3 @@ -25543,7 +25553,7 @@ 1 2 - 65 + 66 2 @@ -25632,15 +25642,15 @@ routinetypes - 762063 + 762068 id - 762063 + 762068 return_type - 357960 + 357963 @@ -25654,7 +25664,7 @@ 1 2 - 762063 + 762068 @@ -25670,7 +25680,7 @@ 1 2 - 295365 + 295367 2 @@ -25690,7 +25700,7 @@ routinetypeargs - 1165647 + 1165645 routine @@ -25731,7 +25741,7 @@ 4 5 - 48935 + 48934 5 @@ -25772,7 +25782,7 @@ 4 5 - 40142 + 40141 5 @@ -26000,12 +26010,12 @@ 6 8 - 9503 + 9502 8 13 - 9503 + 9502 13 @@ -26031,7 +26041,7 @@ 1 2 - 78154 + 78153 2 @@ -26041,7 +26051,7 @@ 3 5 - 9503 + 9502 5 @@ -26212,15 +26222,15 @@ specifiers - 7131 + 8341 id - 7131 + 8341 str - 7131 + 8341 @@ -26234,7 +26244,7 @@ 1 2 - 7131 + 8341 @@ -26250,7 +26260,7 @@ 1 2 - 7131 + 8341 @@ -26260,11 +26270,11 @@ typespecifiers - 988078 + 991496 type_id - 981495 + 984912 spec_id @@ -26282,7 +26292,7 @@ 1 2 - 974911 + 978328 2 @@ -26331,8 +26341,8 @@ 13 - 17156 - 17157 + 17408 + 17409 13 @@ -26348,15 +26358,15 @@ funspecifiers - 9758473 + 9728427 func_id - 3343789 + 3340505 spec_id - 859 + 816 @@ -26370,32 +26380,32 @@ 1 2 - 431941 + 437873 2 3 - 686449 + 677260 3 4 - 1416678 + 1424206 4 5 - 458148 + 459483 5 6 - 233886 + 225080 6 8 - 116685 + 116600 @@ -26438,11 +26448,6 @@ 563 42 - - 704 - 705 - 42 - 1589 1590 @@ -26489,8 +26494,8 @@ 42 - 42404 - 42405 + 42407 + 42408 42 @@ -26511,11 +26516,11 @@ varspecifiers - 2898034 + 2898030 var_id - 2545003 + 2544999 spec_id @@ -26533,12 +26538,12 @@ 1 2 - 2191971 + 2191969 2 3 - 353031 + 353030 @@ -26642,11 +26647,11 @@ attributes - 629816 + 629815 id - 629816 + 629815 kind @@ -26662,7 +26667,7 @@ location - 623358 + 623357 @@ -26676,7 +26681,7 @@ 1 2 - 629816 + 629815 @@ -26692,7 +26697,7 @@ 1 2 - 629816 + 629815 @@ -26708,7 +26713,7 @@ 1 2 - 629816 + 629815 @@ -26724,7 +26729,7 @@ 1 2 - 629816 + 629815 @@ -27112,7 +27117,7 @@ 1 2 - 617034 + 617033 2 @@ -27133,7 +27138,7 @@ 1 2 - 623358 + 623357 @@ -27170,7 +27175,7 @@ 1 2 - 623358 + 623357 @@ -27428,7 +27433,7 @@ 2 3 - 2302 + 2303 @@ -27444,7 +27449,7 @@ 1 2 - 79046 + 79047 2 @@ -27465,7 +27470,7 @@ 1 2 - 80658 + 80659 2 @@ -27641,7 +27646,7 @@ 1 2 - 91726 + 91727 2 @@ -27854,15 +27859,15 @@ attribute_arg_constant - 89599 + 89600 arg - 89599 + 89600 constant - 89599 + 89600 @@ -27876,7 +27881,7 @@ 1 2 - 89599 + 89600 @@ -27892,7 +27897,7 @@ 1 2 - 89599 + 89600 @@ -28071,15 +28076,15 @@ funcattributes - 824910 + 824909 func_id - 776473 + 776472 spec_id - 598601 + 598600 @@ -28114,7 +28119,7 @@ 1 2 - 555008 + 555007 2 @@ -28260,15 +28265,15 @@ unspecifiedtype - 8350274 + 8345603 type_id - 8350274 + 8345603 unspecified_type_id - 4803705 + 4799035 @@ -28282,7 +28287,7 @@ 1 2 - 8350274 + 8345603 @@ -28298,17 +28303,17 @@ 1 2 - 3203138 + 3198462 2 3 - 1309007 + 1309012 3 6271 - 291558 + 291559 @@ -28318,11 +28323,11 @@ member - 4687174 + 4687208 parent - 562417 + 562422 index @@ -28330,7 +28335,7 @@ child - 4569973 + 4570006 @@ -28344,7 +28349,7 @@ 1 2 - 233198 + 233200 2 @@ -28359,17 +28364,17 @@ 4 5 - 37763 + 37764 5 7 - 47859 + 47860 7 11 - 43348 + 43349 11 @@ -28384,7 +28389,7 @@ 19 53 - 42317 + 42318 53 @@ -28405,7 +28410,7 @@ 1 2 - 233069 + 233071 2 @@ -28445,7 +28450,7 @@ 19 53 - 42317 + 42318 53 @@ -28603,7 +28608,7 @@ 1 2 - 4569973 + 4570006 @@ -28619,12 +28624,12 @@ 1 2 - 4482115 + 4482148 2 13 - 87857 + 87858 @@ -28634,15 +28639,15 @@ enclosingfunction - 144782 + 144783 child - 144782 + 144783 parent - 89962 + 89963 @@ -28656,7 +28661,7 @@ 1 2 - 144782 + 144783 @@ -28682,7 +28687,7 @@ 3 4 - 19375 + 19376 4 @@ -28697,15 +28702,15 @@ derivations - 599880 + 599885 derivation - 599880 + 599885 sub - 572471 + 572475 index @@ -28713,11 +28718,11 @@ super - 296052 + 296054 location - 44637 + 44638 @@ -28731,7 +28736,7 @@ 1 2 - 599880 + 599885 @@ -28747,7 +28752,7 @@ 1 2 - 599880 + 599885 @@ -28763,7 +28768,7 @@ 1 2 - 599880 + 599885 @@ -28779,7 +28784,7 @@ 1 2 - 599880 + 599885 @@ -28795,7 +28800,7 @@ 1 2 - 551634 + 551638 2 @@ -28816,7 +28821,7 @@ 1 2 - 551634 + 551638 2 @@ -28837,7 +28842,7 @@ 1 2 - 551634 + 551638 2 @@ -28858,7 +28863,7 @@ 1 2 - 551634 + 551638 2 @@ -29018,7 +29023,7 @@ 1 2 - 283937 + 283939 2 @@ -29039,7 +29044,7 @@ 1 2 - 283937 + 283939 2 @@ -29060,7 +29065,7 @@ 1 2 - 295493 + 295496 2 @@ -29081,7 +29086,7 @@ 1 2 - 289522 + 289524 2 @@ -29174,7 +29179,7 @@ 1 2 - 44637 + 44638 @@ -29215,11 +29220,11 @@ derspecifiers - 602115 + 602119 der_id - 599322 + 599326 spec_id @@ -29237,7 +29242,7 @@ 1 2 - 596529 + 596534 2 @@ -29283,11 +29288,11 @@ direct_base_offsets - 565940 + 565944 der_id - 565940 + 565944 offset @@ -29305,7 +29310,7 @@ 1 2 - 565940 + 565944 @@ -29502,19 +29507,19 @@ frienddecls - 883302 + 883308 id - 883302 + 883308 type_id - 53487 + 53488 decl_id - 98039 + 98169 location @@ -29532,7 +29537,7 @@ 1 2 - 883302 + 883308 @@ -29548,7 +29553,7 @@ 1 2 - 883302 + 883308 @@ -29564,7 +29569,7 @@ 1 2 - 883302 + 883308 @@ -29713,12 +29718,12 @@ 1 2 - 60361 + 60620 2 3 - 7647 + 7518 3 @@ -29754,12 +29759,12 @@ 1 2 - 60361 + 60620 2 3 - 7647 + 7518 3 @@ -29795,7 +29800,7 @@ 1 2 - 97180 + 97310 2 @@ -29862,7 +29867,7 @@ 2 - 2129 + 2132 429 @@ -29873,19 +29878,19 @@ comments - 11290145 + 11290131 id - 11290145 + 11290131 contents - 4299060 + 4299054 location - 11290145 + 11290131 @@ -29899,7 +29904,7 @@ 1 2 - 11290145 + 11290131 @@ -29915,7 +29920,7 @@ 1 2 - 11290145 + 11290131 @@ -29931,7 +29936,7 @@ 1 2 - 3932687 + 3932682 2 @@ -29957,7 +29962,7 @@ 1 2 - 3932687 + 3932682 2 @@ -29983,7 +29988,7 @@ 1 2 - 11290145 + 11290131 @@ -29999,7 +30004,7 @@ 1 2 - 11290145 + 11290131 @@ -30009,15 +30014,15 @@ commentbinding - 3316594 + 3316590 id - 3263044 + 3263040 element - 3173570 + 3173566 @@ -30031,7 +30036,7 @@ 1 2 - 3231291 + 3231287 2 @@ -30052,7 +30057,7 @@ 1 2 - 3030546 + 3030542 2 @@ -30067,15 +30072,15 @@ exprconv - 9603748 + 9603735 converted - 9603643 + 9603630 conversion - 9603748 + 9603735 @@ -30089,7 +30094,7 @@ 1 2 - 9603537 + 9603525 2 @@ -30110,7 +30115,7 @@ 1 2 - 9603748 + 9603735 @@ -30120,22 +30125,22 @@ compgenerated - 10714603 + 10714334 id - 10714603 + 10714334 synthetic_destructor_call - 1791768 + 1791782 element - 1334382 + 1334392 i @@ -30143,7 +30148,7 @@ destructor_call - 1791768 + 1791782 @@ -30157,12 +30162,12 @@ 1 2 - 888204 + 888211 2 3 - 438890 + 438893 3 @@ -30183,12 +30188,12 @@ 1 2 - 888204 + 888211 2 3 - 438890 + 438893 3 @@ -30341,7 +30346,7 @@ 1 2 - 1791768 + 1791782 @@ -30357,7 +30362,7 @@ 1 2 - 1791768 + 1791782 @@ -30436,7 +30441,7 @@ namespacembrs - 2026146 + 2025652 parentid @@ -30444,7 +30449,7 @@ memberid - 2026146 + 2025652 @@ -30488,37 +30493,37 @@ 14 22 - 785 - - - 22 - 36 - 785 - - - 36 - 55 812 - 56 - 115 + 22 + 37 + 799 + + + 37 + 57 + 799 + + + 57 + 118 785 - 115 - 244 + 118 + 255 + 812 + + + 256 + 828 785 - 252 - 673 - 785 - - - 674 - 42760 - 392 + 829 + 42759 + 338 @@ -30534,7 +30539,7 @@ 1 2 - 2026146 + 2025652 @@ -30544,11 +30549,11 @@ exprparents - 19401302 + 19401276 expr_id - 19401302 + 19401276 child_index @@ -30556,7 +30561,7 @@ parent_id - 12904791 + 12904774 @@ -30570,7 +30575,7 @@ 1 2 - 19401302 + 19401276 @@ -30586,7 +30591,7 @@ 1 2 - 19401302 + 19401276 @@ -30704,17 +30709,17 @@ 1 2 - 7374643 + 7374634 2 3 - 5068855 + 5068849 3 712 - 461292 + 461291 @@ -30730,17 +30735,17 @@ 1 2 - 7374643 + 7374634 2 3 - 5068855 + 5068849 3 712 - 461292 + 461291 @@ -30750,22 +30755,22 @@ expr_isload - 6961485 + 6961476 expr_id - 6961485 + 6961476 conversionkinds - 6048224 + 6048225 expr_id - 6048224 + 6048225 kind @@ -30783,7 +30788,7 @@ 1 2 - 6048224 + 6048225 @@ -30827,8 +30832,8 @@ 1 - 5829769 - 5829770 + 5829770 + 5829771 1 @@ -30839,11 +30844,11 @@ iscall - 6219922 + 6219948 caller - 6219922 + 6219948 kind @@ -30861,7 +30866,7 @@ 1 2 - 6219922 + 6219948 @@ -30885,8 +30890,8 @@ 23 - 268068 - 268069 + 268067 + 268068 23 @@ -30897,11 +30902,11 @@ numtemplatearguments - 723397 + 723402 expr_id - 723397 + 723402 num @@ -30919,7 +30924,7 @@ 1 2 - 723397 + 723402 @@ -31028,15 +31033,15 @@ namequalifiers - 3258064 + 3258067 id - 3258064 + 3258067 qualifiableelement - 3258064 + 3258067 qualifyingelement @@ -31044,7 +31049,7 @@ location - 591859 + 591864 @@ -31058,7 +31063,7 @@ 1 2 - 3258064 + 3258067 @@ -31074,7 +31079,7 @@ 1 2 - 3258064 + 3258067 @@ -31090,7 +31095,7 @@ 1 2 - 3258064 + 3258067 @@ -31106,7 +31111,7 @@ 1 2 - 3258064 + 3258067 @@ -31122,7 +31127,7 @@ 1 2 - 3258064 + 3258067 @@ -31138,7 +31143,7 @@ 1 2 - 3258064 + 3258067 @@ -31154,7 +31159,7 @@ 1 2 - 33831 + 33832 2 @@ -31172,7 +31177,7 @@ 3782 - 6807 + 6806 41956 115 @@ -31190,7 +31195,7 @@ 1 2 - 33831 + 33832 2 @@ -31208,7 +31213,7 @@ 3782 - 6807 + 6806 41956 115 @@ -31257,17 +31262,17 @@ 1 2 - 84982 + 85006 2 6 - 40565 + 40543 6 7 - 427774 + 427777 7 @@ -31288,17 +31293,17 @@ 1 2 - 84982 + 85006 2 6 - 40565 + 40543 6 7 - 427774 + 427777 7 @@ -31319,7 +31324,7 @@ 1 2 - 119345 + 119346 2 @@ -31329,7 +31334,7 @@ 4 5 - 445209 + 445212 5 @@ -31344,15 +31349,15 @@ varbind - 8226118 + 8226107 expr - 8226118 + 8226107 var - 1047519 + 1047517 @@ -31366,7 +31371,7 @@ 1 2 - 8226118 + 8226107 @@ -31437,15 +31442,15 @@ funbind - 6230323 + 6230372 expr - 6227671 + 6227720 fun - 295537 + 295540 @@ -31459,7 +31464,7 @@ 1 2 - 6225019 + 6225068 2 @@ -31480,7 +31485,7 @@ 1 2 - 194319 + 194320 2 @@ -31510,11 +31515,11 @@ expr_allocator - 57053 + 57054 expr - 57053 + 57054 func @@ -31536,7 +31541,7 @@ 1 2 - 57053 + 57054 @@ -31552,7 +31557,7 @@ 1 2 - 57053 + 57054 @@ -31783,15 +31788,15 @@ expr_cond_guard - 896445 + 896444 cond - 896445 + 896444 guard - 896445 + 896444 @@ -31805,7 +31810,7 @@ 1 2 - 896445 + 896444 @@ -31821,7 +31826,7 @@ 1 2 - 896445 + 896444 @@ -31831,15 +31836,15 @@ expr_cond_true - 896442 + 896441 cond - 896442 + 896441 true - 896442 + 896441 @@ -31853,7 +31858,7 @@ 1 2 - 896442 + 896441 @@ -31869,7 +31874,7 @@ 1 2 - 896442 + 896441 @@ -31879,15 +31884,15 @@ expr_cond_false - 896445 + 896444 cond - 896445 + 896444 false - 896445 + 896444 @@ -31901,7 +31906,7 @@ 1 2 - 896445 + 896444 @@ -31917,7 +31922,7 @@ 1 2 - 896445 + 896444 @@ -31927,11 +31932,11 @@ values - 14099266 + 14099248 id - 14099266 + 14099248 str @@ -31949,7 +31954,7 @@ 1 2 - 14099266 + 14099248 @@ -31995,11 +32000,11 @@ valuetext - 6605852 + 6605626 id - 6605852 + 6605626 text @@ -32017,7 +32022,7 @@ 1 2 - 6605852 + 6605626 @@ -32047,7 +32052,7 @@ 7 - 593266 + 593260 27560 @@ -32058,15 +32063,15 @@ valuebind - 14484502 + 14484483 val - 14099266 + 14099248 expr - 14484502 + 14484483 @@ -32080,7 +32085,7 @@ 1 2 - 13735597 + 13735579 2 @@ -32101,7 +32106,7 @@ 1 2 - 14484502 + 14484483 @@ -32111,11 +32116,11 @@ fieldoffsets - 1441780 + 1441778 id - 1441780 + 1441778 byteoffset @@ -32137,7 +32142,7 @@ 1 2 - 1441780 + 1441778 @@ -32153,7 +32158,7 @@ 1 2 - 1441780 + 1441778 @@ -32538,23 +32543,23 @@ initialisers - 2336673 + 2336670 init - 2336673 + 2336670 var - 983091 + 983090 expr - 2336673 + 2336670 location - 539035 + 539034 @@ -32568,7 +32573,7 @@ 1 2 - 2336673 + 2336670 @@ -32584,7 +32589,7 @@ 1 2 - 2336673 + 2336670 @@ -32600,7 +32605,7 @@ 1 2 - 2336673 + 2336670 @@ -32616,7 +32621,7 @@ 1 2 - 865934 + 865933 2 @@ -32642,7 +32647,7 @@ 1 2 - 865934 + 865933 2 @@ -32668,7 +32673,7 @@ 1 2 - 983082 + 983081 2 @@ -32689,7 +32694,7 @@ 1 2 - 2336673 + 2336670 @@ -32705,7 +32710,7 @@ 1 2 - 2336673 + 2336670 @@ -32721,7 +32726,7 @@ 1 2 - 2336673 + 2336670 @@ -32768,7 +32773,7 @@ 1 2 - 470682 + 470681 2 @@ -32819,26 +32824,26 @@ braced_initialisers - 74272 + 74303 init - 74272 + 74303 expr_ancestor - 1798179 + 1798193 exp - 1798179 + 1798193 ancestor - 899966 + 899973 @@ -32852,7 +32857,7 @@ 1 2 - 1798179 + 1798193 @@ -32873,12 +32878,12 @@ 2 3 - 870862 + 870868 3 19 - 10792 + 10793 @@ -32888,11 +32893,11 @@ exprs - 25135886 + 25135853 id - 25135886 + 25135853 kind @@ -32900,7 +32905,7 @@ location - 11535483 + 11535468 @@ -32914,7 +32919,7 @@ 1 2 - 25135886 + 25135853 @@ -32930,7 +32935,7 @@ 1 2 - 25135886 + 25135853 @@ -33108,17 +33113,17 @@ 1 2 - 9705673 + 9705660 2 3 - 898510 + 898509 3 16 - 866991 + 866990 16 @@ -33139,17 +33144,17 @@ 1 2 - 9853416 + 9853403 2 3 - 844293 + 844292 3 32 - 837774 + 837773 @@ -33159,15 +33164,15 @@ expr_reuse - 907876 + 907883 reuse - 907876 + 907883 original - 907876 + 907883 value_category @@ -33185,7 +33190,7 @@ 1 2 - 907876 + 907883 @@ -33201,7 +33206,7 @@ 1 2 - 907876 + 907883 @@ -33217,7 +33222,7 @@ 1 2 - 907876 + 907883 @@ -33233,7 +33238,7 @@ 1 2 - 907876 + 907883 @@ -33285,11 +33290,11 @@ expr_types - 25135886 + 25135853 id - 25135886 + 25135853 typeid @@ -33311,7 +33316,7 @@ 1 2 - 25135886 + 25135853 @@ -33327,7 +33332,7 @@ 1 2 - 25135886 + 25135853 @@ -33472,11 +33477,11 @@ new_allocated_type - 58256 + 58257 expr - 58256 + 58257 type_id @@ -33494,7 +33499,7 @@ 1 2 - 58256 + 58257 @@ -33515,7 +33520,7 @@ 2 3 - 18258 + 18259 3 @@ -34600,15 +34605,15 @@ condition_decl_bind - 438290 + 438294 expr - 438290 + 438294 decl - 438290 + 438294 @@ -34622,7 +34627,7 @@ 1 2 - 438290 + 438294 @@ -34638,7 +34643,7 @@ 1 2 - 438290 + 438294 @@ -34648,11 +34653,11 @@ typeid_bind - 60404 + 60405 expr - 60404 + 60405 type_id @@ -34670,7 +34675,7 @@ 1 2 - 60404 + 60405 @@ -34706,11 +34711,11 @@ uuidof_bind - 27728 + 27727 expr - 27728 + 27727 type_id @@ -34728,7 +34733,7 @@ 1 2 - 27728 + 27727 @@ -34759,11 +34764,11 @@ sizeof_bind - 245235 + 245234 expr - 245235 + 245234 type_id @@ -34781,7 +34786,7 @@ 1 2 - 245235 + 245234 @@ -36365,11 +36370,11 @@ stmts - 6324268 + 6324260 id - 6324268 + 6324260 kind @@ -36377,7 +36382,7 @@ location - 2966233 + 2966229 @@ -36391,7 +36396,7 @@ 1 2 - 6324268 + 6324260 @@ -36407,7 +36412,7 @@ 1 2 - 6324268 + 6324260 @@ -36635,7 +36640,7 @@ 1 2 - 2357136 + 2357133 2 @@ -36645,7 +36650,7 @@ 3 8 - 228596 + 228595 8 @@ -36666,7 +36671,7 @@ 1 2 - 2892635 + 2892631 2 @@ -36775,6 +36780,17 @@ + + type_is_vla + 47 + + + type_id + 47 + + + + if_initialization 403 @@ -36825,15 +36841,15 @@ if_then - 987521 + 987520 if_stmt - 987521 + 987520 then_id - 987521 + 987520 @@ -36847,7 +36863,7 @@ 1 2 - 987521 + 987520 @@ -36863,7 +36879,7 @@ 1 2 - 987521 + 987520 @@ -36873,15 +36889,15 @@ if_else - 468501 + 468505 if_stmt - 468501 + 468505 else_id - 468501 + 468505 @@ -36895,7 +36911,7 @@ 1 2 - 468501 + 468505 @@ -36911,7 +36927,7 @@ 1 2 - 468501 + 468505 @@ -37305,11 +37321,11 @@ switch_case - 896207 + 896214 switch_stmt - 441450 + 441453 index @@ -37317,7 +37333,7 @@ case_id - 896207 + 896214 @@ -37336,7 +37352,7 @@ 2 3 - 438359 + 438363 3 @@ -37362,7 +37378,7 @@ 2 3 - 438359 + 438363 3 @@ -37525,7 +37541,7 @@ 1 2 - 896207 + 896214 @@ -37541,7 +37557,7 @@ 1 2 - 896207 + 896214 @@ -37551,15 +37567,15 @@ switch_body - 441450 + 441453 switch_stmt - 441450 + 441453 body_id - 441450 + 441453 @@ -37573,7 +37589,7 @@ 1 2 - 441450 + 441453 @@ -37589,7 +37605,7 @@ 1 2 - 441450 + 441453 @@ -37791,11 +37807,11 @@ stmtparents - 5536444 + 5536437 id - 5536444 + 5536437 index @@ -37803,7 +37819,7 @@ parent - 2349075 + 2349072 @@ -37817,7 +37833,7 @@ 1 2 - 5536444 + 5536437 @@ -37833,7 +37849,7 @@ 1 2 - 5536444 + 5536437 @@ -37971,12 +37987,12 @@ 1 2 - 1349054 + 1349052 2 3 - 508948 + 508947 3 @@ -37991,7 +38007,7 @@ 6 17 - 178120 + 178119 17 @@ -38012,12 +38028,12 @@ 1 2 - 1349054 + 1349052 2 3 - 508948 + 508947 3 @@ -38032,7 +38048,7 @@ 6 17 - 178120 + 178119 17 @@ -38047,11 +38063,11 @@ ishandler - 47521 + 47475 block - 47521 + 47475 @@ -38084,7 +38100,7 @@ 1 2 - 668063 + 668062 2 @@ -38105,7 +38121,7 @@ 1 2 - 668063 + 668062 2 @@ -38170,7 +38186,7 @@ 5480 - 170179 + 170178 8 @@ -38231,7 +38247,7 @@ 5480 - 170162 + 170161 8 @@ -38248,7 +38264,7 @@ 1 2 - 730668 + 730667 2 @@ -38305,7 +38321,7 @@ 1 2 - 668063 + 668062 2 @@ -38326,7 +38342,7 @@ 1 2 - 668063 + 668062 2 @@ -38391,7 +38407,7 @@ 5480 - 170179 + 170178 8 @@ -38452,7 +38468,7 @@ 5480 - 170179 + 170178 8 @@ -38495,15 +38511,15 @@ blockscope - 1838725 + 1838723 block - 1838725 + 1838723 enclosing - 1575685 + 1575683 @@ -38517,7 +38533,7 @@ 1 2 - 1838725 + 1838723 @@ -38533,7 +38549,7 @@ 1 2 - 1400369 + 1400368 2 @@ -38543,7 +38559,7 @@ 3 28 - 45477 + 45476 @@ -38553,11 +38569,11 @@ jumpinfo - 347365 + 347364 id - 347365 + 347364 str @@ -38579,7 +38595,7 @@ 1 2 - 347365 + 347364 @@ -38595,7 +38611,7 @@ 1 2 - 347365 + 347364 @@ -38698,7 +38714,7 @@ 4 5 - 7359 + 7358 5 @@ -38734,11 +38750,11 @@ preprocdirects - 5704677 + 5704669 id - 5704677 + 5704669 kind @@ -38746,7 +38762,7 @@ location - 5701313 + 5701306 @@ -38760,7 +38776,7 @@ 1 2 - 5704677 + 5704669 @@ -38776,7 +38792,7 @@ 1 2 - 5704677 + 5704669 @@ -38924,7 +38940,7 @@ 1 2 - 5701179 + 5701171 26 @@ -38945,7 +38961,7 @@ 1 2 - 5701313 + 5701306 @@ -38955,15 +38971,15 @@ preprocpair - 1103827 + 1103825 begin - 846303 + 846302 elseelifend - 1103827 + 1103825 @@ -38977,7 +38993,7 @@ 1 2 - 601561 + 601560 2 @@ -39003,7 +39019,7 @@ 1 2 - 1103827 + 1103825 @@ -39013,11 +39029,11 @@ preproctrue - 388573 + 388572 branch - 388573 + 388572 @@ -39035,19 +39051,19 @@ preproctext - 4599773 + 4690318 id - 4599773 + 4690318 head - 3333547 + 3333139 body - 1948247 + 1948244 @@ -39061,7 +39077,7 @@ 1 2 - 4599773 + 4690318 @@ -39077,7 +39093,7 @@ 1 2 - 4599773 + 4690318 @@ -39093,12 +39109,12 @@ 1 2 - 3143970 + 3143697 2 740 - 189577 + 189442 @@ -39114,7 +39130,7 @@ 1 2 - 3253357 + 3252949 2 @@ -39135,7 +39151,7 @@ 1 2 - 1763648 + 1763645 2 @@ -39144,7 +39160,7 @@ 6 - 11630 + 12303 38480 @@ -39161,16 +39177,16 @@ 1 2 - 1767549 + 1767547 2 7 - 146522 + 146521 7 - 2980 + 2977 34175 @@ -39181,15 +39197,15 @@ includes - 408672 + 408674 id - 408672 + 408674 included - 75280 + 75281 @@ -39203,7 +39219,7 @@ 1 2 - 408672 + 408674 @@ -39307,11 +39323,11 @@ link_parent - 38279006 + 38313696 element - 4869162 + 4873064 link_target @@ -39329,17 +39345,17 @@ 1 2 - 668749 + 668840 2 9 - 34026 + 33983 9 10 - 4166386 + 4170240 @@ -39358,48 +39374,48 @@ 42 - 97236 - 97237 + 97325 + 97326 42 - 97355 - 97356 + 97444 + 97445 42 - 97408 - 97409 + 97497 + 97498 42 - 97435 - 97436 + 97524 + 97525 42 - 97457 - 97458 + 97546 + 97547 42 - 97490 - 97491 + 97578 + 97579 42 - 99496 - 99497 + 99585 + 99586 42 - 102875 - 102876 + 102965 + 102966 42 - 104238 - 104239 + 104327 + 104328 42 From b75e0ed02eaafb8b8f1830ce0541f986a2e3b412 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 15 Apr 2025 14:25:39 +0100 Subject: [PATCH 279/372] actions: Fix spelling error in UnmaskedSecretExposure.md Corrects "know" to "known" in the description of the UnmaskedSecretExposure document. --- actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md b/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md index 6c681856a7b..3c56374f993 100644 --- a/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md +++ b/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.md @@ -2,7 +2,7 @@ ## Description -Secrets derived from other secrets are not know to the workflow runner and therefore not masked unless explicitly registered. +Secrets derived from other secrets are not known to the workflow runner and therefore not masked unless explicitly registered. ## Recommendations From 39a875e7517d98e9de17c9800d1f19c8705f4016 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:31:29 +0100 Subject: [PATCH 280/372] Rust: Make some summaries value type. --- .../frameworks/stdlib/lang-alloc.model.yml | 4 +- .../frameworks/stdlib/lang-core.model.yml | 4 +- .../dataflow/local/DataFlowStep.expected | 1960 +++++++++-------- 3 files changed, 985 insertions(+), 983 deletions(-) diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml index 24cfd3aa249..effb389aecc 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-alloc.model.yml @@ -32,8 +32,8 @@ extensions: # Fmt - ["lang:alloc", "crate::fmt::format", "Argument[0]", "ReturnValue", "taint", "manual"] # String - - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:alloc", "::as_str", "Argument[self]", "ReturnValue", "value", "manual"] + - ["lang:alloc", "::as_bytes", "Argument[self]", "ReturnValue", "value", "manual"] - ["lang:alloc", "<_ as crate::string::ToString>::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:alloc", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:alloc", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml index dcef65d2a6e..3e37ed7797b 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/lang-core.model.yml @@ -40,8 +40,8 @@ extensions: - ["lang:core", "crate::ptr::write_unaligned", "Argument[1]", "Argument[0].Reference", "value", "manual"] - ["lang:core", "crate::ptr::write_volatile", "Argument[1]", "Argument[0].Reference", "value", "manual"] # Str - - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "manual"] - - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "manual"] + - ["lang:core", "::as_str", "Argument[self]", "ReturnValue", "taint", "value"] + - ["lang:core", "::as_bytes", "Argument[self]", "ReturnValue", "taint", "value"] - ["lang:core", "::to_string", "Argument[self]", "ReturnValue", "taint", "manual"] - ["lang:core", "::parse", "Argument[self]", "ReturnValue.Field[crate::result::Result::Ok(0)]", "taint", "manual"] - ["lang:core", "::trim", "Argument[self]", "ReturnValue.Reference", "taint", "manual"] diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index e9c1ff8c824..b709b2f937d 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -943,985 +943,987 @@ models | 80 | Summary: lang:alloc; ::add; Argument[self]; ReturnValue; value | | 81 | Summary: lang:alloc; ::from_str; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | | 82 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 83 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 84 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 85 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 86 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 87 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 88 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | -| 89 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 90 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | -| 91 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | -| 92 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | -| 93 | Summary: lang:alloc; ::from; Argument[0].Field[0]; ReturnValue; value | -| 94 | Summary: lang:alloc; ::push_within_capacity; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 95 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | -| 96 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | -| 97 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 98 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 99 | Summary: lang:alloc; ::as_into_iter; Argument[self]; ReturnValue; value | -| 100 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 101 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | -| 102 | Summary: lang:alloc; <{766}::StringError as crate::error::Error>::description; Argument[self].Field[0]; ReturnValue.Reference; value | -| 103 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 104 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[1].ReturnValue; Argument[0].Reference; value | -| 105 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[0].Reference; Argument[1].Parameter[0]; value | -| 106 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[1].ReturnValue; Argument[0].Reference; value | -| 107 | Summary: lang:core; <&_ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 108 | Summary: lang:core; <&_ as crate::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | -| 109 | Summary: lang:core; <&_ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 110 | Summary: lang:core; <&mut _ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 111 | Summary: lang:core; <&mut _ as crate::borrow::BorrowMut>::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | -| 112 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[0]; ReturnValue; value | -| 113 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 114 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 115 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[0]; ReturnValue; value | -| 116 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 117 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 118 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[0]; ReturnValue; value | -| 119 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 120 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 121 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[0]; ReturnValue; value | -| 122 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 123 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 124 | Summary: lang:core; <&mut _ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | -| 125 | Summary: lang:core; <&mut _ as crate::ops::deref::DerefMut>::deref_mut; Argument[self].Reference; ReturnValue; value | -| 126 | Summary: lang:core; <[_] as crate::convert::AsMut>::as_mut; Argument[self]; ReturnValue; value | -| 127 | Summary: lang:core; <[_] as crate::convert::AsRef>::as_ref; Argument[self]; ReturnValue; value | -| 128 | Summary: lang:core; <[_] as crate::slice::SlicePattern>::as_slice; Argument[self]; ReturnValue; value | -| 129 | Summary: lang:core; <[_]>::align_to; Argument[self]; ReturnValue.Field[0]; value | -| 130 | Summary: lang:core; <[_]>::align_to_mut; Argument[self]; ReturnValue.Field[0]; value | -| 131 | Summary: lang:core; <[_]>::as_simd; Argument[self]; ReturnValue.Field[0]; value | -| 132 | Summary: lang:core; <[_]>::as_simd_mut; Argument[self]; ReturnValue.Field[0]; value | -| 133 | Summary: lang:core; <[_]>::partition_dedup; Argument[self]; ReturnValue.Field[0]; value | -| 134 | Summary: lang:core; <[_]>::partition_dedup_by; Argument[self]; ReturnValue.Field[0]; value | -| 135 | Summary: lang:core; <[_]>::partition_dedup_by_key; Argument[self]; ReturnValue.Field[0]; value | -| 136 | Summary: lang:core; <[u8]>::trim_ascii; Argument[self]; ReturnValue; value | -| 137 | Summary: lang:core; <[u8]>::trim_ascii_end; Argument[self]; ReturnValue; value | -| 138 | Summary: lang:core; <[u8]>::trim_ascii_start; Argument[self]; ReturnValue; value | -| 139 | Summary: lang:core; <_ as crate::array::SpecArrayClone>::clone; Argument[0].Reference; ReturnValue; value | -| 140 | Summary: lang:core; <_ as crate::async_iter::async_iter::IntoAsyncIterator>::into_async_iter; Argument[self]; ReturnValue; value | -| 141 | Summary: lang:core; <_ as crate::borrow::Borrow>::borrow; Argument[self]; ReturnValue; value | -| 142 | Summary: lang:core; <_ as crate::borrow::BorrowMut>::borrow_mut; Argument[self]; ReturnValue; value | -| 143 | Summary: lang:core; <_ as crate::clone::uninit::CopySpec>::clone_one; Argument[0]; Argument[1].Reference; value | -| 144 | Summary: lang:core; <_ as crate::convert::From>::from; Argument[0]; ReturnValue; value | -| 145 | Summary: lang:core; <_ as crate::future::into_future::IntoFuture>::into_future; Argument[self]; ReturnValue; value | -| 146 | Summary: lang:core; <_ as crate::iter::adapters::step_by::SpecRangeSetup>::setup; Argument[0]; ReturnValue; value | -| 147 | Summary: lang:core; <_ as crate::iter::traits::collect::IntoIterator>::into_iter; Argument[self]; ReturnValue; value | -| 148 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[0]; Argument[self].Reference.Parameter[0]; value | -| 149 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[self].Reference.ReturnValue; ReturnValue; value | -| 150 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 151 | Summary: lang:core; ::select_unpredictable; Argument[0]; ReturnValue; value | -| 152 | Summary: lang:core; ::select_unpredictable; Argument[1]; ReturnValue; value | -| 153 | Summary: lang:core; ::then; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 154 | Summary: lang:core; ::then_some; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 155 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 156 | Summary: lang:core; ::to_ascii_lowercase; Argument[self].Reference; ReturnValue; value | -| 157 | Summary: lang:core; ::to_ascii_uppercase; Argument[self].Reference; ReturnValue; value | -| 158 | Summary: lang:core; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | -| 159 | Summary: lang:core; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 160 | Summary: lang:core; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 161 | Summary: lang:core; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 162 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 163 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 164 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 165 | Summary: lang:core; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 166 | Summary: lang:core; ::index; Argument[self]; ReturnValue; value | -| 167 | Summary: lang:core; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | -| 168 | Summary: lang:core; ::index_mut; Argument[self]; ReturnValue; value | -| 169 | Summary: lang:core; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | -| 170 | Summary: lang:core; ::update; Argument[0].ReturnValue; ReturnValue; value | -| 171 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 172 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 173 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 174 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 175 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 176 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 177 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 178 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 179 | Summary: lang:core; ::get_or_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 180 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 181 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 182 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue; ReturnValue; value | -| 183 | Summary: lang:core; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 184 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 185 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 186 | Summary: lang:core; ::then; Argument[0]; ReturnValue; value | -| 187 | Summary: lang:core; ::then; Argument[self]; ReturnValue; value | -| 188 | Summary: lang:core; ::then_with; Argument[0].ReturnValue; ReturnValue; value | -| 189 | Summary: lang:core; ::then_with; Argument[self]; ReturnValue; value | -| 190 | Summary: lang:core; ::from; Argument[0]; ReturnValue; value | -| 191 | Summary: lang:core; ::provide_ref; Argument[self]; ReturnValue; value | -| 192 | Summary: lang:core; ::provide_ref_with; Argument[self]; ReturnValue; value | -| 193 | Summary: lang:core; ::provide_value; Argument[self]; ReturnValue; value | -| 194 | Summary: lang:core; ::provide_value_with; Argument[self]; ReturnValue; value | -| 195 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 196 | Summary: lang:core; ::with_copy; Argument[0].ReturnValue; ReturnValue; value | -| 197 | Summary: lang:core; ::align; Argument[self]; ReturnValue; value | -| 198 | Summary: lang:core; ::alternate; Argument[self]; ReturnValue; value | -| 199 | Summary: lang:core; ::debug_as_hex; Argument[self]; ReturnValue; value | -| 200 | Summary: lang:core; ::fill; Argument[self]; ReturnValue; value | -| 201 | Summary: lang:core; ::precision; Argument[self]; ReturnValue; value | -| 202 | Summary: lang:core; ::sign; Argument[self]; ReturnValue; value | -| 203 | Summary: lang:core; ::sign_aware_zero_pad; Argument[self]; ReturnValue; value | -| 204 | Summary: lang:core; ::width; Argument[self]; ReturnValue; value | -| 205 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 206 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 207 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 208 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 209 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 210 | Summary: lang:core; ::key; Argument[self]; ReturnValue; value | -| 211 | Summary: lang:core; ::key_with; Argument[self]; ReturnValue; value | -| 212 | Summary: lang:core; ::value; Argument[self]; ReturnValue; value | -| 213 | Summary: lang:core; ::value_with; Argument[self]; ReturnValue; value | -| 214 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | -| 215 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | -| 216 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | -| 217 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 218 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 219 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | -| 220 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | -| 221 | Summary: lang:core; ::into_inner; Argument[self].Field[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 222 | Summary: lang:core; ::clear; Argument[self]; ReturnValue; value | -| 223 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 224 | Summary: lang:core; ::advance; Argument[self]; ReturnValue; value | -| 225 | Summary: lang:core; ::advance_unchecked; Argument[self]; ReturnValue; value | -| 226 | Summary: lang:core; ::ensure_init; Argument[self]; ReturnValue; value | -| 227 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | -| 228 | Summary: lang:core; ::fold; Argument[0].Field[0]; ReturnValue; value | -| 229 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 230 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 231 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 232 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 233 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 234 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 235 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 236 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 237 | Summary: lang:core; ::rfold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 238 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 239 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 240 | Summary: lang:core; ::try_rfold; Argument[self].Field[0]; ReturnValue; value | -| 241 | Summary: lang:core; ::fold; Argument[self].Field[0].Field[0]; ReturnValue; value | -| 242 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 243 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 244 | Summary: lang:core; ::try_fold; Argument[self].Field[0]; ReturnValue; value | -| 245 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 246 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 247 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 248 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 249 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 250 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 251 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 252 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 253 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 254 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 255 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 256 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 257 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 258 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 259 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 260 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 261 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 262 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 263 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 264 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 265 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 266 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 267 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 268 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 269 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 270 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 271 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 272 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 273 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 274 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 275 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 276 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 277 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 278 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 279 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 280 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 281 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 282 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 283 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 284 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 285 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 286 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 287 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 288 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 289 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 290 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 291 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 292 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 293 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 294 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 295 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 296 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 297 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 298 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 299 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 300 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 301 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 302 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 303 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 304 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 305 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 306 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 307 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 308 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 309 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 310 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 311 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 312 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 313 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 314 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 315 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 316 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 317 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 318 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 319 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 320 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 321 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 322 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 323 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 324 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 325 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 326 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 327 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 328 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 329 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 330 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 331 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 332 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 333 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 334 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 335 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 336 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 337 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 338 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 339 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 340 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 341 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 342 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 343 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 344 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 345 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 346 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 347 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 348 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 349 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 350 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 351 | Summary: lang:core; ::fold; Argument[0]; Argument[1].Parameter[0]; value | -| 352 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 353 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 354 | Summary: lang:core; ::try_fold; Argument[0]; Argument[1].Parameter[0]; value | -| 355 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 356 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 357 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 358 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 359 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 360 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 361 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 362 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 363 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 364 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 365 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 366 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 367 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 368 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 369 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 370 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 371 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 372 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 373 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 374 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 375 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 376 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 377 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 378 | Summary: lang:core; ::spec_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 379 | Summary: lang:core; ::spec_rfold; Argument[0]; ReturnValue; value | -| 380 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 381 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | -| 382 | Summary: lang:core; ::spec_try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 383 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 384 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 385 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 386 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 387 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 388 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 389 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 390 | Summary: lang:core; ::rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 391 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 392 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 393 | Summary: lang:core; ::try_rfold; Argument[0]; Argument[1].Parameter[0]; value | -| 394 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 395 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 396 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 397 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 398 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 399 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 400 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 401 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 402 | Summary: lang:core; ::spec_fold; Argument[0].Field[0]; ReturnValue; value | -| 403 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 404 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 405 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 406 | Summary: lang:core; ::rfold; Argument[0].ReturnValue; ReturnValue; value | -| 407 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | -| 408 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | -| 409 | Summary: lang:core; ::rfold; Argument[self].Field[0]; ReturnValue; value | -| 410 | Summary: lang:core; ::rfold; Argument[self]; ReturnValue; value | -| 411 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 412 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 413 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 414 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | -| 415 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | -| 416 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | -| 417 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 418 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 419 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | -| 420 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 421 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | -| 422 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 423 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 424 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 425 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 426 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 427 | Summary: lang:core; ::nth_back; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 428 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 429 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 430 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 431 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 432 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 433 | Summary: lang:core; ::to_canonical; Argument[self].Reference; ReturnValue; value | -| 434 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 435 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 436 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 437 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | -| 438 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | -| 439 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | -| 440 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 441 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 442 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 443 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 444 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 445 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 446 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 447 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 448 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | -| 449 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | -| 450 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | -| 451 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | -| 452 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | -| 453 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | -| 454 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | -| 455 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 456 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 457 | Summary: lang:core; ::from_mut_unchecked; Argument[0]; ReturnValue; value | -| 458 | Summary: lang:core; ::new_unchecked; Argument[0]; ReturnValue; value | -| 459 | Summary: lang:core; ::get; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 460 | Summary: lang:core; ::get_mut; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 461 | Summary: lang:core; ::get_unchecked; Argument[0]; ReturnValue; value | -| 462 | Summary: lang:core; ::get_unchecked_mut; Argument[0]; ReturnValue; value | -| 463 | Summary: lang:core; ::index; Argument[0]; ReturnValue; value | -| 464 | Summary: lang:core; ::index_mut; Argument[0]; ReturnValue; value | -| 465 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | -| 466 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | -| 467 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | -| 468 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 469 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 470 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 471 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 472 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 473 | Summary: lang:core; ::wrap_mut_1; Argument[0]; ReturnValue; value | -| 474 | Summary: lang:core; ::wrap_mut_2; Argument[0]; ReturnValue; value | -| 475 | Summary: lang:core; ::clone; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 476 | Summary: lang:core; ::from; Argument[0].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 477 | Summary: lang:core; ::from; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 478 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 479 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 480 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 481 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 482 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 483 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 484 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | -| 485 | Summary: lang:core; ::cloned; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 486 | Summary: lang:core; ::copied; Argument[self].Field[crate::option::Option::Some(0)].Reference; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 487 | Summary: lang:core; ::expect; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 488 | Summary: lang:core; ::flatten; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 489 | Summary: lang:core; ::get_or_insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 490 | Summary: lang:core; ::get_or_insert; Argument[0]; ReturnValue.Reference; value | -| 491 | Summary: lang:core; ::get_or_insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 492 | Summary: lang:core; ::get_or_insert_default; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 493 | Summary: lang:core; ::get_or_insert_with; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 494 | Summary: lang:core; ::insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 495 | Summary: lang:core; ::insert; Argument[0]; ReturnValue.Reference; value | -| 496 | Summary: lang:core; ::insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | -| 497 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 498 | Summary: lang:core; ::is_none_or; Argument[0].ReturnValue; ReturnValue; value | -| 499 | Summary: lang:core; ::is_none_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 500 | Summary: lang:core; ::is_some_and; Argument[0].ReturnValue; ReturnValue; value | -| 501 | Summary: lang:core; ::is_some_and; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 502 | Summary: lang:core; ::map; Argument[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 503 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 504 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 505 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | -| 506 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 507 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 508 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 509 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 510 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 511 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 512 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 513 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 514 | Summary: lang:core; ::ok_or; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 515 | Summary: lang:core; ::ok_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 516 | Summary: lang:core; ::ok_or_else; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 517 | Summary: lang:core; ::ok_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 518 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 519 | Summary: lang:core; ::or; Argument[self]; ReturnValue; value | -| 520 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 521 | Summary: lang:core; ::or_else; Argument[self]; ReturnValue; value | -| 522 | Summary: lang:core; ::replace; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | -| 523 | Summary: lang:core; ::replace; Argument[self].Reference; ReturnValue; value | -| 524 | Summary: lang:core; ::take; Argument[self].Reference; ReturnValue; value | -| 525 | Summary: lang:core; ::take_if; Argument[self].Reference.Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0].Reference; value | -| 526 | Summary: lang:core; ::take_if; Argument[self].Reference; ReturnValue; value | -| 527 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 528 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; value | -| 529 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 530 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 531 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 532 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 533 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 534 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 535 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 536 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[0].Field[crate::option::Option::Some(0)]; value | -| 537 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[1]; ReturnValue.Field[1].Field[crate::option::Option::Some(0)]; value | -| 538 | Summary: lang:core; ::xor; Argument[0]; ReturnValue; value | -| 539 | Summary: lang:core; ::xor; Argument[self]; ReturnValue; value | -| 540 | Summary: lang:core; ::zip; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 541 | Summary: lang:core; ::zip; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 542 | Summary: lang:core; ::zip_with; Argument[0].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[1]; value | -| 543 | Summary: lang:core; ::zip_with; Argument[1].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 544 | Summary: lang:core; ::zip_with; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | -| 545 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | -| 546 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 547 | Summary: lang:core; ::max; Argument[0]; ReturnValue; value | -| 548 | Summary: lang:core; ::max; Argument[1]; ReturnValue; value | -| 549 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 550 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 551 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | -| 552 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 553 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 554 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 555 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 556 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | -| 557 | Summary: lang:core; ::and; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 558 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | -| 559 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 560 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 561 | Summary: lang:core; ::as_deref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 562 | Summary: lang:core; ::as_deref_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 563 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 564 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 565 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | -| 566 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | -| 567 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 568 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 569 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 570 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Ok(0)].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 571 | Summary: lang:core; ::err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 572 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 573 | Summary: lang:core; ::expect_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 574 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 575 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 576 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | -| 577 | Summary: lang:core; ::inspect_err; Argument[self]; ReturnValue; value | -| 578 | Summary: lang:core; ::into_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 579 | Summary: lang:core; ::into_ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 580 | Summary: lang:core; ::is_err_and; Argument[0].ReturnValue; ReturnValue; value | -| 581 | Summary: lang:core; ::is_err_and; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 582 | Summary: lang:core; ::is_ok_and; Argument[0].ReturnValue; ReturnValue; value | -| 583 | Summary: lang:core; ::is_ok_and; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | -| 584 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 585 | Summary: lang:core; ::map_err; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 586 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 587 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 588 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | -| 589 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | -| 590 | Summary: lang:core; ::map_or; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 591 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 592 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | -| 593 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 594 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | -| 595 | Summary: lang:core; ::ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 596 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | -| 597 | Summary: lang:core; ::or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 598 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | -| 599 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 600 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 601 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; value | -| 602 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; value | -| 603 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 604 | Summary: lang:core; ::unwrap_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 605 | Summary: lang:core; ::unwrap_err_unchecked; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | -| 606 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | -| 607 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 608 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 609 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | -| 610 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)].Reference; ReturnValue; value | -| 611 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | -| 612 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 613 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 614 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 615 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 616 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 617 | Summary: lang:core; ::collect; Argument[self].Element; ReturnValue.Element; value | -| 618 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 619 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 620 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 621 | Summary: lang:core; ::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 622 | Summary: lang:core; ::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 623 | Summary: lang:core; ::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 624 | Summary: lang:core; ::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 625 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 626 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | -| 627 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 628 | Summary: lang:core; ::call; Argument[0].Field[0]; ReturnValue; value | -| 629 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 630 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 631 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 632 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 633 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 634 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | -| 635 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | -| 636 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | -| 637 | Summary: lang:core; ::matching; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | -| 638 | Summary: lang:core; ::matching; Argument[1]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | -| 639 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 640 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | -| 641 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 642 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 643 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 644 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 645 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 646 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 647 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 648 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 649 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 650 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 651 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 652 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 653 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 654 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 655 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 656 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 657 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 658 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 659 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 660 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 661 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 662 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 663 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 664 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 665 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 666 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 667 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 668 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 669 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 670 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 671 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 672 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | -| 673 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | -| 674 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | -| 675 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | -| 676 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | -| 677 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | -| 678 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | -| 679 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | -| 680 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | -| 681 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 682 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 683 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 684 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 685 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 686 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 687 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 688 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 689 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 690 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 691 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 692 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 693 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 694 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 695 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 696 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 697 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 698 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 699 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 700 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 701 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 702 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 703 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 704 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 705 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 706 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 707 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 708 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 709 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 710 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 711 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 712 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 713 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 714 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 715 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 716 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 717 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 718 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 719 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 720 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 721 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 722 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 723 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 724 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 725 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 726 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 727 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 728 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 729 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 730 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 731 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 732 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 733 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 734 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 735 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 736 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 737 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 738 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 739 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 740 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 741 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 742 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 743 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 744 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 745 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 746 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 747 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 748 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 749 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 750 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 751 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 752 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 753 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 754 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 755 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 756 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 757 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 758 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 759 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 760 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 761 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 762 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | -| 763 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 764 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 765 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 766 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | -| 767 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | -| 768 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | -| 769 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | -| 770 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | -| 771 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | -| 772 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | -| 773 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | -| 774 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | -| 775 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | -| 776 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | -| 777 | Summary: lang:core; ::as_mut; Argument[self]; ReturnValue; value | -| 778 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | -| 779 | Summary: lang:core; ::as_str; Argument[self]; ReturnValue; value | -| 780 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 781 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 782 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 783 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 784 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 785 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 786 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 787 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 788 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 789 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 790 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 791 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 792 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 793 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 794 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 795 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | -| 796 | Summary: lang:core; ::index; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 797 | Summary: lang:core; ::index_mut; Argument[0].Reference.Element; ReturnValue.Reference; value | -| 798 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 799 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | -| 800 | Summary: lang:core; crate::array::drain::drain_array_with; Argument[1].ReturnValue; ReturnValue; value | -| 801 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | -| 802 | Summary: lang:core; crate::cmp::max; Argument[1]; ReturnValue; value | -| 803 | Summary: lang:core; crate::cmp::max_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 804 | Summary: lang:core; crate::cmp::max_by; Argument[0]; ReturnValue; value | -| 805 | Summary: lang:core; crate::cmp::max_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 806 | Summary: lang:core; crate::cmp::max_by; Argument[1]; ReturnValue; value | -| 807 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 808 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; ReturnValue; value | -| 809 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 810 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; ReturnValue; value | -| 811 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | -| 812 | Summary: lang:core; crate::cmp::min; Argument[1]; ReturnValue; value | -| 813 | Summary: lang:core; crate::cmp::min_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 814 | Summary: lang:core; crate::cmp::min_by; Argument[0]; ReturnValue; value | -| 815 | Summary: lang:core; crate::cmp::min_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 816 | Summary: lang:core; crate::cmp::min_by; Argument[1]; ReturnValue; value | -| 817 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 818 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; ReturnValue; value | -| 819 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 820 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; ReturnValue; value | -| 821 | Summary: lang:core; crate::cmp::minmax; Argument[0]; ReturnValue.Element; value | -| 822 | Summary: lang:core; crate::cmp::minmax; Argument[1]; ReturnValue.Element; value | -| 823 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; Argument[2].Parameter[1].Reference; value | -| 824 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; ReturnValue.Element; value | -| 825 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 826 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; ReturnValue.Element; value | -| 827 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | -| 828 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; ReturnValue.Element; value | -| 829 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | -| 830 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; ReturnValue.Element; value | -| 831 | Summary: lang:core; crate::contracts::build_check_ensures; Argument[0]; ReturnValue; value | -| 832 | Summary: lang:core; crate::convert::identity; Argument[0]; ReturnValue; value | -| 833 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | -| 834 | Summary: lang:core; crate::intrinsics::contract_check_ensures; Argument[0]; Argument[1].Parameter[0]; value | -| 835 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[1]; ReturnValue; value | -| 836 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[2]; ReturnValue; value | -| 837 | Summary: lang:core; crate::iter::traits::iterator::Iterator::collect; Argument[self].Element; ReturnValue.Element; value | -| 838 | Summary: lang:core; crate::iter::traits::iterator::Iterator::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | -| 839 | Summary: lang:core; crate::iter::traits::iterator::Iterator::map; Argument[self].Element; Argument[0].Parameter[0]; value | -| 840 | Summary: lang:core; crate::iter::traits::iterator::Iterator::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 841 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 842 | Summary: lang:core; crate::mem::copy; Argument[0].Reference; ReturnValue; value | -| 843 | Summary: lang:core; crate::mem::replace; Argument[0].Reference; ReturnValue; value | -| 844 | Summary: lang:core; crate::mem::replace; Argument[1]; Argument[0].Reference; value | -| 845 | Summary: lang:core; crate::mem::take; Argument[0].Reference; ReturnValue; value | -| 846 | Summary: lang:core; crate::num::flt2dec::strategy::dragon::mul_pow10; Argument[0]; ReturnValue; value | -| 847 | Summary: lang:core; crate::num::flt2dec::to_exact_exp_str; Argument[5].Element; Argument[0].Parameter[1].Reference; value | -| 848 | Summary: lang:core; crate::num::flt2dec::to_exact_fixed_str; Argument[4].Element; Argument[0].Parameter[1].Reference; value | -| 849 | Summary: lang:core; crate::num::flt2dec::to_shortest_exp_str; Argument[5]; Argument[0].Parameter[1]; value | -| 850 | Summary: lang:core; crate::num::flt2dec::to_shortest_str; Argument[4]; Argument[0].Parameter[1]; value | -| 851 | Summary: lang:core; crate::panic::abort_unwind; Argument[0].ReturnValue; ReturnValue; value | -| 852 | Summary: lang:core; crate::ptr::from_mut; Argument[0]; ReturnValue; value | -| 853 | Summary: lang:core; crate::ptr::from_ref; Argument[0]; ReturnValue; value | -| 854 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | -| 855 | Summary: lang:core; crate::ptr::read_unaligned; Argument[0].Reference; ReturnValue; value | -| 856 | Summary: lang:core; crate::ptr::read_volatile; Argument[0].Reference; ReturnValue; value | -| 857 | Summary: lang:core; crate::ptr::replace; Argument[0].Reference; ReturnValue; value | -| 858 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | -| 859 | Summary: lang:core; crate::ptr::write_unaligned; Argument[1]; Argument[0].Reference; value | -| 860 | Summary: lang:core; crate::ptr::write_volatile; Argument[1]; Argument[0].Reference; value | -| 861 | Summary: lang:core; crate::slice::sort::shared::find_existing_run; Argument[1].ReturnValue; ReturnValue.Field[1]; value | -| 862 | Summary: lang:core; crate::slice::sort::shared::smallsort::sort4_stable; Argument[0].Reference; Argument[2].Parameter[1].Reference; value | -| 863 | Summary: lang:core; crate::str::validations::next_code_point; Argument[0].Element; ReturnValue; value | -| 864 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_lower; Argument[0]; ReturnValue.Element; value | -| 865 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_upper; Argument[0]; ReturnValue.Element; value | -| 866 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 867 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 868 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 869 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; ReturnValue.Reference; value | -| 870 | Summary: lang:proc_macro; <&str as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | -| 871 | Summary: lang:proc_macro; <&str as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | -| 872 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 873 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 874 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 875 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 876 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 877 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 878 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 879 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 880 | Summary: lang:proc_macro; ::into_token_stream; Argument[self]; ReturnValue; value | -| 881 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 882 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 883 | Summary: lang:proc_macro; ::take; Argument[self].Reference; ReturnValue; value | -| 884 | Summary: lang:proc_macro; ::clone; Argument[self].Reference; ReturnValue; value | -| 885 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 886 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | -| 887 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 888 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | -| 889 | Summary: lang:proc_macro; ::next; Argument[self].Field[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 890 | Summary: lang:proc_macro; ::error; Argument[self]; ReturnValue; value | -| 891 | Summary: lang:proc_macro; ::help; Argument[self]; ReturnValue; value | -| 892 | Summary: lang:proc_macro; ::note; Argument[self]; ReturnValue; value | -| 893 | Summary: lang:proc_macro; ::span_error; Argument[self]; ReturnValue; value | -| 894 | Summary: lang:proc_macro; ::span_help; Argument[self]; ReturnValue; value | -| 895 | Summary: lang:proc_macro; ::span_note; Argument[self]; ReturnValue; value | -| 896 | Summary: lang:proc_macro; ::span_warning; Argument[self]; ReturnValue; value | -| 897 | Summary: lang:proc_macro; ::warning; Argument[self]; ReturnValue; value | -| 898 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 899 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 900 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 901 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 902 | Summary: lang:proc_macro; ::into_spans; Argument[self]; ReturnValue; value | -| 903 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 904 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 905 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 906 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 907 | Summary: lang:proc_macro; ::decode; Argument[0].Element; ReturnValue; value | -| 908 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | -| 909 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | -| 910 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | -| 911 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1].ReturnValue; ReturnValue; value | -| 912 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1]; Argument[1].Parameter[0]; value | -| 913 | Summary: lang:proc_macro; crate::bridge::client::state::with; Argument[0].ReturnValue; ReturnValue; value | -| 914 | Summary: lang:std; <&[u8] as crate::io::BufRead>::consume; Argument[self].Element; Argument[self].Reference.Reference; value | -| 915 | Summary: lang:std; <&[u8] as crate::io::BufRead>::fill_buf; Argument[self].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 916 | Summary: lang:std; <&[u8] as crate::io::Read>::read_buf_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 917 | Summary: lang:std; <&[u8] as crate::io::Read>::read_exact; Argument[self].Element; Argument[self].Reference.Reference; value | -| 918 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_end; Argument[self].Element; Argument[self].Reference.Reference; value | -| 919 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_string; Argument[self].Element; Argument[self].Reference.Reference; value | -| 920 | Summary: lang:std; <&[u8] as crate::io::copy::BufferedReaderSpec>::copy_to; Argument[self].Element; Argument[self].Reference.Reference; value | -| 921 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 922 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | -| 923 | Summary: lang:std; ::pretty; Argument[self]; ReturnValue; value | -| 924 | Summary: lang:std; ::show_backtrace; Argument[self]; ReturnValue; value | -| 925 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 926 | Summary: lang:std; ::borrow; Argument[self].Element; ReturnValue.Reference; value | -| 927 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 928 | Summary: lang:std; ::deref; Argument[self].Element; ReturnValue.Reference; value | -| 929 | Summary: lang:std; ::deref_mut; Argument[self].Element; ReturnValue.Reference; value | -| 930 | Summary: lang:std; ::as_os_str; Argument[self]; ReturnValue; value | -| 931 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 932 | Summary: lang:std; ::recursive; Argument[self]; ReturnValue; value | -| 933 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 934 | Summary: lang:std; ::set_created; Argument[self]; ReturnValue; value | -| 935 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 936 | Summary: lang:std; ::set_accessed; Argument[self]; ReturnValue; value | -| 937 | Summary: lang:std; ::set_modified; Argument[self]; ReturnValue; value | -| 938 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 939 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 940 | Summary: lang:std; ::custom_flags; Argument[self]; ReturnValue; value | -| 941 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | -| 942 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 943 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 944 | Summary: lang:std; ::append; Argument[self]; ReturnValue; value | -| 945 | Summary: lang:std; ::create; Argument[self]; ReturnValue; value | -| 946 | Summary: lang:std; ::create_new; Argument[self]; ReturnValue; value | -| 947 | Summary: lang:std; ::read; Argument[self]; ReturnValue; value | -| 948 | Summary: lang:std; ::truncate; Argument[self]; ReturnValue; value | -| 949 | Summary: lang:std; ::write; Argument[self]; ReturnValue; value | -| 950 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 951 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 952 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | -| 953 | Summary: lang:std; ::error; Argument[self].Field[1]; ReturnValue.Reference; value | -| 954 | Summary: lang:std; ::into_error; Argument[self].Field[1]; ReturnValue; value | -| 955 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 956 | Summary: lang:std; ::into_parts; Argument[self].Field[0]; ReturnValue.Field[1]; value | -| 957 | Summary: lang:std; ::into_parts; Argument[self].Field[1]; ReturnValue.Field[0]; value | -| 958 | Summary: lang:std; ::from; Argument[0].Field[1]; ReturnValue; value | -| 959 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 960 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 961 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 962 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 963 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 964 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 965 | Summary: lang:std; ::as_fd; Argument[self].Reference; ReturnValue; value | -| 966 | Summary: lang:std; ::new; Argument[0].ReturnValue; ReturnValue; value | -| 967 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 968 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 969 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 970 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | -| 971 | Summary: lang:std; ::as_path; Argument[self]; ReturnValue; value | -| 972 | Summary: lang:std; ::arg0; Argument[self]; ReturnValue; value | -| 973 | Summary: lang:std; ::gid; Argument[self]; ReturnValue; value | -| 974 | Summary: lang:std; ::groups; Argument[self]; ReturnValue; value | -| 975 | Summary: lang:std; ::pre_exec; Argument[self]; ReturnValue; value | -| 976 | Summary: lang:std; ::process_group; Argument[self]; ReturnValue; value | -| 977 | Summary: lang:std; ::uid; Argument[self]; ReturnValue; value | -| 978 | Summary: lang:std; ::arg; Argument[self]; ReturnValue; value | -| 979 | Summary: lang:std; ::args; Argument[self]; ReturnValue; value | -| 980 | Summary: lang:std; ::current_dir; Argument[self]; ReturnValue; value | -| 981 | Summary: lang:std; ::env; Argument[self]; ReturnValue; value | -| 982 | Summary: lang:std; ::env_clear; Argument[self]; ReturnValue; value | -| 983 | Summary: lang:std; ::env_remove; Argument[self]; ReturnValue; value | -| 984 | Summary: lang:std; ::envs; Argument[self]; ReturnValue; value | -| 985 | Summary: lang:std; ::stderr; Argument[self]; ReturnValue; value | -| 986 | Summary: lang:std; ::stdin; Argument[self]; ReturnValue; value | -| 987 | Summary: lang:std; ::stdout; Argument[self]; ReturnValue; value | -| 988 | Summary: lang:std; ::report; Argument[self]; ReturnValue; value | -| 989 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 990 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 991 | Summary: lang:std; ::is_leader; Argument[self].Field[0]; ReturnValue; value | -| 992 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 993 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 994 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 995 | Summary: lang:std; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 996 | Summary: lang:std; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | -| 997 | Summary: lang:std; ::wait; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 998 | Summary: lang:std; ::wait_timeout; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 999 | Summary: lang:std; ::wait_timeout_ms; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1000 | Summary: lang:std; ::wait_timeout_while; Argument[0].Reference; Argument[2].Parameter[0].Reference; value | -| 1001 | Summary: lang:std; ::wait_timeout_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | -| 1002 | Summary: lang:std; ::wait_while; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | -| 1003 | Summary: lang:std; ::wait_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1004 | Summary: lang:std; ::timed_out; Argument[self].Field[0]; ReturnValue; value | -| 1005 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1006 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1007 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1008 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1009 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1010 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1011 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1012 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1013 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1014 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1015 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1016 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1017 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1018 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1019 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1020 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1021 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1022 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1023 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1024 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1025 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1026 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1027 | Summary: lang:std; ::as_file_desc; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1028 | Summary: lang:std; ::into_raw; Argument[self].Field[0]; ReturnValue; value | -| 1029 | Summary: lang:std; ::index; Argument[self]; ReturnValue; value | -| 1030 | Summary: lang:std; ::into_string; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1031 | Summary: lang:std; ::name; Argument[self]; ReturnValue; value | -| 1032 | Summary: lang:std; ::no_hooks; Argument[self]; ReturnValue; value | -| 1033 | Summary: lang:std; ::stack_size; Argument[self]; ReturnValue; value | -| 1034 | Summary: lang:std; ::as_u64; Argument[self].Field[0]; ReturnValue; value | -| 1035 | Summary: lang:std; ::try_with; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1036 | Summary: lang:std; ::with; Argument[0].ReturnValue; ReturnValue; value | -| 1037 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | -| 1038 | Summary: lang:std; ::duration; Argument[self].Field[0]; ReturnValue; value | -| 1039 | Summary: lang:std; ::as_raw_fd; Argument[self].Reference; ReturnValue; value | -| 1040 | Summary: lang:std; ::from_raw_fd; Argument[0]; ReturnValue; value | -| 1041 | Summary: lang:std; ::into_raw_fd; Argument[self]; ReturnValue; value | -| 1042 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::as_str; Argument[self].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | -| 1043 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::get; Argument[self].Field[0]; ReturnValue.Reference; value | -| 1044 | Summary: lang:std; <{491}::RewrapBox as crate::panic::PanicPayload>::get; Argument[self].Field[0].Reference; ReturnValue.Reference; value | -| 1045 | Summary: lang:std; crate::backtrace::helper::lazy_resolve; Argument[0]; ReturnValue; value | -| 1046 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1047 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue; ReturnValue; value | -| 1048 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | -| 1049 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | -| 1050 | Summary: lang:std; crate::io::default_read_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1051 | Summary: lang:std; crate::io::default_write_vectored; Argument[0].ReturnValue; ReturnValue; value | -| 1052 | Summary: lang:std; crate::sys::backtrace::__rust_begin_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1053 | Summary: lang:std; crate::sys::backtrace::__rust_end_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | -| 1054 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_path_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1055 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_with_cstr; Argument[1].ReturnValue; ReturnValue; value | -| 1056 | Summary: lang:std; crate::sys::pal::unix::cvt; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | -| 1057 | Summary: lang:std; crate::sys_common::ignore_notfound; Argument[0].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1058 | Summary: lang:std; crate::thread::current::set_current; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | -| 1059 | Summary: lang:std; crate::thread::current::try_with_current; Argument[0].ReturnValue; ReturnValue; value | -| 1060 | Summary: lang:std; crate::thread::with_current_name; Argument[0].ReturnValue; ReturnValue; value | -| 1061 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value | +| 83 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; value | +| 84 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | +| 85 | Summary: lang:alloc; ::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 86 | Summary: lang:alloc; ::as_ref; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 87 | Summary: lang:alloc; ::try_from; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 88 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 89 | Summary: lang:alloc; ::try_unwrap; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 90 | Summary: lang:alloc; ::unwrap_or_clone; Argument[0].Reference; ReturnValue; value | +| 91 | Summary: lang:alloc; ::borrow; Argument[self].Element; ReturnValue.Reference; value | +| 92 | Summary: lang:alloc; ::borrow_mut; Argument[self].Element; ReturnValue.Reference; value | +| 93 | Summary: lang:alloc; ::as_mut; Argument[self]; ReturnValue; value | +| 94 | Summary: lang:alloc; ::as_ref; Argument[self]; ReturnValue; value | +| 95 | Summary: lang:alloc; ::from; Argument[0].Field[0]; ReturnValue; value | +| 96 | Summary: lang:alloc; ::push_within_capacity; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 97 | Summary: lang:alloc; ::as_inner; Argument[self]; ReturnValue; value | +| 98 | Summary: lang:alloc; ::fold; Argument[0]; ReturnValue; value | +| 99 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 100 | Summary: lang:alloc; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 101 | Summary: lang:alloc; ::as_into_iter; Argument[self]; ReturnValue; value | +| 102 | Summary: lang:alloc; ::downcast; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 103 | Summary: lang:alloc; ::spec_to_string; Argument[self]; ReturnValue; value | +| 104 | Summary: lang:alloc; <{766}::StringError as crate::error::Error>::description; Argument[self].Field[0]; ReturnValue.Reference; value | +| 105 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[0].Reference; Argument[1].Parameter[0]; value | +| 106 | Summary: lang:alloc; crate::collections::btree::mem::replace; Argument[1].ReturnValue; Argument[0].Reference; value | +| 107 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[0].Reference; Argument[1].Parameter[0]; value | +| 108 | Summary: lang:alloc; crate::collections::btree::mem::take_mut; Argument[1].ReturnValue; Argument[0].Reference; value | +| 109 | Summary: lang:core; <&_ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 110 | Summary: lang:core; <&_ as crate::clone::Clone>::clone; Argument[self].Reference; ReturnValue; value | +| 111 | Summary: lang:core; <&_ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | +| 112 | Summary: lang:core; <&mut _ as crate::borrow::Borrow>::borrow; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 113 | Summary: lang:core; <&mut _ as crate::borrow::BorrowMut>::borrow_mut; Argument[self].Reference.Reference; ReturnValue.Reference; value | +| 114 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[0]; ReturnValue; value | +| 115 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 116 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | +| 117 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[0]; ReturnValue; value | +| 118 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 119 | Summary: lang:core; <&mut _ as crate::iter::traits::double_ended::DoubleEndedIteratorRefSpec>::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 120 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[0]; ReturnValue; value | +| 121 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 122 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 123 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[0]; ReturnValue; value | +| 124 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 125 | Summary: lang:core; <&mut _ as crate::iter::traits::iterator::IteratorRefSpec>::spec_try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 126 | Summary: lang:core; <&mut _ as crate::ops::deref::Deref>::deref; Argument[self].Reference; ReturnValue; value | +| 127 | Summary: lang:core; <&mut _ as crate::ops::deref::DerefMut>::deref_mut; Argument[self].Reference; ReturnValue; value | +| 128 | Summary: lang:core; <[_] as crate::convert::AsMut>::as_mut; Argument[self]; ReturnValue; value | +| 129 | Summary: lang:core; <[_] as crate::convert::AsRef>::as_ref; Argument[self]; ReturnValue; value | +| 130 | Summary: lang:core; <[_] as crate::slice::SlicePattern>::as_slice; Argument[self]; ReturnValue; value | +| 131 | Summary: lang:core; <[_]>::align_to; Argument[self]; ReturnValue.Field[0]; value | +| 132 | Summary: lang:core; <[_]>::align_to_mut; Argument[self]; ReturnValue.Field[0]; value | +| 133 | Summary: lang:core; <[_]>::as_simd; Argument[self]; ReturnValue.Field[0]; value | +| 134 | Summary: lang:core; <[_]>::as_simd_mut; Argument[self]; ReturnValue.Field[0]; value | +| 135 | Summary: lang:core; <[_]>::partition_dedup; Argument[self]; ReturnValue.Field[0]; value | +| 136 | Summary: lang:core; <[_]>::partition_dedup_by; Argument[self]; ReturnValue.Field[0]; value | +| 137 | Summary: lang:core; <[_]>::partition_dedup_by_key; Argument[self]; ReturnValue.Field[0]; value | +| 138 | Summary: lang:core; <[u8]>::trim_ascii; Argument[self]; ReturnValue; value | +| 139 | Summary: lang:core; <[u8]>::trim_ascii_end; Argument[self]; ReturnValue; value | +| 140 | Summary: lang:core; <[u8]>::trim_ascii_start; Argument[self]; ReturnValue; value | +| 141 | Summary: lang:core; <_ as crate::array::SpecArrayClone>::clone; Argument[0].Reference; ReturnValue; value | +| 142 | Summary: lang:core; <_ as crate::async_iter::async_iter::IntoAsyncIterator>::into_async_iter; Argument[self]; ReturnValue; value | +| 143 | Summary: lang:core; <_ as crate::borrow::Borrow>::borrow; Argument[self]; ReturnValue; value | +| 144 | Summary: lang:core; <_ as crate::borrow::BorrowMut>::borrow_mut; Argument[self]; ReturnValue; value | +| 145 | Summary: lang:core; <_ as crate::clone::uninit::CopySpec>::clone_one; Argument[0]; Argument[1].Reference; value | +| 146 | Summary: lang:core; <_ as crate::convert::From>::from; Argument[0]; ReturnValue; value | +| 147 | Summary: lang:core; <_ as crate::future::into_future::IntoFuture>::into_future; Argument[self]; ReturnValue; value | +| 148 | Summary: lang:core; <_ as crate::iter::adapters::step_by::SpecRangeSetup>::setup; Argument[0]; ReturnValue; value | +| 149 | Summary: lang:core; <_ as crate::iter::traits::collect::IntoIterator>::into_iter; Argument[self]; ReturnValue; value | +| 150 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[0]; Argument[self].Reference.Parameter[0]; value | +| 151 | Summary: lang:core; <_ as crate::str::pattern::MultiCharEq>::matches; Argument[self].Reference.ReturnValue; ReturnValue; value | +| 152 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 153 | Summary: lang:core; ::select_unpredictable; Argument[0]; ReturnValue; value | +| 154 | Summary: lang:core; ::select_unpredictable; Argument[1]; ReturnValue; value | +| 155 | Summary: lang:core; ::then; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 156 | Summary: lang:core; ::then_some; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 157 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 158 | Summary: lang:core; ::to_ascii_lowercase; Argument[self].Reference; ReturnValue; value | +| 159 | Summary: lang:core; ::to_ascii_uppercase; Argument[self].Reference; ReturnValue; value | +| 160 | Summary: lang:core; ::borrow; Argument[self].Field[0]; ReturnValue.Reference; value | +| 161 | Summary: lang:core; ::borrow_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 162 | Summary: lang:core; ::as_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 163 | Summary: lang:core; ::as_ref; Argument[self].Field[0]; ReturnValue.Reference; value | +| 164 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | +| 165 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | +| 166 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 167 | Summary: lang:core; ::index; Argument[self].Field[0].Element; ReturnValue.Reference; value | +| 168 | Summary: lang:core; ::index; Argument[self]; ReturnValue; value | +| 169 | Summary: lang:core; ::index_mut; Argument[self].Field[0].Element; ReturnValue.Reference; value | +| 170 | Summary: lang:core; ::index_mut; Argument[self]; ReturnValue; value | +| 171 | Summary: lang:core; ::as_bytes; Argument[self].Field[0]; ReturnValue.Reference; value | +| 172 | Summary: lang:core; ::update; Argument[0].ReturnValue; ReturnValue; value | +| 173 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 174 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 175 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 176 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 177 | Summary: lang:core; ::filter_map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 178 | Summary: lang:core; ::filter_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 179 | Summary: lang:core; ::map; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 180 | Summary: lang:core; ::map_split; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 181 | Summary: lang:core; ::get_or_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 182 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 183 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 184 | Summary: lang:core; ::get_or_try_init; Argument[0].ReturnValue; ReturnValue; value | +| 185 | Summary: lang:core; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 186 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | +| 187 | Summary: lang:core; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | +| 188 | Summary: lang:core; ::then; Argument[0]; ReturnValue; value | +| 189 | Summary: lang:core; ::then; Argument[self]; ReturnValue; value | +| 190 | Summary: lang:core; ::then_with; Argument[0].ReturnValue; ReturnValue; value | +| 191 | Summary: lang:core; ::then_with; Argument[self]; ReturnValue; value | +| 192 | Summary: lang:core; ::from; Argument[0]; ReturnValue; value | +| 193 | Summary: lang:core; ::provide_ref; Argument[self]; ReturnValue; value | +| 194 | Summary: lang:core; ::provide_ref_with; Argument[self]; ReturnValue; value | +| 195 | Summary: lang:core; ::provide_value; Argument[self]; ReturnValue; value | +| 196 | Summary: lang:core; ::provide_value_with; Argument[self]; ReturnValue; value | +| 197 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | +| 198 | Summary: lang:core; ::with_copy; Argument[0].ReturnValue; ReturnValue; value | +| 199 | Summary: lang:core; ::align; Argument[self]; ReturnValue; value | +| 200 | Summary: lang:core; ::alternate; Argument[self]; ReturnValue; value | +| 201 | Summary: lang:core; ::debug_as_hex; Argument[self]; ReturnValue; value | +| 202 | Summary: lang:core; ::fill; Argument[self]; ReturnValue; value | +| 203 | Summary: lang:core; ::precision; Argument[self]; ReturnValue; value | +| 204 | Summary: lang:core; ::sign; Argument[self]; ReturnValue; value | +| 205 | Summary: lang:core; ::sign_aware_zero_pad; Argument[self]; ReturnValue; value | +| 206 | Summary: lang:core; ::width; Argument[self]; ReturnValue; value | +| 207 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | +| 208 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | +| 209 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | +| 210 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | +| 211 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | +| 212 | Summary: lang:core; ::key; Argument[self]; ReturnValue; value | +| 213 | Summary: lang:core; ::key_with; Argument[self]; ReturnValue; value | +| 214 | Summary: lang:core; ::value; Argument[self]; ReturnValue; value | +| 215 | Summary: lang:core; ::value_with; Argument[self]; ReturnValue; value | +| 216 | Summary: lang:core; ::entries; Argument[self]; ReturnValue; value | +| 217 | Summary: lang:core; ::entry; Argument[self]; ReturnValue; value | +| 218 | Summary: lang:core; ::entry_with; Argument[self]; ReturnValue; value | +| 219 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | +| 220 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | +| 221 | Summary: lang:core; ::field; Argument[self]; ReturnValue; value | +| 222 | Summary: lang:core; ::field_with; Argument[self]; ReturnValue; value | +| 223 | Summary: lang:core; ::into_inner; Argument[self].Field[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 224 | Summary: lang:core; ::clear; Argument[self]; ReturnValue; value | +| 225 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | +| 226 | Summary: lang:core; ::advance; Argument[self]; ReturnValue; value | +| 227 | Summary: lang:core; ::advance_unchecked; Argument[self]; ReturnValue; value | +| 228 | Summary: lang:core; ::ensure_init; Argument[self]; ReturnValue; value | +| 229 | Summary: lang:core; ::set_init; Argument[self]; ReturnValue; value | +| 230 | Summary: lang:core; ::fold; Argument[0].Field[0]; ReturnValue; value | +| 231 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 232 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 233 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 234 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 235 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | +| 236 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | +| 237 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | +| 238 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 239 | Summary: lang:core; ::rfold; Argument[self].Field[0].Field[0]; ReturnValue; value | +| 240 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 241 | Summary: lang:core; ::try_rfold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 242 | Summary: lang:core; ::try_rfold; Argument[self].Field[0]; ReturnValue; value | +| 243 | Summary: lang:core; ::fold; Argument[self].Field[0].Field[0]; ReturnValue; value | +| 244 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 245 | Summary: lang:core; ::try_fold; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 246 | Summary: lang:core; ::try_fold; Argument[self].Field[0]; ReturnValue; value | +| 247 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 248 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 249 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 250 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 251 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 252 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 253 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 254 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 255 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 256 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 257 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 258 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 259 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 260 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 261 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 262 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 263 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 264 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 265 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 266 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 267 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 268 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 269 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 270 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 271 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 272 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 273 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 274 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 275 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 276 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 277 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 278 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 279 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 280 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 281 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 282 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 283 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 284 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 285 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 286 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 287 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 288 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 289 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 290 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 291 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 292 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 293 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 294 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 295 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 296 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 297 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 298 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 299 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 300 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 301 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 302 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 303 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 304 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 305 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 306 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 307 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 308 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 309 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 310 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 311 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 312 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 313 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 314 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 315 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 316 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 317 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 318 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 319 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 320 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 321 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 322 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 323 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 324 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 325 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 326 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 327 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 328 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 329 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 330 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 331 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 332 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 333 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 334 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 335 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 336 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 337 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 338 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 339 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 340 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 341 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 342 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 343 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 344 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 345 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 346 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 347 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 348 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 349 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 350 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 351 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 352 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 353 | Summary: lang:core; ::fold; Argument[0]; Argument[1].Parameter[0]; value | +| 354 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 355 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 356 | Summary: lang:core; ::try_fold; Argument[0]; Argument[1].Parameter[0]; value | +| 357 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 358 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 359 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 360 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 361 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 362 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 363 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 364 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 365 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 366 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 367 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 368 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 369 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 370 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 371 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 372 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 373 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 374 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 375 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 376 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 377 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 378 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 379 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 380 | Summary: lang:core; ::spec_rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 381 | Summary: lang:core; ::spec_rfold; Argument[0]; ReturnValue; value | +| 382 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 383 | Summary: lang:core; ::spec_rfold; Argument[1].ReturnValue; ReturnValue; value | +| 384 | Summary: lang:core; ::spec_try_rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 385 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | +| 386 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 387 | Summary: lang:core; ::spec_try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 388 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | +| 389 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 390 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 391 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | +| 392 | Summary: lang:core; ::rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 393 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 394 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 395 | Summary: lang:core; ::try_rfold; Argument[0]; Argument[1].Parameter[0]; value | +| 396 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 397 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 398 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 399 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 400 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 401 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 402 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 403 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 404 | Summary: lang:core; ::spec_fold; Argument[0].Field[0]; ReturnValue; value | +| 405 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | +| 406 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 407 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 408 | Summary: lang:core; ::rfold; Argument[0].ReturnValue; ReturnValue; value | +| 409 | Summary: lang:core; ::rfold; Argument[0]; ReturnValue; value | +| 410 | Summary: lang:core; ::rfold; Argument[1].ReturnValue; ReturnValue; value | +| 411 | Summary: lang:core; ::rfold; Argument[self].Field[0]; ReturnValue; value | +| 412 | Summary: lang:core; ::rfold; Argument[self]; ReturnValue; value | +| 413 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 414 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 415 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 416 | Summary: lang:core; ::fold; Argument[0].ReturnValue; ReturnValue; value | +| 417 | Summary: lang:core; ::fold; Argument[self].Field[0]; ReturnValue; value | +| 418 | Summary: lang:core; ::fold; Argument[self]; ReturnValue; value | +| 419 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 420 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 421 | Summary: lang:core; ::spec_fold; Argument[0]; ReturnValue; value | +| 422 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 423 | Summary: lang:core; ::spec_fold; Argument[1].ReturnValue; ReturnValue; value | +| 424 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 425 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 426 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 427 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 428 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 429 | Summary: lang:core; ::nth_back; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 430 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 431 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 432 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 433 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 434 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 435 | Summary: lang:core; ::to_canonical; Argument[self].Reference; ReturnValue; value | +| 436 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | +| 437 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | +| 438 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | +| 439 | Summary: lang:core; ::bitand; Argument[self]; ReturnValue; value | +| 440 | Summary: lang:core; ::bitor; Argument[self]; ReturnValue; value | +| 441 | Summary: lang:core; ::not; Argument[self]; ReturnValue; value | +| 442 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | +| 443 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | +| 444 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | +| 445 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | +| 446 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | +| 447 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | +| 448 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | +| 449 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | +| 450 | Summary: lang:core; ::add; Argument[self]; ReturnValue; value | +| 451 | Summary: lang:core; ::add_small; Argument[self]; ReturnValue; value | +| 452 | Summary: lang:core; ::div_rem_small; Argument[self]; ReturnValue.Field[0]; value | +| 453 | Summary: lang:core; ::mul_digits; Argument[self]; ReturnValue; value | +| 454 | Summary: lang:core; ::mul_pow2; Argument[self]; ReturnValue; value | +| 455 | Summary: lang:core; ::mul_pow5; Argument[self]; ReturnValue; value | +| 456 | Summary: lang:core; ::mul_small; Argument[self]; ReturnValue; value | +| 457 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | +| 458 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 459 | Summary: lang:core; ::from_mut_unchecked; Argument[0]; ReturnValue; value | +| 460 | Summary: lang:core; ::new_unchecked; Argument[0]; ReturnValue; value | +| 461 | Summary: lang:core; ::get; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 462 | Summary: lang:core; ::get_mut; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 463 | Summary: lang:core; ::get_unchecked; Argument[0]; ReturnValue; value | +| 464 | Summary: lang:core; ::get_unchecked_mut; Argument[0]; ReturnValue; value | +| 465 | Summary: lang:core; ::index; Argument[0]; ReturnValue; value | +| 466 | Summary: lang:core; ::index_mut; Argument[0]; ReturnValue; value | +| 467 | Summary: lang:core; ::spec_try_fold; Argument[0]; ReturnValue; value | +| 468 | Summary: lang:core; ::spec_try_rfold; Argument[0]; ReturnValue; value | +| 469 | Summary: lang:core; ::try_rfold; Argument[0]; ReturnValue; value | +| 470 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 471 | Summary: lang:core; ::try_rfold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 472 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 473 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 474 | Summary: lang:core; ::try_fold; Argument[1].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 475 | Summary: lang:core; ::wrap_mut_1; Argument[0]; ReturnValue; value | +| 476 | Summary: lang:core; ::wrap_mut_2; Argument[0]; ReturnValue; value | +| 477 | Summary: lang:core; ::clone; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 478 | Summary: lang:core; ::from; Argument[0].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | +| 479 | Summary: lang:core; ::from; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 480 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 481 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | +| 482 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | +| 483 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 484 | Summary: lang:core; ::and_then; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 485 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | +| 486 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Reference; value | +| 487 | Summary: lang:core; ::cloned; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 488 | Summary: lang:core; ::copied; Argument[self].Field[crate::option::Option::Some(0)].Reference; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 489 | Summary: lang:core; ::expect; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 490 | Summary: lang:core; ::flatten; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 491 | Summary: lang:core; ::get_or_insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | +| 492 | Summary: lang:core; ::get_or_insert; Argument[0]; ReturnValue.Reference; value | +| 493 | Summary: lang:core; ::get_or_insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 494 | Summary: lang:core; ::get_or_insert_default; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 495 | Summary: lang:core; ::get_or_insert_with; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 496 | Summary: lang:core; ::insert; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | +| 497 | Summary: lang:core; ::insert; Argument[0]; ReturnValue.Reference; value | +| 498 | Summary: lang:core; ::insert; Argument[self].Reference.Field[crate::option::Option::Some(0)]; ReturnValue.Reference; value | +| 499 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | +| 500 | Summary: lang:core; ::is_none_or; Argument[0].ReturnValue; ReturnValue; value | +| 501 | Summary: lang:core; ::is_none_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 502 | Summary: lang:core; ::is_some_and; Argument[0].ReturnValue; ReturnValue; value | +| 503 | Summary: lang:core; ::is_some_and; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 504 | Summary: lang:core; ::map; Argument[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 505 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 506 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | +| 507 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0]; value | +| 508 | Summary: lang:core; ::map; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | +| 509 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | +| 510 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | +| 511 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | +| 512 | Summary: lang:core; ::map_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 513 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 514 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | +| 515 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | +| 516 | Summary: lang:core; ::ok_or; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 517 | Summary: lang:core; ::ok_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 518 | Summary: lang:core; ::ok_or_else; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 519 | Summary: lang:core; ::ok_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 520 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | +| 521 | Summary: lang:core; ::or; Argument[self]; ReturnValue; value | +| 522 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | +| 523 | Summary: lang:core; ::or_else; Argument[self]; ReturnValue; value | +| 524 | Summary: lang:core; ::replace; Argument[0]; Argument[self].Reference.Field[crate::option::Option::Some(0)]; value | +| 525 | Summary: lang:core; ::replace; Argument[self].Reference; ReturnValue; value | +| 526 | Summary: lang:core; ::take; Argument[self].Reference; ReturnValue; value | +| 527 | Summary: lang:core; ::take_if; Argument[self].Reference.Field[crate::option::Option::Some(0)]; Argument[0].Parameter[0].Reference; value | +| 528 | Summary: lang:core; ::take_if; Argument[self].Reference; ReturnValue; value | +| 529 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 530 | Summary: lang:core; ::transpose; Argument[self].Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; value | +| 531 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 532 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | +| 533 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 534 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 535 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 536 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 537 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 538 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[0]; ReturnValue.Field[0].Field[crate::option::Option::Some(0)]; value | +| 539 | Summary: lang:core; ::unzip; Argument[self].Field[crate::option::Option::Some(0)].Field[1]; ReturnValue.Field[1].Field[crate::option::Option::Some(0)]; value | +| 540 | Summary: lang:core; ::xor; Argument[0]; ReturnValue; value | +| 541 | Summary: lang:core; ::xor; Argument[self]; ReturnValue; value | +| 542 | Summary: lang:core; ::zip; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | +| 543 | Summary: lang:core; ::zip; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | +| 544 | Summary: lang:core; ::zip_with; Argument[0].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[1]; value | +| 545 | Summary: lang:core; ::zip_with; Argument[1].ReturnValue; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 546 | Summary: lang:core; ::zip_with; Argument[self].Field[crate::option::Option::Some(0)]; Argument[1].Parameter[0]; value | +| 547 | Summary: lang:core; ::deref; Argument[self].Field[0]; ReturnValue.Reference; value | +| 548 | Summary: lang:core; ::deref_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 549 | Summary: lang:core; ::max; Argument[0]; ReturnValue; value | +| 550 | Summary: lang:core; ::max; Argument[1]; ReturnValue; value | +| 551 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 552 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 553 | Summary: lang:core; ::sub; Argument[self]; ReturnValue; value | +| 554 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 555 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 556 | Summary: lang:core; ::clone; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 557 | Summary: lang:core; ::from_output; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 558 | Summary: lang:core; ::and; Argument[0]; ReturnValue; value | +| 559 | Summary: lang:core; ::and; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 560 | Summary: lang:core; ::and_then; Argument[0].ReturnValue; ReturnValue; value | +| 561 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 562 | Summary: lang:core; ::and_then; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | +| 563 | Summary: lang:core; ::as_deref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 564 | Summary: lang:core; ::as_deref_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 565 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 566 | Summary: lang:core; ::as_mut; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | +| 567 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)].Reference; value | +| 568 | Summary: lang:core; ::as_ref; Argument[self].Reference.Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)].Reference; value | +| 569 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 570 | Summary: lang:core; ::cloned; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 571 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 572 | Summary: lang:core; ::copied; Argument[self].Field[crate::result::Result::Ok(0)].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 573 | Summary: lang:core; ::err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 574 | Summary: lang:core; ::expect; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 575 | Summary: lang:core; ::expect_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 576 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 577 | Summary: lang:core; ::flatten; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 578 | Summary: lang:core; ::inspect; Argument[self]; ReturnValue; value | +| 579 | Summary: lang:core; ::inspect_err; Argument[self]; ReturnValue; value | +| 580 | Summary: lang:core; ::into_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 581 | Summary: lang:core; ::into_ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 582 | Summary: lang:core; ::is_err_and; Argument[0].ReturnValue; ReturnValue; value | +| 583 | Summary: lang:core; ::is_err_and; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 584 | Summary: lang:core; ::is_ok_and; Argument[0].ReturnValue; ReturnValue; value | +| 585 | Summary: lang:core; ::is_ok_and; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[0].Parameter[0]; value | +| 586 | Summary: lang:core; ::map; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 587 | Summary: lang:core; ::map_err; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 588 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 589 | Summary: lang:core; ::map_err; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 590 | Summary: lang:core; ::map_or; Argument[0]; ReturnValue; value | +| 591 | Summary: lang:core; ::map_or; Argument[1].ReturnValue; ReturnValue; value | +| 592 | Summary: lang:core; ::map_or; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | +| 593 | Summary: lang:core; ::map_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 594 | Summary: lang:core; ::map_or_else; Argument[1].ReturnValue; ReturnValue; value | +| 595 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 596 | Summary: lang:core; ::map_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; Argument[1].Parameter[0]; value | +| 597 | Summary: lang:core; ::ok; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 598 | Summary: lang:core; ::or; Argument[0]; ReturnValue; value | +| 599 | Summary: lang:core; ::or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 600 | Summary: lang:core; ::or_else; Argument[0].ReturnValue; ReturnValue; value | +| 601 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 602 | Summary: lang:core; ::or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 603 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Err(0)]; value | +| 604 | Summary: lang:core; ::transpose; Argument[self].Field[crate::result::Result::Ok(0)].Field[crate::option::Option::Some(0)]; ReturnValue.Field[crate::option::Option::Some(0)].Field[crate::result::Result::Ok(0)]; value | +| 605 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 606 | Summary: lang:core; ::unwrap_err; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 607 | Summary: lang:core; ::unwrap_err_unchecked; Argument[self].Field[crate::result::Result::Err(0)]; ReturnValue; value | +| 608 | Summary: lang:core; ::unwrap_or; Argument[0]; ReturnValue; value | +| 609 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 610 | Summary: lang:core; ::unwrap_or_default; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 611 | Summary: lang:core; ::unwrap_or_else; Argument[0].ReturnValue; ReturnValue; value | +| 612 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)].Reference; ReturnValue; value | +| 613 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Err(0)]; Argument[0].Parameter[0]; value | +| 614 | Summary: lang:core; ::unwrap_or_else; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 615 | Summary: lang:core; ::unwrap_unchecked; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 616 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 617 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 618 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 619 | Summary: lang:core; ::collect; Argument[self].Element; ReturnValue.Element; value | +| 620 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 621 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 622 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 623 | Summary: lang:core; ::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | +| 624 | Summary: lang:core; ::map; Argument[self].Element; Argument[0].Parameter[0]; value | +| 625 | Summary: lang:core; ::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 626 | Summary: lang:core; ::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 627 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 628 | Summary: lang:core; ::fold; Argument[1].ReturnValue; Argument[1].Parameter[0]; value | +| 629 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 630 | Summary: lang:core; ::call; Argument[0].Field[0]; ReturnValue; value | +| 631 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 632 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 633 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 634 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 635 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 636 | Summary: lang:core; ::fold; Argument[0]; ReturnValue; value | +| 637 | Summary: lang:core; ::fold; Argument[1].ReturnValue; ReturnValue; value | +| 638 | Summary: lang:core; ::try_fold; Argument[0]; ReturnValue; value | +| 639 | Summary: lang:core; ::matching; Argument[0]; ReturnValue.Field[crate::option::Option::Some(0)].Field[0]; value | +| 640 | Summary: lang:core; ::matching; Argument[1]; ReturnValue.Field[crate::option::Option::Some(0)].Field[1]; value | +| 641 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | +| 642 | Summary: lang:core; ::clone_from; Argument[0]; Argument[self].Reference; value | +| 643 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 644 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 645 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 646 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 647 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 648 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 649 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 650 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 651 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 652 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 653 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 654 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 655 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 656 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 657 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 658 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 659 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 660 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 661 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 662 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 663 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 664 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 665 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 666 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 667 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 668 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 669 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 670 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 671 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 672 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 673 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 674 | Summary: lang:core; ::clamp; Argument[0]; ReturnValue; value | +| 675 | Summary: lang:core; ::clamp; Argument[1]; ReturnValue; value | +| 676 | Summary: lang:core; ::clamp; Argument[self]; ReturnValue; value | +| 677 | Summary: lang:core; ::maximum; Argument[0]; ReturnValue; value | +| 678 | Summary: lang:core; ::maximum; Argument[self]; ReturnValue; value | +| 679 | Summary: lang:core; ::minimum; Argument[0]; ReturnValue; value | +| 680 | Summary: lang:core; ::minimum; Argument[self]; ReturnValue; value | +| 681 | Summary: lang:core; ::next_down; Argument[self]; ReturnValue; value | +| 682 | Summary: lang:core; ::next_up; Argument[self]; ReturnValue; value | +| 683 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 684 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 685 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 686 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 687 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 688 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 689 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 690 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 691 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 692 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 693 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 694 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 695 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 696 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 697 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 698 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 699 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 700 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 701 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 702 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 703 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 704 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 705 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 706 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 707 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 708 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 709 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 710 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 711 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 712 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 713 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 714 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 715 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 716 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 717 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 718 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 719 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 720 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 721 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 722 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 723 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 724 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 725 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 726 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 727 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 728 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 729 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 730 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 731 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 732 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 733 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 734 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 735 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 736 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 737 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 738 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 739 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 740 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 741 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 742 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 743 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 744 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 745 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 746 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 747 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 748 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 749 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 750 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 751 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 752 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 753 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 754 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 755 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 756 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 757 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 758 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 759 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 760 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 761 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 762 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 763 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 764 | Summary: lang:core; ::abs; Argument[self]; ReturnValue; value | +| 765 | Summary: lang:core; ::checked_abs; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 766 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 767 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 768 | Summary: lang:core; ::overflowing_abs; Argument[self]; ReturnValue.Field[0]; value | +| 769 | Summary: lang:core; ::overflowing_div; Argument[self]; ReturnValue.Field[0]; value | +| 770 | Summary: lang:core; ::overflowing_div_euclid; Argument[self]; ReturnValue.Field[0]; value | +| 771 | Summary: lang:core; ::saturating_abs; Argument[self]; ReturnValue; value | +| 772 | Summary: lang:core; ::saturating_div; Argument[self]; ReturnValue; value | +| 773 | Summary: lang:core; ::strict_abs; Argument[self]; ReturnValue; value | +| 774 | Summary: lang:core; ::strict_div; Argument[self]; ReturnValue; value | +| 775 | Summary: lang:core; ::strict_div_euclid; Argument[self]; ReturnValue; value | +| 776 | Summary: lang:core; ::wrapping_abs; Argument[self]; ReturnValue; value | +| 777 | Summary: lang:core; ::wrapping_div; Argument[self]; ReturnValue; value | +| 778 | Summary: lang:core; ::wrapping_div_euclid; Argument[self]; ReturnValue; value | +| 779 | Summary: lang:core; ::as_mut; Argument[self]; ReturnValue; value | +| 780 | Summary: lang:core; ::as_ref; Argument[self]; ReturnValue; value | +| 781 | Summary: lang:core; ::as_str; Argument[self]; ReturnValue; value | +| 782 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 783 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 784 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 785 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 786 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 787 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 788 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 789 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 790 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 791 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 792 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 793 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 794 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 795 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 796 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 797 | Summary: lang:core; ::clone; Argument[self].Reference; ReturnValue; value | +| 798 | Summary: lang:core; ::index; Argument[0].Reference.Element; ReturnValue.Reference; value | +| 799 | Summary: lang:core; ::index_mut; Argument[0].Reference.Element; ReturnValue.Reference; value | +| 800 | Summary: lang:core; ::checked_next_multiple_of; Argument[self]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 801 | Summary: lang:core; ::next_multiple_of; Argument[self]; ReturnValue; value | +| 802 | Summary: lang:core; crate::array::drain::drain_array_with; Argument[1].ReturnValue; ReturnValue; value | +| 803 | Summary: lang:core; crate::cmp::max; Argument[0]; ReturnValue; value | +| 804 | Summary: lang:core; crate::cmp::max; Argument[1]; ReturnValue; value | +| 805 | Summary: lang:core; crate::cmp::max_by; Argument[0]; Argument[2].Parameter[1].Reference; value | +| 806 | Summary: lang:core; crate::cmp::max_by; Argument[0]; ReturnValue; value | +| 807 | Summary: lang:core; crate::cmp::max_by; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 808 | Summary: lang:core; crate::cmp::max_by; Argument[1]; ReturnValue; value | +| 809 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | +| 810 | Summary: lang:core; crate::cmp::max_by_key; Argument[0]; ReturnValue; value | +| 811 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 812 | Summary: lang:core; crate::cmp::max_by_key; Argument[1]; ReturnValue; value | +| 813 | Summary: lang:core; crate::cmp::min; Argument[0]; ReturnValue; value | +| 814 | Summary: lang:core; crate::cmp::min; Argument[1]; ReturnValue; value | +| 815 | Summary: lang:core; crate::cmp::min_by; Argument[0]; Argument[2].Parameter[1].Reference; value | +| 816 | Summary: lang:core; crate::cmp::min_by; Argument[0]; ReturnValue; value | +| 817 | Summary: lang:core; crate::cmp::min_by; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 818 | Summary: lang:core; crate::cmp::min_by; Argument[1]; ReturnValue; value | +| 819 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | +| 820 | Summary: lang:core; crate::cmp::min_by_key; Argument[0]; ReturnValue; value | +| 821 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 822 | Summary: lang:core; crate::cmp::min_by_key; Argument[1]; ReturnValue; value | +| 823 | Summary: lang:core; crate::cmp::minmax; Argument[0]; ReturnValue.Element; value | +| 824 | Summary: lang:core; crate::cmp::minmax; Argument[1]; ReturnValue.Element; value | +| 825 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; Argument[2].Parameter[1].Reference; value | +| 826 | Summary: lang:core; crate::cmp::minmax_by; Argument[0]; ReturnValue.Element; value | +| 827 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 828 | Summary: lang:core; crate::cmp::minmax_by; Argument[1]; ReturnValue.Element; value | +| 829 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; Argument[2].Parameter[0].Reference; value | +| 830 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[0]; ReturnValue.Element; value | +| 831 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; Argument[2].Parameter[0].Reference; value | +| 832 | Summary: lang:core; crate::cmp::minmax_by_key; Argument[1]; ReturnValue.Element; value | +| 833 | Summary: lang:core; crate::contracts::build_check_ensures; Argument[0]; ReturnValue; value | +| 834 | Summary: lang:core; crate::convert::identity; Argument[0]; ReturnValue; value | +| 835 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | +| 836 | Summary: lang:core; crate::intrinsics::contract_check_ensures; Argument[0]; Argument[1].Parameter[0]; value | +| 837 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[1]; ReturnValue; value | +| 838 | Summary: lang:core; crate::intrinsics::select_unpredictable; Argument[2]; ReturnValue; value | +| 839 | Summary: lang:core; crate::iter::traits::iterator::Iterator::collect; Argument[self].Element; ReturnValue.Element; value | +| 840 | Summary: lang:core; crate::iter::traits::iterator::Iterator::for_each; Argument[self].Element; Argument[0].Parameter[0]; value | +| 841 | Summary: lang:core; crate::iter::traits::iterator::Iterator::map; Argument[self].Element; Argument[0].Parameter[0]; value | +| 842 | Summary: lang:core; crate::iter::traits::iterator::Iterator::next; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 843 | Summary: lang:core; crate::iter::traits::iterator::Iterator::nth; Argument[self].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 844 | Summary: lang:core; crate::mem::copy; Argument[0].Reference; ReturnValue; value | +| 845 | Summary: lang:core; crate::mem::replace; Argument[0].Reference; ReturnValue; value | +| 846 | Summary: lang:core; crate::mem::replace; Argument[1]; Argument[0].Reference; value | +| 847 | Summary: lang:core; crate::mem::take; Argument[0].Reference; ReturnValue; value | +| 848 | Summary: lang:core; crate::num::flt2dec::strategy::dragon::mul_pow10; Argument[0]; ReturnValue; value | +| 849 | Summary: lang:core; crate::num::flt2dec::to_exact_exp_str; Argument[5].Element; Argument[0].Parameter[1].Reference; value | +| 850 | Summary: lang:core; crate::num::flt2dec::to_exact_fixed_str; Argument[4].Element; Argument[0].Parameter[1].Reference; value | +| 851 | Summary: lang:core; crate::num::flt2dec::to_shortest_exp_str; Argument[5]; Argument[0].Parameter[1]; value | +| 852 | Summary: lang:core; crate::num::flt2dec::to_shortest_str; Argument[4]; Argument[0].Parameter[1]; value | +| 853 | Summary: lang:core; crate::panic::abort_unwind; Argument[0].ReturnValue; ReturnValue; value | +| 854 | Summary: lang:core; crate::ptr::from_mut; Argument[0]; ReturnValue; value | +| 855 | Summary: lang:core; crate::ptr::from_ref; Argument[0]; ReturnValue; value | +| 856 | Summary: lang:core; crate::ptr::read; Argument[0].Reference; ReturnValue; value | +| 857 | Summary: lang:core; crate::ptr::read_unaligned; Argument[0].Reference; ReturnValue; value | +| 858 | Summary: lang:core; crate::ptr::read_volatile; Argument[0].Reference; ReturnValue; value | +| 859 | Summary: lang:core; crate::ptr::replace; Argument[0].Reference; ReturnValue; value | +| 860 | Summary: lang:core; crate::ptr::write; Argument[1]; Argument[0].Reference; value | +| 861 | Summary: lang:core; crate::ptr::write_unaligned; Argument[1]; Argument[0].Reference; value | +| 862 | Summary: lang:core; crate::ptr::write_volatile; Argument[1]; Argument[0].Reference; value | +| 863 | Summary: lang:core; crate::slice::sort::shared::find_existing_run; Argument[1].ReturnValue; ReturnValue.Field[1]; value | +| 864 | Summary: lang:core; crate::slice::sort::shared::smallsort::sort4_stable; Argument[0].Reference; Argument[2].Parameter[1].Reference; value | +| 865 | Summary: lang:core; crate::str::validations::next_code_point; Argument[0].Element; ReturnValue; value | +| 866 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_lower; Argument[0]; ReturnValue.Element; value | +| 867 | Summary: lang:core; crate::unicode::unicode_data::conversions::to_upper; Argument[0]; ReturnValue.Element; value | +| 868 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | +| 869 | Summary: lang:proc_macro; <&[u8] as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | +| 870 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 871 | Summary: lang:proc_macro; <&[u8] as crate::bridge::rpc::DecodeMut>::decode; Argument[0].Element; ReturnValue.Reference; value | +| 872 | Summary: lang:proc_macro; <&str as crate::bridge::Mark>::mark; Argument[0]; ReturnValue; value | +| 873 | Summary: lang:proc_macro; <&str as crate::bridge::Unmark>::unmark; Argument[self]; ReturnValue; value | +| 874 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 875 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 876 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 877 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 878 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 879 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 880 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 881 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 882 | Summary: lang:proc_macro; ::into_token_stream; Argument[self]; ReturnValue; value | +| 883 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 884 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 885 | Summary: lang:proc_macro; ::take; Argument[self].Reference; ReturnValue; value | +| 886 | Summary: lang:proc_macro; ::clone; Argument[self].Reference; ReturnValue; value | +| 887 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | +| 888 | Summary: lang:proc_macro; ::clone; Argument[self]; ReturnValue; value | +| 889 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | +| 890 | Summary: lang:proc_macro; ::run_bridge_and_client; Argument[2].ReturnValue; ReturnValue; value | +| 891 | Summary: lang:proc_macro; ::next; Argument[self].Field[0].Element; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 892 | Summary: lang:proc_macro; ::error; Argument[self]; ReturnValue; value | +| 893 | Summary: lang:proc_macro; ::help; Argument[self]; ReturnValue; value | +| 894 | Summary: lang:proc_macro; ::note; Argument[self]; ReturnValue; value | +| 895 | Summary: lang:proc_macro; ::span_error; Argument[self]; ReturnValue; value | +| 896 | Summary: lang:proc_macro; ::span_help; Argument[self]; ReturnValue; value | +| 897 | Summary: lang:proc_macro; ::span_note; Argument[self]; ReturnValue; value | +| 898 | Summary: lang:proc_macro; ::span_warning; Argument[self]; ReturnValue; value | +| 899 | Summary: lang:proc_macro; ::warning; Argument[self]; ReturnValue; value | +| 900 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 901 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 902 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 903 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 904 | Summary: lang:proc_macro; ::into_spans; Argument[self]; ReturnValue; value | +| 905 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 906 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 907 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 908 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 909 | Summary: lang:proc_macro; ::decode; Argument[0].Element; ReturnValue; value | +| 910 | Summary: lang:proc_macro; ::mark; Argument[0]; ReturnValue; value | +| 911 | Summary: lang:proc_macro; ::unmark; Argument[self]; ReturnValue; value | +| 912 | Summary: lang:proc_macro; ::decode; Argument[0].Element; Argument[0].Reference.Reference; value | +| 913 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1].ReturnValue; ReturnValue; value | +| 914 | Summary: lang:proc_macro; crate::bridge::client::state::set; Argument[1]; Argument[1].Parameter[0]; value | +| 915 | Summary: lang:proc_macro; crate::bridge::client::state::with; Argument[0].ReturnValue; ReturnValue; value | +| 916 | Summary: lang:std; <&[u8] as crate::io::BufRead>::consume; Argument[self].Element; Argument[self].Reference.Reference; value | +| 917 | Summary: lang:std; <&[u8] as crate::io::BufRead>::fill_buf; Argument[self].Reference; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 918 | Summary: lang:std; <&[u8] as crate::io::Read>::read_buf_exact; Argument[self].Element; Argument[self].Reference.Reference; value | +| 919 | Summary: lang:std; <&[u8] as crate::io::Read>::read_exact; Argument[self].Element; Argument[self].Reference.Reference; value | +| 920 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_end; Argument[self].Element; Argument[self].Reference.Reference; value | +| 921 | Summary: lang:std; <&[u8] as crate::io::Read>::read_to_string; Argument[self].Element; Argument[self].Reference.Reference; value | +| 922 | Summary: lang:std; <&[u8] as crate::io::copy::BufferedReaderSpec>::copy_to; Argument[self].Element; Argument[self].Reference.Reference; value | +| 923 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | +| 924 | Summary: lang:std; ::fold; Argument[0]; ReturnValue; value | +| 925 | Summary: lang:std; ::pretty; Argument[self]; ReturnValue; value | +| 926 | Summary: lang:std; ::show_backtrace; Argument[self]; ReturnValue; value | +| 927 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 928 | Summary: lang:std; ::borrow; Argument[self].Element; ReturnValue.Reference; value | +| 929 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 930 | Summary: lang:std; ::deref; Argument[self].Element; ReturnValue.Reference; value | +| 931 | Summary: lang:std; ::deref_mut; Argument[self].Element; ReturnValue.Reference; value | +| 932 | Summary: lang:std; ::as_os_str; Argument[self]; ReturnValue; value | +| 933 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | +| 934 | Summary: lang:std; ::recursive; Argument[self]; ReturnValue; value | +| 935 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 936 | Summary: lang:std; ::set_created; Argument[self]; ReturnValue; value | +| 937 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 938 | Summary: lang:std; ::set_accessed; Argument[self]; ReturnValue; value | +| 939 | Summary: lang:std; ::set_modified; Argument[self]; ReturnValue; value | +| 940 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 941 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 942 | Summary: lang:std; ::custom_flags; Argument[self]; ReturnValue; value | +| 943 | Summary: lang:std; ::mode; Argument[self]; ReturnValue; value | +| 944 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 945 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 946 | Summary: lang:std; ::append; Argument[self]; ReturnValue; value | +| 947 | Summary: lang:std; ::create; Argument[self]; ReturnValue; value | +| 948 | Summary: lang:std; ::create_new; Argument[self]; ReturnValue; value | +| 949 | Summary: lang:std; ::read; Argument[self]; ReturnValue; value | +| 950 | Summary: lang:std; ::truncate; Argument[self]; ReturnValue; value | +| 951 | Summary: lang:std; ::write; Argument[self]; ReturnValue; value | +| 952 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 953 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | +| 954 | Summary: lang:std; ::advance_slices; Argument[0].Reference.Element; Argument[0].Reference.Reference; value | +| 955 | Summary: lang:std; ::error; Argument[self].Field[1]; ReturnValue.Reference; value | +| 956 | Summary: lang:std; ::into_error; Argument[self].Field[1]; ReturnValue; value | +| 957 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 958 | Summary: lang:std; ::into_parts; Argument[self].Field[0]; ReturnValue.Field[1]; value | +| 959 | Summary: lang:std; ::into_parts; Argument[self].Field[1]; ReturnValue.Field[0]; value | +| 960 | Summary: lang:std; ::from; Argument[0].Field[1]; ReturnValue; value | +| 961 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 962 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 963 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 964 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 965 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 966 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 967 | Summary: lang:std; ::as_fd; Argument[self].Reference; ReturnValue; value | +| 968 | Summary: lang:std; ::new; Argument[0].ReturnValue; ReturnValue; value | +| 969 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 970 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 971 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 972 | Summary: lang:std; ::as_ref; Argument[self]; ReturnValue; value | +| 973 | Summary: lang:std; ::as_path; Argument[self]; ReturnValue; value | +| 974 | Summary: lang:std; ::arg0; Argument[self]; ReturnValue; value | +| 975 | Summary: lang:std; ::gid; Argument[self]; ReturnValue; value | +| 976 | Summary: lang:std; ::groups; Argument[self]; ReturnValue; value | +| 977 | Summary: lang:std; ::pre_exec; Argument[self]; ReturnValue; value | +| 978 | Summary: lang:std; ::process_group; Argument[self]; ReturnValue; value | +| 979 | Summary: lang:std; ::uid; Argument[self]; ReturnValue; value | +| 980 | Summary: lang:std; ::arg; Argument[self]; ReturnValue; value | +| 981 | Summary: lang:std; ::args; Argument[self]; ReturnValue; value | +| 982 | Summary: lang:std; ::current_dir; Argument[self]; ReturnValue; value | +| 983 | Summary: lang:std; ::env; Argument[self]; ReturnValue; value | +| 984 | Summary: lang:std; ::env_clear; Argument[self]; ReturnValue; value | +| 985 | Summary: lang:std; ::env_remove; Argument[self]; ReturnValue; value | +| 986 | Summary: lang:std; ::envs; Argument[self]; ReturnValue; value | +| 987 | Summary: lang:std; ::stderr; Argument[self]; ReturnValue; value | +| 988 | Summary: lang:std; ::stdin; Argument[self]; ReturnValue; value | +| 989 | Summary: lang:std; ::stdout; Argument[self]; ReturnValue; value | +| 990 | Summary: lang:std; ::report; Argument[self]; ReturnValue; value | +| 991 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 992 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 993 | Summary: lang:std; ::is_leader; Argument[self].Field[0]; ReturnValue; value | +| 994 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 995 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 996 | Summary: lang:std; ::write; Argument[1]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 997 | Summary: lang:std; ::set; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 998 | Summary: lang:std; ::try_insert; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)].Field[1]; value | +| 999 | Summary: lang:std; ::wait; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1000 | Summary: lang:std; ::wait_timeout; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | +| 1001 | Summary: lang:std; ::wait_timeout_ms; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | +| 1002 | Summary: lang:std; ::wait_timeout_while; Argument[0].Reference; Argument[2].Parameter[0].Reference; value | +| 1003 | Summary: lang:std; ::wait_timeout_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; value | +| 1004 | Summary: lang:std; ::wait_while; Argument[0].Reference; Argument[1].Parameter[0].Reference; value | +| 1005 | Summary: lang:std; ::wait_while; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1006 | Summary: lang:std; ::timed_out; Argument[self].Field[0]; ReturnValue; value | +| 1007 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1008 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1009 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1010 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1011 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1012 | Summary: lang:std; ::try_map; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1013 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1014 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1015 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1016 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1017 | Summary: lang:std; ::bind; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1018 | Summary: lang:std; ::bind; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1019 | Summary: lang:std; ::connect; Argument[0].Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1020 | Summary: lang:std; ::connect; Argument[0].Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1021 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1022 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1023 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1024 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1025 | Summary: lang:std; ::as_inner; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1026 | Summary: lang:std; ::as_inner_mut; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1027 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1028 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1029 | Summary: lang:std; ::as_file_desc; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1030 | Summary: lang:std; ::into_raw; Argument[self].Field[0]; ReturnValue; value | +| 1031 | Summary: lang:std; ::index; Argument[self]; ReturnValue; value | +| 1032 | Summary: lang:std; ::into_string; Argument[self]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1033 | Summary: lang:std; ::name; Argument[self]; ReturnValue; value | +| 1034 | Summary: lang:std; ::no_hooks; Argument[self]; ReturnValue; value | +| 1035 | Summary: lang:std; ::stack_size; Argument[self]; ReturnValue; value | +| 1036 | Summary: lang:std; ::as_u64; Argument[self].Field[0]; ReturnValue; value | +| 1037 | Summary: lang:std; ::try_with; Argument[0].ReturnValue; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1038 | Summary: lang:std; ::with; Argument[0].ReturnValue; ReturnValue; value | +| 1039 | Summary: lang:std; ::into_inner; Argument[self].Field[0]; ReturnValue; value | +| 1040 | Summary: lang:std; ::duration; Argument[self].Field[0]; ReturnValue; value | +| 1041 | Summary: lang:std; ::as_raw_fd; Argument[self].Reference; ReturnValue; value | +| 1042 | Summary: lang:std; ::from_raw_fd; Argument[0]; ReturnValue; value | +| 1043 | Summary: lang:std; ::into_raw_fd; Argument[self]; ReturnValue; value | +| 1044 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::as_str; Argument[self].Field[0]; ReturnValue.Field[crate::option::Option::Some(0)]; value | +| 1045 | Summary: lang:std; <{486}::StaticStrPayload as crate::panic::PanicPayload>::get; Argument[self].Field[0]; ReturnValue.Reference; value | +| 1046 | Summary: lang:std; <{491}::RewrapBox as crate::panic::PanicPayload>::get; Argument[self].Field[0].Reference; ReturnValue.Reference; value | +| 1047 | Summary: lang:std; crate::backtrace::helper::lazy_resolve; Argument[0]; ReturnValue; value | +| 1048 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue.Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1049 | Summary: lang:std; crate::io::append_to_string; Argument[1].ReturnValue; ReturnValue; value | +| 1050 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::option::Option::Some(0)]; ReturnValue; value | +| 1051 | Summary: lang:std; crate::io::default_read_buf; Argument[0].ReturnValue.Field[crate::result::Result::Ok(0)]; ReturnValue; value | +| 1052 | Summary: lang:std; crate::io::default_read_vectored; Argument[0].ReturnValue; ReturnValue; value | +| 1053 | Summary: lang:std; crate::io::default_write_vectored; Argument[0].ReturnValue; ReturnValue; value | +| 1054 | Summary: lang:std; crate::sys::backtrace::__rust_begin_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | +| 1055 | Summary: lang:std; crate::sys::backtrace::__rust_end_short_backtrace; Argument[0].ReturnValue; ReturnValue; value | +| 1056 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_path_with_cstr; Argument[1].ReturnValue; ReturnValue; value | +| 1057 | Summary: lang:std; crate::sys::pal::common::small_c_string::run_with_cstr; Argument[1].ReturnValue; ReturnValue; value | +| 1058 | Summary: lang:std; crate::sys::pal::unix::cvt; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; value | +| 1059 | Summary: lang:std; crate::sys_common::ignore_notfound; Argument[0].Field[crate::result::Result::Err(0)]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1060 | Summary: lang:std; crate::thread::current::set_current; Argument[0]; ReturnValue.Field[crate::result::Result::Err(0)]; value | +| 1061 | Summary: lang:std; crate::thread::current::try_with_current; Argument[0].ReturnValue; ReturnValue; value | +| 1062 | Summary: lang:std; crate::thread::with_current_name; Argument[0].ReturnValue; ReturnValue; value | +| 1063 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value | storeStep | file://:0:0:0:0 | [summary] to write: Argument[0].Field[crate::option::Option::Some(0)] in lang:core::_::::zip_with | Some | file://:0:0:0:0 | [post] [summary param] 0 in lang:core::_::::zip_with | | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0].Reference in lang:alloc::_::::retain | &ref | file://:0:0:0:0 | [summary] to write: Argument[0].Parameter[0] in lang:alloc::_::::retain | From 2c31363680154c32b4a5049f824e0f3e80767f93 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 15 Apr 2025 17:09:12 +0200 Subject: [PATCH 281/372] Partially revert "Rust: fix compilation errors" This reverts commit 260322b669e436f5f7776869b363489b202459d2. --- rust/extractor/src/crate_graph.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 88802e6239b..4fea5d9984d 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -18,18 +18,17 @@ use ra_ap_hir_def::{ }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; +use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; use ra_ap_hir_ty::WhereClause; +use ra_ap_hir_ty::db::InternedCallableDefId; +use ra_ap_hir_ty::from_assoc_type_id; use ra_ap_hir_ty::{Binders, FnPointer}; use ra_ap_hir_ty::{Interner, ProjectionTy}; -use ra_ap_hir_ty::{TraitRefExt, from_assoc_type_id}; use ra_ap_ide_db::RootDatabase; use ra_ap_vfs::{Vfs, VfsPath}; -use ra_ap_hir_def::data::ConstFlags; -use ra_ap_hir_def::item_tree::StaticFlags; -use ra_ap_hir_ty::db::InternedCallableDefId; use std::hash::Hasher; use std::{cmp::Ordering, collections::HashMap, path::PathBuf}; use std::{hash::Hash, vec}; @@ -377,7 +376,7 @@ fn emit_const( attrs: vec![], body: None, is_const: true, - is_default: konst.flags.contains(ConstFlags::HAS_BODY), + is_default: konst.has_body(), type_repr, visibility, }) @@ -410,9 +409,9 @@ fn emit_static( body: None, type_repr, visibility, - is_mut: statik.flags.contains(StaticFlags::MUTABLE), + is_mut: statik.mutable(), is_static: true, - is_unsafe: statik.flags.contains(StaticFlags::HAS_UNSAFE_KW), + is_unsafe: statik.has_unsafe_kw(), }) .into(), ); @@ -1307,7 +1306,7 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari trap.emit(generated::StructField { id: trap::TrapId::Star, attrs: vec![], - is_unsafe: false, + is_unsafe: field_data[field_id].is_unsafe, name, type_repr, visibility, From a7ccba9aeb58979b64c51ddd3770dbd2951a941a Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 28 Mar 2025 16:30:33 +0100 Subject: [PATCH 282/372] Rust: crate graph: type variables --- rust/extractor/src/crate_graph.rs | 127 ++++++++++++++---- .../extractor-tests/crate_graph/module.rs | 10 ++ .../crate_graph/modules.expected | 15 ++- 3 files changed, 120 insertions(+), 32 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 4fea5d9984d..f75224f3fdf 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -18,6 +18,7 @@ use ra_ap_hir_def::{ }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; +use ra_ap_hir_ty::GenericArg; use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; @@ -244,7 +245,7 @@ fn emit_reexport( name, }) }); - let path = make_qualified_path(trap, path_components); + let path = make_qualified_path(trap, path_components, None); let use_tree = trap.emit(generated::UseTree { id: trap::TrapId::Star, is_glob: false, @@ -638,15 +639,13 @@ fn emit_module_impls( module.scope.impls().for_each(|imp| { let self_ty = db.impl_self_ty(imp); let self_ty = emit_hir_ty(trap, db, self_ty.skip_binders()); - let imp_data = db.impl_data(imp); - let trait_ = imp_data - .target_trait - .as_ref() - .and_then(|t| make_qualified_path(trap, emit_hir_path(&imp_data.types_map[t.path]))); - let trait_ = trait_.map(|trait_| { + let path = db + .impl_trait(imp) + .map(|trait_ref| trait_path(db, trap, trait_ref.skip_binders())); + let trait_ = path.map(|path| { trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, - path: Some(trait_), + path, }) .into() }); @@ -759,7 +758,7 @@ fn emit_visibility( Visibility::Module(_, VisibilityExplicitness::Implicit) => None, }; path.map(|path| { - let path = make_qualified_path(trap, path); + let path = make_qualified_path(trap, path, None); trap.emit(generated::Visibility { id: trap::TrapId::Star, path, @@ -859,14 +858,7 @@ fn emit_hir_type_bound( ) -> Option> { match type_bound.skip_binders() { WhereClause::Implemented(trait_ref) => { - let mut path = make_path(db, trait_ref.hir_trait_id()); - path.push( - db.trait_data(trait_ref.hir_trait_id()) - .name - .as_str() - .to_owned(), - ); - let path = make_qualified_path(trap, path); + let path = trait_path(db, trap, trait_ref); let type_repr = Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -887,11 +879,22 @@ fn emit_hir_type_bound( } } -fn emit_hir_path(path: &ra_ap_hir_def::path::Path) -> Vec { - path.segments() - .iter() - .map(|x| x.name.as_str().to_owned()) - .collect() +fn trait_path( + db: &dyn HirDatabase, + trap: &mut TrapFile, + trait_ref: &chalk_ir::TraitRef, +) -> Option> { + let mut path = make_path(db, trait_ref.hir_trait_id()); + path.push( + db.trait_data(trait_ref.hir_trait_id()) + .name + .as_str() + .to_owned(), + ); + let generic_arg_list = + emit_generic_arg_list(trap, db, &trait_ref.substitution.as_slice(Interner)[1..]); + let path = make_qualified_path(trap, path, generic_arg_list); + path } fn emit_hir_fn_ptr( @@ -995,14 +998,17 @@ fn make_path_mod(db: &dyn DefDatabase, module: ModuleId) -> Vec { path.reverse(); path } + fn make_qualified_path( trap: &mut TrapFile, path: Vec, + generic_arg_list: Option>, ) -> Option> { fn qualified_path( trap: &mut TrapFile, qualifier: Option>, name: String, + generic_arg_list: Option>, ) -> trap::Label { let identifier = Some(trap.emit(generated::NameRef { id: trap::TrapId::Star, @@ -1010,7 +1016,7 @@ fn make_qualified_path( })); let segment = Some(trap.emit(generated::PathSegment { id: trap::TrapId::Star, - generic_arg_list: None, + generic_arg_list, identifier, parenthesized_arg_list: None, ret_type: None, @@ -1022,8 +1028,10 @@ fn make_qualified_path( segment, }) } + let args = std::iter::repeat_n(None, &path.len() - 1).chain(std::iter::once(generic_arg_list)); path.into_iter() - .fold(None, |q, p| Some(qualified_path(trap, q, p))) + .zip(args) + .fold(None, |q, (p, a)| Some(qualified_path(trap, q, p, a))) } fn emit_hir_ty( trap: &mut TrapFile, @@ -1109,7 +1117,7 @@ fn emit_hir_ty( ) } - chalk_ir::TyKind::Adt(adt_id, _substitution) => { + chalk_ir::TyKind::Adt(adt_id, substitution) => { let mut path = make_path(db, adt_id.0); let name = match adt_id.0 { ra_ap_hir_def::AdtId::StructId(struct_id) => { @@ -1123,7 +1131,8 @@ fn emit_hir_ty( } }; path.push(name); - let path = make_qualified_path(trap, path); + let generic_arg_list = emit_generic_arg_list(trap, db, substitution.as_slice(Interner)); + let path = make_qualified_path(trap, path, generic_arg_list); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1133,7 +1142,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Scalar(scalar) => { - let path = make_qualified_path(trap, vec![scalar_to_str(scalar).to_owned()]); + let path = make_qualified_path(trap, vec![scalar_to_str(scalar).to_owned()], None); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1143,7 +1152,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Str => { - let path = make_qualified_path(trap, vec!["str".to_owned()]); + let path = make_qualified_path(trap, vec!["str".to_owned()], None); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1234,7 +1243,7 @@ fn emit_hir_ty( } chalk_ir::TyKind::BoundVar(var) => { let var = format!("T_{}_{}", var.debruijn.depth(), var.index); - let path = make_qualified_path(trap, vec![var]); + let path = make_qualified_path(trap, vec![var], None); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1255,6 +1264,66 @@ fn emit_hir_ty( } } +fn emit_generic_arg_list( + trap: &mut TrapFile, + db: &dyn HirDatabase, + args: &[GenericArg], +) -> Option> { + if args.is_empty() { + return None; + } + let generic_args = args + .iter() + .flat_map(|arg| { + if let Some(ty) = arg.ty(Interner) { + let type_repr = emit_hir_ty(trap, db, ty); + Some( + trap.emit(generated::TypeArg { + id: trap::TrapId::Star, + type_repr, + }) + .into(), + ) + } else if let Some(l) = arg.lifetime(Interner) { + let text = match l.data(Interner) { + chalk_ir::LifetimeData::BoundVar(var) => { + format!("'T_{}_{}", var.debruijn.depth(), var.index).into() + } + chalk_ir::LifetimeData::Static => "'static'".to_owned().into(), + _ => None, + }; + let lifetime = trap.emit(generated::Lifetime { + id: trap::TrapId::Star, + text, + }); + Some( + trap.emit(generated::LifetimeArg { + id: trap::TrapId::Star, + lifetime: Some(lifetime), + }) + .into(), + ) + } else if let Some(_) = arg.constant(Interner) { + Some( + trap.emit(generated::ConstArg { + id: trap::TrapId::Star, + expr: None, + }) + .into(), + ) + } else { + None + } + }) + .collect(); + + trap.emit(generated::GenericArgList { + id: trap::TrapId::Star, + generic_args, + }) + .into() +} + enum Variant { Unit, Record(trap::Label), diff --git a/rust/ql/test/extractor-tests/crate_graph/module.rs b/rust/ql/test/extractor-tests/crate_graph/module.rs index 17ef271a729..716c882da33 100644 --- a/rust/ql/test/extractor-tests/crate_graph/module.rs +++ b/rust/ql/test/extractor-tests/crate_graph/module.rs @@ -43,3 +43,13 @@ pub static X_B: X = X::B; pub use std::fs::create_dir as mkdir; pub use std::{fs::*, path::PathBuf}; + +pub struct LocalKey { + inner: fn(Option<&mut Option>) -> *const T, +} + +impl From for X { + fn from(x: usize) -> Self { + X::A + } +} diff --git a/rust/ql/test/extractor-tests/crate_graph/modules.expected b/rust/ql/test/extractor-tests/crate_graph/modules.expected index 40ee24579e0..11eb095ea79 100644 --- a/rust/ql/test/extractor-tests/crate_graph/modules.expected +++ b/rust/ql/test/extractor-tests/crate_graph/modules.expected @@ -10,13 +10,18 @@ #-----| fn fmt +#-----| fn from + #-----| fn length +#-----| impl ...::AsString for ...::X { ... } +#-----| -> fn as_string + #-----| impl ...::Display for ...::X { ... } #-----| -> fn fmt -#-----| impl AsString for ...::X { ... } -#-----| -> fn as_string +#-----| impl ...::From::<...> for ...::X { ... } +#-----| -> fn from lib.rs: # 0| mod crate @@ -27,8 +32,10 @@ lib.rs: #-----| -> Static #-----| -> enum X #-----| -> fn length +#-----| -> impl ...::AsString for ...::X { ... } #-----| -> impl ...::Display for ...::X { ... } -#-----| -> impl AsString for ...::X { ... } +#-----| -> impl ...::From::<...> for ...::X { ... } +#-----| -> struct LocalKey #-----| -> struct X_List #-----| -> trait AsString #-----| -> use ...::DirBuilder @@ -62,6 +69,8 @@ lib.rs: #-----| -> use ...::symlink_metadata #-----| -> use ...::write +#-----| struct LocalKey + #-----| struct X_List #-----| trait AsString From cec95ae87597847dce347bd019afeee8dbb8c8f5 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 31 Mar 2025 14:13:48 +0200 Subject: [PATCH 283/372] Rust: crate graph: generic parameters --- rust/extractor/src/crate_graph.rs | 133 ++++++++++++++++-- .../extractor-tests/crate_graph/module.rs | 9 +- .../crate_graph/modules.expected | 11 +- .../extractor-tests/crate_graph/modules.ql | 29 +++- 4 files changed, 160 insertions(+), 22 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index f75224f3fdf..53562462534 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -11,10 +11,12 @@ use ra_ap_base_db::{Crate, RootQueryDb}; use ra_ap_cfg::CfgAtom; use ra_ap_hir::{DefMap, ModuleDefId, PathKind, db::HirDatabase}; use ra_ap_hir::{VariantId, Visibility, db::DefDatabase}; +use ra_ap_hir_def::GenericDefId; use ra_ap_hir_def::Lookup; use ra_ap_hir_def::{ - AssocItemId, LocalModuleId, data::adt::VariantData, item_scope::ImportOrGlob, - item_tree::ImportKind, nameres::ModuleData, path::ImportAlias, + AssocItemId, ConstParamId, LocalModuleId, TypeOrConstParamId, data::adt::VariantData, + generics::TypeOrConstParamData, item_scope::ImportOrGlob, item_tree::ImportKind, + nameres::ModuleData, path::ImportAlias, }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; @@ -22,6 +24,7 @@ use ra_ap_hir_ty::GenericArg; use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; +use ra_ap_hir_ty::TyLoweringContext; use ra_ap_hir_ty::WhereClause; use ra_ap_hir_ty::db::InternedCallableDefId; use ra_ap_hir_ty::from_assoc_type_id; @@ -432,7 +435,98 @@ fn emit_enum_variant( } items } +fn emit_generic_param_list( + trap: &mut TrapFile, + db: &dyn HirDatabase, + def: GenericDefId, +) -> Option> { + let params = db.generic_params(def); + let trait_self_param = params.trait_self_param(); + if params.is_empty() || params.len() == 1 && trait_self_param.is_some() { + return None; + } + let mut generic_params = Vec::new(); + generic_params.extend(params.iter_lt().map( + |(_, param)| -> trap::Label { + let lifetime = trap + .emit(generated::Lifetime { + id: trap::TrapId::Star, + text: Some(param.name.as_str().to_owned()), + }) + .into(); + trap.emit(generated::LifetimeParam { + id: trap::TrapId::Star, + attrs: vec![], + lifetime, + type_bound_list: None, + }) + .into() + }, + )); + generic_params.extend( + params + .iter_type_or_consts() + .filter(|(id, _)| trait_self_param != Some(*id)) + .map( + |(param_id, param)| -> trap::Label { + match param { + TypeOrConstParamData::TypeParamData(param) => { + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: param.name.as_ref().map(|name| name.as_str().to_owned()), + })); + let resolver = def.resolver(db.upcast()); + let mut ctx = TyLoweringContext::new( + db, + &resolver, + ¶ms.types_map, + def.into(), + ); + + let default_type = param + .default + .and_then(|ty| emit_hir_ty(trap, db, &ctx.lower_ty(ty))); + trap.emit(generated::TypeParam { + id: trap::TrapId::Star, + attrs: vec![], + name, + default_type, + type_bound_list: None, + }) + .into() + } + TypeOrConstParamData::ConstParamData(param) => { + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: param.name.as_str().to_owned().into(), + })); + let param_id = TypeOrConstParamId { + parent: def, + local_id: param_id, + }; + let ty = db.const_param_ty(ConstParamId::from_unchecked(param_id)); + let type_repr = emit_hir_ty(trap, db, &ty); + trap.emit(generated::ConstParam { + id: trap::TrapId::Star, + attrs: vec![], + name, + default_val: None, + is_const: true, + type_repr, + }) + .into() + } + } + }, + ), + ); + trap.emit(generated::GenericParamList { + id: trap::TrapId::Star, + generic_params, + }) + .into() +} fn emit_adt( db: &dyn HirDatabase, name: &str, @@ -441,6 +535,7 @@ fn emit_adt( visibility: Visibility, ) -> Vec> { let mut items = Vec::new(); + match adt_id { ra_ap_hir_def::AdtId::StructId(struct_id) => { let name = Some(trap.emit(generated::Name { @@ -449,13 +544,14 @@ fn emit_adt( })); let field_list = emit_variant_data(trap, db, struct_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); items.push( trap.emit(generated::Struct { id: trap::TrapId::Star, name, attrs: vec![], field_list, - generic_param_list: None, + generic_param_list, visibility, where_clause: None, }) @@ -493,12 +589,13 @@ fn emit_adt( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); items.push( trap.emit(generated::Enum { id: trap::TrapId::Star, name, attrs: vec![], - generic_param_list: None, + generic_param_list, variant_list, visibility, where_clause: None, @@ -513,13 +610,14 @@ fn emit_adt( })); let struct_field_list = emit_variant_data(trap, db, union_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); items.push( trap.emit(generated::Union { id: trap::TrapId::Star, name, attrs: vec![], struct_field_list, - generic_param_list: None, + generic_param_list, visibility, where_clause: None, }) @@ -538,8 +636,8 @@ fn emit_trait( visibility: Visibility, ) -> Vec> { let mut items = Vec::new(); - let data = db.trait_items(trait_id); - let assoc_items: Vec> = data + let trait_items = db.trait_items(trait_id); + let assoc_items: Vec> = trait_items .items .iter() .flat_map(|(name, item)| { @@ -577,6 +675,7 @@ fn emit_trait( text: Some(name.as_str().to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); Some( trap.emit(generated::Function { id: trap::TrapId::Star, @@ -590,7 +689,7 @@ fn emit_trait( is_async: false, is_gen: false, is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list: None, //TODO + generic_param_list, param_list: Some(param_list), ret_type, where_clause: None, @@ -612,13 +711,14 @@ fn emit_trait( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, trait_id.into()); items.push( trap.emit(generated::Trait { id: trap::TrapId::Star, name, assoc_item_list, attrs: vec![], - generic_param_list: None, + generic_param_list, is_auto: false, is_unsafe: false, type_bound_list: None, @@ -694,7 +794,7 @@ fn emit_module_impls( data.visibility .resolve(db.upcast(), &function.resolver(db.upcast())), ); - + let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); Some( trap.emit(generated::Function { id: trap::TrapId::Star, @@ -708,7 +808,7 @@ fn emit_module_impls( is_async: false, is_gen: false, is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list: None, //TODO + generic_param_list, param_list: Some(param_list), ret_type, where_clause: None, @@ -725,6 +825,7 @@ fn emit_module_impls( assoc_items, attrs: vec![], })); + let generic_param_list = emit_generic_param_list(trap, db, imp.into()); items.push( trap.emit(generated::Impl { id: trap::TrapId::Star, @@ -732,7 +833,7 @@ fn emit_module_impls( self_ty, assoc_item_list, attrs: vec![], - generic_param_list: None, + generic_param_list, is_const: false, is_default: false, is_unsafe: false, @@ -778,7 +879,6 @@ fn const_or_function( let callable_def_id = db.lookup_intern_callable_def(InternedCallableDefId::from(*fn_def_id)); let data = db.fn_def_datum(callable_def_id); - let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); let params = sig .params() @@ -811,6 +911,11 @@ fn const_or_function( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); + let callable_def_id = db.lookup_intern_callable_def((*fn_def_id).into()); + let generic_def_id = GenericDefId::from_callable(db.upcast(), callable_def_id); + let generic_param_list: Option> = + emit_generic_param_list(trap, db, generic_def_id); + trap.emit(generated::Function { id: trap::TrapId::Star, name, @@ -823,7 +928,7 @@ fn const_or_function( is_async: false, is_gen: false, is_unsafe: matches!(data.sig.safety, Safety::Unsafe), - generic_param_list: None, //TODO + generic_param_list, param_list: Some(param_list), ret_type, where_clause: None, diff --git a/rust/ql/test/extractor-tests/crate_graph/module.rs b/rust/ql/test/extractor-tests/crate_graph/module.rs index 716c882da33..0cb34cbcb1b 100644 --- a/rust/ql/test/extractor-tests/crate_graph/module.rs +++ b/rust/ql/test/extractor-tests/crate_graph/module.rs @@ -48,8 +48,11 @@ pub struct LocalKey { inner: fn(Option<&mut Option>) -> *const T, } -impl From for X { - fn from(x: usize) -> Self { - X::A +pub struct Thing { + x: T, +} +impl From for Thing { + fn from(_x: usize) -> Self { + Thing { x: X::A } } } diff --git a/rust/ql/test/extractor-tests/crate_graph/modules.expected b/rust/ql/test/extractor-tests/crate_graph/modules.expected index 11eb095ea79..157432a77e3 100644 --- a/rust/ql/test/extractor-tests/crate_graph/modules.expected +++ b/rust/ql/test/extractor-tests/crate_graph/modules.expected @@ -20,7 +20,7 @@ #-----| impl ...::Display for ...::X { ... } #-----| -> fn fmt -#-----| impl ...::From::<...> for ...::X { ... } +#-----| impl ...::From::<...> for ...::Thing::<...> { ... } #-----| -> fn from lib.rs: @@ -34,8 +34,9 @@ lib.rs: #-----| -> fn length #-----| -> impl ...::AsString for ...::X { ... } #-----| -> impl ...::Display for ...::X { ... } -#-----| -> impl ...::From::<...> for ...::X { ... } -#-----| -> struct LocalKey +#-----| -> impl ...::From::<...> for ...::Thing::<...> { ... } +#-----| -> struct LocalKey +#-----| -> struct Thing #-----| -> struct X_List #-----| -> trait AsString #-----| -> use ...::DirBuilder @@ -69,7 +70,9 @@ lib.rs: #-----| -> use ...::symlink_metadata #-----| -> use ...::write -#-----| struct LocalKey +#-----| struct LocalKey + +#-----| struct Thing #-----| struct X_List diff --git a/rust/ql/test/extractor-tests/crate_graph/modules.ql b/rust/ql/test/extractor-tests/crate_graph/modules.ql index 42b0e5c0fcb..5554a69d1a9 100644 --- a/rust/ql/test/extractor-tests/crate_graph/modules.ql +++ b/rust/ql/test/extractor-tests/crate_graph/modules.ql @@ -13,6 +13,33 @@ class RelevantNode extends Item { this.getParentNode*() = any(Crate m | m.getName() = "test" and m.getVersion() = "0.0.1").getModule() } + + string label() { result = this.toString() } +} + +class HasGenericParams extends RelevantNode { + private GenericParamList params; + + HasGenericParams() { + params = this.(Function).getGenericParamList() or + params = this.(Enum).getGenericParamList() or + params = this.(Struct).getGenericParamList() or + params = this.(Union).getGenericParamList() or + params = this.(Impl).getGenericParamList() or + params = this.(Enum).getGenericParamList() or + params = this.(Trait).getGenericParamList() or + params = this.(TraitAlias).getGenericParamList() + } + + override string label() { + result = + super.toString() + "<" + + strictconcat(string part, int index | + part = params.getGenericParam(index).toString() + | + part, ", " order by index + ) + ">" + } } predicate edges(RelevantNode container, RelevantNode element) { @@ -25,7 +52,7 @@ query predicate nodes(RelevantNode node, string attr, string val) { nodes(node) and ( attr = "semmle.label" and - val = node.toString() + val = node.label() or attr = "semmle.order" and val = From b24fbe8db951a870963bb6c051c2641ecf4ebe76 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 12:45:59 +0200 Subject: [PATCH 284/372] Rust: remove unreachable case Enum variants cannot be declared as a module item, they can only be imported --- rust/extractor/src/crate_graph.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 53562462534..fa4f1636a93 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -305,9 +305,6 @@ fn emit_module_items( ModuleDefId::StaticId(statik) => { items.extend(emit_static(db, name.as_str(), trap, statik, vis)); } - ModuleDefId::EnumVariantId(variant_id) => { - items.extend(emit_enum_variant(db, name.as_str(), trap, variant_id, vis)); - } _ => (), } } @@ -422,19 +419,6 @@ fn emit_static( items } -fn emit_enum_variant( - db: &dyn HirDatabase, - name: &str, - trap: &mut TrapFile, - variant_id: ra_ap_hir_def::EnumVariantId, - visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); - if let Some(type_) = db.value_ty(variant_id.into()) { - items.push(const_or_function(db, name, trap, type_, visibility)); - } - items -} fn emit_generic_param_list( trap: &mut TrapFile, db: &dyn HirDatabase, From 5cfbedc114ada4ef9d56519cb48a06d4f3756db5 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 12:58:21 +0200 Subject: [PATCH 285/372] Rust: replace singleton vectors with Option --- rust/extractor/src/crate_graph.rs | 50 ++++++++++++------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index fa4f1636a93..701d87abb69 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -346,12 +346,9 @@ fn emit_function( trap: &mut TrapFile, function: ra_ap_hir_def::FunctionId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); - if let Some(type_) = db.value_ty(function.into()) { - items.push(const_or_function(db, name, trap, type_, visibility)); - } - items +) -> Option> { + db.value_ty(function.into()) + .map(|type_| const_or_function(db, name, trap, type_, visibility)) } fn emit_const( @@ -360,8 +357,7 @@ fn emit_const( trap: &mut TrapFile, konst: ra_ap_hir_def::ConstId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); +) -> Option> { let type_ = db.value_ty(konst.into()); let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); let name = Some(trap.emit(generated::Name { @@ -370,7 +366,7 @@ fn emit_const( })); let konst = db.const_data(konst); let visibility = emit_visibility(db, trap, visibility); - items.push( + Some( trap.emit(generated::Const { id: trap::TrapId::Star, name, @@ -382,8 +378,7 @@ fn emit_const( visibility, }) .into(), - ); - items + ) } fn emit_static( @@ -392,8 +387,7 @@ fn emit_static( trap: &mut TrapFile, statik: ra_ap_hir_def::StaticId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); +) -> Option> { let type_ = db.value_ty(statik.into()); let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); let name = Some(trap.emit(generated::Name { @@ -402,7 +396,7 @@ fn emit_static( })); let statik = db.static_data(statik); let visibility = emit_visibility(db, trap, visibility); - items.push( + Some( trap.emit(generated::Static { id: trap::TrapId::Star, name, @@ -415,8 +409,7 @@ fn emit_static( is_unsafe: statik.has_unsafe_kw(), }) .into(), - ); - items + ) } fn emit_generic_param_list( @@ -517,9 +510,7 @@ fn emit_adt( trap: &mut TrapFile, adt_id: ra_ap_hir_def::AdtId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); - +) -> Option> { match adt_id { ra_ap_hir_def::AdtId::StructId(struct_id) => { let name = Some(trap.emit(generated::Name { @@ -529,7 +520,7 @@ fn emit_adt( let field_list = emit_variant_data(trap, db, struct_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); - items.push( + Some( trap.emit(generated::Struct { id: trap::TrapId::Star, name, @@ -540,7 +531,7 @@ fn emit_adt( where_clause: None, }) .into(), - ); + ) } ra_ap_hir_def::AdtId::EnumId(enum_id) => { let data = db.enum_variants(enum_id); @@ -574,7 +565,7 @@ fn emit_adt( })); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); - items.push( + Some( trap.emit(generated::Enum { id: trap::TrapId::Star, name, @@ -585,7 +576,7 @@ fn emit_adt( where_clause: None, }) .into(), - ); + ) } ra_ap_hir_def::AdtId::UnionId(union_id) => { let name = Some(trap.emit(generated::Name { @@ -595,7 +586,7 @@ fn emit_adt( let struct_field_list = emit_variant_data(trap, db, union_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); - items.push( + Some( trap.emit(generated::Union { id: trap::TrapId::Star, name, @@ -606,10 +597,9 @@ fn emit_adt( where_clause: None, }) .into(), - ); + ) } } - items } fn emit_trait( @@ -618,8 +608,7 @@ fn emit_trait( trap: &mut TrapFile, trait_id: ra_ap_hir_def::TraitId, visibility: Visibility, -) -> Vec> { - let mut items = Vec::new(); +) -> Option> { let trait_items = db.trait_items(trait_id); let assoc_items: Vec> = trait_items .items @@ -696,7 +685,7 @@ fn emit_trait( })); let visibility = emit_visibility(db, trap, visibility); let generic_param_list = emit_generic_param_list(trap, db, trait_id.into()); - items.push( + Some( trap.emit(generated::Trait { id: trap::TrapId::Star, name, @@ -710,8 +699,7 @@ fn emit_trait( where_clause: None, }) .into(), - ); - items + ) } fn emit_module_impls( From 0545f782e04572244986bfc518e860c6c3bc946d Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 13:30:20 +0200 Subject: [PATCH 286/372] Rust: get rid of const_or_function --- rust/extractor/src/crate_graph.rs | 147 +++++++++++------------------- 1 file changed, 55 insertions(+), 92 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 701d87abb69..998af55e175 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -26,7 +26,6 @@ use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; use ra_ap_hir_ty::TyLoweringContext; use ra_ap_hir_ty::WhereClause; -use ra_ap_hir_ty::db::InternedCallableDefId; use ra_ap_hir_ty::from_assoc_type_id; use ra_ap_hir_ty::{Binders, FnPointer}; use ra_ap_hir_ty::{Interner, ProjectionTy}; @@ -347,8 +346,61 @@ fn emit_function( function: ra_ap_hir_def::FunctionId, visibility: Visibility, ) -> Option> { - db.value_ty(function.into()) - .map(|type_| const_or_function(db, name, trap, type_, visibility)) + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: Some(name.to_owned()), + })); + let visibility = emit_visibility(db, trap, visibility); + let generic_param_list = emit_generic_param_list(trap, db, function.into()); + let data = db.function_data(function); + let sig = db.callable_item_signature(function.into()); + let sig = sig.skip_binders(); + let params = sig + .params() + .iter() + .map(|p| { + let type_repr = emit_hir_ty(trap, db, p); + trap.emit(generated::Param { + id: trap::TrapId::Star, + attrs: vec![], + type_repr, + pat: None, + }) + }) + .collect(); + + let ret_type = emit_hir_ty(trap, db, sig.ret()); + let param_list = trap.emit(generated::ParamList { + id: trap::TrapId::Star, + params, + self_param: None, + }); + let ret_type = ret_type.map(|ret_type| { + trap.emit(generated::RetTypeRepr { + id: trap::TrapId::Star, + type_repr: Some(ret_type), + }) + }); + Some( + trap.emit(generated::Function { + id: trap::TrapId::Star, + name, + attrs: vec![], + body: None, + is_const: data.is_const(), + is_default: data.is_default(), + visibility, + abi: None, + is_async: data.is_async(), + is_gen: false, + is_unsafe: data.is_unsafe(), + generic_param_list, + param_list: Some(param_list), + ret_type, + where_clause: None, + }) + .into(), + ) } fn emit_const( @@ -838,96 +890,7 @@ fn emit_visibility( }) }) } -fn const_or_function( - db: &dyn HirDatabase, - name: &str, - trap: &mut TrapFile, - type_: Binders, - visibility: Visibility, -) -> trap::Label { - let type_: &chalk_ir::Ty = type_.skip_binders(); - match type_.kind(ra_ap_hir_ty::Interner) { - chalk_ir::TyKind::FnDef(fn_def_id, parameters) => { - let callable_def_id = - db.lookup_intern_callable_def(InternedCallableDefId::from(*fn_def_id)); - let data = db.fn_def_datum(callable_def_id); - let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); - let params = sig - .params() - .iter() - .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); - trap.emit(generated::Param { - id: trap::TrapId::Star, - attrs: vec![], - type_repr, - pat: None, - }) - }) - .collect(); - let ret_type = emit_hir_ty(trap, db, sig.ret()); - let param_list = trap.emit(generated::ParamList { - id: trap::TrapId::Star, - params, - self_param: None, - }); - let ret_type = ret_type.map(|ret_type| { - trap.emit(generated::RetTypeRepr { - id: trap::TrapId::Star, - type_repr: Some(ret_type), - }) - }); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - let callable_def_id = db.lookup_intern_callable_def((*fn_def_id).into()); - let generic_def_id = GenericDefId::from_callable(db.upcast(), callable_def_id); - let generic_param_list: Option> = - emit_generic_param_list(trap, db, generic_def_id); - - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - visibility, - abi: None, - is_async: false, - is_gen: false, - is_unsafe: matches!(data.sig.safety, Safety::Unsafe), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into() - } - _ => { - let type_repr = emit_hir_ty(trap, db, type_); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - trap.emit(generated::Const { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - type_repr, - visibility, - }) - .into() - } - } -} fn emit_hir_type_bound( db: &dyn HirDatabase, trap: &mut TrapFile, From db4306d0c1d3d3317027d30e6400f34e62c57aee Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 3 Apr 2025 14:06:21 +0200 Subject: [PATCH 287/372] Rust: avoid duplication for functions and methods --- rust/extractor/src/crate_graph.rs | 181 ++++++------------------------ 1 file changed, 35 insertions(+), 146 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 998af55e175..16a65d779f1 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -2,10 +2,10 @@ use crate::{ generated::{self}, trap::{self, TrapFile}, }; +use chalk_ir::FloatTy; use chalk_ir::IntTy; use chalk_ir::Scalar; use chalk_ir::UintTy; -use chalk_ir::{FloatTy, Safety}; use itertools::Itertools; use ra_ap_base_db::{Crate, RootQueryDb}; use ra_ap_cfg::CfgAtom; @@ -296,7 +296,7 @@ fn emit_module_items( { match value { ModuleDefId::FunctionId(function) => { - items.extend(emit_function(db, name.as_str(), trap, function, vis)); + items.push(emit_function(db, trap, function, name).into()); } ModuleDefId::ConstId(konst) => { items.extend(emit_const(db, name.as_str(), trap, konst, vis)); @@ -341,18 +341,10 @@ fn emit_module_items( fn emit_function( db: &dyn HirDatabase, - name: &str, trap: &mut TrapFile, function: ra_ap_hir_def::FunctionId, - visibility: Visibility, -) -> Option> { - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, function.into()); - let data = db.function_data(function); + name: &ra_ap_hir::Name, +) -> trap::Label { let sig = db.callable_item_signature(function.into()); let sig = sig.skip_binders(); let params = sig @@ -381,26 +373,35 @@ fn emit_function( type_repr: Some(ret_type), }) }); - Some( - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: data.is_const(), - is_default: data.is_default(), - visibility, - abi: None, - is_async: data.is_async(), - is_gen: false, - is_unsafe: data.is_unsafe(), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into(), - ) + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: Some(name.as_str().to_owned()), + })); + let data = db.function_data(function); + let visibility = emit_visibility( + db, + trap, + data.visibility + .resolve(db.upcast(), &function.resolver(db.upcast())), + ); + let generic_param_list = emit_generic_param_list(trap, db, function.into()); + trap.emit(generated::Function { + id: trap::TrapId::Star, + name, + attrs: vec![], + body: None, + is_const: data.is_const(), + is_default: data.is_default(), + visibility, + abi: None, + is_async: data.is_async(), + is_gen: false, + is_unsafe: data.is_unsafe(), + generic_param_list, + param_list: Some(param_list), + ret_type, + where_clause: None, + }) } fn emit_const( @@ -667,60 +668,7 @@ fn emit_trait( .iter() .flat_map(|(name, item)| { if let AssocItemId::FunctionId(function) = item { - let sig = db.callable_item_signature((*function).into()); - let sig = sig.skip_binders(); - let params = sig - .params() - .iter() - .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); - trap.emit(generated::Param { - id: trap::TrapId::Star, - attrs: vec![], - type_repr, - pat: None, - }) - }) - .collect(); - - let ret_type = emit_hir_ty(trap, db, sig.ret()); - let param_list = trap.emit(generated::ParamList { - id: trap::TrapId::Star, - params, - self_param: None, - }); - let ret_type = ret_type.map(|ret_type| { - trap.emit(generated::RetTypeRepr { - id: trap::TrapId::Star, - type_repr: Some(ret_type), - }) - }); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.as_str().to_owned()), - })); - let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); - Some( - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - visibility, - abi: None, - is_async: false, - is_gen: false, - is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into(), - ) + Some(emit_function(db, trap, *function, name).into()) } else { None } @@ -779,66 +727,7 @@ fn emit_module_impls( .iter() .flat_map(|item| { if let (name, AssocItemId::FunctionId(function)) = item { - let sig = db.callable_item_signature((*function).into()); - let sig = sig.skip_binders(); - let params = sig - .params() - .iter() - .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); - trap.emit(generated::Param { - id: trap::TrapId::Star, - attrs: vec![], - type_repr, - pat: None, - }) - }) - .collect(); - - let ret_type = emit_hir_ty(trap, db, sig.ret()); - let param_list = trap.emit(generated::ParamList { - id: trap::TrapId::Star, - params, - self_param: None, - }); - let ret_type = ret_type.map(|ret_type| { - trap.emit(generated::RetTypeRepr { - id: trap::TrapId::Star, - type_repr: Some(ret_type), - }) - }); - let name = Some(trap.emit(generated::Name { - id: trap::TrapId::Star, - text: Some(name.as_str().to_owned()), - })); - let data = db.function_data(*function); - let visibility = emit_visibility( - db, - trap, - data.visibility - .resolve(db.upcast(), &function.resolver(db.upcast())), - ); - let generic_param_list = emit_generic_param_list(trap, db, (*function).into()); - Some( - trap.emit(generated::Function { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: false, - is_default: false, - visibility, - abi: None, - is_async: false, - is_gen: false, - is_unsafe: matches!(sig.to_fn_ptr().sig.safety, Safety::Unsafe), - generic_param_list, - param_list: Some(param_list), - ret_type, - where_clause: None, - }) - .into(), - ) + Some(emit_function(db, trap, *function, name).into()) } else { None } From a4b1c2bbdc961cfe42dc017a0e91b62d02d77b48 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 4 Apr 2025 14:35:13 +0200 Subject: [PATCH 288/372] Rust: crate graph: resolve bound type variablesp --- rust/extractor/src/crate_graph.rs | 299 +++++++++++++----- .../rust/elements/internal/LifetimeImpl.qll | 2 +- 2 files changed, 229 insertions(+), 72 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 16a65d779f1..64dced1b19e 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -14,9 +14,13 @@ use ra_ap_hir::{VariantId, Visibility, db::DefDatabase}; use ra_ap_hir_def::GenericDefId; use ra_ap_hir_def::Lookup; use ra_ap_hir_def::{ - AssocItemId, ConstParamId, LocalModuleId, TypeOrConstParamId, data::adt::VariantData, - generics::TypeOrConstParamData, item_scope::ImportOrGlob, item_tree::ImportKind, - nameres::ModuleData, path::ImportAlias, + AssocItemId, ConstParamId, LocalModuleId, TypeOrConstParamId, + data::adt::VariantData, + generics::{GenericParams, TypeOrConstParamData}, + item_scope::ImportOrGlob, + item_tree::ImportKind, + nameres::ModuleData, + path::ImportAlias, }; use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; @@ -296,15 +300,24 @@ fn emit_module_items( { match value { ModuleDefId::FunctionId(function) => { - items.push(emit_function(db, trap, function, name).into()); + items.push(emit_function(db, trap, None, function, name).into()); } ModuleDefId::ConstId(konst) => { - items.extend(emit_const(db, name.as_str(), trap, konst, vis)); + items.extend(emit_const(db, name.as_str(), trap, None, konst, vis)); } ModuleDefId::StaticId(statik) => { items.extend(emit_static(db, name.as_str(), trap, statik, vis)); } - _ => (), + // Enum variants can only be introduced into the value namespace by an import (`use`) statement + ModuleDefId::EnumVariantId(_) => (), + // Not in the "value" namespace + ModuleDefId::ModuleId(_) + | ModuleDefId::AdtId(_) + | ModuleDefId::TraitId(_) + | ModuleDefId::TraitAliasId(_) + | ModuleDefId::TypeAliasId(_) + | ModuleDefId::BuiltinType(_) + | ModuleDefId::MacroId(_) => (), } } if let Some(ra_ap_hir_def::per_ns::Item { @@ -331,7 +344,17 @@ fn emit_module_items( ModuleDefId::TraitId(trait_id) => { items.extend(emit_trait(db, name.as_str(), trap, trait_id, vis)); } - _ => (), + ModuleDefId::TraitAliasId(_) | ModuleDefId::TypeAliasId(_) => (), // TODO + ModuleDefId::BuiltinType(_) => (), // TODO? + // modules are handled separatedly + ModuleDefId::ModuleId(_) => (), + // Enum variants cannot be declarted, only imported + ModuleDefId::EnumVariantId(_) => (), + // Not in the "types" namespace + ModuleDefId::FunctionId(_) + | ModuleDefId::ConstId(_) + | ModuleDefId::StaticId(_) + | ModuleDefId::MacroId(_) => (), } } } @@ -342,16 +365,21 @@ fn emit_module_items( fn emit_function( db: &dyn HirDatabase, trap: &mut TrapFile, + container: Option, function: ra_ap_hir_def::FunctionId, name: &ra_ap_hir::Name, ) -> trap::Label { let sig = db.callable_item_signature(function.into()); + let parameters = collect_generic_parameters(db, function.into(), container); + + assert_eq!(sig.binders.len(Interner), parameters.len()); let sig = sig.skip_binders(); + let ty_vars = &[parameters]; let params = sig .params() .iter() .map(|p| { - let type_repr = emit_hir_ty(trap, db, p); + let type_repr = emit_hir_ty(trap, db, ty_vars, p); trap.emit(generated::Param { id: trap::TrapId::Star, attrs: vec![], @@ -361,7 +389,7 @@ fn emit_function( }) .collect(); - let ret_type = emit_hir_ty(trap, db, sig.ret()); + let ret_type = emit_hir_ty(trap, db, ty_vars, sig.ret()); let param_list = trap.emit(generated::ParamList { id: trap::TrapId::Star, params, @@ -384,7 +412,7 @@ fn emit_function( data.visibility .resolve(db.upcast(), &function.resolver(db.upcast())), ); - let generic_param_list = emit_generic_param_list(trap, db, function.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, function.into()); trap.emit(generated::Function { id: trap::TrapId::Star, name, @@ -404,15 +432,54 @@ fn emit_function( }) } +fn collect_generic_parameters( + db: &dyn HirDatabase, + def: GenericDefId, + container: Option, +) -> Vec { + let mut parameters = Vec::new(); + let gen_params = db.generic_params(def); + collect(&gen_params, &mut parameters); + if let Some(gen_params) = container.map(|container| db.generic_params(container)) { + collect(gen_params.as_ref(), &mut parameters); + } + return parameters; + + fn collect(gen_params: &GenericParams, parameters: &mut Vec) { + // Self, Lifetimes, TypesOrConsts + let skip = if gen_params.trait_self_param().is_some() { + parameters.push("Self".into()); + 1 + } else { + 0 + }; + parameters.extend(gen_params.iter_lt().map(|(_, lt)| lt.name.as_str().into())); + parameters.extend(gen_params.iter_type_or_consts().skip(skip).map(|(_, p)| { + p.name() + .map(|p| p.as_str().into()) + .unwrap_or("{error}".into()) + })); + } +} + fn emit_const( db: &dyn HirDatabase, name: &str, trap: &mut TrapFile, + container: Option, konst: ra_ap_hir_def::ConstId, visibility: Visibility, ) -> Option> { let type_ = db.value_ty(konst.into()); - let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); + let parameters = collect_generic_parameters(db, konst.into(), container); + assert_eq!( + type_ + .as_ref() + .map_or(0, |type_| type_.binders.len(Interner)), + parameters.len() + ); + let ty_vars = &[parameters]; + let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, ty_vars, type_.skip_binders())); let name = Some(trap.emit(generated::Name { id: trap::TrapId::Star, text: Some(name.to_owned()), @@ -442,7 +509,15 @@ fn emit_static( visibility: Visibility, ) -> Option> { let type_ = db.value_ty(statik.into()); - let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, type_.skip_binders())); + let parameters = collect_generic_parameters(db, statik.into(), None); + assert_eq!( + type_ + .as_ref() + .map_or(0, |type_| type_.binders.len(Interner)), + parameters.len() + ); + let ty_vars = &[parameters]; + let type_repr = type_.and_then(|type_| emit_hir_ty(trap, db, ty_vars, type_.skip_binders())); let name = Some(trap.emit(generated::Name { id: trap::TrapId::Star, text: Some(name.to_owned()), @@ -468,6 +543,7 @@ fn emit_static( fn emit_generic_param_list( trap: &mut TrapFile, db: &dyn HirDatabase, + ty_vars: &[Vec], def: GenericDefId, ) -> Option> { let params = db.generic_params(def); @@ -516,7 +592,7 @@ fn emit_generic_param_list( let default_type = param .default - .and_then(|ty| emit_hir_ty(trap, db, &ctx.lower_ty(ty))); + .and_then(|ty| emit_hir_ty(trap, db, ty_vars, &ctx.lower_ty(ty))); trap.emit(generated::TypeParam { id: trap::TrapId::Star, attrs: vec![], @@ -536,7 +612,7 @@ fn emit_generic_param_list( local_id: param_id, }; let ty = db.const_param_ty(ConstParamId::from_unchecked(param_id)); - let type_repr = emit_hir_ty(trap, db, &ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, &ty); trap.emit(generated::ConstParam { id: trap::TrapId::Star, attrs: vec![], @@ -564,15 +640,18 @@ fn emit_adt( adt_id: ra_ap_hir_def::AdtId, visibility: Visibility, ) -> Option> { + let parameters = collect_generic_parameters(db, adt_id.into(), None); + let ty_vars = &[parameters]; + match adt_id { ra_ap_hir_def::AdtId::StructId(struct_id) => { let name = Some(trap.emit(generated::Name { id: trap::TrapId::Star, text: Some(name.to_owned()), })); - let field_list = emit_variant_data(trap, db, struct_id.into()).into(); + let field_list = emit_variant_data(trap, db, ty_vars, struct_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, adt_id.into()); Some( trap.emit(generated::Struct { id: trap::TrapId::Star, @@ -596,7 +675,7 @@ fn emit_adt( id: trap::TrapId::Star, text: Some(name.as_str().to_owned()), })); - let field_list = emit_variant_data(trap, db, (*enum_id).into()).into(); + let field_list = emit_variant_data(trap, db, ty_vars, (*enum_id).into()).into(); let visibility = None; trap.emit(generated::Variant { id: trap::TrapId::Star, @@ -617,7 +696,7 @@ fn emit_adt( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, adt_id.into()); Some( trap.emit(generated::Enum { id: trap::TrapId::Star, @@ -636,9 +715,9 @@ fn emit_adt( id: trap::TrapId::Star, text: Some(name.to_owned()), })); - let struct_field_list = emit_variant_data(trap, db, union_id.into()).into(); + let struct_field_list = emit_variant_data(trap, db, ty_vars, union_id.into()).into(); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, adt_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, adt_id.into()); Some( trap.emit(generated::Union { id: trap::TrapId::Star, @@ -662,13 +741,15 @@ fn emit_trait( trait_id: ra_ap_hir_def::TraitId, visibility: Visibility, ) -> Option> { + let parameters = collect_generic_parameters(db, trait_id.into(), None); + let ty_vars = &[parameters]; let trait_items = db.trait_items(trait_id); let assoc_items: Vec> = trait_items .items .iter() .flat_map(|(name, item)| { if let AssocItemId::FunctionId(function) = item { - Some(emit_function(db, trap, *function, name).into()) + Some(emit_function(db, trap, Some(trait_id.into()), *function, name).into()) } else { None } @@ -684,7 +765,7 @@ fn emit_trait( text: Some(name.to_owned()), })); let visibility = emit_visibility(db, trap, visibility); - let generic_param_list = emit_generic_param_list(trap, db, trait_id.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, trait_id.into()); Some( trap.emit(generated::Trait { id: trap::TrapId::Star, @@ -710,10 +791,16 @@ fn emit_module_impls( let mut items = Vec::new(); module.scope.impls().for_each(|imp| { let self_ty = db.impl_self_ty(imp); - let self_ty = emit_hir_ty(trap, db, self_ty.skip_binders()); - let path = db - .impl_trait(imp) - .map(|trait_ref| trait_path(db, trap, trait_ref.skip_binders())); + let parameters = collect_generic_parameters(db, imp.into(), None); + let parameters_len = parameters.len(); + assert_eq!(self_ty.binders.len(Interner), parameters_len); + + let ty_vars = &[parameters]; + let self_ty = emit_hir_ty(trap, db, ty_vars, self_ty.skip_binders()); + let path = db.impl_trait(imp).map(|trait_ref| { + assert_eq!(trait_ref.binders.len(Interner), parameters_len); + trait_path(db, trap, ty_vars, trait_ref.skip_binders()) + }); let trait_ = path.map(|path| { trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -727,7 +814,7 @@ fn emit_module_impls( .iter() .flat_map(|item| { if let (name, AssocItemId::FunctionId(function)) = item { - Some(emit_function(db, trap, *function, name).into()) + Some(emit_function(db, trap, Some(imp.into()), *function, name).into()) } else { None } @@ -738,7 +825,7 @@ fn emit_module_impls( assoc_items, attrs: vec![], })); - let generic_param_list = emit_generic_param_list(trap, db, imp.into()); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, imp.into()); items.push( trap.emit(generated::Impl { id: trap::TrapId::Star, @@ -779,15 +866,25 @@ fn emit_visibility( }) }) } - +fn push_ty_vars(ty_vars: &[Vec], vars: Vec) -> Vec> { + let mut result = ty_vars.to_vec(); + result.push(vars); + result +} fn emit_hir_type_bound( db: &dyn HirDatabase, trap: &mut TrapFile, + ty_vars: &[Vec], type_bound: &Binders>, ) -> Option> { + // Rust-analyzer seems to call `wrap_empty_binders` on `WhereClause`s. + let parameters = vec![]; + assert_eq!(type_bound.binders.len(Interner), parameters.len(),); + let ty_vars = &push_ty_vars(ty_vars, parameters); + match type_bound.skip_binders() { WhereClause::Implemented(trait_ref) => { - let path = trait_path(db, trap, trait_ref); + let path = trait_path(db, trap, ty_vars, trait_ref); let type_repr = Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -804,13 +901,16 @@ fn emit_hir_type_bound( use_bound_generic_args: None, })) } - _ => None, + WhereClause::AliasEq(_) + | WhereClause::LifetimeOutlives(_) + | WhereClause::TypeOutlives(_) => None, // TODO } } fn trait_path( db: &dyn HirDatabase, trap: &mut TrapFile, + ty_vars: &[Vec], trait_ref: &chalk_ir::TraitRef, ) -> Option> { let mut path = make_path(db, trait_ref.hir_trait_id()); @@ -820,23 +920,37 @@ fn trait_path( .as_str() .to_owned(), ); - let generic_arg_list = - emit_generic_arg_list(trap, db, &trait_ref.substitution.as_slice(Interner)[1..]); - let path = make_qualified_path(trap, path, generic_arg_list); - path + let generic_arg_list = emit_generic_arg_list( + trap, + db, + ty_vars, + &trait_ref.substitution.as_slice(Interner)[1..], + ); + + make_qualified_path(trap, path, generic_arg_list) } fn emit_hir_fn_ptr( trap: &mut TrapFile, - db: &dyn HirDatabase, + ty_vars: &[Vec], function: &FnPointer, ) -> trap::Label { + // Currently rust-analyzer does not handle `for<'a'> fn()` correctly: + // ```rust + // TyKind::Function(FnPointer { + // num_binders: 0, // FIXME lower `for<'a> fn()` correctly + // ``` + // https://github.com/rust-lang/rust-analyzer/blob/c5882732e6e6e09ac75cddd13545e95860be1c42/crates/hir-ty/src/lower.rs#L325 + let parameters = vec![]; + assert_eq!(function.num_binders, parameters.len(),); + let ty_vars = &push_ty_vars(ty_vars, parameters); + let parameters: Vec<_> = function.substitution.0.type_parameters(Interner).collect(); let (ret_type, params) = parameters.split_last().unwrap(); - let ret_type = emit_hir_ty(trap, db, ret_type); + let ret_type = emit_hir_ty(trap, db, ty_vars, ret_type); let ret_type = Some(trap.emit(generated::RetTypeRepr { id: trap::TrapId::Star, type_repr: ret_type, @@ -844,7 +958,7 @@ fn emit_hir_fn_ptr( let params = params .iter() .map(|t| { - let type_repr = emit_hir_ty(trap, db, t); + let type_repr = emit_hir_ty(trap, db, ty_vars, t); trap.emit(generated::Param { id: trap::TrapId::Star, attrs: vec![], @@ -964,8 +1078,8 @@ fn make_qualified_path( } fn emit_hir_ty( trap: &mut TrapFile, - db: &dyn HirDatabase, + ty_vars: &[Vec], ty: &Ty, ) -> Option> { match ty.kind(ra_ap_hir_ty::Interner) { @@ -986,7 +1100,7 @@ fn emit_hir_ty( chalk_ir::TyKind::Tuple(_size, substitution) => { let fields = substitution.type_parameters(ra_ap_hir_ty::Interner); let fields = fields - .flat_map(|field| emit_hir_ty(trap, db, &field)) + .flat_map(|field| emit_hir_ty(trap, db, ty_vars, &field)) .collect(); Some( @@ -998,7 +1112,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Raw(mutability, ty) => { - let type_repr = emit_hir_ty(trap, db, ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); Some( trap.emit(generated::PtrTypeRepr { @@ -1010,21 +1124,21 @@ fn emit_hir_ty( .into(), ) } - chalk_ir::TyKind::Ref(mutability, _lifetime, ty) => { - let type_repr = emit_hir_ty(trap, db, ty); - let lifetime = None; //TODO: ? + chalk_ir::TyKind::Ref(mutability, lifetime, ty) => { + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); + let lifetime = emit_lifetime(trap, ty_vars, lifetime); Some( trap.emit(generated::RefTypeRepr { id: trap::TrapId::Star, is_mut: matches!(mutability, chalk_ir::Mutability::Mut), - lifetime, + lifetime: Some(lifetime), type_repr, }) .into(), ) } chalk_ir::TyKind::Array(ty, _konst) => { - let element_type_repr = emit_hir_ty(trap, db, ty); + let element_type_repr = emit_hir_ty(trap, db, ty_vars, ty); // TODO: handle array size constant Some( trap.emit(generated::ArrayTypeRepr { @@ -1036,7 +1150,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Slice(ty) => { - let type_repr = emit_hir_ty(trap, db, ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); Some( trap.emit(generated::SliceTypeRepr { id: trap::TrapId::Star, @@ -1060,7 +1174,8 @@ fn emit_hir_ty( } }; path.push(name); - let generic_arg_list = emit_generic_arg_list(trap, db, substitution.as_slice(Interner)); + let generic_arg_list = + emit_generic_arg_list(trap, db, ty_vars, substitution.as_slice(Interner)); let path = make_qualified_path(trap, path, generic_arg_list); Some( trap.emit(generated::PathTypeRepr { @@ -1091,7 +1206,7 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Function(fn_pointer) => { - Some(emit_hir_fn_ptr(trap, db, fn_pointer).into()) + Some(emit_hir_fn_ptr(trap, db, ty_vars, fn_pointer).into()) } chalk_ir::TyKind::OpaqueType(_, _) | chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(_)) => { @@ -1099,7 +1214,7 @@ fn emit_hir_ty( .impl_trait_bounds(db) .iter() .flatten() - .flat_map(|t| emit_hir_type_bound(db, trap, t)) + .flat_map(|t| emit_hir_type_bound(db, trap, ty_vars, t)) .collect(); let type_bound_list = Some(trap.emit(generated::TypeBoundList { id: trap::TrapId::Star, @@ -1114,11 +1229,15 @@ fn emit_hir_ty( ) } chalk_ir::TyKind::Dyn(dyn_ty) => { + let parameters = vec!["Self".to_owned()]; + assert_eq!(dyn_ty.bounds.binders.len(Interner), parameters.len(),); + let ty_vars = &push_ty_vars(ty_vars, parameters); + let bounds = dyn_ty .bounds .skip_binders() .iter(ra_ap_hir_ty::Interner) - .flat_map(|t| emit_hir_type_bound(db, trap, t)) + .flat_map(|t| emit_hir_type_bound(db, trap, ty_vars, t)) .collect(); let type_bound_list = Some(trap.emit(generated::TypeBoundList { id: trap::TrapId::Star, @@ -1134,7 +1253,7 @@ fn emit_hir_ty( } chalk_ir::TyKind::FnDef(fn_def_id, parameters) => { let sig = ra_ap_hir_ty::CallableSig::from_def(db, *fn_def_id, parameters); - Some(emit_hir_fn_ptr(trap, db, &sig.to_fn_ptr()).into()) + Some(emit_hir_fn_ptr(trap, db, ty_vars, &sig.to_fn_ptr()).into()) } chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(ProjectionTy { @@ -1171,8 +1290,17 @@ fn emit_hir_ty( None } chalk_ir::TyKind::BoundVar(var) => { - let var = format!("T_{}_{}", var.debruijn.depth(), var.index); - let path = make_qualified_path(trap, vec![var], None); + let var_ = ty_vars + .get(ty_vars.len() - 1 - var.debruijn.depth() as usize) + .and_then(|ty_vars| ty_vars.get(var.index)); + let path = make_qualified_path( + trap, + vec![ + var_.unwrap_or(&format!("E_{}_{}", var.debruijn.depth(), var.index)) + .clone(), + ], + None, + ); Some( trap.emit(generated::PathTypeRepr { id: trap::TrapId::Star, @@ -1196,6 +1324,7 @@ fn emit_hir_ty( fn emit_generic_arg_list( trap: &mut TrapFile, db: &dyn HirDatabase, + ty_vars: &[Vec], args: &[GenericArg], ) -> Option> { if args.is_empty() { @@ -1205,7 +1334,7 @@ fn emit_generic_arg_list( .iter() .flat_map(|arg| { if let Some(ty) = arg.ty(Interner) { - let type_repr = emit_hir_ty(trap, db, ty); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty); Some( trap.emit(generated::TypeArg { id: trap::TrapId::Star, @@ -1214,17 +1343,7 @@ fn emit_generic_arg_list( .into(), ) } else if let Some(l) = arg.lifetime(Interner) { - let text = match l.data(Interner) { - chalk_ir::LifetimeData::BoundVar(var) => { - format!("'T_{}_{}", var.debruijn.depth(), var.index).into() - } - chalk_ir::LifetimeData::Static => "'static'".to_owned().into(), - _ => None, - }; - let lifetime = trap.emit(generated::Lifetime { - id: trap::TrapId::Star, - text, - }); + let lifetime = emit_lifetime(trap, ty_vars, l); Some( trap.emit(generated::LifetimeArg { id: trap::TrapId::Star, @@ -1232,7 +1351,7 @@ fn emit_generic_arg_list( }) .into(), ) - } else if let Some(_) = arg.constant(Interner) { + } else if arg.constant(Interner).is_some() { Some( trap.emit(generated::ConstArg { id: trap::TrapId::Star, @@ -1253,6 +1372,36 @@ fn emit_generic_arg_list( .into() } +fn emit_lifetime( + trap: &mut TrapFile, + ty_vars: &[Vec], + l: &chalk_ir::Lifetime, +) -> trap::Label { + let text = match l.data(Interner) { + chalk_ir::LifetimeData::BoundVar(var) => { + let var_ = ty_vars + .get(ty_vars.len() - 1 - var.debruijn.depth() as usize) + .and_then(|ty_vars| ty_vars.get(var.index)); + + Some(var_.map(|v| v.to_string()).unwrap_or(format!( + "'E_{}_{}", + var.debruijn.depth(), + var.index + ))) + } + chalk_ir::LifetimeData::Static => "'static'".to_owned().into(), + chalk_ir::LifetimeData::InferenceVar(_) + | chalk_ir::LifetimeData::Placeholder(_) + | chalk_ir::LifetimeData::Erased + | chalk_ir::LifetimeData::Phantom(_, _) + | chalk_ir::LifetimeData::Error => None, + }; + trap.emit(generated::Lifetime { + id: trap::TrapId::Star, + text, + }) +} + enum Variant { Unit, Record(trap::Label), @@ -1263,7 +1412,7 @@ impl From for Option> { fn from(val: Variant) -> Self { match val { Variant::Record(label) => Some(label), - _ => None, + Variant::Unit | Variant::Tuple(_) => None, } } } @@ -1278,7 +1427,13 @@ impl From for Option> { } } -fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: VariantId) -> Variant { +fn emit_variant_data( + trap: &mut TrapFile, + db: &dyn HirDatabase, + ty_vars: &[Vec], + variant_id: VariantId, +) -> Variant { + let parameters_len = ty_vars.last().map_or(0, Vec::len); let variant = variant_id.variant_data(db.upcast()); match variant.as_ref() { VariantData::Record { @@ -1293,7 +1448,8 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari id: trap::TrapId::Star, text: Some(field_data[field_id].name.as_str().to_owned()), })); - let type_repr = emit_hir_ty(trap, db, ty.skip_binders()); + assert_eq!(ty.binders.len(Interner), parameters_len); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty.skip_binders()); let visibility = emit_visibility( db, trap, @@ -1324,7 +1480,8 @@ fn emit_variant_data(trap: &mut TrapFile, db: &dyn HirDatabase, variant_id: Vari let fields = field_types .iter() .map(|(field_id, ty)| { - let type_repr = emit_hir_ty(trap, db, ty.skip_binders()); + assert_eq!(ty.binders.len(Interner), parameters_len); + let type_repr = emit_hir_ty(trap, db, ty_vars, ty.skip_binders()); let visibility = emit_visibility( db, trap, diff --git a/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll index 08bc22901fe..e15f5733748 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/LifetimeImpl.qll @@ -20,7 +20,7 @@ module Impl { */ class Lifetime extends Generated::Lifetime { override string toStringImpl() { - result = "'" + this.getText() + result = this.getText() or not this.hasText() and result = "'_" } From 2f87630dedd6bea10426eb5703e6d9349e321957 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 8 Apr 2025 09:58:52 +0200 Subject: [PATCH 289/372] Rust: update expected output --- .../generated/BreakExpr/BreakExpr.expected | 4 +- .../BreakExpr/BreakExpr_getExpr.expected | 4 +- .../BreakExpr/BreakExpr_getLifetime.expected | 4 +- .../ContinueExpr_getLifetime.expected | 2 +- .../Label/Label_getLifetime.expected | 2 +- .../SelfParam/SelfParam_getLifetime.expected | 2 +- .../ql/test/extractor-tests/utf8/ast.expected | 2 +- .../controlflow/BasicBlocks.expected | 108 +++++++++--------- .../library-tests/controlflow/Cfg.expected | 50 ++++---- .../dataflow/local/DataFlowStep.expected | 12 +- 10 files changed, 95 insertions(+), 95 deletions(-) diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected index 30c734fd682..26a3ea2d998 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr.expected @@ -1,3 +1,3 @@ | gen_break_expr.rs:7:13:7:17 | break | getNumberOfAttrs: | 0 | hasExpr: | no | hasLifetime: | no | -| gen_break_expr.rs:12:13:12:27 | break ''label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | -| gen_break_expr.rs:17:13:17:27 | break ''label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | +| gen_break_expr.rs:12:13:12:27 | break 'label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | +| gen_break_expr.rs:17:13:17:27 | break 'label 42 | getNumberOfAttrs: | 0 | hasExpr: | yes | hasLifetime: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected index 20c5295354a..276f1d3333b 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getExpr.expected @@ -1,2 +1,2 @@ -| gen_break_expr.rs:12:13:12:27 | break ''label 42 | gen_break_expr.rs:12:26:12:27 | 42 | -| gen_break_expr.rs:17:13:17:27 | break ''label 42 | gen_break_expr.rs:17:26:17:27 | 42 | +| gen_break_expr.rs:12:13:12:27 | break 'label 42 | gen_break_expr.rs:12:26:12:27 | 42 | +| gen_break_expr.rs:17:13:17:27 | break 'label 42 | gen_break_expr.rs:17:26:17:27 | 42 | diff --git a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected index 2e1a8801795..09f1132362f 100644 --- a/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/BreakExpr/BreakExpr_getLifetime.expected @@ -1,2 +1,2 @@ -| gen_break_expr.rs:12:13:12:27 | break ''label 42 | gen_break_expr.rs:12:19:12:24 | ''label | -| gen_break_expr.rs:17:13:17:27 | break ''label 42 | gen_break_expr.rs:17:19:17:24 | ''label | +| gen_break_expr.rs:12:13:12:27 | break 'label 42 | gen_break_expr.rs:12:19:12:24 | 'label | +| gen_break_expr.rs:17:13:17:27 | break 'label 42 | gen_break_expr.rs:17:19:17:24 | 'label | diff --git a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected index d81d276ce0a..3260e45d1b7 100644 --- a/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/ContinueExpr/ContinueExpr_getLifetime.expected @@ -1 +1 @@ -| gen_continue_expr.rs:12:13:12:27 | continue 'label | gen_continue_expr.rs:12:22:12:27 | ''label | +| gen_continue_expr.rs:12:13:12:27 | continue 'label | gen_continue_expr.rs:12:22:12:27 | 'label | diff --git a/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected b/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected index 73ebbe963e8..9bbe9151913 100644 --- a/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/Label/Label_getLifetime.expected @@ -1 +1 @@ -| gen_label.rs:5:5:5:11 | 'label | gen_label.rs:5:5:5:10 | ''label | +| gen_label.rs:5:5:5:11 | 'label | gen_label.rs:5:5:5:10 | 'label | diff --git a/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected b/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected index 47e9eba10ac..cfe91c68c85 100644 --- a/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected +++ b/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.expected @@ -1 +1 @@ -| gen_self_param.rs:10:15:10:22 | SelfParam | gen_self_param.rs:10:16:10:17 | ''a | +| gen_self_param.rs:10:15:10:22 | SelfParam | gen_self_param.rs:10:16:10:17 | 'a | diff --git a/rust/ql/test/extractor-tests/utf8/ast.expected b/rust/ql/test/extractor-tests/utf8/ast.expected index 58f926364c0..a37eed8e264 100644 --- a/rust/ql/test/extractor-tests/utf8/ast.expected +++ b/rust/ql/test/extractor-tests/utf8/ast.expected @@ -5,7 +5,7 @@ | utf8_identifiers.rs:1:1:12:2 | SourceFile | | utf8_identifiers.rs:1:4:1:6 | foo | | utf8_identifiers.rs:1:7:4:1 | <...> | -| utf8_identifiers.rs:2:5:2:6 | ''\u03b2 | +| utf8_identifiers.rs:2:5:2:6 | '\u03b2 | | utf8_identifiers.rs:2:5:2:6 | LifetimeParam | | utf8_identifiers.rs:3:5:3:5 | \u03b3 | | utf8_identifiers.rs:3:5:3:5 | \u03b3 | diff --git a/rust/ql/test/library-tests/controlflow/BasicBlocks.expected b/rust/ql/test/library-tests/controlflow/BasicBlocks.expected index 8de7e7066cd..d5d978b9f52 100644 --- a/rust/ql/test/library-tests/controlflow/BasicBlocks.expected +++ b/rust/ql/test/library-tests/controlflow/BasicBlocks.expected @@ -304,8 +304,8 @@ dominates | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:227:9:236:9 | if ... {...} else {...} | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:228:13:230:13 | if ... {...} | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:228:13:230:14 | ExprStmt | -| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:229:17:229:36 | ExprStmt | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:233:13:233:13 | 1 | | test.rs:226:5:237:5 | enter fn test_if_loop2 | test.rs:235:13:235:13 | 0 | @@ -314,18 +314,18 @@ dominates | test.rs:228:13:230:14 | ExprStmt | test.rs:227:9:236:9 | if ... {...} else {...} | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | | test.rs:228:13:230:14 | ExprStmt | test.rs:233:13:233:13 | 1 | | test.rs:228:13:230:14 | ExprStmt | test.rs:235:13:235:13 | 0 | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:235:13:235:13 | 0 | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:233:13:233:13 | 1 | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:235:13:235:13 | 0 | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:233:13:233:13 | 1 | | test.rs:229:17:229:36 | ExprStmt | test.rs:227:9:236:9 | if ... {...} else {...} | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | | test.rs:229:17:229:36 | ExprStmt | test.rs:233:13:233:13 | 1 | | test.rs:229:17:229:36 | ExprStmt | test.rs:235:13:235:13 | 0 | @@ -333,15 +333,15 @@ dominates | test.rs:235:13:235:13 | 0 | test.rs:235:13:235:13 | 0 | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:239:5:247:5 | enter fn test_labelled_block | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:240:9:246:9 | if ... {...} else {...} | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:243:13:243:13 | 1 | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:245:13:245:13 | 0 | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:240:9:246:9 | if ... {...} else {...} | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:245:13:245:13 | 0 | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:243:13:243:13 | 1 | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:245:13:245:13 | 0 | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:243:13:243:13 | 1 | | test.rs:243:13:243:13 | 1 | test.rs:243:13:243:13 | 1 | | test.rs:245:13:245:13 | 0 | test.rs:245:13:245:13 | 0 | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:252:5:255:5 | enter fn test_and_operator | @@ -1031,8 +1031,8 @@ postDominance | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:227:9:236:9 | if ... {...} else {...} | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:228:13:230:13 | if ... {...} | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:228:13:230:14 | ExprStmt | -| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:36 | ExprStmt | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:233:13:233:13 | 1 | | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:235:13:235:13 | 0 | @@ -1040,28 +1040,28 @@ postDominance | test.rs:228:13:230:14 | ExprStmt | test.rs:226:5:237:5 | enter fn test_if_loop2 | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:229:17:229:36 | ExprStmt | test.rs:226:5:237:5 | enter fn test_if_loop2 | | test.rs:229:17:229:36 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | | test.rs:229:17:229:36 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | | test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | -| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | +| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | | test.rs:233:13:233:13 | 1 | test.rs:233:13:233:13 | 1 | -| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | +| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | | test.rs:235:13:235:13 | 0 | test.rs:235:13:235:13 | 0 | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:239:5:247:5 | enter fn test_labelled_block | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:239:5:247:5 | enter fn test_labelled_block | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:240:9:246:9 | if ... {...} else {...} | -| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | +| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:243:13:243:13 | 1 | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:245:13:245:13 | 0 | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | -| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | +| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | | test.rs:243:13:243:13 | 1 | test.rs:243:13:243:13 | 1 | -| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | +| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | | test.rs:245:13:245:13 | 0 | test.rs:245:13:245:13 | 0 | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:252:5:255:5 | enter fn test_and_operator | | test.rs:253:17:253:22 | [boolean(false)] ... && ... | test.rs:253:17:253:22 | [boolean(false)] ... && ... | @@ -1543,16 +1543,16 @@ immediateDominator | test.rs:227:9:236:9 | if ... {...} else {...} | test.rs:229:17:229:36 | ExprStmt | | test.rs:228:13:230:13 | if ... {...} | test.rs:228:13:230:14 | ExprStmt | | test.rs:228:13:230:14 | ExprStmt | test.rs:226:5:237:5 | enter fn test_if_loop2 | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:229:17:229:36 | ExprStmt | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:229:17:229:36 | ExprStmt | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:229:17:229:36 | ExprStmt | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:229:17:229:36 | ExprStmt | | test.rs:229:17:229:36 | ExprStmt | test.rs:228:13:230:14 | ExprStmt | -| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | -| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | +| test.rs:233:13:233:13 | 1 | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | +| test.rs:235:13:235:13 | 0 | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:239:5:247:5 | enter fn test_labelled_block | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | -| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | -| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:239:5:247:5 | enter fn test_labelled_block | +| test.rs:243:13:243:13 | 1 | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | +| test.rs:245:13:245:13 | 0 | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | | test.rs:253:17:253:22 | [boolean(false)] ... && ... | test.rs:252:5:255:5 | enter fn test_and_operator | | test.rs:253:17:253:22 | [boolean(true)] ... && ... | test.rs:253:22:253:22 | b | | test.rs:253:17:253:27 | ... && ... | test.rs:252:5:255:5 | enter fn test_and_operator | @@ -1798,23 +1798,23 @@ controls | test.rs:216:17:216:29 | ExprStmt | test.rs:222:13:222:13 | 0 | false | | test.rs:228:13:230:14 | ExprStmt | test.rs:227:9:236:9 | if ... {...} else {...} | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | false | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | true | -| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | true | +| test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:233:13:233:13 | 1 | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:235:13:235:13 | 0 | true | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:235:13:235:13 | 0 | false | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:233:13:233:13 | 1 | true | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | false | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:235:13:235:13 | 0 | false | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:233:13:233:13 | 1 | true | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | false | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | | test.rs:229:17:229:36 | ExprStmt | test.rs:233:13:233:13 | 1 | true | | test.rs:229:17:229:36 | ExprStmt | test.rs:235:13:235:13 | 0 | false | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | false | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | true | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | false | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | true | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:243:13:243:13 | 1 | true | | test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:245:13:245:13 | 0 | false | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:245:13:245:13 | 0 | false | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:243:13:243:13 | 1 | true | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:245:13:245:13 | 0 | false | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:243:13:243:13 | 1 | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:17:253:22 | [boolean(true)] ... && ... | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:22:253:22 | b | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:27:253:27 | c | true | @@ -1974,14 +1974,14 @@ successor | test.rs:216:17:216:29 | ExprStmt | test.rs:216:17:216:28 | [boolean(true)] break ... | true | | test.rs:228:13:230:14 | ExprStmt | test.rs:228:13:230:13 | if ... {...} | false | | test.rs:228:13:230:14 | ExprStmt | test.rs:229:17:229:36 | ExprStmt | true | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:235:13:235:13 | 0 | false | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:233:13:233:13 | 1 | true | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | false | -| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | false | -| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | true | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:245:13:245:13 | 0 | false | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:243:13:243:13 | 1 | true | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:235:13:235:13 | 0 | false | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:233:13:233:13 | 1 | true | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | false | +| test.rs:229:17:229:36 | ExprStmt | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | false | +| test.rs:239:5:247:5 | enter fn test_labelled_block | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | true | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:245:13:245:13 | 0 | false | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:243:13:243:13 | 1 | true | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:17:253:22 | [boolean(false)] ... && ... | false | | test.rs:252:5:255:5 | enter fn test_and_operator | test.rs:253:22:253:22 | b | true | | test.rs:253:17:253:22 | [boolean(false)] ... && ... | test.rs:253:17:253:27 | ... && ... | false | diff --git a/rust/ql/test/library-tests/controlflow/Cfg.expected b/rust/ql/test/library-tests/controlflow/Cfg.expected index 40348a474e5..1705b88e3d7 100644 --- a/rust/ql/test/library-tests/controlflow/Cfg.expected +++ b/rust/ql/test/library-tests/controlflow/Cfg.expected @@ -119,10 +119,10 @@ edges | test.rs:49:24:51:17 | if b {...} | test.rs:47:17:51:17 | if b {...} else {...} | | | test.rs:49:27:49:27 | b | test.rs:49:24:51:17 | if b {...} | false | | test.rs:49:27:49:27 | b | test.rs:50:21:50:33 | ExprStmt | true | -| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | 'outer: loop { ... } | break | -| test.rs:50:21:50:33 | ExprStmt | test.rs:50:21:50:32 | break ''outer | | -| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | 'inner: loop { ... } | break | -| test.rs:52:17:52:29 | ExprStmt | test.rs:52:17:52:28 | break ''inner | | +| test.rs:50:21:50:32 | break 'outer | test.rs:45:9:54:9 | 'outer: loop { ... } | break | +| test.rs:50:21:50:33 | ExprStmt | test.rs:50:21:50:32 | break 'outer | | +| test.rs:52:17:52:28 | break 'inner | test.rs:46:13:53:13 | 'inner: loop { ... } | break | +| test.rs:52:17:52:29 | ExprStmt | test.rs:52:17:52:28 | break 'inner | | | test.rs:55:9:55:12 | true | test.rs:44:48:56:5 | { ... } | | | test.rs:58:5:70:5 | enter fn test_continue_with_labels | test.rs:58:34:58:34 | b | | | test.rs:58:34:58:34 | b | test.rs:58:34:58:34 | b | | @@ -534,12 +534,12 @@ edges | test.rs:228:16:228:20 | ... > ... | test.rs:228:13:230:13 | if ... {...} | false | | test.rs:228:16:228:20 | ... > ... | test.rs:229:17:229:36 | ExprStmt | true | | test.rs:228:20:228:20 | 0 | test.rs:228:16:228:20 | ... > ... | | -| test.rs:229:17:229:35 | [boolean(false)] break ''label ... | test.rs:227:13:232:9 | [boolean(false)] 'label: loop { ... } | break | -| test.rs:229:17:229:35 | [boolean(true)] break ''label ... | test.rs:227:13:232:9 | [boolean(true)] 'label: loop { ... } | break | +| test.rs:229:17:229:35 | [boolean(false)] break 'label ... | test.rs:227:13:232:9 | [boolean(false)] 'label: loop { ... } | break | +| test.rs:229:17:229:35 | [boolean(true)] break 'label ... | test.rs:227:13:232:9 | [boolean(true)] 'label: loop { ... } | break | | test.rs:229:17:229:36 | ExprStmt | test.rs:229:30:229:30 | a | | | test.rs:229:30:229:30 | a | test.rs:229:34:229:35 | 10 | | -| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(false)] break ''label ... | false | -| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(true)] break ''label ... | true | +| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(false)] break 'label ... | false | +| test.rs:229:30:229:35 | ... > ... | test.rs:229:17:229:35 | [boolean(true)] break 'label ... | true | | test.rs:229:34:229:35 | 10 | test.rs:229:30:229:35 | ... > ... | | | test.rs:231:13:231:13 | a | test.rs:231:17:231:18 | 10 | | | test.rs:231:13:231:18 | ... < ... | test.rs:227:26:232:9 | { ... } | | @@ -558,12 +558,12 @@ edges | test.rs:240:9:246:9 | if ... {...} else {...} | test.rs:239:43:247:5 | { ... } | | | test.rs:240:13:242:9 | [boolean(false)] 'block: { ... } | test.rs:245:13:245:13 | 0 | false | | test.rs:240:13:242:9 | [boolean(true)] 'block: { ... } | test.rs:243:13:243:13 | 1 | true | -| test.rs:241:13:241:30 | [boolean(false)] break ''block ... | test.rs:240:13:242:9 | [boolean(false)] 'block: { ... } | break | -| test.rs:241:13:241:30 | [boolean(true)] break ''block ... | test.rs:240:13:242:9 | [boolean(true)] 'block: { ... } | break | +| test.rs:241:13:241:30 | [boolean(false)] break 'block ... | test.rs:240:13:242:9 | [boolean(false)] 'block: { ... } | break | +| test.rs:241:13:241:30 | [boolean(true)] break 'block ... | test.rs:240:13:242:9 | [boolean(true)] 'block: { ... } | break | | test.rs:241:13:241:31 | ExprStmt | test.rs:241:26:241:26 | a | | | test.rs:241:26:241:26 | a | test.rs:241:30:241:30 | 0 | | -| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(false)] break ''block ... | false | -| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(true)] break ''block ... | true | +| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(false)] break 'block ... | false | +| test.rs:241:26:241:30 | ... > ... | test.rs:241:13:241:30 | [boolean(true)] break 'block ... | true | | test.rs:241:30:241:30 | 0 | test.rs:241:26:241:30 | ... > ... | | | test.rs:242:12:244:9 | { ... } | test.rs:240:9:246:9 | if ... {...} else {...} | | | test.rs:243:13:243:13 | 1 | test.rs:242:12:244:9 | { ... } | | @@ -1364,9 +1364,9 @@ edges | test.rs:571:12:571:28 | condition_not_met | test.rs:571:12:571:30 | condition_not_met(...) | | | test.rs:571:12:571:30 | condition_not_met(...) | test.rs:571:9:573:9 | if ... {...} | false | | test.rs:571:12:571:30 | condition_not_met(...) | test.rs:572:13:572:27 | ExprStmt | true | -| test.rs:572:13:572:26 | break ''block 1 | test.rs:569:18:580:5 | 'block: { ... } | break | +| test.rs:572:13:572:26 | break 'block 1 | test.rs:569:18:580:5 | 'block: { ... } | break | | test.rs:572:13:572:27 | ExprStmt | test.rs:572:26:572:26 | 1 | | -| test.rs:572:26:572:26 | 1 | test.rs:572:13:572:26 | break ''block 1 | | +| test.rs:572:26:572:26 | 1 | test.rs:572:13:572:26 | break 'block 1 | | | test.rs:574:9:574:21 | do_next_thing | test.rs:574:9:574:23 | do_next_thing(...) | | | test.rs:574:9:574:23 | do_next_thing(...) | test.rs:575:9:577:9 | ExprStmt | | | test.rs:574:9:574:24 | ExprStmt | test.rs:574:9:574:21 | do_next_thing | | @@ -1375,9 +1375,9 @@ edges | test.rs:575:12:575:28 | condition_not_met | test.rs:575:12:575:30 | condition_not_met(...) | | | test.rs:575:12:575:30 | condition_not_met(...) | test.rs:575:9:577:9 | if ... {...} | false | | test.rs:575:12:575:30 | condition_not_met(...) | test.rs:576:13:576:27 | ExprStmt | true | -| test.rs:576:13:576:26 | break ''block 2 | test.rs:569:18:580:5 | 'block: { ... } | break | +| test.rs:576:13:576:26 | break 'block 2 | test.rs:569:18:580:5 | 'block: { ... } | break | | test.rs:576:13:576:27 | ExprStmt | test.rs:576:26:576:26 | 2 | | -| test.rs:576:26:576:26 | 2 | test.rs:576:13:576:26 | break ''block 2 | | +| test.rs:576:26:576:26 | 2 | test.rs:576:13:576:26 | break 'block 2 | | | test.rs:578:9:578:21 | do_last_thing | test.rs:578:9:578:23 | do_last_thing(...) | | | test.rs:578:9:578:23 | do_last_thing(...) | test.rs:579:9:579:9 | 3 | | | test.rs:578:9:578:24 | ExprStmt | test.rs:578:9:578:21 | do_last_thing | | @@ -1400,9 +1400,9 @@ edges | test.rs:587:18:587:18 | y | test.rs:587:18:587:18 | y | | | test.rs:587:18:587:18 | y | test.rs:590:9:590:9 | 0 | match | | test.rs:587:23:587:23 | x | test.rs:587:13:587:19 | Some(...) | | -| test.rs:588:13:588:26 | break ''block 1 | test.rs:585:18:591:5 | 'block: { ... } | break | +| test.rs:588:13:588:26 | break 'block 1 | test.rs:585:18:591:5 | 'block: { ... } | break | | test.rs:588:13:588:27 | ExprStmt | test.rs:588:26:588:26 | 1 | | -| test.rs:588:26:588:26 | 1 | test.rs:588:13:588:26 | break ''block 1 | | +| test.rs:588:26:588:26 | 1 | test.rs:588:13:588:26 | break 'block 1 | | | test.rs:590:9:590:9 | 0 | test.rs:585:18:591:5 | 'block: { ... } | | | test.rs:594:1:600:1 | enter fn test_nested_function2 | test.rs:595:5:595:18 | let ... = 0 | | | test.rs:594:1:600:1 | exit fn test_nested_function2 (normal) | test.rs:594:1:600:1 | exit fn test_nested_function2 | | @@ -1468,18 +1468,18 @@ edges breakTarget | test.rs:34:17:34:21 | break | test.rs:28:9:40:9 | loop { ... } | | test.rs:48:21:48:25 | break | test.rs:46:13:53:13 | 'inner: loop { ... } | -| test.rs:50:21:50:32 | break ''outer | test.rs:45:9:54:9 | 'outer: loop { ... } | -| test.rs:52:17:52:28 | break ''inner | test.rs:46:13:53:13 | 'inner: loop { ... } | +| test.rs:50:21:50:32 | break 'outer | test.rs:45:9:54:9 | 'outer: loop { ... } | +| test.rs:52:17:52:28 | break 'inner | test.rs:46:13:53:13 | 'inner: loop { ... } | | test.rs:91:17:91:21 | break | test.rs:88:9:94:9 | while b { ... } | | test.rs:101:17:101:21 | break | test.rs:99:9:103:9 | while ... { ... } | | test.rs:109:17:109:21 | break | test.rs:107:9:112:9 | for ... in ... { ... } | | test.rs:117:13:117:26 | break ... | test.rs:116:9:118:9 | loop { ... } | | test.rs:216:17:216:28 | break ... | test.rs:214:13:219:9 | loop { ... } | -| test.rs:229:17:229:35 | break ''label ... | test.rs:227:13:232:9 | 'label: loop { ... } | -| test.rs:241:13:241:30 | break ''block ... | test.rs:240:13:242:9 | 'block: { ... } | -| test.rs:572:13:572:26 | break ''block 1 | test.rs:569:18:580:5 | 'block: { ... } | -| test.rs:576:13:576:26 | break ''block 2 | test.rs:569:18:580:5 | 'block: { ... } | -| test.rs:588:13:588:26 | break ''block 1 | test.rs:585:18:591:5 | 'block: { ... } | +| test.rs:229:17:229:35 | break 'label ... | test.rs:227:13:232:9 | 'label: loop { ... } | +| test.rs:241:13:241:30 | break 'block ... | test.rs:240:13:242:9 | 'block: { ... } | +| test.rs:572:13:572:26 | break 'block 1 | test.rs:569:18:580:5 | 'block: { ... } | +| test.rs:576:13:576:26 | break 'block 2 | test.rs:569:18:580:5 | 'block: { ... } | +| test.rs:588:13:588:26 | break 'block 1 | test.rs:585:18:591:5 | 'block: { ... } | continueTarget | test.rs:37:17:37:24 | continue | test.rs:28:9:40:9 | loop { ... } | | test.rs:63:21:63:28 | continue | test.rs:61:13:68:13 | 'inner: loop { ... } | diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected index c147ec62e2e..79b0ebc62f0 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected @@ -90,8 +90,8 @@ localStep | main.rs:66:9:66:9 | a | main.rs:66:9:66:9 | [SSA] a | | main.rs:66:9:66:9 | a | main.rs:66:9:66:9 | a | | main.rs:66:13:71:5 | 'block: { ... } | main.rs:66:9:66:9 | a | -| main.rs:68:13:68:26 | break ''block 1 | main.rs:66:13:71:5 | 'block: { ... } | -| main.rs:68:26:68:26 | 1 | main.rs:68:13:68:26 | break ''block 1 | +| main.rs:68:13:68:26 | break 'block 1 | main.rs:66:13:71:5 | 'block: { ... } | +| main.rs:68:26:68:26 | 1 | main.rs:68:13:68:26 | break 'block 1 | | main.rs:70:9:70:9 | 2 | main.rs:66:13:71:5 | 'block: { ... } | | main.rs:72:5:72:5 | a | main.rs:65:38:73:1 | { ... } | | main.rs:75:22:75:22 | [SSA] b | main.rs:77:12:77:12 | b | @@ -102,10 +102,10 @@ localStep | main.rs:76:9:76:9 | a | main.rs:76:9:76:9 | [SSA] a | | main.rs:76:9:76:9 | a | main.rs:76:9:76:9 | a | | main.rs:76:13:81:5 | 'block: { ... } | main.rs:76:9:76:9 | a | -| main.rs:78:13:78:26 | break ''block 1 | main.rs:76:13:81:5 | 'block: { ... } | -| main.rs:78:26:78:26 | 1 | main.rs:78:13:78:26 | break ''block 1 | -| main.rs:80:9:80:22 | break ''block 2 | main.rs:76:13:81:5 | 'block: { ... } | -| main.rs:80:22:80:22 | 2 | main.rs:80:9:80:22 | break ''block 2 | +| main.rs:78:13:78:26 | break 'block 1 | main.rs:76:13:81:5 | 'block: { ... } | +| main.rs:78:26:78:26 | 1 | main.rs:78:13:78:26 | break 'block 1 | +| main.rs:80:9:80:22 | break 'block 2 | main.rs:76:13:81:5 | 'block: { ... } | +| main.rs:80:22:80:22 | 2 | main.rs:80:9:80:22 | break 'block 2 | | main.rs:82:5:82:5 | a | main.rs:75:38:83:1 | { ... } | | main.rs:89:9:89:9 | [SSA] i | main.rs:90:11:90:11 | i | | main.rs:89:9:89:9 | i | main.rs:89:9:89:9 | [SSA] i | From 7bfd5f161ed3c0281063ebd1dc2b8811467f0d8a Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 8 Apr 2025 19:42:15 +0200 Subject: [PATCH 290/372] Rust: crate graph: extract associated types --- rust/extractor/src/crate_graph.rs | 194 ++++++++++++++++++++++-------- 1 file changed, 142 insertions(+), 52 deletions(-) diff --git a/rust/extractor/src/crate_graph.rs b/rust/extractor/src/crate_graph.rs index 64dced1b19e..0203e8adc47 100644 --- a/rust/extractor/src/crate_graph.rs +++ b/rust/extractor/src/crate_graph.rs @@ -25,6 +25,7 @@ use ra_ap_hir_def::{ use ra_ap_hir_def::{HasModule, visibility::VisibilityExplicitness}; use ra_ap_hir_def::{ModuleId, resolver::HasResolver}; use ra_ap_hir_ty::GenericArg; +use ra_ap_hir_ty::ProjectionTyExt; use ra_ap_hir_ty::TraitRefExt; use ra_ap_hir_ty::Ty; use ra_ap_hir_ty::TyExt; @@ -279,7 +280,7 @@ fn emit_module_items( module: &ModuleData, trap: &mut TrapFile, ) -> Vec> { - let mut items = Vec::new(); + let mut items: Vec> = Vec::new(); let mut uses = HashMap::new(); let item_scope = &module.scope; for (name, item) in item_scope.entries() { @@ -303,7 +304,10 @@ fn emit_module_items( items.push(emit_function(db, trap, None, function, name).into()); } ModuleDefId::ConstId(konst) => { - items.extend(emit_const(db, name.as_str(), trap, None, konst, vis)); + items.extend( + emit_const(db, trap, None, name.as_str(), konst, vis) + .map(Into::>::into), + ); } ModuleDefId::StaticId(statik) => { items.extend(emit_static(db, name.as_str(), trap, statik, vis)); @@ -344,8 +348,12 @@ fn emit_module_items( ModuleDefId::TraitId(trait_id) => { items.extend(emit_trait(db, name.as_str(), trap, trait_id, vis)); } - ModuleDefId::TraitAliasId(_) | ModuleDefId::TypeAliasId(_) => (), // TODO - ModuleDefId::BuiltinType(_) => (), // TODO? + ModuleDefId::TypeAliasId(type_alias_id_) => items.extend( + emit_type_alias(db, trap, None, name.as_str(), type_alias_id_, vis) + .map(Into::>::into), + ), + ModuleDefId::TraitAliasId(_) => (), + ModuleDefId::BuiltinType(_) => (), // modules are handled separatedly ModuleDefId::ModuleId(_) => (), // Enum variants cannot be declarted, only imported @@ -464,12 +472,12 @@ fn collect_generic_parameters( fn emit_const( db: &dyn HirDatabase, - name: &str, trap: &mut TrapFile, container: Option, + name: &str, konst: ra_ap_hir_def::ConstId, visibility: Visibility, -) -> Option> { +) -> Option> { let type_ = db.value_ty(konst.into()); let parameters = collect_generic_parameters(db, konst.into(), container); assert_eq!( @@ -486,19 +494,16 @@ fn emit_const( })); let konst = db.const_data(konst); let visibility = emit_visibility(db, trap, visibility); - Some( - trap.emit(generated::Const { - id: trap::TrapId::Star, - name, - attrs: vec![], - body: None, - is_const: true, - is_default: konst.has_body(), - type_repr, - visibility, - }) - .into(), - ) + Some(trap.emit(generated::Const { + id: trap::TrapId::Star, + name, + attrs: vec![], + body: None, + is_const: true, + is_default: konst.has_body(), + type_repr, + visibility, + })) } fn emit_static( @@ -540,6 +545,39 @@ fn emit_static( ) } +fn emit_type_alias( + db: &dyn HirDatabase, + trap: &mut TrapFile, + container: Option, + name: &str, + alias_id: ra_ap_hir_def::TypeAliasId, + visibility: Visibility, +) -> Option> { + let (type_, _) = db.type_for_type_alias_with_diagnostics(alias_id); + let parameters = collect_generic_parameters(db, alias_id.into(), container); + assert_eq!(type_.binders.len(Interner), parameters.len()); + let ty_vars = &[parameters]; + let type_repr = emit_hir_ty(trap, db, ty_vars, type_.skip_binders()); + let name = Some(trap.emit(generated::Name { + id: trap::TrapId::Star, + text: Some(name.to_owned()), + })); + let visibility = emit_visibility(db, trap, visibility); + let alias = db.type_alias_data(alias_id); + let generic_param_list = emit_generic_param_list(trap, db, ty_vars, alias_id.into()); + Some(trap.emit(generated::TypeAlias { + id: trap::TrapId::Star, + name, + attrs: vec![], + is_default: container.is_some() && alias.type_ref.is_some(), + type_repr, + visibility, + generic_param_list, + type_bound_list: None, + where_clause: None, + })) +} + fn emit_generic_param_list( trap: &mut TrapFile, db: &dyn HirDatabase, @@ -747,12 +785,29 @@ fn emit_trait( let assoc_items: Vec> = trait_items .items .iter() - .flat_map(|(name, item)| { - if let AssocItemId::FunctionId(function) = item { - Some(emit_function(db, trap, Some(trait_id.into()), *function, name).into()) - } else { - None + .flat_map(|(name, item)| match item { + AssocItemId::FunctionId(function_id) => { + Some(emit_function(db, trap, Some(trait_id.into()), *function_id, name).into()) } + + AssocItemId::ConstId(const_id) => emit_const( + db, + trap, + Some(trait_id.into()), + name.as_str(), + *const_id, + visibility, + ) + .map(Into::into), + AssocItemId::TypeAliasId(type_alias_id) => emit_type_alias( + db, + trap, + Some(trait_id.into()), + name.as_str(), + *type_alias_id, + visibility, + ) + .map(Into::into), }) .collect(); let assoc_item_list = Some(trap.emit(generated::AssocItemList { @@ -1258,36 +1313,71 @@ fn emit_hir_ty( chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(ProjectionTy { associated_ty_id, - substitution: _, + substitution, })) - | chalk_ir::TyKind::AssociatedType(associated_ty_id, _) => { - let assoc_ty_data = db.associated_ty_data(from_assoc_type_id(*associated_ty_id)); - - let _name = db - .type_alias_data(assoc_ty_data.name) - .name - .as_str() - .to_owned(); - - let trait_ref = ra_ap_hir_ty::TraitRef { - trait_id: assoc_ty_data.trait_id, - substitution: assoc_ty_data.binders.identity_substitution(Interner), + | chalk_ir::TyKind::AssociatedType(associated_ty_id, substitution) => { + let pt = ProjectionTy { + associated_ty_id: *associated_ty_id, + substitution: substitution.clone(), }; - let mut trait_path = make_path(db, trait_ref.hir_trait_id()); - trait_path.push( - db.trait_data(trait_ref.hir_trait_id()) - .name - .as_str() - .to_owned(), - ); - //TODO - // trap.emit(generated::AssociatedType { - // id: trap::TrapId::Star, - // trait_path, - // name, - // }) - // .into() - None + + // >::Name<...> + + let qualifier = trap.emit(generated::PathSegment { + id: trap::TrapId::Star, + generic_arg_list: None, + identifier: None, + parenthesized_arg_list: None, + ret_type: None, + return_type_syntax: None, + }); + let self_ty = pt.self_type_parameter(db); + let self_ty = emit_hir_ty(trap, db, ty_vars, &self_ty); + if let Some(self_ty) = self_ty { + generated::PathSegment::emit_type_repr(qualifier, self_ty, &mut trap.writer) + } + let trait_ref = pt.trait_ref(db); + let trait_ref = trait_path(db, trap, ty_vars, &trait_ref); + let trait_ref = trait_ref.map(|path| { + trap.emit(generated::PathTypeRepr { + id: trap::TrapId::Star, + path: Some(path), + }) + }); + if let Some(trait_ref) = trait_ref { + generated::PathSegment::emit_trait_type_repr(qualifier, trait_ref, &mut trap.writer) + } + let data = db.type_alias_data(from_assoc_type_id(*associated_ty_id)); + + let identifier = Some(trap.emit(generated::NameRef { + id: trap::TrapId::Star, + text: Some(data.name.as_str().to_owned()), + })); + let segment = trap.emit(generated::PathSegment { + id: trap::TrapId::Star, + generic_arg_list: None, + identifier, + parenthesized_arg_list: None, + ret_type: None, + return_type_syntax: None, + }); + let qualifier = trap.emit(generated::Path { + id: trap::TrapId::Star, + qualifier: None, + segment: Some(qualifier), + }); + let path = trap.emit(generated::Path { + id: trap::TrapId::Star, + qualifier: Some(qualifier), + segment: Some(segment), + }); + Some( + trap.emit(generated::PathTypeRepr { + id: trap::TrapId::Star, + path: Some(path), + }) + .into(), + ) } chalk_ir::TyKind::BoundVar(var) => { let var_ = ty_vars From d78736b1bf238085efc8ba255283e3a6ff6428ad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Apr 2025 16:33:15 +0000 Subject: [PATCH 291/372] Post-release preparation for codeql-cli-2.21.1 --- actions/ql/lib/qlpack.yml | 2 +- actions/ql/src/qlpack.yml | 2 +- cpp/ql/lib/qlpack.yml | 2 +- cpp/ql/src/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/lib/qlpack.yml | 2 +- csharp/ql/campaigns/Solorigate/src/qlpack.yml | 2 +- csharp/ql/lib/qlpack.yml | 2 +- csharp/ql/src/qlpack.yml | 2 +- go/ql/consistency-queries/qlpack.yml | 2 +- go/ql/lib/qlpack.yml | 2 +- go/ql/src/qlpack.yml | 2 +- java/ql/lib/qlpack.yml | 2 +- java/ql/src/qlpack.yml | 2 +- javascript/ql/lib/qlpack.yml | 2 +- javascript/ql/src/qlpack.yml | 2 +- misc/suite-helpers/qlpack.yml | 2 +- python/ql/lib/qlpack.yml | 2 +- python/ql/src/qlpack.yml | 2 +- ruby/ql/lib/qlpack.yml | 2 +- ruby/ql/src/qlpack.yml | 2 +- rust/ql/lib/qlpack.yml | 2 +- rust/ql/src/qlpack.yml | 2 +- shared/controlflow/qlpack.yml | 2 +- shared/dataflow/qlpack.yml | 2 +- shared/mad/qlpack.yml | 2 +- shared/rangeanalysis/qlpack.yml | 2 +- shared/regex/qlpack.yml | 2 +- shared/ssa/qlpack.yml | 2 +- shared/threat-models/qlpack.yml | 2 +- shared/tutorial/qlpack.yml | 2 +- shared/typeflow/qlpack.yml | 2 +- shared/typeinference/qlpack.yml | 2 +- shared/typetracking/qlpack.yml | 2 +- shared/typos/qlpack.yml | 2 +- shared/util/qlpack.yml | 2 +- shared/xml/qlpack.yml | 2 +- shared/yaml/qlpack.yml | 2 +- swift/ql/lib/qlpack.yml | 2 +- swift/ql/src/qlpack.yml | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/actions/ql/lib/qlpack.yml b/actions/ql/lib/qlpack.yml index 361f8bf995d..31e85dd618a 100644 --- a/actions/ql/lib/qlpack.yml +++ b/actions/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-all -version: 0.4.7 +version: 0.4.8-dev library: true warnOnImplicitThis: true dependencies: diff --git a/actions/ql/src/qlpack.yml b/actions/ql/src/qlpack.yml index 6e59f29dd11..e8af2efb337 100644 --- a/actions/ql/src/qlpack.yml +++ b/actions/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/actions-queries -version: 0.5.4 +version: 0.5.5-dev library: false warnOnImplicitThis: true groups: [actions, queries] diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index 6ce41fd3e93..faa1d6c3d6a 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 4.2.0 +version: 4.2.1-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index b6f5c9ad642..c62bc64277e 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 1.3.8 +version: 1.3.9-dev groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index fbd64509040..403da429281 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.7.38 +version: 1.7.39-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 179247e4ef5..888f784b86d 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.7.38 +version: 1.7.39-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index 9d39196e6f6..db0a477a5cd 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 5.1.4 +version: 5.1.5-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index f87c44597d3..ac3522ef68c 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 1.1.1 +version: 1.1.2-dev groups: - csharp - queries diff --git a/go/ql/consistency-queries/qlpack.yml b/go/ql/consistency-queries/qlpack.yml index 8cba3ce7a4f..6555842cf3b 100644 --- a/go/ql/consistency-queries/qlpack.yml +++ b/go/ql/consistency-queries/qlpack.yml @@ -1,5 +1,5 @@ name: codeql-go-consistency-queries -version: 1.0.21 +version: 1.0.22-dev groups: - go - queries diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index 4306f3f8b43..3aabb5860bc 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 4.2.3 +version: 4.2.4-dev groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index 0804625f085..34af2e38018 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 1.1.12 +version: 1.1.13-dev groups: - go - queries diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index d1e431b431d..342dcb64626 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 7.1.3 +version: 7.1.4-dev groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index 1a1ed7fac40..38c7ecf94c5 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 1.4.1 +version: 1.4.2-dev groups: - java - queries diff --git a/javascript/ql/lib/qlpack.yml b/javascript/ql/lib/qlpack.yml index 5b5e10e0c0d..3955e8909e5 100644 --- a/javascript/ql/lib/qlpack.yml +++ b/javascript/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-all -version: 2.6.1 +version: 2.6.2-dev groups: javascript dbscheme: semmlecode.javascript.dbscheme extractor: javascript diff --git a/javascript/ql/src/qlpack.yml b/javascript/ql/src/qlpack.yml index 1239092b279..471704d5955 100644 --- a/javascript/ql/src/qlpack.yml +++ b/javascript/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/javascript-queries -version: 1.5.3 +version: 1.5.4-dev groups: - javascript - queries diff --git a/misc/suite-helpers/qlpack.yml b/misc/suite-helpers/qlpack.yml index fa098c1e805..9dd4a6e2d6e 100644 --- a/misc/suite-helpers/qlpack.yml +++ b/misc/suite-helpers/qlpack.yml @@ -1,4 +1,4 @@ name: codeql/suite-helpers -version: 1.0.21 +version: 1.0.22-dev groups: shared warnOnImplicitThis: true diff --git a/python/ql/lib/qlpack.yml b/python/ql/lib/qlpack.yml index a269f6ea946..3517e1daa3d 100644 --- a/python/ql/lib/qlpack.yml +++ b/python/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-all -version: 4.0.5 +version: 4.0.6-dev groups: python dbscheme: semmlecode.python.dbscheme extractor: python diff --git a/python/ql/src/qlpack.yml b/python/ql/src/qlpack.yml index 88b09575d0c..c9bbffd46b3 100644 --- a/python/ql/src/qlpack.yml +++ b/python/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/python-queries -version: 1.4.7 +version: 1.4.8-dev groups: - python - queries diff --git a/ruby/ql/lib/qlpack.yml b/ruby/ql/lib/qlpack.yml index 4bc89e7863a..fcc413c263f 100644 --- a/ruby/ql/lib/qlpack.yml +++ b/ruby/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-all -version: 4.1.4 +version: 4.1.5-dev groups: ruby extractor: ruby dbscheme: ruby.dbscheme diff --git a/ruby/ql/src/qlpack.yml b/ruby/ql/src/qlpack.yml index 6003cc96ddf..d12d9343d8a 100644 --- a/ruby/ql/src/qlpack.yml +++ b/ruby/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ruby-queries -version: 1.2.0 +version: 1.2.1-dev groups: - ruby - queries diff --git a/rust/ql/lib/qlpack.yml b/rust/ql/lib/qlpack.yml index 5a7ba107f7a..817d23c54c2 100644 --- a/rust/ql/lib/qlpack.yml +++ b/rust/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-all -version: 0.1.6 +version: 0.1.7-dev groups: rust extractor: rust dbscheme: rust.dbscheme diff --git a/rust/ql/src/qlpack.yml b/rust/ql/src/qlpack.yml index f7afd1d4c99..d5fd49b0c38 100644 --- a/rust/ql/src/qlpack.yml +++ b/rust/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rust-queries -version: 0.1.6 +version: 0.1.7-dev groups: - rust - queries diff --git a/shared/controlflow/qlpack.yml b/shared/controlflow/qlpack.yml index 91c33675bab..34183f2048b 100644 --- a/shared/controlflow/qlpack.yml +++ b/shared/controlflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/controlflow -version: 2.0.5 +version: 2.0.6-dev groups: shared library: true dependencies: diff --git a/shared/dataflow/qlpack.yml b/shared/dataflow/qlpack.yml index 82b137f996d..06d87a5c3cc 100644 --- a/shared/dataflow/qlpack.yml +++ b/shared/dataflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/dataflow -version: 2.0.5 +version: 2.0.6-dev groups: shared library: true dependencies: diff --git a/shared/mad/qlpack.yml b/shared/mad/qlpack.yml index bd73c23bb12..77eeff61cb8 100644 --- a/shared/mad/qlpack.yml +++ b/shared/mad/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/mad -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/rangeanalysis/qlpack.yml b/shared/rangeanalysis/qlpack.yml index 76a9eeb5196..4e2065f70d2 100644 --- a/shared/rangeanalysis/qlpack.yml +++ b/shared/rangeanalysis/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/rangeanalysis -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/regex/qlpack.yml b/shared/regex/qlpack.yml index b32c38cae91..1121f153bf5 100644 --- a/shared/regex/qlpack.yml +++ b/shared/regex/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/regex -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/ssa/qlpack.yml b/shared/ssa/qlpack.yml index 1fa4f9cd719..7ed319dae57 100644 --- a/shared/ssa/qlpack.yml +++ b/shared/ssa/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/ssa -version: 1.1.0 +version: 1.1.1-dev groups: shared library: true dependencies: diff --git a/shared/threat-models/qlpack.yml b/shared/threat-models/qlpack.yml index ca7ab6760c8..2b35e47d089 100644 --- a/shared/threat-models/qlpack.yml +++ b/shared/threat-models/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/threat-models -version: 1.0.21 +version: 1.0.22-dev library: true groups: shared dataExtensions: diff --git a/shared/tutorial/qlpack.yml b/shared/tutorial/qlpack.yml index 0735fce8bb1..3dcf3d9653a 100644 --- a/shared/tutorial/qlpack.yml +++ b/shared/tutorial/qlpack.yml @@ -1,7 +1,7 @@ name: codeql/tutorial description: Library for the CodeQL detective tutorials, helping new users learn to write CodeQL queries. -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/typeflow/qlpack.yml b/shared/typeflow/qlpack.yml index b918a6647d4..2a80a2fd93d 100644 --- a/shared/typeflow/qlpack.yml +++ b/shared/typeflow/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeflow -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/typeinference/qlpack.yml b/shared/typeinference/qlpack.yml index e53d74a0f0b..2ae46b4a8f3 100644 --- a/shared/typeinference/qlpack.yml +++ b/shared/typeinference/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typeinference -version: 0.0.2 +version: 0.0.3-dev groups: shared library: true dependencies: diff --git a/shared/typetracking/qlpack.yml b/shared/typetracking/qlpack.yml index 3a49c131870..5a18f7e7bb7 100644 --- a/shared/typetracking/qlpack.yml +++ b/shared/typetracking/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typetracking -version: 2.0.5 +version: 2.0.6-dev groups: shared library: true dependencies: diff --git a/shared/typos/qlpack.yml b/shared/typos/qlpack.yml index 9f9eb31e03f..640123cfba6 100644 --- a/shared/typos/qlpack.yml +++ b/shared/typos/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/typos -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true warnOnImplicitThis: true diff --git a/shared/util/qlpack.yml b/shared/util/qlpack.yml index 8f17062384d..923d31ad895 100644 --- a/shared/util/qlpack.yml +++ b/shared/util/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/util -version: 2.0.8 +version: 2.0.9-dev groups: shared library: true dependencies: null diff --git a/shared/xml/qlpack.yml b/shared/xml/qlpack.yml index 36d5e9aaf98..1cbd3609e72 100644 --- a/shared/xml/qlpack.yml +++ b/shared/xml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/xml -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true dependencies: diff --git a/shared/yaml/qlpack.yml b/shared/yaml/qlpack.yml index 2a582f48a94..38c92ec2777 100644 --- a/shared/yaml/qlpack.yml +++ b/shared/yaml/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/yaml -version: 1.0.21 +version: 1.0.22-dev groups: shared library: true warnOnImplicitThis: true diff --git a/swift/ql/lib/qlpack.yml b/swift/ql/lib/qlpack.yml index a4a4492d599..75899228952 100644 --- a/swift/ql/lib/qlpack.yml +++ b/swift/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-all -version: 4.1.4 +version: 4.1.5-dev groups: swift extractor: swift dbscheme: swift.dbscheme diff --git a/swift/ql/src/qlpack.yml b/swift/ql/src/qlpack.yml index a99b65317ee..efe9d3232c8 100644 --- a/swift/ql/src/qlpack.yml +++ b/swift/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/swift-queries -version: 1.1.1 +version: 1.1.2-dev groups: - swift - queries From 495276856987c7b4155ee5146242487db27163a5 Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Tue, 15 Apr 2025 10:21:54 -0700 Subject: [PATCH 292/372] Actions: Fix change note newline --- .../2025-04-14-excessive-secrets-exposure-security-severity.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md index 9beaabecbe6..c59e1eb9db3 100644 --- a/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md +++ b/actions/ql/src/change-notes/2025-04-14-excessive-secrets-exposure-security-severity.md @@ -1,5 +1,4 @@ --- category: fix --- -* Assigned a `security-severity` to the query `actions - excessive-secrets-exposure`. \ No newline at end of file +* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`. \ No newline at end of file From 49183bb82a78b0414cd9e9be67d12849fceae462 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:19:26 +0200 Subject: [PATCH 293/372] C++: add predicate to distinguish between array/field designators --- cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll | 41 +++++++++++++++++++- cpp/ql/lib/semmlecode.cpp.dbscheme | 6 ++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll index a36758417bb..fb79988c10f 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll @@ -213,7 +213,27 @@ class ClassAggregateLiteral extends AggregateLiteral { Expr getFieldExpr(Field field, int position) { field = classType.getAField() and aggregate_field_init(underlyingElement(this), unresolveElement(result), unresolveElement(field), - position) + position, _) + } + + /** + * Holds if the `position`-th initialization of `field` in this aggregate initializer + * uses a designator (e.g., `.x =`, `[42] =`) rather than a positional initializer. + * + * This can be used to distinguish explicitly designated initializations from + * implicit positional ones. + * + * For example, in the initializer: + * ```c + * struct S { int x, y; }; + * struct S s = { .x = 1, 2 }; + * ``` + * - `.x = 1` is a designator init, therefore `isDesignatorInit(x, 0)` holds. + * - `2` is a positional init for `.y`, therefore `isDesignatorInit(y, 1)` does **not** hold. + */ + predicate isDesignatorInit(Field field, int position) { + field = classType.getAField() and + aggregate_field_init(underlyingElement(this), _, unresolveElement(field), position, true) } /** @@ -304,7 +324,24 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral { * - `a.getElementExpr(0, 2)` gives `789`. */ Expr getElementExpr(int elementIndex, int position) { - aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position) + aggregate_array_init(underlyingElement(this), unresolveElement(result), elementIndex, position, + _) + } + + /** + * Holds if the `position`-th initialization of the array element at `elementIndex` + * in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than + * an implicit positional initializer. + * + * For example, in: + * ```c + * int x[] = { [0] = 1, 2 }; + * ``` + * - `[0] = 1` is a designator init, therefore `isDesignatorInit(0, 0)` holds. + * - `2` is a positional init for `x[1]`, therefore `isDesignatorInit(1, 1)` does **not** hold. + */ + predicate isDesignatorInit(int elementIndex, int position) { + aggregate_array_init(underlyingElement(this), _, elementIndex, position, true) } /** diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index 0f0a390468a..2e2d805ef93 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -2039,7 +2039,8 @@ aggregate_field_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int field: @membervariable ref, - int position: int ref + int position: int ref, + boolean is_designated: boolean ref ); /** @@ -2051,7 +2052,8 @@ aggregate_array_init( int aggregate: @aggregateliteral ref, int initializer: @expr ref, int element_index: int ref, - int position: int ref + int position: int ref, + boolean is_designated: boolean ref ); @ctorinit = @ctordirectinit From d8afd2a786e4b73ef3ce5344cf51fe2d87ee20e0 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:23:32 +0200 Subject: [PATCH 294/372] C++: add change note for designator-based initializations --- cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md diff --git a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md new file mode 100644 index 00000000000..8b4911abd44 --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md @@ -0,0 +1,4 @@ +--- +category: feature +--- +* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements. \ No newline at end of file From 36a425715cefa967855257d169d4cb17d6a01e83 Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:23:55 +0200 Subject: [PATCH 295/372] C++: add upgrade and downgrade scripts --- .../aggregate_array_init.ql | 11 + .../aggregate_field_init.ql | 15 + .../old.dbscheme | 2448 +++++++++++++++++ .../semmlecode.cpp.dbscheme | 2446 ++++++++++++++++ .../upgrade.properties | 4 + .../aggregate_array_init.ql | 11 + .../aggregate_field_init.ql | 15 + .../old.dbscheme | 2446 ++++++++++++++++ .../semmlecode.cpp.dbscheme | 2448 +++++++++++++++++ .../upgrade.properties | 4 + 10 files changed, 9848 insertions(+) create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme create mode 100644 cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme create mode 100644 cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql new file mode 100644 index 00000000000..acf38e44950 --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_array_init.ql @@ -0,0 +1,11 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, int element_index, int position +where aggregate_array_init(aggregate, initializer, element_index, position, _) +select aggregate, initializer, element_index, position diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql new file mode 100644 index 00000000000..47503cbfd17 --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/aggregate_field_init.ql @@ -0,0 +1,15 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +class MemberVariable extends @membervariable { + string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, MemberVariable field, int position +where aggregate_field_init(aggregate, initializer, field, position, _) +select aggregate, initializer, field, position diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme new file mode 100644 index 00000000000..2e2d805ef93 --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme new file mode 100644 index 00000000000..0f0a390468a --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties new file mode 100644 index 00000000000..b7e78b39ee7 --- /dev/null +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties @@ -0,0 +1,4 @@ +description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +compatibility: backwards +aggregate_array_init.rel: run aggregate_array_init.qlo +aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql new file mode 100644 index 00000000000..9d09506d2d4 --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_array_init.ql @@ -0,0 +1,11 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, int element_index, int position +where aggregate_array_init(aggregate, initializer, element_index, position) +select aggregate, initializer, element_index, position, false diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql new file mode 100644 index 00000000000..dd300af4c22 --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/aggregate_field_init.ql @@ -0,0 +1,15 @@ +class Expr extends @expr { + string toString() { none() } +} + +class AggregateLiteral extends Expr, @aggregateliteral { + override string toString() { none() } +} + +class MemberVariable extends @membervariable { + string toString() { none() } +} + +from AggregateLiteral aggregate, Expr initializer, MemberVariable field, int position +where aggregate_field_init(aggregate, initializer, field, position) +select aggregate, initializer, field, position, false diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme new file mode 100644 index 00000000000..0f0a390468a --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/old.dbscheme @@ -0,0 +1,2446 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme new file mode 100644 index 00000000000..2e2d805ef93 --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/semmlecode.cpp.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties new file mode 100644 index 00000000000..b7e78b39ee7 --- /dev/null +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties @@ -0,0 +1,4 @@ +description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +compatibility: backwards +aggregate_array_init.rel: run aggregate_array_init.qlo +aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file From 9da6d9435ea96d04e608734db334e38e7f917065 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 16 Apr 2025 16:07:30 +0100 Subject: [PATCH 296/372] Rust: More tests affected. --- .../dataflow/strings/inline-taint-flow.expected | 2 +- rust/ql/test/library-tests/dataflow/strings/main.rs | 2 +- .../test/query-tests/security/CWE-089/SqlInjection.expected | 6 +++++- .../query-tests/security/CWE-312/CleartextLogging.expected | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected b/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected index 08c883f1ec1..63076f6b5df 100644 --- a/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected +++ b/rust/ql/test/library-tests/dataflow/strings/inline-taint-flow.expected @@ -1,7 +1,7 @@ models | 1 | Summary: lang:alloc; <_ as crate::string::ToString>::to_string; Argument[self]; ReturnValue; taint | | 2 | Summary: lang:alloc; ::from; Argument[0]; ReturnValue; value | -| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | +| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | | 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 5 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | edges diff --git a/rust/ql/test/library-tests/dataflow/strings/main.rs b/rust/ql/test/library-tests/dataflow/strings/main.rs index 01041e3df46..c04934de051 100644 --- a/rust/ql/test/library-tests/dataflow/strings/main.rs +++ b/rust/ql/test/library-tests/dataflow/strings/main.rs @@ -61,7 +61,7 @@ fn string_to_string() { fn as_str() { let s = source(67); - sink_slice(s.as_str()); // $ hasTaintFlow=67 + sink_slice(s.as_str()); // $ hasValueFlow=67 } fn format_args_built_in() { diff --git a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected index f2b9d39fd16..267728ef9df 100644 --- a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected @@ -32,11 +32,15 @@ edges | sqlx.rs:52:32:52:87 | MacroExpr | sqlx.rs:52:32:52:87 | ...::format(...) | provenance | MaD:4 | | sqlx.rs:52:32:52:87 | { ... } | sqlx.rs:52:32:52:87 | ...::must_use(...) | provenance | MaD:9 | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:63:26:63:39 | unsafe_query_1 [&ref] | provenance | | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:63:26:63:48 | unsafe_query_1.as_str() | provenance | MaD:3 | | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:74:25:74:38 | unsafe_query_1 [&ref] | provenance | | +| sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | sqlx.rs:74:25:74:47 | unsafe_query_1.as_str() | provenance | MaD:3 | | sqlx.rs:53:26:53:36 | &arg_string [&ref] | sqlx.rs:53:9:53:22 | unsafe_query_1 [&ref] | provenance | | | sqlx.rs:53:27:53:36 | arg_string | sqlx.rs:53:26:53:36 | &arg_string [&ref] | provenance | | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:65:30:65:43 | unsafe_query_2 [&ref] | provenance | | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:65:30:65:52 | unsafe_query_2.as_str() | provenance | MaD:3 | | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:76:29:76:42 | unsafe_query_2 [&ref] | provenance | | +| sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | sqlx.rs:76:29:76:51 | unsafe_query_2.as_str() | provenance | MaD:3 | | sqlx.rs:54:26:54:39 | &remote_string [&ref] | sqlx.rs:54:9:54:22 | unsafe_query_2 [&ref] | provenance | | | sqlx.rs:54:27:54:39 | remote_string | sqlx.rs:54:26:54:39 | &remote_string [&ref] | provenance | | | sqlx.rs:56:9:56:22 | unsafe_query_4 | sqlx.rs:67:30:67:52 | unsafe_query_4.as_str() | provenance | MaD:3 | @@ -53,7 +57,7 @@ edges models | 1 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | | 2 | Source: repo:https://github.com/seanmonstar/reqwest:reqwest; crate::blocking::get; remote; ReturnValue.Field[crate::result::Result::Ok(0)] | -| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | +| 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | | 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 5 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::option::Option::Some(0)]; ReturnValue; value | | 6 | Summary: lang:core; ::unwrap; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | diff --git a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected index 92ba9448e38..61218e9c908 100644 --- a/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected +++ b/rust/ql/test/query-tests/security/CWE-312/CleartextLogging.expected @@ -226,8 +226,8 @@ models | 8 | Sink: lang:std; crate::io::stdio::_print; log-injection; Argument[0] | | 9 | Sink: repo:https://github.com/rust-lang/log:log; crate::__private_api::log; log-injection; Argument[1] | | 10 | Sink: repo:https://github.com/rust-lang/log:log; crate::__private_api::log; log-injection; Argument[3] | -| 11 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; taint | -| 12 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | +| 11 | Summary: lang:alloc; ::as_bytes; Argument[self]; ReturnValue; value | +| 12 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; value | | 13 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 14 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | nodes From 15fe2fbba6a0466e8cc5a112c1c0539ab4fb0acc Mon Sep 17 00:00:00 2001 From: idrissrio Date: Wed, 16 Apr 2025 16:25:24 +0200 Subject: [PATCH 297/372] C++: update stats file --- cpp/ql/lib/semmlecode.cpp.dbscheme.stats | 1267 ++++++++++++++-------- 1 file changed, 813 insertions(+), 454 deletions(-) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 585e8f31e0a..1a4c6b8c5c9 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 16215 + 16216 @externalDataElement @@ -34,7 +34,7 @@ @file - 83639 + 83640 @folder @@ -42,7 +42,7 @@ @macro_expansion - 40299208 + 40299816 @other_macro_reference @@ -58,11 +58,11 @@ @var_decl - 6734225 + 6733822 @type_decl - 1890777 + 1890806 @namespace_decl @@ -70,7 +70,7 @@ @using_declaration - 333244 + 333262 @using_directive @@ -90,7 +90,7 @@ @membervariable - 1441778 + 1441833 @globalvariable @@ -98,7 +98,7 @@ @localvariable - 735324 + 735322 @enumconstant @@ -370,7 +370,7 @@ @usertype - 4987434 + 4987509 @mangledname @@ -390,7 +390,7 @@ @ptrtomember - 12083 + 12084 @specifier @@ -422,7 +422,7 @@ @attribute_arg_constant_expr - 89600 + 89384 @attribute_arg_expr @@ -538,7 +538,7 @@ @divexpr - 60352 + 60353 @remexpr @@ -734,7 +734,7 @@ @temp_init - 1076139 + 1076142 @errorexpr @@ -818,7 +818,7 @@ @throw_expr - 26159 + 26260 @condition_decl @@ -966,7 +966,7 @@ @static_cast - 335479 + 335484 @reinterpret_cast @@ -986,7 +986,7 @@ @param_ref - 177993 + 177994 @noopexpr @@ -1430,7 +1430,7 @@ @stmt_decl - 770895 + 770907 @stmt_empty @@ -1446,7 +1446,7 @@ @stmt_try_block - 28973 + 29068 @stmt_microsoft_try @@ -1470,7 +1470,7 @@ @stmt_handler - 47475 + 47531 @stmt_constexpr_if @@ -1514,7 +1514,7 @@ @ppd_plain_include - 408579 + 408585 @ppd_define @@ -1592,11 +1592,11 @@ compilations - 16215 + 16216 id - 16215 + 16216 cwd @@ -1614,7 +1614,7 @@ 1 2 - 16215 + 16216 @@ -1640,11 +1640,11 @@ compilation_args - 1298229 + 1298248 id - 16215 + 16216 num @@ -1652,7 +1652,7 @@ arg - 37538 + 37539 @@ -2011,12 +2011,12 @@ 1 2 - 24858 + 24859 2 3 - 11189 + 11190 3 @@ -2031,11 +2031,11 @@ compilation_build_mode - 16215 + 16216 id - 16215 + 16216 mode @@ -2053,7 +2053,7 @@ 1 2 - 16215 + 16216 @@ -2079,11 +2079,11 @@ compilation_compiling_files - 16215 + 16216 id - 16215 + 16216 num @@ -2105,7 +2105,7 @@ 1 2 - 16215 + 16216 @@ -2121,7 +2121,7 @@ 1 2 - 16215 + 16216 @@ -2205,7 +2205,7 @@ compilation_time - 64592 + 64593 id @@ -2221,7 +2221,7 @@ seconds - 17407 + 17652 @@ -2267,17 +2267,17 @@ 2 3 - 149 + 203 3 4 - 8277 + 8250 4 5 - 7721 + 7694 @@ -2323,8 +2323,8 @@ 12 - 1285 - 1286 + 1303 + 1304 13 @@ -2371,18 +2371,18 @@ 12 - 9 - 10 + 8 + 9 13 - 11 - 12 + 10 + 11 13 - 718 - 719 + 710 + 711 13 @@ -2404,27 +2404,27 @@ 1 2 - 10837 + 11162 2 3 - 3617 + 3508 3 4 - 1368 + 1598 4 - 10 + 55 1327 - 10 - 694 - 257 + 77 + 700 + 54 @@ -2440,7 +2440,7 @@ 1 2 - 17407 + 17652 @@ -2456,16 +2456,16 @@ 1 2 - 14414 + 15051 2 3 - 2980 + 2587 - 3 - 4 + 4 + 5 13 @@ -2722,19 +2722,19 @@ compilation_finished - 16215 + 16216 id - 16215 + 16216 cpu_seconds - 12083 + 12165 elapsed_seconds - 257 + 243 @@ -2748,7 +2748,7 @@ 1 2 - 16215 + 16216 @@ -2764,7 +2764,7 @@ 1 2 - 16215 + 16216 @@ -2785,12 +2785,12 @@ 2 3 - 1246 + 1408 3 - 35 - 596 + 38 + 514 @@ -2806,12 +2806,12 @@ 1 2 - 11365 + 11311 2 3 - 717 + 853 @@ -2827,7 +2827,7 @@ 1 2 - 67 + 40 2 @@ -2840,48 +2840,63 @@ 13 - 6 - 7 + 4 + 5 13 - 11 - 12 - 54 - - - 20 - 21 + 8 + 9 13 - 31 - 32 + 9 + 10 13 - 43 - 44 + 10 + 11 + 27 + + + 13 + 14 13 - 127 - 128 + 19 + 20 13 - 265 - 266 + 28 + 29 13 - 321 - 322 + 42 + 43 13 - 330 - 331 + 142 + 143 + 13 + + + 272 + 273 + 13 + + + 296 + 297 + 13 + + + 336 + 337 13 @@ -2898,7 +2913,7 @@ 1 2 - 67 + 40 2 @@ -2911,48 +2926,63 @@ 13 - 6 - 7 + 4 + 5 13 - 11 - 12 - 54 - - - 20 - 21 + 8 + 9 13 - 31 - 32 + 9 + 10 13 - 43 - 44 + 10 + 11 + 27 + + + 13 + 14 13 - 120 - 121 + 19 + 20 13 - 171 - 172 + 28 + 29 13 - 233 - 234 + 42 + 43 13 - 267 - 268 + 136 + 137 + 13 + + + 183 + 184 + 13 + + + 245 + 246 + 13 + + + 246 + 247 13 @@ -11159,15 +11189,15 @@ files - 83639 + 83640 id - 83639 + 83640 name - 83639 + 83640 @@ -11181,7 +11211,7 @@ 1 2 - 83639 + 83640 @@ -11197,7 +11227,7 @@ 1 2 - 83639 + 83640 @@ -11255,7 +11285,7 @@ containerparent - 99503 + 99504 parent @@ -11263,7 +11293,7 @@ child - 99503 + 99504 @@ -11328,7 +11358,7 @@ 1 2 - 99503 + 99504 @@ -11338,7 +11368,7 @@ fileannotations - 5387479 + 5387560 id @@ -11350,11 +11380,11 @@ name - 75308 + 75309 value - 50679 + 50680 @@ -11604,7 +11634,7 @@ 2 3 - 5594 + 5595 3 @@ -11619,7 +11649,7 @@ 7 9 - 5892 + 5893 9 @@ -11644,7 +11674,7 @@ 47 128 - 6312 + 6313 128 @@ -11670,7 +11700,7 @@ 1 2 - 75308 + 75309 @@ -11752,7 +11782,7 @@ 1 2 - 4307 + 4308 2 @@ -12195,19 +12225,19 @@ macroinvocations - 40601294 + 40601906 id - 40601294 + 40601906 macro_id - 109907 + 109909 location - 1070096 + 1070112 kind @@ -12225,7 +12255,7 @@ 1 2 - 40601294 + 40601906 @@ -12241,7 +12271,7 @@ 1 2 - 40601294 + 40601906 @@ -12257,7 +12287,7 @@ 1 2 - 40601294 + 40601906 @@ -12273,12 +12303,12 @@ 1 2 - 23517 + 23518 2 3 - 20428 + 20429 3 @@ -12298,7 +12328,7 @@ 11 21 - 9184 + 9185 21 @@ -12334,17 +12364,17 @@ 1 2 - 60257 + 60258 2 3 - 13641 + 13642 3 4 - 6881 + 6882 4 @@ -12380,7 +12410,7 @@ 1 2 - 101453 + 101455 2 @@ -12401,37 +12431,37 @@ 1 2 - 426610 + 426617 2 3 - 252707 + 252710 3 4 - 113199 + 113201 4 6 - 77502 + 77503 6 11 - 82759 + 82760 11 42 - 80456 + 80457 42 226288 - 36861 + 36862 @@ -12447,7 +12477,7 @@ 1 2 - 1009649 + 1009664 2 @@ -12468,7 +12498,7 @@ 1 2 - 1070096 + 1070112 @@ -12541,15 +12571,15 @@ macroparent - 35811023 + 35811564 id - 35811023 + 35811564 parent_id - 28060082 + 28060505 @@ -12563,7 +12593,7 @@ 1 2 - 35811023 + 35811564 @@ -12579,17 +12609,17 @@ 1 2 - 21858004 + 21858334 2 3 - 5174275 + 5174353 3 91 - 1027802 + 1027818 @@ -12677,11 +12707,11 @@ macro_argument_unexpanded - 103252337 + 103253896 invocation - 31226086 + 31226557 argument_index @@ -12689,7 +12719,7 @@ text - 440266 + 440272 @@ -12703,22 +12733,22 @@ 1 2 - 9979461 + 9979611 2 3 - 12505068 + 12505256 3 4 - 6395516 + 6395613 4 67 - 2346040 + 2346075 @@ -12734,22 +12764,22 @@ 1 2 - 10213703 + 10213857 2 3 - 12526567 + 12526756 3 4 - 6195602 + 6195695 4 67 - 2290213 + 2290247 @@ -12817,32 +12847,32 @@ 1 2 - 52020 + 52021 2 3 - 79995 + 79996 3 4 - 29681 + 29682 4 5 - 44447 + 44448 5 6 - 50218 + 50219 6 9 - 36590 + 36591 9 @@ -12862,7 +12892,7 @@ 57 517 - 33244 + 33245 518 @@ -12883,12 +12913,12 @@ 1 2 - 311894 + 311898 2 3 - 115272 + 115273 3 @@ -12903,11 +12933,11 @@ macro_argument_expanded - 103252337 + 103253896 invocation - 31226086 + 31226557 argument_index @@ -12915,7 +12945,7 @@ text - 266687 + 266691 @@ -12929,22 +12959,22 @@ 1 2 - 9979461 + 9979611 2 3 - 12505068 + 12505256 3 4 - 6395516 + 6395613 4 67 - 2346040 + 2346075 @@ -12960,22 +12990,22 @@ 1 2 - 13763116 + 13763324 2 3 - 10789751 + 10789914 3 4 - 5403993 + 5404074 4 9 - 1269224 + 1269243 @@ -13043,17 +13073,17 @@ 1 2 - 28299 + 28300 2 3 - 35154 + 35155 3 4 - 58509 + 58510 4 @@ -13078,12 +13108,12 @@ 10 19 - 22948 + 22949 19 51 - 20076 + 20077 51 @@ -13109,12 +13139,12 @@ 1 2 - 134779 + 134781 2 3 - 114039 + 114040 3 @@ -14871,7 +14901,7 @@ constraint - 30948 + 30949 @@ -15010,7 +15040,7 @@ 1 2 - 30948 + 30949 @@ -15296,11 +15326,11 @@ var_decls - 6739203 + 6738800 id - 6734225 + 6733822 variable @@ -15330,7 +15360,7 @@ 1 2 - 6734225 + 6733822 @@ -15346,7 +15376,7 @@ 1 2 - 6729247 + 6728843 2 @@ -15367,7 +15397,7 @@ 1 2 - 6734225 + 6733822 @@ -15383,7 +15413,7 @@ 1 2 - 6734225 + 6733822 @@ -15399,12 +15429,12 @@ 1 2 - 6408486 + 6408890 2 4 - 157285 + 156882 @@ -15488,12 +15518,12 @@ 2 3 - 294120 + 294254 3 5 - 133201 + 133067 5 @@ -15646,7 +15676,7 @@ 28 - 6411 + 6408 27716 @@ -15780,7 +15810,7 @@ 4 - 2760 + 2757 194017 @@ -16018,19 +16048,19 @@ type_decls - 1890777 + 1890806 id - 1890777 + 1890806 type_id - 1849364 + 1849392 location - 1485517 + 1485539 @@ -16044,7 +16074,7 @@ 1 2 - 1890777 + 1890806 @@ -16060,7 +16090,7 @@ 1 2 - 1890777 + 1890806 @@ -16076,7 +16106,7 @@ 1 2 - 1819574 + 1819601 2 @@ -16097,7 +16127,7 @@ 1 2 - 1820902 + 1820929 2 @@ -16118,12 +16148,12 @@ 1 2 - 1408989 + 1409011 2 651 - 76527 + 76528 @@ -16139,12 +16169,12 @@ 1 2 - 1410331 + 1410352 2 651 - 75186 + 75187 @@ -16154,11 +16184,11 @@ type_def - 1297362 + 1297381 id - 1297362 + 1297381 @@ -16234,7 +16264,7 @@ 1 2 - 8186 + 8187 2 @@ -16615,19 +16645,19 @@ usings - 338568 + 338586 id - 338568 + 338586 element_id - 65337 + 65352 location - 33921 + 33922 kind @@ -16645,7 +16675,7 @@ 1 2 - 338568 + 338586 @@ -16661,7 +16691,7 @@ 1 2 - 338568 + 338586 @@ -16677,7 +16707,7 @@ 1 2 - 338568 + 338586 @@ -16693,7 +16723,7 @@ 1 2 - 55421 + 55435 2 @@ -16703,7 +16733,7 @@ 4 134 - 4307 + 4308 @@ -16719,7 +16749,7 @@ 1 2 - 55421 + 55435 2 @@ -16729,7 +16759,7 @@ 4 134 - 4307 + 4308 @@ -16745,7 +16775,7 @@ 1 2 - 65337 + 65352 @@ -16761,17 +16791,17 @@ 1 2 - 26809 + 26810 2 4 - 2858 + 2844 4 145 - 2465 + 2479 145 @@ -16792,17 +16822,17 @@ 1 2 - 26809 + 26810 2 4 - 2858 + 2844 4 145 - 2465 + 2479 145 @@ -16823,7 +16853,7 @@ 1 2 - 33921 + 33922 @@ -16842,8 +16872,8 @@ 13 - 24599 - 24600 + 24600 + 24601 13 @@ -16863,8 +16893,8 @@ 13 - 4609 - 4610 + 4610 + 4611 13 @@ -16896,7 +16926,7 @@ using_container - 732097 + 732121 parent @@ -16904,7 +16934,7 @@ child - 338568 + 338586 @@ -16918,17 +16948,17 @@ 1 2 - 12327 + 12328 2 4 - 2438 + 2424 4 6 - 1598 + 1612 6 @@ -16969,12 +16999,12 @@ 1 2 - 114174 + 114189 2 3 - 154260 + 154262 3 @@ -18206,15 +18236,15 @@ membervariables - 1444236 + 1444291 id - 1441778 + 1441833 type_id - 448006 + 448060 name @@ -18232,7 +18262,7 @@ 1 2 - 1439430 + 1439484 2 @@ -18253,7 +18283,7 @@ 1 2 - 1441778 + 1441833 @@ -18269,12 +18299,12 @@ 1 2 - 332222 + 332331 2 3 - 70944 + 70890 3 @@ -18283,7 +18313,7 @@ 10 - 4152 + 4153 9939 @@ -18300,12 +18330,12 @@ 1 2 - 348934 + 349043 2 3 - 63517 + 63462 3 @@ -18553,11 +18583,11 @@ localvariables - 735324 + 735322 id - 735324 + 735322 type_id @@ -18565,7 +18595,7 @@ name - 102827 + 102826 @@ -18579,7 +18609,7 @@ 1 2 - 735324 + 735322 @@ -18595,7 +18625,7 @@ 1 2 - 735324 + 735322 @@ -18616,7 +18646,7 @@ 2 3 - 7926 + 7925 3 @@ -18657,7 +18687,7 @@ 1 2 - 38831 + 38830 2 @@ -18688,7 +18718,7 @@ 1 2 - 63262 + 63261 2 @@ -21390,7 +21420,7 @@ decltypes - 175649 + 175650 id @@ -21711,15 +21741,15 @@ usertypes - 4987434 + 4987509 id - 4987434 + 4987509 name - 1074810 + 1074799 kind @@ -21737,7 +21767,7 @@ 1 2 - 4987434 + 4987509 @@ -21753,7 +21783,7 @@ 1 2 - 4987434 + 4987509 @@ -21769,22 +21799,22 @@ 1 2 - 743259 + 743244 2 3 - 196974 + 196950 3 7 - 85996 + 86025 7 30181 - 48579 + 48580 @@ -21800,12 +21830,12 @@ 1 2 - 1008457 + 1008445 2 10 - 66353 + 66354 @@ -21935,8 +21965,8 @@ 13 - 10829 - 10830 + 10827 + 10828 13 @@ -21957,11 +21987,11 @@ usertypesize - 1632137 + 1632161 id - 1632137 + 1632161 size @@ -21983,7 +22013,7 @@ 1 2 - 1632137 + 1632161 @@ -21999,7 +22029,7 @@ 1 2 - 1632137 + 1632161 @@ -22334,7 +22364,7 @@ constraint - 27881 + 27882 @@ -22399,15 +22429,15 @@ mangled_name - 7776179 + 7776283 id - 7776179 + 7776283 mangled_name - 5325040 + 5327221 is_complete @@ -22425,7 +22455,7 @@ 1 2 - 7776179 + 7776283 @@ -22441,7 +22471,7 @@ 1 2 - 7776179 + 7776283 @@ -22457,17 +22487,17 @@ 1 2 - 4731503 + 4733728 2 3 - 459353 + 459564 3 9032 - 134183 + 133928 @@ -22483,7 +22513,7 @@ 1 2 - 5325040 + 5327221 @@ -22497,13 +22527,13 @@ 12 - 5005 - 5006 + 4842 + 4843 13 - 570633 - 570634 + 570790 + 570791 13 @@ -22518,13 +22548,13 @@ 12 - 1518 - 1519 + 1515 + 1516 13 - 391559 - 391560 + 391717 + 391718 13 @@ -22546,48 +22576,48 @@ is_standard_layout_class - 1344858 + 1344878 id - 1344858 + 1344878 is_complete - 1611274 + 1611299 id - 1611274 + 1611299 is_class_template - 292183 + 292187 id - 292183 + 292187 class_instantiation - 1327030 + 1327050 to - 1323128 + 1323148 from - 91605 + 91606 @@ -22601,7 +22631,7 @@ 1 2 - 1320392 + 1320411 2 @@ -22672,11 +22702,11 @@ class_template_argument - 3501700 + 3501753 type_id - 1631215 + 1631240 index @@ -22684,7 +22714,7 @@ arg_type - 1034467 + 1034483 @@ -22698,22 +22728,22 @@ 1 2 - 678884 + 678894 2 3 - 490105 + 490113 3 4 - 308751 + 308755 4 7 - 124118 + 124120 7 @@ -22734,22 +22764,22 @@ 1 2 - 713442 + 713453 2 3 - 505454 + 505462 3 4 - 306813 + 306818 4 113 - 105504 + 105506 @@ -22857,22 +22887,22 @@ 1 2 - 649080 + 649090 2 3 - 212187 + 212190 3 4 - 62153 + 62154 4 11 - 78667 + 78669 11 @@ -22893,12 +22923,12 @@ 1 2 - 912381 + 912395 2 3 - 98852 + 98854 3 @@ -23139,15 +23169,15 @@ is_proxy_class_for - 62059 + 62060 id - 62059 + 62060 templ_param_id - 58631 + 58632 @@ -23161,7 +23191,7 @@ 1 2 - 62059 + 62060 @@ -23177,7 +23207,7 @@ 1 2 - 57710 + 57711 2 @@ -24710,12 +24740,12 @@ 1 2 - 6461 + 6462 2 4 - 717 + 718 4 @@ -24863,7 +24893,7 @@ 1 2 - 11609 + 11610 3 @@ -26066,11 +26096,11 @@ ptrtomembers - 12083 + 12084 id - 12083 + 12084 type_id @@ -26092,7 +26122,7 @@ 1 2 - 12083 + 12084 @@ -26108,7 +26138,7 @@ 1 2 - 12083 + 12084 @@ -26166,7 +26196,7 @@ 1 2 - 4876 + 4877 2 @@ -26197,7 +26227,7 @@ 1 2 - 4876 + 4877 2 @@ -26270,11 +26300,11 @@ typespecifiers - 991496 + 991511 type_id - 984912 + 984927 spec_id @@ -26292,7 +26322,7 @@ 1 2 - 978328 + 978343 2 @@ -26358,7 +26388,7 @@ funspecifiers - 9728427 + 9728384 func_id @@ -26385,12 +26415,12 @@ 2 3 - 677260 + 677303 3 4 - 1424206 + 1424163 4 @@ -26494,8 +26524,8 @@ 42 - 42407 - 42408 + 42406 + 42407 42 @@ -26516,11 +26546,11 @@ varspecifiers - 2898030 + 2898085 var_id - 2544999 + 2545054 spec_id @@ -26538,7 +26568,7 @@ 1 2 - 2191969 + 2192023 2 @@ -26587,8 +26617,8 @@ 54 - 32448 - 32449 + 32449 + 32450 54 @@ -27185,11 +27215,11 @@ attribute_args - 99123 + 98908 id - 99123 + 98908 kind @@ -27197,7 +27227,7 @@ attribute - 85332 + 85334 index @@ -27205,7 +27235,7 @@ location - 91943 + 91945 @@ -27219,7 +27249,7 @@ 1 2 - 99123 + 98908 @@ -27235,7 +27265,7 @@ 1 2 - 99123 + 98908 @@ -27251,7 +27281,7 @@ 1 2 - 99123 + 98908 @@ -27267,7 +27297,7 @@ 1 2 - 99123 + 98908 @@ -27296,8 +27326,8 @@ 13 - 6614 - 6615 + 6598 + 6599 13 @@ -27402,12 +27432,12 @@ 1 2 - 77177 + 77395 2 4 - 6800 + 6583 4 @@ -27428,7 +27458,7 @@ 1 2 - 83029 + 83031 2 @@ -27449,7 +27479,7 @@ 1 2 - 79047 + 79048 2 @@ -27470,7 +27500,7 @@ 1 2 - 80659 + 80660 2 @@ -27509,8 +27539,8 @@ 13 - 6497 - 6498 + 6481 + 6482 13 @@ -27625,12 +27655,12 @@ 1 2 - 89329 + 89547 2 23 - 2614 + 2397 @@ -27646,7 +27676,7 @@ 1 2 - 91727 + 91728 2 @@ -27667,7 +27697,7 @@ 1 2 - 91537 + 91538 2 @@ -27688,7 +27718,7 @@ 1 2 - 91388 + 91389 2 @@ -27859,15 +27889,15 @@ attribute_arg_constant - 89600 + 89384 arg - 89600 + 89384 constant - 89600 + 89384 @@ -27881,7 +27911,7 @@ 1 2 - 89600 + 89384 @@ -27897,7 +27927,7 @@ 1 2 - 89600 + 89384 @@ -28265,15 +28295,15 @@ unspecifiedtype - 8345603 + 8345729 type_id - 8345603 + 8345729 unspecified_type_id - 4799035 + 4799107 @@ -28287,7 +28317,7 @@ 1 2 - 8345603 + 8345729 @@ -28303,17 +28333,17 @@ 1 2 - 3198462 + 3198511 2 3 - 1309012 + 1309032 3 6271 - 291559 + 291564 @@ -29519,7 +29549,7 @@ decl_id - 98169 + 98040 location @@ -29718,12 +29748,12 @@ 1 2 - 60620 + 60362 2 3 - 7518 + 7647 3 @@ -29759,12 +29789,12 @@ 1 2 - 60620 + 60362 2 3 - 7518 + 7647 3 @@ -29800,7 +29830,7 @@ 1 2 - 97310 + 97181 2 @@ -29867,7 +29897,7 @@ 2 - 2132 + 2129 429 @@ -30125,11 +30155,11 @@ compgenerated - 10714334 + 10716063 id - 10714334 + 10716063 @@ -30441,7 +30471,7 @@ namespacembrs - 2025652 + 2025696 parentid @@ -30449,7 +30479,7 @@ memberid - 2025652 + 2025696 @@ -30539,7 +30569,7 @@ 1 2 - 2025652 + 2025696 @@ -32000,11 +32030,11 @@ valuetext - 6605626 + 6605580 id - 6605626 + 6605580 text @@ -32022,7 +32052,7 @@ 1 2 - 6605626 + 6605580 @@ -32116,11 +32146,11 @@ fieldoffsets - 1441778 + 1441833 id - 1441778 + 1441833 byteoffset @@ -32142,7 +32172,7 @@ 1 2 - 1441778 + 1441833 @@ -32158,7 +32188,7 @@ 1 2 - 1441778 + 1441833 @@ -32203,7 +32233,7 @@ 244 - 5638 + 5639 1092 @@ -32274,8 +32304,8 @@ 54 - 26131 - 26132 + 26132 + 26133 54 @@ -32317,11 +32347,11 @@ bitfield - 27375 + 27388 id - 27375 + 27388 bits @@ -32343,7 +32373,7 @@ 1 2 - 27375 + 27388 @@ -32359,7 +32389,7 @@ 1 2 - 27375 + 27388 @@ -32408,7 +32438,7 @@ 19 - 17 + 18 21 19 @@ -32419,7 +32449,7 @@ 36 - 78 + 79 19 @@ -32495,7 +32525,7 @@ 19 - 17 + 18 21 19 @@ -32506,7 +32536,7 @@ 36 - 78 + 79 19 @@ -33616,6 +33646,10 @@ position 32 + + is_designated + 2 + @@ -33771,6 +33805,27 @@ + + aggregate + is_designated + + + 12 + + + 1 + 2 + 1242986 + + + 2 + 3 + 82 + + + + + initializer aggregate @@ -33824,6 +33879,22 @@ + + initializer + is_designated + + + 12 + + + 1 + 2 + 5717202 + + + + + field aggregate @@ -33957,6 +34028,27 @@ + + field + is_designated + + + 12 + + + 1 + 2 + 3201 + + + 2 + 3 + 26 + + + + + position aggregate @@ -34170,6 +34262,111 @@ + + position + is_designated + + + 12 + + + 1 + 2 + 24 + + + 2 + 3 + 8 + + + + + + + is_designated + aggregate + + + 12 + + + 480 + 481 + 1 + + + 1242670 + 1242671 + 1 + + + + + + + is_designated + initializer + + + 12 + + + 710 + 711 + 1 + + + 5716492 + 5716493 + 1 + + + + + + + is_designated + field + + + 12 + + + 218 + 219 + 1 + + + 3035 + 3036 + 1 + + + + + + + is_designated + position + + + 12 + + + 8 + 9 + 1 + + + 32 + 33 + 1 + + + + + @@ -34192,6 +34389,10 @@ position 62922 + + is_designated + 2 + @@ -34347,6 +34548,22 @@ + + aggregate + is_designated + + + 12 + + + 1 + 2 + 152356 + + + + + initializer aggregate @@ -34395,6 +34612,22 @@ + + initializer + is_designated + + + 12 + + + 1 + 2 + 1349246 + + + + + element_index aggregate @@ -34498,6 +34731,27 @@ + + element_index + is_designated + + + 12 + + + 1 + 2 + 62914 + + + 2 + 3 + 8 + + + + + position aggregate @@ -34601,6 +34855,111 @@ + + position + is_designated + + + 12 + + + 1 + 2 + 62915 + + + 2 + 3 + 7 + + + + + + + is_designated + aggregate + + + 12 + + + 3 + 4 + 1 + + + 152353 + 152354 + 1 + + + + + + + is_designated + initializer + + + 12 + + + 16 + 17 + 1 + + + 1349230 + 1349231 + 1 + + + + + + + is_designated + element_index + + + 12 + + + 8 + 9 + 1 + + + 62922 + 62923 + 1 + + + + + + + is_designated + position + + + 12 + + + 7 + 8 + 1 + + + 62922 + 62923 + 1 + + + + + @@ -38063,22 +38422,22 @@ ishandler - 47475 + 47531 block - 47475 + 47531 stmt_decl_bind - 730761 + 730759 stmt - 690291 + 690289 num @@ -38086,7 +38445,7 @@ decl - 730692 + 730690 @@ -38100,7 +38459,7 @@ 1 2 - 668062 + 668061 2 @@ -38121,7 +38480,7 @@ 1 2 - 668062 + 668061 2 @@ -38186,7 +38545,7 @@ 5480 - 170178 + 170179 8 @@ -38247,7 +38606,7 @@ 5480 - 170161 + 170162 8 @@ -38264,7 +38623,7 @@ 1 2 - 730667 + 730666 2 @@ -38285,7 +38644,7 @@ 1 2 - 730692 + 730690 @@ -38295,11 +38654,11 @@ stmt_decl_entry_bind - 730761 + 730759 stmt - 690291 + 690289 num @@ -38307,7 +38666,7 @@ decl_entry - 730761 + 730759 @@ -38321,7 +38680,7 @@ 1 2 - 668062 + 668061 2 @@ -38342,7 +38701,7 @@ 1 2 - 668062 + 668061 2 @@ -38407,7 +38766,7 @@ 5480 - 170178 + 170179 8 @@ -38468,7 +38827,7 @@ 5480 - 170178 + 170179 8 @@ -38485,7 +38844,7 @@ 1 2 - 730761 + 730759 @@ -38501,7 +38860,7 @@ 1 2 - 730761 + 730759 @@ -39197,15 +39556,15 @@ includes - 408674 + 408680 id - 408674 + 408680 included - 75281 + 75282 @@ -39219,7 +39578,7 @@ 1 2 - 408674 + 408680 From ed2d06bcd7f37f4dc8fb14dc692a2c3b9b9a8201 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 17 Apr 2025 09:57:59 +0100 Subject: [PATCH 298/372] Rust: environment-source -> environment. --- rust/ql/lib/codeql/rust/Concepts.qll | 2 +- rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml | 8 ++++---- .../query-tests/security/CWE-020/RegexInjection.expected | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index 723cde6913a..fb37cbac46a 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -99,7 +99,7 @@ module EnvironmentSource { * An externally modeled source for data from the program's environment. */ class ModeledEnvironmentSource extends EnvironmentSource::Range { - ModeledEnvironmentSource() { sourceNode(this, "environment-source") } + ModeledEnvironmentSource() { sourceNode(this, "environment") } } /** diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml index 9e579c8c4de..2906b0a064f 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml @@ -8,7 +8,7 @@ extensions: - ["lang:std", "crate::env::current_dir", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - ["lang:std", "crate::env::current_exe", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - ["lang:std", "crate::env::home_dir", "ReturnValue.Field[crate::option::Option::Some(0)]", "command-line-source", "manual"] - - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment-source", "manual"] - - ["lang:std", "crate::env::var_os", "ReturnValue.Field[crate::option::Option::Some(0)]", "environment-source", "manual"] - - ["lang:std", "crate::env::vars", "ReturnValue.Element", "environment-source", "manual"] - - ["lang:std", "crate::env::vars_os", "ReturnValue.Element", "environment-source", "manual"] + - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment", "manual"] + - ["lang:std", "crate::env::var_os", "ReturnValue.Field[crate::option::Option::Some(0)]", "environment", "manual"] + - ["lang:std", "crate::env::vars", "ReturnValue.Element", "environment", "manual"] + - ["lang:std", "crate::env::vars_os", "ReturnValue.Element", "environment", "manual"] diff --git a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected index c86d5f444d6..01bcab8c1f8 100644 --- a/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-020/RegexInjection.expected @@ -13,7 +13,7 @@ edges | main.rs:5:25:5:44 | { ... } | main.rs:5:25:5:44 | ...::must_use(...) | provenance | MaD:4 | | main.rs:6:26:6:30 | regex | main.rs:6:25:6:30 | ®ex | provenance | | models -| 1 | Source: lang:std; crate::env::var; environment-source; ReturnValue.Field[crate::result::Result::Ok(0)] | +| 1 | Source: lang:std; crate::env::var; environment; ReturnValue.Field[crate::result::Result::Ok(0)] | | 2 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | | 3 | Summary: lang:core; ::unwrap_or; Argument[self].Field[crate::result::Result::Ok(0)]; ReturnValue; value | | 4 | Summary: lang:core; crate::hint::must_use; Argument[0]; ReturnValue; value | From 43069f139d8ff66d140035de3da8bb7fa56db9f2 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 17 Apr 2025 10:05:07 +0100 Subject: [PATCH 299/372] Rust: command-line-source -> commandargs. --- rust/ql/lib/codeql/rust/Concepts.qll | 2 +- .../ql/lib/codeql/rust/frameworks/stdlib/env.model.yml | 10 +++++----- .../query-tests/security/CWE-089/SqlInjection.expected | 2 +- .../CWE-770/UncontrolledAllocationSize.expected | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rust/ql/lib/codeql/rust/Concepts.qll b/rust/ql/lib/codeql/rust/Concepts.qll index fb37cbac46a..c2a8c08ca0a 100644 --- a/rust/ql/lib/codeql/rust/Concepts.qll +++ b/rust/ql/lib/codeql/rust/Concepts.qll @@ -73,7 +73,7 @@ module CommandLineArgsSource { * An externally modeled source for command line arguments. */ class ModeledCommandLineArgsSource extends CommandLineArgsSource::Range { - ModeledCommandLineArgsSource() { sourceNode(this, "command-line-source") } + ModeledCommandLineArgsSource() { sourceNode(this, "commandargs") } } /** diff --git a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml index 2906b0a064f..8ca01fdc422 100644 --- a/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml +++ b/rust/ql/lib/codeql/rust/frameworks/stdlib/env.model.yml @@ -3,11 +3,11 @@ extensions: pack: codeql/rust-all extensible: sourceModel data: - - ["lang:std", "crate::env::args", "ReturnValue.Element", "command-line-source", "manual"] - - ["lang:std", "crate::env::args_os", "ReturnValue.Element", "command-line-source", "manual"] - - ["lang:std", "crate::env::current_dir", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - - ["lang:std", "crate::env::current_exe", "ReturnValue.Field[crate::result::Result::Ok(0)]", "command-line-source", "manual"] - - ["lang:std", "crate::env::home_dir", "ReturnValue.Field[crate::option::Option::Some(0)]", "command-line-source", "manual"] + - ["lang:std", "crate::env::args", "ReturnValue.Element", "commandargs", "manual"] + - ["lang:std", "crate::env::args_os", "ReturnValue.Element", "commandargs", "manual"] + - ["lang:std", "crate::env::current_dir", "ReturnValue.Field[crate::result::Result::Ok(0)]", "commandargs", "manual"] + - ["lang:std", "crate::env::current_exe", "ReturnValue.Field[crate::result::Result::Ok(0)]", "commandargs", "manual"] + - ["lang:std", "crate::env::home_dir", "ReturnValue.Field[crate::option::Option::Some(0)]", "commandargs", "manual"] - ["lang:std", "crate::env::var", "ReturnValue.Field[crate::result::Result::Ok(0)]", "environment", "manual"] - ["lang:std", "crate::env::var_os", "ReturnValue.Field[crate::option::Option::Some(0)]", "environment", "manual"] - ["lang:std", "crate::env::vars", "ReturnValue.Element", "environment", "manual"] diff --git a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected index f2b9d39fd16..fcc56a9c077 100644 --- a/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected +++ b/rust/ql/test/query-tests/security/CWE-089/SqlInjection.expected @@ -51,7 +51,7 @@ edges | sqlx.rs:74:25:74:38 | unsafe_query_1 [&ref] | sqlx.rs:74:25:74:47 | unsafe_query_1.as_str() | provenance | MaD:3 | | sqlx.rs:76:29:76:42 | unsafe_query_2 [&ref] | sqlx.rs:76:29:76:51 | unsafe_query_2.as_str() | provenance | MaD:3 | models -| 1 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | +| 1 | Source: lang:std; crate::env::args; commandargs; ReturnValue.Element | | 2 | Source: repo:https://github.com/seanmonstar/reqwest:reqwest; crate::blocking::get; remote; ReturnValue.Field[crate::result::Result::Ok(0)] | | 3 | Summary: lang:alloc; ::as_str; Argument[self]; ReturnValue; taint | | 4 | Summary: lang:alloc; crate::fmt::format; Argument[0]; ReturnValue; taint | diff --git a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected index 8fbaf765939..0e9acca98d7 100644 --- a/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected +++ b/rust/ql/test/query-tests/security/CWE-770/UncontrolledAllocationSize.expected @@ -271,7 +271,7 @@ models | 13 | Sink: repo:https://github.com/rust-lang/libc:libc; ::calloc; alloc-size; Argument[0,1] | | 14 | Sink: repo:https://github.com/rust-lang/libc:libc; ::malloc; alloc-size; Argument[0] | | 15 | Sink: repo:https://github.com/rust-lang/libc:libc; ::realloc; alloc-size; Argument[1] | -| 16 | Source: lang:std; crate::env::args; command-line-source; ReturnValue.Element | +| 16 | Source: lang:std; crate::env::args; commandargs; ReturnValue.Element | | 17 | Summary: lang:core; ::align_to; Argument[self]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | | 18 | Summary: lang:core; ::array; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)]; taint | | 19 | Summary: lang:core; ::extend; Argument[0]; ReturnValue.Field[crate::result::Result::Ok(0)].Field[0]; taint | From 0bcee84117cbac52eb9dfbce063e4968a29a0191 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 12:33:27 +0200 Subject: [PATCH 300/372] C++: Minor textual fixes --- .../upgrade.properties | 4 ++-- .../2025-04-15-field-array-designator.md | 2 +- cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll | 23 ++++++++----------- .../upgrade.properties | 4 ++-- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties index b7e78b39ee7..42981491b82 100644 --- a/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties +++ b/cpp/downgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties @@ -1,4 +1,4 @@ -description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +description: add `hasDesignator` predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` compatibility: backwards aggregate_array_init.rel: run aggregate_array_init.qlo -aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file +aggregate_field_init.rel: run aggregate_field_init.qlo diff --git a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md index 8b4911abd44..c621bb499e3 100644 --- a/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md +++ b/cpp/ql/lib/change-notes/2025-04-15-field-array-designator.md @@ -1,4 +1,4 @@ --- category: feature --- -* Introduced `isDesignatorInit()` predicates to distinguish between designator-based and positional initializations for both struct/union fields and array elements. \ No newline at end of file +* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements. \ No newline at end of file diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll index fb79988c10f..31e2b5135b4 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Literal.qll @@ -218,20 +218,17 @@ class ClassAggregateLiteral extends AggregateLiteral { /** * Holds if the `position`-th initialization of `field` in this aggregate initializer - * uses a designator (e.g., `.x =`, `[42] =`) rather than a positional initializer. + * uses a designated (e.g., `.x = ...`) rather than a positional initializer. * - * This can be used to distinguish explicitly designated initializations from - * implicit positional ones. - * - * For example, in the initializer: + * For example, in: * ```c * struct S { int x, y; }; * struct S s = { .x = 1, 2 }; * ``` - * - `.x = 1` is a designator init, therefore `isDesignatorInit(x, 0)` holds. - * - `2` is a positional init for `.y`, therefore `isDesignatorInit(y, 1)` does **not** hold. + * - `.x = 1` is a designated initializer, therefore `hasDesignator(x, 0)` holds. + * - `2` is a positional initializer for `s.y`, therefore `hasDesignator(y, 1)` does not hold. */ - predicate isDesignatorInit(Field field, int position) { + predicate hasDesignator(Field field, int position) { field = classType.getAField() and aggregate_field_init(underlyingElement(this), _, unresolveElement(field), position, true) } @@ -330,17 +327,17 @@ class ArrayOrVectorAggregateLiteral extends AggregateLiteral { /** * Holds if the `position`-th initialization of the array element at `elementIndex` - * in this aggregate initializer uses a designator (e.g., `[0] = ...`) rather than - * an implicit positional initializer. + * in this aggregate initializer uses a designated (e.g., `[0] = ...`) rather than + * a positional initializer. * * For example, in: * ```c * int x[] = { [0] = 1, 2 }; * ``` - * - `[0] = 1` is a designator init, therefore `isDesignatorInit(0, 0)` holds. - * - `2` is a positional init for `x[1]`, therefore `isDesignatorInit(1, 1)` does **not** hold. + * - `[0] = 1` is a designated initializer, therefore `hasDesignator(0, 0)` holds. + * - `2` is a positional initializer for `x[1]`, therefore `hasDesignator(1, 1)` does not hold. */ - predicate isDesignatorInit(int elementIndex, int position) { + predicate hasDesignator(int elementIndex, int position) { aggregate_array_init(underlyingElement(this), _, elementIndex, position, true) } diff --git a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties index b7e78b39ee7..42981491b82 100644 --- a/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties +++ b/cpp/ql/lib/upgrades/0f0a390468a5eb43d1dc72937c028070b106bf53/upgrade.properties @@ -1,4 +1,4 @@ -description: add `isDesignatorInit`predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` +description: add `hasDesignator` predicate to `ArrayOrVectorAggregateLiteral` and `ClassAggregateLiteral` compatibility: backwards aggregate_array_init.rel: run aggregate_array_init.qlo -aggregate_field_init.rel: run aggregate_field_init.qlo \ No newline at end of file +aggregate_field_init.rel: run aggregate_field_init.qlo From 7f5b48d485e1dac0948b6c0aaae91572faaf97f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nora=20Dimitrijevi=C4=87?= Date: Wed, 16 Apr 2025 15:25:23 +0200 Subject: [PATCH 301/372] C#: Fix join order in ExternalFlow::interpretElement/6 (only affects RTJO mode) --- .../lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll index ccc0a333b9e..87b28b76e99 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll @@ -408,7 +408,8 @@ Declaration interpretBaseDeclaration(string namespace, string type, string name, ) } -pragma[inline] +bindingset[d, ext] +pragma[inline_late] private Declaration interpretExt(Declaration d, ExtPath ext) { ext = "" and result = d or From 3d48b234287c73144f09a0de26bf66a50b9ebcea Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:33:35 +0100 Subject: [PATCH 302/372] C++: Instantiate model generation library. --- .../modelgenerator/internal/CaptureModels.qll | 388 ++++++++++++++++++ 1 file changed, 388 insertions(+) create mode 100644 cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll new file mode 100644 index 00000000000..6439cd46749 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -0,0 +1,388 @@ +/** + * Provides predicates related to capturing summary models of the Standard or a 3rd party library. + */ + +private import cpp +private import semmle.code.cpp.dataflow.new.DataFlow +private import semmle.code.cpp.ir.IR +private import semmle.code.cpp.dataflow.ExternalFlow as ExternalFlow +private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon as DataFlowImplCommon +private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific +private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate as DataFlowPrivate +private import semmle.code.cpp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl +private import semmle.code.cpp.ir.dataflow.internal.TaintTrackingImplSpecific +private import semmle.code.cpp.dataflow.new.TaintTracking +private import codeql.mad.modelgenerator.internal.ModelGeneratorImpl + +module ModelGeneratorInput implements ModelGeneratorInputSig { + class Type = DataFlowPrivate::DataFlowType; + + // Note: This also includes `this` + class Parameter = DataFlow::ParameterNode; + + class Callable = Declaration; + + class NodeExtended extends DataFlow::Node { + Callable getAsExprEnclosingCallable() { result = this.asExpr().getEnclosingDeclaration() } + } + + Parameter asParameter(NodeExtended n) { result = n } + + Callable getEnclosingCallable(NodeExtended n) { + result = n.getEnclosingCallable().asSourceCallable() + } + + Callable getAsExprEnclosingCallable(NodeExtended n) { + result = n.asExpr().getEnclosingDeclaration() + } + + private predicate hasManualSummaryModel(Callable api) { + api = any(FlowSummaryImpl::Public::SummarizedCallable sc | sc.applyManualModel()) or + api = any(FlowSummaryImpl::Public::NeutralSummaryCallable sc | sc.hasManualModel()) + } + + private predicate hasManualSourceModel(Callable api) { + api = any(FlowSummaryImpl::Public::NeutralSourceCallable sc | sc.hasManualModel()) + } + + private predicate hasManualSinkModel(Callable api) { + api = any(FlowSummaryImpl::Public::NeutralSinkCallable sc | sc.hasManualModel()) + } + + private predicate relevant(Callable api) { api.fromSource() } + + class SummaryTargetApi extends Callable { + private Callable lift; + + SummaryTargetApi() { + lift = this and + not hasManualSummaryModel(lift) + } + + Callable lift() { result = lift } + + predicate isRelevant() { + relevant(this) and + not hasManualSummaryModel(this) + } + } + + class SourceOrSinkTargetApi extends Callable { + SourceOrSinkTargetApi() { relevant(this) } + } + + class SinkTargetApi extends SourceOrSinkTargetApi { + SinkTargetApi() { not hasManualSinkModel(this) } + } + + class SourceTargetApi extends SourceOrSinkTargetApi { + SourceTargetApi() { not hasManualSourceModel(this) } + } + + class InstanceParameterNode extends DataFlow::ParameterNode { + InstanceParameterNode() { + DataFlowPrivate::nodeHasInstruction(this, + any(InitializeParameterInstruction i | i.hasIndex(-1)), 1) + } + } + + /** + * Holds if the summary generated for `c` should also apply to overrides + * of `c`. + */ + private string isExtensible(Callable c) { + if c instanceof MemberFunction then result = "true" else result = "false" + } + + /** + * Gets the string representing the list of template parameters declared + * by `template`. + * + * `template` must either be: + * - An uninstantiated template, or + * - A declaration that is not from a template instantiation. + */ + private string templateParams(Declaration template) { + exists(string params | + params = + concat(int i | + | + template.getTemplateArgument(i).(TypeTemplateParameter).getName(), "," order by i + ) + | + if params = "" then result = "" else result = "<" + params + ">" + ) + } + + /** + * Gets the string representing the list of parameters declared + * by `functionTemplate`. + * + * `functionTemplate` must either be: + * - An uninstantiated template, or + * - A declaration that is not from a template instantiation. + */ + private string params(Function functionTemplate) { + exists(string params | + params = + concat(int i | + | + ExternalFlow::getParameterTypeWithoutTemplateArguments(functionTemplate, i, true), "," + order by + i + ) + | + if params = "" then result = "()" else result = "(" + params + ")" + ) + } + + /** + * Holds if the callable `c` is: + * - In the namespace represented by `namespace`, and + * - Has a declaring type represented by `type`, and + * - Has the name `name`, and + * - Has a list of parameters represented by `params` + * + * This is the predicate that computes the columns that it put into the MaD + * row for `callable`. + */ + private predicate qualifiedName( + Callable callable, string namespace, string type, string name, string params + ) { + exists( + Function functionTemplate, string typeWithoutTemplateArgs, string nameWithoutTemplateArgs + | + functionTemplate = ExternalFlow::getFullyTemplatedFunction(callable) and + functionTemplate.hasQualifiedName(namespace, typeWithoutTemplateArgs, nameWithoutTemplateArgs) and + nameWithoutTemplateArgs = functionTemplate.getName() and + name = nameWithoutTemplateArgs + templateParams(functionTemplate) and + params = params(functionTemplate) + | + exists(Class classTemplate | + classTemplate = functionTemplate.getDeclaringType() and + type = typeWithoutTemplateArgs + templateParams(classTemplate) + ) + or + not exists(functionTemplate.getDeclaringType()) and + type = "" + ) + } + + predicate isRelevantType(Type t) { any() } + + Type getUnderlyingContentType(DataFlow::ContentSet c) { + result = c.(DataFlow::FieldContent).getField().getUnspecifiedType() or + result = c.(DataFlow::UnionContent).getUnion().getUnspecifiedType() + } + + string qualifierString() { result = "Argument[-1]" } + + private predicate parameterContentAccessImpl(Parameter p, string argument) { + exists(int indirectionIndex, int argumentIndex, DataFlowPrivate::Position pos | + p.isSourceParameterOf(_, pos) and + pos.getArgumentIndex() = argumentIndex and + argumentIndex != -1 and // handled elsewhere + pos.getIndirectionIndex() = indirectionIndex + | + indirectionIndex = 0 and + argument = "Argument[" + argumentIndex + "]" + or + indirectionIndex > 0 and + argument = "Argument[" + DataFlow::repeatStars(indirectionIndex) + argumentIndex + "]" + ) + } + + string parameterAccess(Parameter p) { parameterContentAccessImpl(p, result) } + + string parameterContentAccess(Parameter p) { parameterContentAccessImpl(p, result) } + + bindingset[c] + string paramReturnNodeAsOutput(Callable c, DataFlowPrivate::Position pos) { + exists(Parameter p | + p.isSourceParameterOf(c, pos) and + result = parameterAccess(p) + ) + or + pos.getArgumentIndex() = -1 and + result = qualifierString() and + pos.getIndirectionIndex() = 1 + } + + bindingset[c] + string paramReturnNodeAsContentOutput(Callable c, DataFlowPrivate::ParameterPosition pos) { + result = paramReturnNodeAsOutput(c, pos) + } + + pragma[nomagic] + Callable returnNodeEnclosingCallable(DataFlow::Node ret) { + result = DataFlowImplCommon::getNodeEnclosingCallable(ret).asSourceCallable() + } + + /** Holds if this instance access is to an enclosing instance of type `t`. */ + pragma[nomagic] + private predicate isEnclosingInstanceAccess(DataFlowPrivate::ReturnNode n, Class t) { + n.getKind().isIndirectReturn(-1) and + t = n.getType().stripType() and + t != n.getEnclosingCallable().asSourceCallable().(Function).getDeclaringType() + } + + pragma[nomagic] + predicate isOwnInstanceAccessNode(DataFlowPrivate::ReturnNode node) { + node.getKind().isIndirectReturn(-1) and + not isEnclosingInstanceAccess(node, _) + } + + predicate sinkModelSanitizer(DataFlow::Node node) { none() } + + predicate apiSource(DataFlow::Node source) { + DataFlowPrivate::nodeHasOperand(source, any(DataFlow::FieldAddress fa), 1) + or + source instanceof DataFlow::ParameterNode + } + + string getInputArgument(DataFlow::Node source) { + exists(DataFlowPrivate::Position pos, int argumentIndex, int indirectionIndex | + source.(DataFlow::ParameterNode).isParameterOf(_, pos) and + argumentIndex = pos.getArgumentIndex() and + indirectionIndex = pos.getIndirectionIndex() and + result = "Argument[" + DataFlow::repeatStars(indirectionIndex) + argumentIndex + "]" + ) + or + DataFlowPrivate::nodeHasOperand(source, any(DataFlow::FieldAddress fa), 1) and + result = qualifierString() + } + + string getReturnValueString(DataFlowPrivate::ReturnKind k) { + k.isNormalReturn() and + exists(int indirectionIndex | indirectionIndex = k.getIndirectionIndex() | + indirectionIndex = 0 and + result = "ReturnValue" + or + indirectionIndex > 0 and + result = "ReturnValue[" + DataFlow::repeatStars(indirectionIndex) + "]" + ) + } + + predicate irrelevantSourceSinkApi(Callable source, SourceTargetApi api) { none() } + + bindingset[kind] + predicate isRelevantSourceKind(string kind) { any() } + + bindingset[kind] + predicate isRelevantSinkKind(string kind) { any() } + + predicate containerContent(DataFlow::ContentSet cs) { cs instanceof DataFlow::ElementContent } + + predicate isAdditionalContentFlowStep(DataFlow::Node node1, DataFlow::Node node2) { + TaintTracking::defaultAdditionalTaintStep(node1, node2, _) and + not exists(DataFlow::Content f | + DataFlowPrivate::readStep(node1, f, node2) and containerContent(f) + ) + } + + predicate isField(DataFlow::ContentSet cs) { + exists(DataFlow::Content c | cs.isSingleton(c) | + c instanceof DataFlow::FieldContent or + c instanceof DataFlow::UnionContent + ) + } + + predicate isCallback(DataFlow::ContentSet c) { none() } + + string getSyntheticName(DataFlow::ContentSet c) { + exists(Field f | + not f.isPublic() and + f = c.(DataFlow::FieldContent).getField() and + result = f.getName() + ) + } + + string printContent(DataFlow::ContentSet c) { + exists(int indirectionIndex, string name, string kind | + exists(DataFlow::UnionContent uc | + c.isSingleton(uc) and + name = uc.getUnion().getName() and + indirectionIndex = uc.getIndirectionIndex() and + // Note: We don't actually support the union string in MaD, but we should do that eventually + kind = "Union[" + ) + or + exists(DataFlow::FieldContent fc | + c.isSingleton(fc) and + name = fc.getField().getName() and + indirectionIndex = fc.getIndirectionIndex() and + kind = "Field[" + ) + | + result = kind + DataFlow::repeatStars(indirectionIndex) + name + "]" + ) + or + exists(DataFlow::ElementContent ec | + c.isSingleton(ec) and + result = "Element[" + ec.getIndirectionIndex() + "]" + ) + } + + /** + * Holds if `f` is a "private" function. + * + * A "private" function does not contribute any models as it is assumed + * to be an implementation detail of some other "public" function for which + * we will generate a summary. + */ + private predicate isPrivate(Function f) { + f.getNamespace().getParentNamespace*().isAnonymous() + or + f.(MemberFunction).isPrivate() + or + f.isStatic() + } + + predicate isUninterestingForDataFlowModels(Callable api) { + // Note: This also makes all global/static-local variables + // uninteresting (which is good!) + not api.(Function).hasDefinition() + or + isPrivate(api) + or + api instanceof Destructor + or + api = any(LambdaExpression lambda).getLambdaFunction() + or + api.isFromUninstantiatedTemplate(_) + } + + predicate isUninterestingForHeuristicDataFlowModels(Callable api) { + isUninterestingForDataFlowModels(api) + } + + string partialModelRow(Callable api, int i) { + i = 0 and qualifiedName(api, result, _, _, _) // namespace + or + i = 1 and qualifiedName(api, _, result, _, _) // type + or + i = 2 and result = isExtensible(api) // extensible + or + i = 3 and qualifiedName(api, _, _, result, _) // name + or + i = 4 and qualifiedName(api, _, _, _, result) // parameters + or + i = 5 and result = "" and exists(api) // ext + } + + string partialNeutralModelRow(Callable api, int i) { + i = 0 and qualifiedName(api, result, _, _, _) // namespace + or + i = 1 and qualifiedName(api, _, result, _, _) // type + or + i = 2 and qualifiedName(api, _, _, result, _) // name + or + i = 3 and qualifiedName(api, _, _, _, result) // parameters + } + + predicate sourceNode = ExternalFlow::sourceNode/2; + + predicate sinkNode = ExternalFlow::sinkNode/2; +} + +import MakeModelGenerator From f241e4b53740be97a5fd5977bacf5ed41a0e415e Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:34:09 +0100 Subject: [PATCH 303/372] C++: Add tests that will soon succeed. --- .../modelgenerator/dataflow/summaries.cpp | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp new file mode 100644 index 00000000000..3f401812859 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -0,0 +1,130 @@ +using size_t = decltype(sizeof(int)); + +size_t strlen(const char* str); +char* strcpy(char* dest, const char* src); + +namespace Models { + struct BasicFlow { + int* tainted; + + //No model as destructors are excluded from model generation. + ~BasicFlow() = default; + + //summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnThis;(int *);;Argument[-1];ReturnValue[*];value;dfc-generated + BasicFlow* returnThis(int* input) { + return this; + } + + //summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[0];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParam0;(int *,int *);;Argument[*0];ReturnValue[*];value;dfc-generated + int* returnParam0(int* input0, int* input1) { + return input0; + } + + //summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[1];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParam1;(int *,int *);;Argument[*1];ReturnValue[*];value;dfc-generated + int* returnParam1(int* input0, int* input1) { + return input1; + } + + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];taint;df-generated + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*2];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[1];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*1];ReturnValue[*];value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[2];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnParamMultiple;(bool,int *,int *);;Argument[*2];ReturnValue[*];value;dfc-generated + int* returnParamMultiple(bool b, int* input0, int* input1) { + return b ? input0 : input1; + } + + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];Argument[*1];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];Argument[*1];taint;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[0];ReturnValue[*];taint;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];ReturnValue[*];value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[1];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnSubstring;(const char *,char *);;Argument[*0];Argument[*1];value;dfc-generated + char* returnSubstring(const char* source, char* dest) { + return strcpy(dest, source + 1); + } + + //summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1];taint;df-generated + //summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;setField;(int *);;Argument[0];Argument[-1].Field[*tainted];value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;setField;(int *);;Argument[*0];Argument[-1].Field[**tainted];value;dfc-generated + void setField(int* s) { + tainted = s; + } + + //summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue;taint;df-generated + //summary=Models;BasicFlow;true;returnField;();;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;BasicFlow;true;returnField;();;Argument[-1].Field[*tainted];ReturnValue;value;dfc-generated + //contentbased-summary=Models;BasicFlow;true;returnField;();;Argument[-1].Field[**tainted];ReturnValue[*];value;dfc-generated + int* returnField() { + return tainted; + } + }; + + template + struct TemplatedFlow { + T tainted; + + //summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnThis;(T);;Argument[-1];ReturnValue[*];value;dfc-generated + TemplatedFlow* template_returnThis(T input) { + return this; + } + + //summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;taint;df-generated + //summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[0];ReturnValue;value;dfc-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnParam0;(T *,T *);;Argument[*0];ReturnValue[*];value;dfc-generated + T* template_returnParam0(T* input0, T* input1) { + return input0; + } + + //summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_setField;(T);;Argument[0];Argument[-1].Field[*tainted];value;dfc-generated + void template_setField(T s) { + tainted = s; + } + + //summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;template_returnField;();;Argument[-1].Field[*tainted];ReturnValue[*];value;dfc-generated + T& template_returnField() { + return tainted; + } + + //summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;taint;df-generated + //summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];taint;df-generated + //contentbased-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[0];ReturnValue;value;dfc-generated + //contentbased-summary=Models;TemplatedFlow;true;templated_function;(U *,T *);;Argument[*0];ReturnValue[*];value;dfc-generated + template + U* templated_function(U* u, T* t) { + return u; + } + }; + + void test_templated_flow() { + // Ensure that we have an instantiation of the templated class + TemplatedFlow intFlow; + intFlow.template_returnThis(0); + + intFlow.template_returnParam0(nullptr, nullptr); + + intFlow.template_setField(0); + intFlow.template_returnField(); + + intFlow.templated_function(nullptr, nullptr); + } +} \ No newline at end of file From 09ebd6e87dcf8f9f66f96b8854247f814d1d1be0 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:34:57 +0100 Subject: [PATCH 304/372] C++: Instantiate inline expectation test framework to test model generation. --- cpp/ql/lib/utils/test/InlineMadTest.qll | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cpp/ql/lib/utils/test/InlineMadTest.qll diff --git a/cpp/ql/lib/utils/test/InlineMadTest.qll b/cpp/ql/lib/utils/test/InlineMadTest.qll new file mode 100644 index 00000000000..599dfec7d86 --- /dev/null +++ b/cpp/ql/lib/utils/test/InlineMadTest.qll @@ -0,0 +1,34 @@ +private import cpp +private import codeql.mad.test.InlineMadTest + +class MadRelevantFunction extends Function { + MadRelevantFunction() { not this.isFromUninstantiatedTemplate(_) } +} + +private module InlineMadTestLang implements InlineMadTestLangSig { + class Callable = MadRelevantFunction; + + /** + * Holds if `c` is the closest `Callable` that suceeds `comment` in the file. + */ + private predicate hasClosestCallable(CppStyleComment comment, Callable c) { + c = + min(Callable cand, int dist | + // This has no good join order, but should hopefully be good enough for tests. + cand.getFile() = comment.getFile() and + dist = cand.getLocation().getStartLine() - comment.getLocation().getStartLine() and + dist > 0 + | + cand order by dist + ) + } + + string getComment(Callable c) { + exists(CppStyleComment comment | + hasClosestCallable(comment, c) and + result = comment.getContents().suffix(2) + ) + } +} + +import InlineMadTestImpl From 1465058da0610015f43b4f9cd37bf9b0ac628a3a Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 19:36:36 +0100 Subject: [PATCH 305/372] C++: Add copy-pasted files from C#. --- .../modelgenerator/CaptureContentSummaryModels.ql | 13 +++++++++++++ .../modelgenerator/CaptureMixedNeutralModels.ql | 13 +++++++++++++ .../modelgenerator/CaptureMixedSummaryModels.ql | 13 +++++++++++++ .../utils/modelgenerator/CaptureNeutralModels.ql | 13 +++++++++++++ .../src/utils/modelgenerator/CaptureSinkModels.ql | 13 +++++++++++++ .../utils/modelgenerator/CaptureSourceModels.ql | 13 +++++++++++++ .../utils/modelgenerator/CaptureSummaryModels.ql | 13 +++++++++++++ .../src/utils/modelgenerator/GenerateFlowModel.py | 15 +++++++++++++++ .../internal/CaptureModelsPrinting.qll | 13 +++++++++++++ .../dataflow/CaptureContentSummaryModels.expected | 2 ++ .../dataflow/CaptureContentSummaryModels.ext.yml | 6 ++++++ .../dataflow/CaptureContentSummaryModels.ql | 11 +++++++++++ .../dataflow/CaptureSummaryModels.expected | 2 ++ .../dataflow/CaptureSummaryModels.ext.yml | 6 ++++++ .../dataflow/CaptureSummaryModels.ql | 11 +++++++++++ 15 files changed, 157 insertions(+) create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql create mode 100644 cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py create mode 100644 cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml create mode 100644 cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql diff --git a/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql new file mode 100644 index 00000000000..8dc0c3d7f6b --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture content based summary models. + * @description Finds applicable content based summary models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/contentbased-summary-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string flow +where flow = ContentSensitive::captureFlow(api, _) +select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql new file mode 100644 index 00000000000..d03fa1b6030 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureMixedNeutralModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture mixed neutral models. + * @description Finds neutral models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/mixed-neutral-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string noflow +where noflow = captureMixedNeutral(api) +select noflow order by noflow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql new file mode 100644 index 00000000000..dc289a07ab1 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureMixedSummaryModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture mixed summary models. + * @description Finds applicable summary models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/mixed-summary-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string flow +where flow = captureMixedFlow(api, _) +select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql new file mode 100644 index 00000000000..8a244cabe86 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture neutral models. + * @description Finds neutral models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/neutral-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string noflow +where noflow = captureNoFlow(api) +select noflow order by noflow diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql new file mode 100644 index 00000000000..8cbcac192a2 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture sink models. + * @description Finds public methods that act as sinks as they flow into a known sink. + * @kind diagnostic + * @id cpp/utils/modelgenerator/sink-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSinkTargetApi api, string sink +where sink = captureSink(api) +select sink order by sink diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql new file mode 100644 index 00000000000..b4614634ce6 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture source models. + * @description Finds APIs that act as sources as they expose already known sources. + * @kind diagnostic + * @id cpp/utils/modelgenerator/source-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSourceTargetApi api, string source +where source = captureSource(api) +select source order by source diff --git a/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql b/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql new file mode 100644 index 00000000000..ba692135172 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql @@ -0,0 +1,13 @@ +/** + * @name Capture summary models. + * @description Finds applicable summary models to be used by other queries. + * @kind diagnostic + * @id cpp/utils/modelgenerator/summary-models + * @tags modelgenerator + */ + +import internal.CaptureModels + +from DataFlowSummaryTargetApi api, string flow +where flow = captureFlow(api) +select flow order by flow diff --git a/cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py b/cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py new file mode 100644 index 00000000000..38bbaad118b --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/GenerateFlowModel.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import sys +import os.path +import subprocess + +# Add Model as Data script directory to sys.path. +gitroot = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip() +madpath = os.path.join(gitroot, "misc/scripts/models-as-data/") +sys.path.append(madpath) + +import generate_flow_model as model + +language = "cpp" +model.Generator.make(language).run() diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll new file mode 100644 index 00000000000..7841f8ed1a4 --- /dev/null +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModelsPrinting.qll @@ -0,0 +1,13 @@ +private import cpp as Cpp +private import codeql.mad.modelgenerator.internal.ModelPrinting +private import CaptureModels::ModelGeneratorInput as ModelGeneratorInput + +private module ModelPrintingLang implements ModelPrintingLangSig { + class Callable = Cpp::Declaration; + + predicate partialModelRow = ModelGeneratorInput::partialModelRow/2; + + predicate partialNeutralModelRow = ModelGeneratorInput::partialNeutralModelRow/2; +} + +import ModelPrintingImpl diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected new file mode 100644 index 00000000000..cb6fc390349 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.expected @@ -0,0 +1,2 @@ +unexpectedModel +expectedModel diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml new file mode 100644 index 00000000000..10a8a069808 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ext.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: + - [ "models", "ManuallyModelled", False, "hasSummary", "(void *)", "", "Argument[0]", "ReturnValue", "value", "manual"] diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql new file mode 100644 index 00000000000..22f1ba66b52 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql @@ -0,0 +1,11 @@ +import cpp +import utils.modelgenerator.internal.CaptureModels +import utils.test.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel(MadRelevantFunction c) { result = ContentSensitive::captureFlow(c, _) } + + string getKind() { result = "contentbased-summary" } +} + +import InlineMadTest diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected new file mode 100644 index 00000000000..cb6fc390349 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.expected @@ -0,0 +1,2 @@ +unexpectedModel +expectedModel diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml new file mode 100644 index 00000000000..44d895bc7e0 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ext.yml @@ -0,0 +1,6 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: + - [ "Models", "ManuallyModelled", False, "hasSummary", "(void *)", "", "Argument[0]", "ReturnValue", "value", "manual"] diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql new file mode 100644 index 00000000000..630acc295b3 --- /dev/null +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql @@ -0,0 +1,11 @@ +import cpp +import utils.modelgenerator.internal.CaptureModels +import utils.test.InlineMadTest + +module InlineMadTestConfig implements InlineMadTestConfigSig { + string getCapturedModel(MadRelevantFunction c) { result = captureFlow(c) } + + string getKind() { result = "summary" } +} + +import InlineMadTest From 1f43e51be426caeb850bc80e4554bbb880f15e28 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 11 Apr 2025 20:01:31 +0100 Subject: [PATCH 306/372] C++: Fix ql-for-ql findings. --- cpp/ql/lib/utils/test/InlineMadTest.qll | 2 +- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cpp/ql/lib/utils/test/InlineMadTest.qll b/cpp/ql/lib/utils/test/InlineMadTest.qll index 599dfec7d86..4fbfa793fff 100644 --- a/cpp/ql/lib/utils/test/InlineMadTest.qll +++ b/cpp/ql/lib/utils/test/InlineMadTest.qll @@ -9,7 +9,7 @@ private module InlineMadTestLang implements InlineMadTestLangSig { class Callable = MadRelevantFunction; /** - * Holds if `c` is the closest `Callable` that suceeds `comment` in the file. + * Holds if `c` is the closest `Callable` that succeeds `comment` in the file. */ private predicate hasClosestCallable(CppStyleComment comment, Callable c) { c = diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 6439cd46749..d33786b2b30 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -3,7 +3,6 @@ */ private import cpp -private import semmle.code.cpp.dataflow.new.DataFlow private import semmle.code.cpp.ir.IR private import semmle.code.cpp.dataflow.ExternalFlow as ExternalFlow private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon as DataFlowImplCommon From 5462dcdf75ffe214c3e5d20c617e80b861156c1d Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 14 Apr 2025 18:02:47 +0100 Subject: [PATCH 307/372] C++: Make final member functions not extensible. --- .../src/utils/modelgenerator/internal/CaptureModels.qll | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index d33786b2b30..c8ddaf465e7 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -85,12 +85,18 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Mon, 14 Apr 2025 18:03:13 +0100 Subject: [PATCH 308/372] Remove an unnecessary if. --- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index c8ddaf465e7..501da3f1d88 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -135,9 +135,8 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Fri, 18 Apr 2025 15:55:28 +0100 Subject: [PATCH 309/372] C++: Add another entry to 'qlpack' for external models. --- cpp/ql/lib/qlpack.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index faa1d6c3d6a..cc728434ef2 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -16,6 +16,7 @@ dependencies: codeql/xml: ${workspace} dataExtensions: - ext/*.model.yml + - ext/generated/*.model.yml - ext/deallocation/*.model.yml - ext/allocation/*.model.yml warnOnImplicitThis: true From e55f94c364febba8712e34cd2c4b3c362f3ad175 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 18 Apr 2025 16:08:07 +0100 Subject: [PATCH 310/372] C++: Move contents of 'isUninterestingForDataFlowModels' to 'relevant' --- .../modelgenerator/internal/CaptureModels.qll | 72 +++++++++++-------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index 501da3f1d88..ed2f1a32203 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -35,6 +35,9 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Fri, 18 Apr 2025 16:08:39 +0100 Subject: [PATCH 311/372] C++: Also make protected members irrelevant. --- cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll index ed2f1a32203..e6bbfe1e5c9 100644 --- a/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll +++ b/cpp/ql/src/utils/modelgenerator/internal/CaptureModels.qll @@ -58,7 +58,7 @@ module ModelGeneratorInput implements ModelGeneratorInputSig Date: Fri, 18 Apr 2025 16:14:22 +0100 Subject: [PATCH 312/372] C++: Add more tests. --- .../modelgenerator/dataflow/summaries.cpp | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp index 3f401812859..d72d417e49f 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -127,4 +127,57 @@ namespace Models { intFlow.templated_function(nullptr, nullptr); } -} \ No newline at end of file +} + +//summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;df-generated +//summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;taint;df-generated +//contentbased-summary=;;true;toplevel_function;(int *);;Argument[0];ReturnValue;taint;dfc-generated +//contentbased-summary=;;true;toplevel_function;(int *);;Argument[*0];ReturnValue;value;dfc-generated +int toplevel_function(int* p) { + return *p; +} + +//No model as static functions are excluded from model generation. +static int static_toplevel_function(int* p) { + return *p; +} + +struct NonFinalStruct { + //summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;NonFinalStruct;true;public_not_final_member_function;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_not_final_member_function(int x) { + return x; + } + + //summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;NonFinalStruct;false;public_final_member_function;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_final_member_function(int x) final { + return x; + } + +private: + //No model as private members are excluded from model generation. + int private_member_function(int x) { + return x; + } + +protected: + //No model as protected members are excluded from model generation. + int protected_member_function(int x) { + return x; + } +}; + +struct FinalStruct final { + //summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;FinalStruct;false;public_not_final_member_function_2;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_not_final_member_function_2(int x) { + return x; + } + + //summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;taint;df-generated + //contentbased-summary=;FinalStruct;false;public_final_member_function_2;(int);;Argument[0];ReturnValue;value;dfc-generated + virtual int public_final_member_function_2(int x) final { + return x; + } +}; \ No newline at end of file From 3fd760c6325212ed234d1a64787684da1f22394c Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Fri, 18 Apr 2025 16:42:01 +0100 Subject: [PATCH 313/372] C++: Move 'InlineMadTest.qll' out of 'lib/utils/test' and into 'test' since C++ has no external packs depending on MaD testing. --- .../modelgenerator/dataflow/CaptureContentSummaryModels.ql | 2 +- .../dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql | 2 +- .../modelgenerator/dataflow/InlineModelsAsDataTest.qll} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename cpp/ql/{lib/utils/test/InlineMadTest.qll => test/library-tests/dataflow/modelgenerator/dataflow/InlineModelsAsDataTest.qll} (100%) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql index 22f1ba66b52..0156eaaeb98 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureContentSummaryModels.ql @@ -1,6 +1,6 @@ import cpp import utils.modelgenerator.internal.CaptureModels -import utils.test.InlineMadTest +import InlineModelsAsDataTest module InlineMadTestConfig implements InlineMadTestConfigSig { string getCapturedModel(MadRelevantFunction c) { result = ContentSensitive::captureFlow(c, _) } diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql index 630acc295b3..65ec6060e87 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/CaptureSummaryModels.ql @@ -1,6 +1,6 @@ import cpp import utils.modelgenerator.internal.CaptureModels -import utils.test.InlineMadTest +import InlineModelsAsDataTest module InlineMadTestConfig implements InlineMadTestConfigSig { string getCapturedModel(MadRelevantFunction c) { result = captureFlow(c) } diff --git a/cpp/ql/lib/utils/test/InlineMadTest.qll b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/InlineModelsAsDataTest.qll similarity index 100% rename from cpp/ql/lib/utils/test/InlineMadTest.qll rename to cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/InlineModelsAsDataTest.qll From 2b9160526a7bccc904f5108a10a302aefbc4a119 Mon Sep 17 00:00:00 2001 From: Jami <57204504+jcogs33@users.noreply.github.com> Date: Sun, 20 Apr 2025 21:47:25 -0400 Subject: [PATCH 314/372] Apply docs review suggestion Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- .../Undesirable Calls/DoNotCallFinalize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md index d6fd5cf76bd..385cbfb5cfe 100644 --- a/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md +++ b/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.md @@ -1,6 +1,6 @@ ## Overview -Triggering garbage collection by directly calling `finalize()` may either have no effect or may trigger unnecessary garbage collection, leading to erratic behavior, performance issues, or deadlock. +Triggering garbage collection by directly calling `finalize()` may either have no effect or trigger unnecessary garbage collection, leading to erratic behavior, performance issues, or deadlock. ## Recommendation From 07a694e804af154191de208820a9d41a70ec66cf Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 21 Apr 2025 09:52:52 -0400 Subject: [PATCH 315/372] Java: add new query to java-code-quality.qls.expected --- .../java/query-suite/java-code-quality.qls.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected index 2cff4a3eaa6..835e2bd3ee9 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -5,6 +5,7 @@ ql/java/ql/src/Likely Bugs/Comparison/IncomparableEquals.ql ql/java/ql/src/Likely Bugs/Comparison/InconsistentEqualsHashCode.ql ql/java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql ql/java/ql/src/Likely Bugs/Comparison/RefEqBoxed.ql +ql/java/ql/src/Likely Bugs/Frameworks/JUnit/JUnit5MissingNestedAnnotation.ql ql/java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql From 3aa6b49204d2acd38ba026de88afa9b202f91ee5 Mon Sep 17 00:00:00 2001 From: Jami Cogswell Date: Mon, 21 Apr 2025 10:02:08 -0400 Subject: [PATCH 316/372] Java: Add new query to java-code-quality.qls.expected --- .../java/query-suite/java-code-quality.qls.expected | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected index 2cff4a3eaa6..bdd51d7eee6 100644 --- a/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected +++ b/java/ql/integration-tests/java/query-suite/java-code-quality.qls.expected @@ -10,3 +10,4 @@ ql/java/ql/src/Likely Bugs/Likely Typos/SuspiciousDateFormat.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseReader.ql ql/java/ql/src/Likely Bugs/Resource Leaks/CloseWriter.ql ql/java/ql/src/Performance/StringReplaceAllWithNonRegex.ql +ql/java/ql/src/Violations of Best Practice/Undesirable Calls/DoNotCallFinalize.ql From ce5c48192ea33e167784deb132b1564fb20c05c6 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 10:41:12 +0200 Subject: [PATCH 317/372] Swift: Make file checking in tests more strict With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests. --- swift/ql/test/TestUtils.qll | 3 ++- swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql | 2 +- swift/ql/test/library-tests/elements/decl/function/function.ql | 2 +- .../library-tests/elements/type/nominaltype/nominaltype.ql | 2 +- .../library-tests/elements/type/nominaltype/nominaltypedecl.ql | 2 +- .../library-tests/elements/type/numerictype/numerictype.ql | 2 +- .../library-tests/elements/type/pointertypes/pointertypes.ql | 2 +- swift/ql/test/query-tests/Diagnostics/Info.ql | 1 + 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/swift/ql/test/TestUtils.qll b/swift/ql/test/TestUtils.qll index f1f47eda808..9b5429f8ba9 100644 --- a/swift/ql/test/TestUtils.qll +++ b/swift/ql/test/TestUtils.qll @@ -6,7 +6,8 @@ import codeql.swift.elements.expr.internal.DotSyntaxCallExpr cached predicate toBeTested(Element e) { - e instanceof File + e instanceof File and + (exists(e.(File).getRelativePath()) or e instanceof UnknownFile) or e instanceof ParameterizedProtocolType or diff --git a/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql b/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql index dba88e6009d..5e4c0c6035f 100644 --- a/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql +++ b/swift/ql/test/library-tests/elements/decl/enumdecl/enumdecl.ql @@ -21,5 +21,5 @@ string describe(Decl d) { } from Decl d -where d.getLocation().getFile().getName() != "" +where exists(d.getLocation().getFile().getRelativePath()) select d, strictconcat(describe(d), ", ") diff --git a/swift/ql/test/library-tests/elements/decl/function/function.ql b/swift/ql/test/library-tests/elements/decl/function/function.ql index 9468929d194..fbd47a20f4b 100644 --- a/swift/ql/test/library-tests/elements/decl/function/function.ql +++ b/swift/ql/test/library-tests/elements/decl/function/function.ql @@ -27,6 +27,6 @@ string describe(Function f) { from Function f where - not f.getFile() instanceof UnknownFile and + exists(f.getFile().getRelativePath()) and not f.getName().matches("%init%") select f, concat(describe(f), ", ") diff --git a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql index 713e471d15f..68a0184cdcd 100644 --- a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql +++ b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltype.ql @@ -16,7 +16,7 @@ string describe(Type t) { from VarDecl v, Type t where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and not v.getName() = "self" and t = v.getType() select v, t.toString(), concat(describe(t), ", ") diff --git a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql index 83fb434a7f7..cec74fbf392 100644 --- a/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql +++ b/swift/ql/test/library-tests/elements/type/nominaltype/nominaltypedecl.ql @@ -14,7 +14,7 @@ string describe(TypeDecl td) { from VarDecl v, TypeDecl td where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and not v.getName() = "self" and ( td = v.getType().(NominalType).getDeclaration() or diff --git a/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql b/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql index 7f3fb4591f8..73f11673a5f 100644 --- a/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql +++ b/swift/ql/test/library-tests/elements/type/numerictype/numerictype.ql @@ -14,6 +14,6 @@ string describe(Type t) { from VarDecl v, Type t where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and t = v.getType() select v, t.toString(), concat(describe(t), ", ") diff --git a/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql b/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql index fe0157fa6c7..9232b24167c 100644 --- a/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql +++ b/swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql @@ -22,6 +22,6 @@ string describe(Type t) { from VarDecl v, Type t where - v.getLocation().getFile().getBaseName() != "" and + exists(v.getLocation().getFile().getRelativePath()) and t = v.getType() select v, t.toString(), strictconcat(describe(t), ", ") diff --git a/swift/ql/test/query-tests/Diagnostics/Info.ql b/swift/ql/test/query-tests/Diagnostics/Info.ql index 765ee15c737..dd7e316c877 100644 --- a/swift/ql/test/query-tests/Diagnostics/Info.ql +++ b/swift/ql/test/query-tests/Diagnostics/Info.ql @@ -3,4 +3,5 @@ import swift string describe(File f) { (f.isSuccessfullyExtracted() and result = "isSuccessfullyExtracted") } from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f, concat(f.getRelativePath(), ", "), concat(describe(f), ", ") From ae5ac11387e33f2fa6f2744b7922574f5e067e29 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 22 Apr 2025 12:15:22 +0200 Subject: [PATCH 318/372] Shared: Fix join in `FileSystem.qll` Before ``` Evaluated relational algebra for predicate FileSystem::Folder::Append::appendStep/3#bed54f6d@d2a7eeoa on iteration 2 running pipeline standard with tuple counts: 120 ~2% {4} r1 = SCAN `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev_delta` OUTPUT In.1, In.0, In.2, In.3 0 ~0% {6} r2 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#1` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 0 ~0% {4} | SCAN OUTPUT In.2, In.0, In.1, In.4 91 ~3% {6} r3 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 81 ~0% {4} | SCAN OUTPUT In.4, In.0, In.1, In.2 81 ~3% {4} | JOIN WITH containerparent_10#join_rhs ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2, Rhs.1 269 ~0% {7} r4 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#2` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Rhs.2, Lhs.1, Lhs.2, Lhs.3, _ {7} | REWRITE WITH Tmp.6 := 1, Out.6 := (InOut.1 - Tmp.6), TEST Out.6 = InOut.4 39 ~1% {5} | SCAN OUTPUT In.5, In.0, In.1, In.2, In.3 1295 ~0% {6} | JOIN WITH containerparent ON FIRST 1 OUTPUT Rhs.1, Lhs.3, _, Lhs.1, Lhs.2, Lhs.4 1295 ~0% {6} | REWRITE WITH Out.2 := 1 34 ~1% {4} | JOIN WITH `cached_FileSystem::Container.splitAbsolutePath/2#dispred#dc97b0cc` ON FIRST 3 OUTPUT Lhs.5, Lhs.3, Lhs.4, Lhs.0 115 ~0% {4} r5 = r2 UNION r3 UNION r4 115 ~0% {4} | AND NOT `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev`(FIRST 4) return r5 ``` After ``` Evaluated relational algebra for predicate FileSystem::Folder::Append::appendStep/3#bed54f6d@4fb6e6v7 on iteration 2 running pipeline standard with tuple counts: 120 ~0% {4} r1 = SCAN `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev_delta` OUTPUT In.1, In.0, In.2, In.3 0 ~0% {6} r2 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#1` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 0 ~0% {4} | SCAN OUTPUT In.2, In.0, In.1, In.4 91 ~0% {6} r3 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Lhs.1, Lhs.2, Lhs.3, _ {6} | REWRITE WITH Tmp.5 := 1, Out.5 := (InOut.1 - Tmp.5), TEST Out.5 = InOut.3 81 ~0% {4} | SCAN OUTPUT In.4, In.0, In.1, In.2 81 ~5% {4} | JOIN WITH containerparent_10#join_rhs ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2, Rhs.1 269 ~0% {7} r4 = JOIN r1 WITH `_FileSystem::Folder::Append::getComponent/2#a6e36a04#join_rhs#2` ON FIRST 1 OUTPUT Lhs.0, Rhs.1, Rhs.2, Lhs.1, Lhs.2, Lhs.3, _ {7} | REWRITE WITH Tmp.6 := 1, Out.6 := (InOut.1 - Tmp.6), TEST Out.6 = InOut.4 39 ~3% {5} | SCAN OUTPUT In.5, In.2, In.0, In.1, In.3 34 ~0% {4} | JOIN WITH `FileSystem::Folder::Append::getAChildContainer/2#2e91feca` ON FIRST 2 OUTPUT Lhs.4, Lhs.2, Lhs.3, Rhs.2 115 ~2% {4} r5 = r2 UNION r3 UNION r4 115 ~2% {4} | AND NOT `FileSystem::Folder::Append::appendStep/3#bed54f6d#prev`(FIRST 4) return r5 ``` --- shared/util/codeql/util/FileSystem.qll | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/shared/util/codeql/util/FileSystem.qll b/shared/util/codeql/util/FileSystem.qll index ea58db929c5..8eb372e0c24 100644 --- a/shared/util/codeql/util/FileSystem.qll +++ b/shared/util/codeql/util/FileSystem.qll @@ -239,6 +239,12 @@ module Make { result = 0 } + pragma[nomagic] + private Container getAChildContainer(Container c, string baseName) { + result = c.getAChildContainer() and + baseName = result.getBaseName() + } + pragma[nomagic] private Container appendStep(Folder f, string relativePath, int i) { i = -1 and @@ -253,10 +259,7 @@ module Make { else if comp = "." then result = mid - else ( - result = mid.getAChildContainer() and - result.getBaseName() = comp - ) + else result = getAChildContainer(mid, comp) ) } From a211998bc9b3940ac922d9f554c09515b3bdd8ff Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 13:52:15 +0200 Subject: [PATCH 319/372] Swift: Make file checking in integration tests more strict With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests. --- .../autobuilder/xcode-fails-spm-works/Files.ql | 1 + swift/ql/integration-tests/osx/canonical-case/Files.ql | 1 + swift/ql/integration-tests/osx/hello-ios/Files.ql | 1 + swift/ql/integration-tests/osx/hello-xcode/Files.ql | 1 + swift/ql/integration-tests/posix/cross-references/Classes.ql | 4 +++- .../posix/cross-references/Deinitializers.ql | 4 +++- swift/ql/integration-tests/posix/cross-references/Enums.ql | 4 +++- .../ql/integration-tests/posix/cross-references/Functions.ql | 4 +++- .../integration-tests/posix/cross-references/Initializers.ql | 4 +++- .../ql/integration-tests/posix/cross-references/Protocols.ql | 4 +++- swift/ql/integration-tests/posix/cross-references/Structs.ql | 4 +++- swift/ql/integration-tests/posix/cross-references/VarDecls.ql | 4 +++- .../ql/integration-tests/posix/frontend-invocations/Files.ql | 1 + swift/ql/integration-tests/posix/hello-world/test.ql | 1 + swift/ql/integration-tests/posix/symlinks/Files.ql | 1 + 15 files changed, 31 insertions(+), 8 deletions(-) diff --git a/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql b/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql +++ b/swift/ql/integration-tests/autobuilder/xcode-fails-spm-works/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/osx/canonical-case/Files.ql b/swift/ql/integration-tests/osx/canonical-case/Files.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/osx/canonical-case/Files.ql +++ b/swift/ql/integration-tests/osx/canonical-case/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/osx/hello-ios/Files.ql b/swift/ql/integration-tests/osx/hello-ios/Files.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/osx/hello-ios/Files.ql +++ b/swift/ql/integration-tests/osx/hello-ios/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/osx/hello-xcode/Files.ql b/swift/ql/integration-tests/osx/hello-xcode/Files.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/osx/hello-xcode/Files.ql +++ b/swift/ql/integration-tests/osx/hello-xcode/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/posix/cross-references/Classes.ql b/swift/ql/integration-tests/posix/cross-references/Classes.ql index dbdbcb723b9..d3c0d759de6 100644 --- a/swift/ql/integration-tests/posix/cross-references/Classes.ql +++ b/swift/ql/integration-tests/posix/cross-references/Classes.ql @@ -1,5 +1,7 @@ import swift from ClassDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql b/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql index b9291948718..9180f63667f 100644 --- a/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql +++ b/swift/ql/integration-tests/posix/cross-references/Deinitializers.ql @@ -1,5 +1,7 @@ import swift from Deinitializer d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Enums.ql b/swift/ql/integration-tests/posix/cross-references/Enums.ql index 5417ec05610..ebfcaafa0ef 100644 --- a/swift/ql/integration-tests/posix/cross-references/Enums.ql +++ b/swift/ql/integration-tests/posix/cross-references/Enums.ql @@ -1,5 +1,7 @@ import swift from EnumDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Functions.ql b/swift/ql/integration-tests/posix/cross-references/Functions.ql index d166c2a51ec..50b9393d953 100644 --- a/swift/ql/integration-tests/posix/cross-references/Functions.ql +++ b/swift/ql/integration-tests/posix/cross-references/Functions.ql @@ -1,5 +1,7 @@ import codeql.swift.elements.decl.internal.AccessorOrNamedFunction from AccessorOrNamedFunction f -where f.getLocation().getFile().getBaseName() != "Package.swift" +where + f.getLocation().getFile().getBaseName() != "Package.swift" and + exists(f.getLocation().getFile().getRelativePath()) select f diff --git a/swift/ql/integration-tests/posix/cross-references/Initializers.ql b/swift/ql/integration-tests/posix/cross-references/Initializers.ql index 74398846417..c9b5a4e136b 100644 --- a/swift/ql/integration-tests/posix/cross-references/Initializers.ql +++ b/swift/ql/integration-tests/posix/cross-references/Initializers.ql @@ -1,5 +1,7 @@ import swift from Initializer d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Protocols.ql b/swift/ql/integration-tests/posix/cross-references/Protocols.ql index 521dfeee705..cde35a03d5f 100644 --- a/swift/ql/integration-tests/posix/cross-references/Protocols.ql +++ b/swift/ql/integration-tests/posix/cross-references/Protocols.ql @@ -1,5 +1,7 @@ import swift from ProtocolDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/Structs.ql b/swift/ql/integration-tests/posix/cross-references/Structs.ql index d746e92752e..6b8dd3556bd 100644 --- a/swift/ql/integration-tests/posix/cross-references/Structs.ql +++ b/swift/ql/integration-tests/posix/cross-references/Structs.ql @@ -1,5 +1,7 @@ import swift from StructDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/cross-references/VarDecls.ql b/swift/ql/integration-tests/posix/cross-references/VarDecls.ql index 9d227acd472..cdaa7d58898 100644 --- a/swift/ql/integration-tests/posix/cross-references/VarDecls.ql +++ b/swift/ql/integration-tests/posix/cross-references/VarDecls.ql @@ -1,5 +1,7 @@ import swift from VarDecl d -where d.getLocation().getFile().getBaseName() != "Package.swift" +where + d.getLocation().getFile().getBaseName() != "Package.swift" and + exists(d.getLocation().getFile().getRelativePath()) select d diff --git a/swift/ql/integration-tests/posix/frontend-invocations/Files.ql b/swift/ql/integration-tests/posix/frontend-invocations/Files.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/posix/frontend-invocations/Files.ql +++ b/swift/ql/integration-tests/posix/frontend-invocations/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/posix/hello-world/test.ql b/swift/ql/integration-tests/posix/hello-world/test.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/posix/hello-world/test.ql +++ b/swift/ql/integration-tests/posix/hello-world/test.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f diff --git a/swift/ql/integration-tests/posix/symlinks/Files.ql b/swift/ql/integration-tests/posix/symlinks/Files.ql index 9782ea4ce0b..0ef87821564 100644 --- a/swift/ql/integration-tests/posix/symlinks/Files.ql +++ b/swift/ql/integration-tests/posix/symlinks/Files.ql @@ -1,4 +1,5 @@ import swift from File f +where exists(f.getRelativePath()) or f instanceof UnknownFile select f From 40390d1adacda812a1a3f87b2a5fc727c4c1d8c1 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 22 Apr 2025 15:08:39 +0200 Subject: [PATCH 320/372] Address review comment --- ql/ql/src/codeql_ql/ast/Yaml.qll | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ql/ql/src/codeql_ql/ast/Yaml.qll b/ql/ql/src/codeql_ql/ast/Yaml.qll index 403640c1f84..e88f2a0c2aa 100644 --- a/ql/ql/src/codeql_ql/ast/Yaml.qll +++ b/ql/ql/src/codeql_ql/ast/Yaml.qll @@ -88,6 +88,16 @@ class QlPackDocument extends YamlDocument { } } +/** + * Holds if `qlref` is a `.qlref` YAML document referencing a query + * at relative path `relativePath`, and `f` is a candidate folder + * in which to lookup the referenced query. + * + * `f` is either: + * - the root of the QL pack containing `qlref`, + * - the root of a QL pack that is a dependency of the QL pack containing `qlref`, or + * - the folder containing `qlref`. + */ private predicate shouldAppend(QlRefDocument qlref, Folder f, string relativePath) { relativePath = qlref.getRelativeQueryPath() and ( From adb58e304d3267c98895e7688510cb10c122a481 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 16:51:36 +0200 Subject: [PATCH 321/372] Swift: Make file checking in tests more strict With Swift 6.1 the extractor will start to extract files outside of the test directory. These files and their elements we do not want to see in our tests. Test forgotten in https://github.com/github/codeql/pull/19344 --- swift/ql/test/library-tests/elements/location/location.ql | 1 + 1 file changed, 1 insertion(+) diff --git a/swift/ql/test/library-tests/elements/location/location.ql b/swift/ql/test/library-tests/elements/location/location.ql index 1d0b80f6bc1..0bb91d5748a 100644 --- a/swift/ql/test/library-tests/elements/location/location.ql +++ b/swift/ql/test/library-tests/elements/location/location.ql @@ -1,4 +1,5 @@ import swift from Location l +where exists(l.getFile().getRelativePath()) or l instanceof UnknownLocation select l From 1cf10d8f9fb9d1fb04e0ad367f350ad1a5e884f8 Mon Sep 17 00:00:00 2001 From: Jon Janego Date: Tue, 22 Apr 2025 14:51:11 -0500 Subject: [PATCH 322/372] changedocs from 2.21.1 release --- .../codeql-changelog/codeql-cli-2.21.1.rst | 141 ++++++++++++++++++ .../codeql-changelog/index.rst | 1 + 2 files changed, 142 insertions(+) create mode 100644 docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst diff --git a/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst new file mode 100644 index 00000000000..1c28523b18f --- /dev/null +++ b/docs/codeql/codeql-overview/codeql-changelog/codeql-cli-2.21.1.rst @@ -0,0 +1,141 @@ +.. _codeql-cli-2.21.1: + +========================== +CodeQL 2.21.1 (2025-04-22) +========================== + +.. contents:: Contents + :depth: 2 + :local: + :backlinks: none + +This is an overview of changes in the CodeQL CLI and relevant CodeQL query and library packs. For additional updates on changes to the CodeQL code scanning experience, check out the `code scanning section on the GitHub blog `__, `relevant GitHub Changelog updates `__, `changes in the CodeQL extension for Visual Studio Code `__, and the `CodeQL Action changelog `__. + +Security Coverage +----------------- + +CodeQL 2.21.1 runs a total of 452 security queries when configured with the Default suite (covering 168 CWE). The Extended suite enables an additional 136 queries (covering 35 more CWE). + +CodeQL CLI +---------- + +Bug Fixes +~~~~~~~~~ + +* Fixed a bug in CodeQL analysis for GitHub Actions in the presence of a code scanning configuration file containing :code:`paths-ignore` exclusion patterns but not :code:`paths` inclusion patterns. + Previously, such a configuration incorrectly led to all YAML, HTML, + JSON, and JS source files being extracted, + except for those filtered by :code:`paths-ignore`. + This in turn led to performance issues on large codebases. + Now, only workflow and Action metadata YAML files relevant to the GitHub Actions analysis will be extracted, + except for those filtered by :code:`paths-ignore`. + This matches the default behavior when no configuration file is provided. + The handling of :code:`paths` inclusion patterns is unchanged: + if provided, only those paths will be considered, + except for those filtered by :code:`paths-ignore`. + +Query Packs +----------- + +Bug Fixes +~~~~~~~~~ + +JavaScript/TypeScript +""""""""""""""""""""" + +* Fixed a bug that would prevent extraction of :code:`tsconfig.json` files when it contained an array literal with a trailing comma. + +GitHub Actions +"""""""""""""" + +* Alerts produced by the query :code:`actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file. + +Major Analysis Improvements +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Ruby +"""" + +* The query :code:`rb/useless-assignment-to-local` now comes with query help and has been tweaked to produce fewer false positives. +* The query :code:`rb/uninitialized-local-variable` now only produces alerts when the variable is the receiver of a method call and should produce very few false positives. It also now comes with a help file. + +Minor Analysis Improvements +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +C# +"" + +* Enums and :code:`System.DateTimeOffset` are now treated as *simple* types, which means that they are considered to have a sanitizing effect. This impacts many queries, among others the :code:`cs/log-forging` query. +* The MaD models for the .NET 9 Runtime have been re-generated after a fix related to :code:`out`\ /\ :code:`ref` parameters. + +JavaScript/TypeScript +""""""""""""""""""""" + +* Data passed to the `Response `__ constructor is now treated as a sink for :code:`js/reflected-xss`. +* Slightly improved detection of DOM element references, leading to XSS results being detected in more cases. + +Python +"""""" + +* The :code:`py/mixed-tuple-returns` query no longer flags instances where the tuple is passed into the function as an argument, as this led to too many false positives. + +Language Libraries +------------------ + +Minor Analysis Improvements +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +C# +"" + +* The *alignment* and *format* clauses in string interpolation expressions are now extracted. That is, in :code:`$"Hello {name,align:format}"` *name*, *align* and *format* are extracted as children of the string interpolation *insert* :code:`{name,align:format}`. +* Blazor support can now better recognize when a property being set is specified with a string literal, rather than referenced in a :code:`nameof` expression. + +Golang +"""""" + +* Local source models for APIs reading from databases have been added for :code:`github.com/gogf/gf/database/gdb` and :code:`github.com/uptrace/bun`. + +Java/Kotlin +""""""""""" + +* Enum-typed values are now assumed to be safe by most queries. This means that queries may return fewer results where an enum value is used in a sensitive context, e.g. pasted into a query string. +* All existing modelling and support for :code:`javax.persistence` now applies to :code:`jakarta.persistence` as well. + +JavaScript/TypeScript +""""""""""""""""""""" + +* Data passed to the `NextResponse `__ constructor is now treated as a sink for :code:`js/reflected-xss`. +* Data received from `NextRequest `__ and `Request `__ is now treated as a remote user input :code:`source`. +* Added support for the :code:`make-dir` package. +* Added support for the :code:`open` package. +* Added taint propagation for :code:`Uint8Array`, :code:`ArrayBuffer`, :code:`SharedArrayBuffer` and :code:`TextDecoder.decode()`. +* Improved detection of :code:`WebSocket` and :code:`SockJS` usage. +* Added data received from :code:`WebSocket` clients as a remote flow source. +* Added support for additional :code:`mkdirp` methods as sinks in path-injection queries. +* Added support for additional :code:`rimraf` methods as sinks in path-injection queries. + +Ruby +"""" + +* Calls to :code:`super` without explict arguments now have their implicit arguments generated. For example, in :code:`def foo(x, y) { super } end` the call to :code:`super` becomes :code:`super(x, y)`. + +New Features +~~~~~~~~~~~~ + +C/C++ +""""" + +* Calling conventions explicitly specified on function declarations (:code:`__cdecl`, :code:`__stdcall`, :code:`__fastcall`, etc.) are now represented as specifiers of those declarations. +* A new class :code:`CallingConventionSpecifier` extending the :code:`Specifier` class was introduced, which represents explicitly specified calling conventions. + +Shared Libraries +---------------- + +Deprecated APIs +~~~~~~~~~~~~~~~ + +Static Single Assignment (SSA) +"""""""""""""""""""""""""""""" + +* All references to the :code:`DefinitionExt` and :code:`PhiReadNode` classes in the SSA library have been deprecated. The concept of phi-read nodes is now strictly an internal implementation detail. Their sole use-case is to improve the structure of the use-use flow relation for data flow, and this use-case remains supported by the :code:`DataFlowIntegration` module. diff --git a/docs/codeql/codeql-overview/codeql-changelog/index.rst b/docs/codeql/codeql-overview/codeql-changelog/index.rst index 08c8502ad1a..137185c94db 100644 --- a/docs/codeql/codeql-overview/codeql-changelog/index.rst +++ b/docs/codeql/codeql-overview/codeql-changelog/index.rst @@ -11,6 +11,7 @@ A list of queries for each suite and language `is available here Date: Wed, 23 Apr 2025 10:24:17 +0100 Subject: [PATCH 323/372] C++: Add an empty model to prevent a warning. --- cpp/ql/lib/ext/generated/empty.model.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cpp/ql/lib/ext/generated/empty.model.yml diff --git a/cpp/ql/lib/ext/generated/empty.model.yml b/cpp/ql/lib/ext/generated/empty.model.yml new file mode 100644 index 00000000000..078a8618ee3 --- /dev/null +++ b/cpp/ql/lib/ext/generated/empty.model.yml @@ -0,0 +1,5 @@ +extensions: + - addsTo: + pack: codeql/cpp-all + extensible: summaryModel + data: [] \ No newline at end of file From 9e9a580d02e7c7917280971c79e5b6d81d5b56da Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 23 Apr 2025 11:11:17 +0100 Subject: [PATCH 324/372] C++: Add MaD generation test with union content. --- .../modelgenerator/dataflow/summaries.cpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp index d72d417e49f..8b6da3e8ac5 100644 --- a/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp +++ b/cpp/ql/test/library-tests/dataflow/modelgenerator/dataflow/summaries.cpp @@ -180,4 +180,22 @@ struct FinalStruct final { virtual int public_final_member_function_2(int x) final { return x; } -}; \ No newline at end of file +}; + +union U { + int x, y; +}; + +//summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;df-generated +//summary=;;true;get_x_from_union;(U *);;Argument[*0];ReturnValue;taint;df-generated +//contentbased-summary=;;true;get_x_from_union;(U *);;Argument[0];ReturnValue;taint;dfc-generated +//contentbased-summary=;;true;get_x_from_union;(U *);;Argument[*0].Union[*U];ReturnValue;value;dfc-generated +int get_x_from_union(U* u) { + return u->x; +} + +//summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0];taint;df-generated +//contentbased-summary=;;true;set_x_in_union;(U *,int);;Argument[1];Argument[*0].Union[*U];value;dfc-generated +void set_x_in_union(U* u, int x) { + u->x = x; +} \ No newline at end of file From d6f1bd97921bf95a2b018c550cf43aecf58893a0 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:24:29 +0100 Subject: [PATCH 325/372] Rust: Remove unnecessary predicate. --- rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql index 396a4b7caa8..29158454b2f 100644 --- a/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql +++ b/rust/ql/test/library-tests/dataflow/local/DataFlowStep.ql @@ -2,10 +2,6 @@ import codeql.rust.dataflow.DataFlow import codeql.rust.dataflow.internal.DataFlowImpl import utils.test.TranslateModels -private predicate provenance(string model) { RustDataFlow::simpleLocalFlowStep(_, _, model) } - -private module Tm = TranslateModels; - query predicate localStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) { // Local flow steps that don't originate from a flow summary. RustDataFlow::simpleLocalFlowStep(nodeFrom, nodeTo, "") From 617f4729d8c0f410dd6e2991454f8632430b5aa7 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 12:35:17 +0200 Subject: [PATCH 326/372] Shared: Match line information on Alert and Sink locations. --- shared/util/codeql/util/test/InlineExpectationsTest.qll | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/util/codeql/util/test/InlineExpectationsTest.qll b/shared/util/codeql/util/test/InlineExpectationsTest.qll index 5fe8932808c..56ac6ea3227 100644 --- a/shared/util/codeql/util/test/InlineExpectationsTest.qll +++ b/shared/util/codeql/util/test/InlineExpectationsTest.qll @@ -774,8 +774,10 @@ module TestPostProcessing { */ private string getSinkTag(int row) { getQueryKind() = "path-problem" and - exists(string loc | queryResults(mainResultSet(), row, 4, loc) | - if queryResults(mainResultSet(), row, 0, loc) then result = "Alert" else result = "Sink" + exists(TestLocation sinkLoc, TestLocation selectLoc | + mainQueryResult(row, 0, selectLoc) and + mainQueryResult(row, 4, sinkLoc) and + if sameLineInfo(selectLoc, sinkLoc) then result = "Alert" else result = "Sink" ) } From 2e0ce44fde36cd871c6e6df3947ad202c9af9360 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 15:41:20 +0200 Subject: [PATCH 327/372] Javascript: Update test files. --- .../CommandInjection/child_process-test.js | 6 +- .../CWE-078/CommandInjection/exec-sh.js | 2 +- .../CWE-078/CommandInjection/exec-sh2.js | 2 +- .../lib/isImported.js | 4 +- .../UnsafeShellCommandConstruction/lib/lib.js | 152 +++++++++--------- .../lib/lib2.js | 6 +- .../lib/subLib/amdSub.js | 4 +- .../lib/subLib/index.js | 6 +- .../lib/subLib2/compiled-file.ts | 2 +- .../lib/subLib2/special-file.js | 4 +- .../lib/subLib3/my-file.ts | 2 +- .../lib/subLib4/subsub.js | 2 +- .../Security/CWE-400/ReDoS/lib/closure.js | 4 +- .../Security/CWE-400/ReDoS/lib/indirect.js | 4 +- .../Security/CWE-400/ReDoS/lib/lib.js | 14 +- .../CWE-400/ReDoS/lib/moduleLib/moduleLib.js | 2 +- .../ReDoS/lib/otherLib/js/src/index.js | 2 +- .../Security/CWE-400/ReDoS/lib/snapdragon.js | 6 +- .../CWE-400/ReDoS/lib/subLib4/factory.js | 4 +- .../CWE-400/ReDoS/lib/subLib5/feature.js | 4 +- .../CWE-400/ReDoS/lib/subLib5/main.js | 2 +- .../CWE-400/ReDoS/lib/subLib5/subclass.js | 2 +- .../CWE-400/ReDoS/lib/subLib6/index.js | 4 +- .../CWE-400/ReDoS/lib/sublib/factory.js | 2 +- .../CWE-400/ReDoS/polynomial-redos.js | 144 ++++++++--------- .../Request/app/api/proxy/route.serverSide.ts | 2 +- .../app/api/proxy/route2.serverSide.ts | 2 +- .../Security/CWE-918/Request/middleware.ts | 5 +- .../Security/CWE-918/apollo.serverSide.ts | 4 +- .../Security/CWE-918/clientSide.js | 8 +- .../Security/CWE-918/serverSide.js | 46 +++--- 31 files changed, 226 insertions(+), 227 deletions(-) diff --git a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js index d11d97fc1c3..5fea8a3e4d6 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/child_process-test.js @@ -36,7 +36,7 @@ var server = http.createServer(function(req, res) { sh = 'cmd.exe', flag = '/c'; else sh = '/bin/sh', flag = '-c'; - cp.spawn(sh, [ flag, cmd ]); // $ Alert Sink + cp.spawn(sh, [ flag, cmd ]); // $ Alert let args = []; args[0] = "-c"; @@ -53,8 +53,8 @@ var server = http.createServer(function(req, res) { args[1] = cmd; // $ Sink cp.execFile(`/bin` + "/bash", args); // $ Alert - cp.spawn('cmd.exe', ['/C', 'foo'].concat(["bar", cmd])); // $ Alert Sink - cp.spawn('cmd.exe', ['/C', 'foo'].concat(cmd)); // $ Alert Sink + cp.spawn('cmd.exe', ['/C', 'foo'].concat(["bar", cmd])); // $ Alert + cp.spawn('cmd.exe', ['/C', 'foo'].concat(cmd)); // $ Alert let myArgs = []; myArgs.push(`-` + "c"); diff --git a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js index 9e59ff90b14..de7e60c6962 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh.js @@ -12,7 +12,7 @@ function getShell() { function execSh(command, options) { var shell = getShell() - return cp.spawn(shell.cmd, [shell.arg, command], options) // $ Alert Sink + return cp.spawn(shell.cmd, [shell.arg, command], options) // $ Alert } http.createServer(function (req, res) { diff --git a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js index 5b6d770a265..c98653e7cb4 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/CommandInjection/exec-sh2.js @@ -7,7 +7,7 @@ function getShell() { } function execSh(command, options) { - return cp.spawn(getShell(), ["-c", command], options) // $ Alert Sink + return cp.spawn(getShell(), ["-c", command], options) // $ Alert }; http.createServer(function (req, res) { diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js index b4f75df03ac..fc91dddf873 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/isImported.js @@ -3,5 +3,5 @@ const cp = require("child_process"); module.exports.thisMethodIsImported = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink -} \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert +} diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js index 85d0402a8ae..e7911746d6e 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib.js @@ -1,30 +1,30 @@ var cp = require("child_process") module.exports.blah = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.execFile(name, [name]); cp.execFile(name, name); }; module.exports.foo = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.foo.bar = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } function cla() { } cla.prototype.method = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.cla = new cla(); function cla2() { } cla2.prototype.method = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.bla = new cla2(); @@ -32,13 +32,13 @@ module.exports.lib2 = require("./lib2.js") class Cla3 { constructor(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } static foo(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } bar(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.exec("rm -rf " + notASource); } @@ -47,14 +47,14 @@ class Cla3 { module.exports.cla3 = Cla3; module.exports.mz = function (name) { // $ Source - require("mz/child_process").exec("rm -rf " + name); // $ Alert Sink + require("mz/child_process").exec("rm -rf " + name); // $ Alert } module.exports.flow = function (name) { // $ Source - var cmd1 = "rm -rf " + name; // $ Alert Sink + var cmd1 = "rm -rf " + name; // $ Alert cp.exec(cmd1); - var cmd2 = "rm -rf " + name; // $ Alert Sink + var cmd2 = "rm -rf " + name; // $ Alert function myExec(cmd) { cp.exec(cmd); } @@ -62,25 +62,25 @@ module.exports.flow = function (name) { // $ Source } module.exports.stringConcat = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.exec(name); - cp.exec("for foo in (" + name + ") do bla end"); // $ Alert Sink + cp.exec("for foo in (" + name + ") do bla end"); // $ Alert - cp.exec("cat /foO/BAR/" + name) // $ Alert Sink + cp.exec("cat /foO/BAR/" + name) // $ Alert - cp.exec("cat \"" + name + "\"") // $ Alert Sink + cp.exec("cat \"" + name + "\"") // $ Alert - cp.exec("cat '" + name + "'") // $ Alert Sink + cp.exec("cat '" + name + "'") // $ Alert - cp.exec("cat '/foo/bar" + name + "'") // $ Alert Sink + cp.exec("cat '/foo/bar" + name + "'") // $ Alert cp.exec(name + " some file") } module.exports.arrays = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var args1 = ["node"]; args1.push(name); // $ Alert @@ -109,7 +109,7 @@ module.exports.format = function (name) { // $ Source } module.exports.valid = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!isValidName(name)) { return; @@ -118,7 +118,7 @@ module.exports.valid = function (name) { // $ Source } module.exports.safe = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!isSafeName(name)) { return; @@ -128,7 +128,7 @@ module.exports.safe = function (name) { // $ Source class Cla4 { wha(name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } static bla(name) { @@ -146,7 +146,7 @@ function Cla5(name) { module.exports.cla5 = new Cla5(); module.exports.indirect = function (name) { // $ Source - let cmd = "rm -rf " + name; // $ Alert Sink + let cmd = "rm -rf " + name; // $ Alert let sh = "sh"; let args = ["-c", cmd]; cp.spawn(sh, args, cb); @@ -158,7 +158,7 @@ module.exports.indirect2 = function (name) { // $ Source let args = ["-c", cmd]; cp.spawn(sh, args, cb); - let cmd2 = "rm -rf " + name; // $ Alert Sink + let cmd2 = "rm -rf " + name; // $ Alert var args2 = [cmd2]; cp.spawn( 'cmd.exe', @@ -170,7 +170,7 @@ module.exports.indirect2 = function (name) { // $ Source module.exports.cmd = function (command, name) { // $ Source cp.exec("fo | " + command); - cp.exec("fo | " + name); // $ Alert Sink + cp.exec("fo | " + name); // $ Alert } @@ -178,54 +178,54 @@ module.exports.sanitizer = function (name) { // $ Source var sanitized = "'" + name.replace(/'/g, "'\\''") + "'" cp.exec("rm -rf " + sanitized); - var broken = "'" + name.replace(/'/g, "'\''") + "'" // $ Alert Sink - cp.exec("rm -rf " + broken); // $ Alert Sink + var broken = "'" + name.replace(/'/g, "'\''") + "'" // $ Alert + cp.exec("rm -rf " + broken); // $ Alert } var path = require("path"); module.exports.guard = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!path.exist(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert return; } cp.exec("rm -rf " + name); } module.exports.blacklistOfChars = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (/[^A-Za-z0-9_\/:=-]/.test(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } } module.exports.whitelistOfChars = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (/^[A-Za-z0-9_\/:=-]$/.test(name)) { cp.exec("rm -rf " + name); } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } } module.exports.blackList2 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!/^([a-zA-Z0-9]+))?$/.test(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert process.exit(-1); } - cp.exec("rm -rf " + name); // $ Sink SPURIOUS: Alert - FP due to tracking flow through `process.exit()`. + cp.exec("rm -rf " + name); // $ SPURIOUS: Alert - FP due to tracking flow through `process.exit()`. } module.exports.accessSync = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert try { path.accessSync(name); @@ -233,7 +233,7 @@ module.exports.accessSync = function (name) { // $ Source return; } - cp.exec("rm -rf " + name); // $ Sink SPURIOUS: Alert - FP due to `path.accessSync` not being recognized as a sanitizer. + cp.exec("rm -rf " + name); // $ SPURIOUS: Alert - FP due to `path.accessSync` not being recognized as a sanitizer. } var cleanInput = function (s) { @@ -246,26 +246,26 @@ var cleanInput = function (s) { } module.exports.goodSanitizer = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var cleaned = cleanInput(name); - cp.exec("rm -rf " + cleaned); // $ Sink SPURIOUS: Alert - SanitizingRegExpTest is not able to generate a barrier edge for an edge into a phi node. + cp.exec("rm -rf " + cleaned); // $ SPURIOUS: Alert - SanitizingRegExpTest is not able to generate a barrier edge for an edge into a phi node. } var fs = require("fs"); module.exports.guard2 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (!fs.existsSync("prefix/" + name)) { - cp.exec("rm -rf prefix/" + name); // $ Alert Sink + cp.exec("rm -rf prefix/" + name); // $ Alert return; } cp.exec("rm -rf prefix/" + name); } module.exports.sanitizerProperty = function (obj) { // $ Source - cp.exec("rm -rf " + obj.version); // $ Alert Sink + cp.exec("rm -rf " + obj.version); // $ Alert obj.version = ""; @@ -274,11 +274,11 @@ module.exports.sanitizerProperty = function (obj) { // $ Source module.exports.Foo = class Foo { start(opts) { // $ Source - cp.exec("rm -rf " + opts.bla); // $ Alert Sink + cp.exec("rm -rf " + opts.bla); // $ Alert this.opts = {}; this.opts.bla = opts.bla - cp.exec("rm -rf " + this.opts.bla); // $ Alert Sink + cp.exec("rm -rf " + this.opts.bla); // $ Alert } } @@ -305,24 +305,24 @@ function sanitizeShellString(str) { } module.exports.sanitizer2 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var sanitized = sanitizeShellString(name); cp.exec("rm -rf " + sanitized); } module.exports.typeofcheck = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (typeof name === "undefined") { cp.exec("rm -rf " + name); } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } } module.exports.typeofcheck = function (arg) { // $ Source - var cmd = "MyWindowCommand | findstr /i /c:" + arg; // $ Alert Sink + var cmd = "MyWindowCommand | findstr /i /c:" + arg; // $ Alert cp.exec(cmd); } @@ -337,7 +337,7 @@ module.exports.unproblematic = function() { }; module.exports.problematic = function(n) { // $ Source - cp.exec("rm -rf " + id(n)); // $ Alert Sink + cp.exec("rm -rf " + id(n)); // $ Alert }; module.exports.typeofNumber = function(n) { @@ -348,7 +348,7 @@ module.exports.typeofNumber = function(n) { function boundProblem(safe, unsafe) { // $ Source cp.exec("rm -rf " + safe); - cp.exec("rm -rf " + unsafe); // $ Alert Sink + cp.exec("rm -rf " + unsafe); // $ Alert } Object.defineProperty(module.exports, "boundProblem", { @@ -403,7 +403,7 @@ function yetAnohterSanitizer(str) { } module.exports.sanitizer3 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert var sanitized = yetAnohterSanitizer(name); cp.exec("rm -rf " + sanitized); @@ -412,7 +412,7 @@ module.exports.sanitizer3 = function (name) { // $ Source const cp = require("child_process"); const spawn = cp.spawn; module.exports.shellOption = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert cp.execFile("rm", ["-rf", name], {shell: true}, (err, out) => {}); // $ Alert cp.spawn("rm", ["-rf", name], {shell: true}); // $ Alert @@ -439,12 +439,12 @@ function build(first, last) { var asyncExec = require("async-execute"); module.exports.asyncStuff = function (name) { // $ Source - asyncExec("rm -rf " + name); // $ Alert Sink + asyncExec("rm -rf " + name); // $ Alert } const myFuncs = { myFunc: function (name) { // $ Source - asyncExec("rm -rf " + name); // $ Alert Sink + asyncExec("rm -rf " + name); // $ Alert } }; @@ -480,7 +480,7 @@ module.exports.check = function check(config) { // $ Source } module.exports.splitConcat = function (name) { // $ Source - let args = ' my name is ' + name; // $ Alert Sink + let args = ' my name is ' + name; // $ Alert let cmd = 'echo'; cp.exec(cmd + args); } @@ -496,7 +496,7 @@ module.exports.myCommand = function (myCommand) { }; module.exports.myIndirectThing = function (name) { // $ Source - MyThing.cp.exec("rm -rf " + name); // $ Alert Sink + MyThing.cp.exec("rm -rf " + name); // $ Alert } }); @@ -507,42 +507,42 @@ for (var name in imp){ } module.exports.sanitizer4 = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (isNaN(name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(parseInt(name))) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(+name)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(parseInt(name, 10))) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(name - 0)) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { cp.exec("rm -rf " + name); } if (isNaN(name | 0)) { // <- not a sanitizer - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } } @@ -557,26 +557,26 @@ module.exports.shellThing = function (name) { // $ Source module.exports.badSanitizer = function (name) { // $ Source if (!name.match(/^(.|\.){1,64}$/)) { // <- bad sanitizer - exec("rm -rf " + name); // $ Alert Sink + exec("rm -rf " + name); // $ Alert } else { - exec("rm -rf " + name); // $ Alert Sink + exec("rm -rf " + name); // $ Alert } if (!name.match(/^\w{1,64}$/)) { // <- good sanitizer - exec("rm -rf " + name); // $ Alert Sink + exec("rm -rf " + name); // $ Alert } else { exec("rm -rf " + name); } } module.exports.safeWithBool = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (isSafeName(name)) { cp.exec("rm -rf " + name); } - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (isSafeName(name) === true) { cp.exec("rm -rf " + name); @@ -587,10 +587,10 @@ module.exports.safeWithBool = function (name) { // $ Source } if (isSafeName(name) == false) { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } function indirectThing(name) { @@ -606,7 +606,7 @@ function moreIndirect(name) { } module.exports.veryIndeirect = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert if (indirectThing(name)) { cp.exec("rm -rf " + name); @@ -623,15 +623,15 @@ module.exports.veryIndeirect = function (name) { // $ Source if (moreIndirect(name) !== false) { cp.exec("rm -rf " + name); } else { - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } - cp.exec("rm -rf " + name); // $ Alert Sink + cp.exec("rm -rf " + name); // $ Alert } module.exports.sanitizer = function (name) { // $ Source - var sanitized = "'" + name.replace(new RegExp("\'"), "'\\''") + "'" // $ Alert Sink - cp.exec("rm -rf " + sanitized); // $ Alert Sink + var sanitized = "'" + name.replace(new RegExp("\'"), "'\\''") + "'" // $ Alert + cp.exec("rm -rf " + sanitized); // $ Alert var sanitized = "'" + name.replace(new RegExp("\'", 'g'), "'\\''") + "'" cp.exec("rm -rf " + sanitized); diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js index 9c427622c77..2f0d80b60e0 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/lib2.js @@ -1,9 +1,9 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - is imported from main module. + cp.exec("rm -rf " + name); // $ Alert - is imported from main module. }; module.exports.foo = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - is imported from main module. -}; \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert - is imported from main module. +}; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js index e268f47c4e2..ab9be8e4eaf 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/amdSub.js @@ -1,5 +1,5 @@ const cp = require("child_process"); module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - this function is exported from `amd.js` -}; \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert - this function is exported from `amd.js` +}; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js index 0b1abc95128..d422ac9184a 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib/index.js @@ -1,15 +1,15 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - functions exported as part of a submodule are also flagged. + cp.exec("rm -rf " + name); // $ Alert - functions exported as part of a submodule are also flagged. }; module.exports.foo = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - this is being called explicitly from child_process-test.js + cp.exec("rm -rf " + name); // $ Alert - this is being called explicitly from child_process-test.js }; module.exports.amd = require("./amd.js"); module.exports.arrToShell = function (cmd, arr) { // $ Source cp.spawn("echo", arr, {shell: true}); // $ Alert -} \ No newline at end of file +} diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts index e6b7a10bacf..b10ee80481e 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/compiled-file.ts @@ -1,5 +1,5 @@ var cp = require("child_process") export default function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - the "files" directory points to this file. + cp.exec("rm -rf " + name); // $ Alert - the "files" directory points to this file. } diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js index 853e144a0d6..b5740c3057e 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib2/special-file.js @@ -1,5 +1,5 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - the "files" directory points to this file. -}; \ No newline at end of file + cp.exec("rm -rf " + name); // $ Alert - the "files" directory points to this file. +}; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts index f28c157a5ea..7320835f8ec 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib3/my-file.ts @@ -1,5 +1,5 @@ var cp = require("child_process") module.exports = function (name) { // $ Source - cp.exec("rm -rf " + name); // $ Alert Sink - functions exported as part of a submodule are also flagged. + cp.exec("rm -rf " + name); // $ Alert - functions exported as part of a submodule are also flagged. }; diff --git a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js index b8da58006c7..bc9e5156203 100644 --- a/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js +++ b/javascript/ql/test/query-tests/Security/CWE-078/UnsafeShellCommandConstruction/lib/subLib4/subsub.js @@ -1,5 +1,5 @@ const cp = require("child_process") module.exports = function (name) { - cp.exec("rm -rf " + name); // $ Alert Sink - functions exported as part of a submodule are also flagged. + cp.exec("rm -rf " + name); // $ Alert - functions exported as part of a submodule are also flagged. }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js index 19f928a015b..45951253dd7 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/closure.js @@ -1,5 +1,5 @@ goog.module('x.y.z.closure2'); exports = function (x) { // $ Source[js/polynomial-redos] - /u*o/.test(x); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -} \ No newline at end of file + /u*o/.test(x); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js index 12577a4de31..a6c712ad7cb 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/indirect.js @@ -1,3 +1,3 @@ module.exports.foo = function (x) { // $ Source[js/polynomial-redos] - /k*h/.test(x); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -} \ No newline at end of file + /k*h/.test(x); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js index 313d555f9f5..b22ef792b93 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/lib.js @@ -1,11 +1,11 @@ var regexp = /a*b/; module.exports = function (name) { // $ Source[js/polynomial-redos] - regexp.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + regexp.test(name); // $ Alert[js/polynomial-redos] }; function bar(reg, name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } if (typeof define !== 'undefined' && define.amd) { // AMD @@ -33,16 +33,16 @@ module.exports.useArguments = function () { } function usedWithArguments(name) { - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } module.exports.snapdragon = require("./snapdragon") module.exports.foo = function (name) { // $ Source[js/polynomial-redos] - var data1 = name.match(/f*g/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var data1 = name.match(/f*g/); // $ Alert[js/polynomial-redos] name = name.substr(1); - var data2 = name.match(/f*g/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var data2 = name.match(/f*g/); // $ Alert[js/polynomial-redos] } var indirectAssign = {}; @@ -50,6 +50,6 @@ module.exports.indirectAssign = indirectAssign; Object.assign(indirectAssign, { myThing: function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] }, -}); \ No newline at end of file +}); diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js index 44c24db352e..8d7f26935da 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/moduleLib/moduleLib.js @@ -1,3 +1,3 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js index 44c24db352e..8d7f26935da 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/otherLib/js/src/index.js @@ -1,3 +1,3 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js index ce6dae71ea8..3749edca43f 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/snapdragon.js @@ -4,7 +4,7 @@ module.exports.test1 = function (input) { // $ Source[js/polynomial-redos] var snapdragon = new Snapdragon(); var ast = snapdragon.parser .set("foo", function () { - var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] }) .parse(input, options); }; @@ -12,7 +12,7 @@ module.exports.test1 = function (input) { // $ Source[js/polynomial-redos] module.exports.test2 = function (input) { // $ Source[js/polynomial-redos] var snapdragon = new Snapdragon(); snapdragon.parser.set("foo", function () { - var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + var m = this.match(/aa*$/); // $ Alert[js/polynomial-redos] }); snapdragon.parse(input, options); }; @@ -20,7 +20,7 @@ module.exports.test2 = function (input) { // $ Source[js/polynomial-redos] module.exports.test3 = function (input) { // $ Source[js/polynomial-redos] var snapdragon = new Snapdragon(); snapdragon.compiler.set("foo", function (node) { - node.val.match(/aa*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + node.val.match(/aa*$/); // $ Alert[js/polynomial-redos] }); snapdragon.compile(input, options); }; diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js index 088fe11e20a..31c39e974ca 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib4/factory.js @@ -5,6 +5,6 @@ }(this, (function (exports) { 'use strict'; exports.foo = function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } -}))); \ No newline at end of file +}))); diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js index 44c24db352e..5c73d32f701 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/feature.js @@ -1,3 +1,3 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -}; + /a*b/.test(name); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js index daf462fea1c..92463bf21b5 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/main.js @@ -1,5 +1,5 @@ module.exports = function (name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] }; const SubClass = require('./subclass'); diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js index 9786b49b032..c09dc8ada30 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib5/subclass.js @@ -2,7 +2,7 @@ class Subclass { constructor() {} define(name) { // $ Source[js/polynomial-redos] - /a*b/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /a*b/.test(name); // $ Alert[js/polynomial-redos] } } diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js index dd5b0db354f..9155913f76b 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/subLib6/index.js @@ -1,3 +1,3 @@ module.exports.foo = function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] -} \ No newline at end of file + /f*g/.test(name); // $ Alert[js/polynomial-redos] +} diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js index 5ba28dca421..3bcbe5aaf52 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/lib/sublib/factory.js @@ -10,7 +10,7 @@ }(this, function () { function create() { return function (name) { // $ Source[js/polynomial-redos] - /f*g/.test(name); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /f*g/.test(name); // $ Alert[js/polynomial-redos] } } return create() diff --git a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js index be1f8d9577a..5f2dee1c744 100644 --- a/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js +++ b/javascript/ql/test/query-tests/Security/CWE-400/ReDoS/polynomial-redos.js @@ -4,140 +4,140 @@ var app = express(); app.use(function(req, res) { let tainted = req.query.tainted; // $ Source[js/polynomial-redos] - tainted.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.split(/ *, */); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.replace(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] + tainted.split(/ *, */); // $ Alert[js/polynomial-redos] + tainted.replace(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] tainted.split('\n'); - tainted.replace(/.*[/\\]/, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.replace(/.*\./, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replace(/.*[/\\]/, ''); // $ Alert[js/polynomial-redos] + tainted.replace(/.*\./, ''); // $ Alert[js/polynomial-redos] tainted.replace(/^.*[/\\]/, ''); tainted.replace(/^.*\./, ''); - tainted.replace(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.replace(/^(`+)([\s\S]*?[^`])\1(?!`)/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /^(.*,)+(.+)?$/.test(tainted); // $ Alert[js/polynomial-redos] Alert[js/redos] Sink[js/polynomial-redos] - tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - even though it is a proposed fix for the above - tainted.match(/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replace(/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/); // $ Alert[js/polynomial-redos] + tainted.replace(/^(`+)([\s\S]*?[^`])\1(?!`)/); // $ Alert[js/polynomial-redos] + /^(.*,)+(.+)?$/.test(tainted); // $ Alert[js/polynomial-redos] Alert[js/redos] + tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i); // $ Alert[js/polynomial-redos] + tainted.match(/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i); // $ Alert[js/polynomial-redos] - even though it is a proposed fix for the above + tainted.match(/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/); // $ Alert[js/polynomial-redos] if (tainted.length < 7000) { tainted.match(/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/); // OK - but flagged } - tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/); // $ Alert[js/polynomial-redos] tainted.match(/^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/); /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/.test(tainted); // $ MISSING: Alert[js/polynomial-redos] - not detected due to not supporting ranges /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/.test(tainted); - tainted.replace(/[?]+.*$/g, ""); // $ Sink[js/polynomial-redos] SPURIOUS: Alert[js/polynomial-redos] - can not fail once a match has started + tainted.replace(/[?]+.*$/g, ""); // $ SPURIOUS: Alert[js/polynomial-redos] - can not fail once a match has started tainted.replace(/\-\-+/g, "-").replace(/-+$/, ""); // OK - indirectly sanitized tainted.replace(/\n\n\n+/g, "\n").replace(/\n*$/g, ""); // OK - indirectly sanitized - tainted.match(/(.)*solve\/challenges\/server-side(.)*/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/(.)*solve\/challenges\/server-side(.)*/); // $ Alert[js/polynomial-redos] tainted.match(/(?![\s\S]*)/i); - tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/<.*style="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/<.*href="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] + tainted.match(/<.*style="([^"]+)".*>/); // $ Alert[js/polynomial-redos] + tainted.match(/<.*href="([^"]+)".*>/); // $ Alert[js/polynomial-redos] - tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] tainted.match(/^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/); // $ Alert[js/redos] - it is a fix for the above, but it introduces exponential complexity elsewhere - tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/); // $ Alert[js/polynomial-redos] tainted.match(/^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/); tainted.match(/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/); // $ Alert[js/redos] tainted.match(/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/); - tainted.replaceAll(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.replaceAll(/\s*\n\s*/g, ' '); // $ Alert[js/polynomial-redos] - /Y.*X/.test(tainted); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /B?(YH|K)(YH|J)*X/.test(tainted) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/B?(YH|K).*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+(Y)*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - /f(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+(Y|K)*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+.*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/f(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + /Y.*X/.test(tainted); // $ Alert[js/polynomial-redos] + /B?(YH|K)(YH|J)*X/.test(tainted) // $ Alert[js/polynomial-redos] + (/B?(YH|K).*X/.test(tainted)); // $ Alert[js/polynomial-redos] + /(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] + (/(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] + (/f(B|Y)+(Y)*X/.test(tainted)); // $ Alert[js/polynomial-redos] + /f(B|Y)+(Y)*X/.test(tainted) // $ Alert[js/polynomial-redos] + (/f(B|Y)+(Y|K)*X/.test(tainted)) // $ Alert[js/polynomial-redos] + (/f(B|Y)+.*X/.test(tainted)) // $ Alert[js/polynomial-redos] + (/f(B|Y)+(.)*X/.test(tainted)) // $ Alert[js/polynomial-redos] (/^(.)*X/.test(tainted)); (/^Y(Y)*X/.test(tainted)); - (/^Y*Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/^(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/^foo(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/^foo(K|Y)+.*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/(K|Y).*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - (/[^Y].*X/.test(tainted)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + (/^Y*Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/^(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/^foo(K|Y)+Y*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/^foo(K|Y)+.*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/(K|Y).*X/.test(tainted)); // $ Alert[js/polynomial-redos] + (/[^Y].*X/.test(tainted)); // $ Alert[js/polynomial-redos] (/[^Y].*$/.test(req.url)); // OK - the input cannot contain newlines. - (/[^Y].*$/.test(req.body)); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + (/[^Y].*$/.test(req.body)); // $ Alert[js/polynomial-redos] - tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([^-]+)-([A-Za-z0-9+/]+(?:=?=?))([?\x21-\x7E]*)$/); // $ Alert[js/polynomial-redos] - tainted.match(new RegExp("(MSIE) (\\d+)\\.(\\d+).*XBLWP7")); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(new RegExp("(MSIE) (\\d+)\\.(\\d+).*XBLWP7")); // $ Alert[js/polynomial-redos] - tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/<.*class="([^"]+)".*>/); // $ Alert[js/polynomial-redos] - tainted.match(/Y.*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/Y.*X/); // $ Alert[js/polynomial-redos] tatined.match(/B?(YH|K)(YH|J)*X/); // $ MISSING: Alert[js/polynomial-redos] - tainted.match(/a*b/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - the initial repetition can start matching anywhere. - tainted.match(/cc*D/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/a*b/); // $ Alert[js/polynomial-redos] - the initial repetition can start matching anywhere. + tainted.match(/cc*D/); // $ Alert[js/polynomial-redos] tainted.match(/^ee*F/); tainted.match(/^g*g*/); tainted.match(/^h*i*/); - tainted.match(/^(ab)*ab(ab)*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^(ab)*ab(ab)*X/); // $ Alert[js/polynomial-redos] - tainted.match(/aa*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^a*a*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/\wa*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/aa*X/); // $ Alert[js/polynomial-redos] + tainted.match(/^a*a*X/); // $ Alert[js/polynomial-redos] + tainted.match(/\wa*X/); // $ Alert[js/polynomial-redos] tainted.match(/a*b*c*/); tainted.match(/a*a*a*a*/); - tainted.match(/^([3-7]|A)*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^\d*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^([3-7]|A)*\d*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([3-7]|A)*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] + tainted.match(/^\d*([2-5]|B)*X/); // $ Alert[js/polynomial-redos] + tainted.match(/^([3-7]|A)*\d*X/); // $ Alert[js/polynomial-redos] - tainted.match(/^(ab)+ab(ab)+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^(ab)+ab(ab)+X/); // $ Alert[js/polynomial-redos] - tainted.match(/aa+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/a+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^a+a+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/\wa+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/a+b+c+/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/aa+X/); // $ Alert[js/polynomial-redos] + tainted.match(/a+X/); // $ Alert[js/polynomial-redos] + tainted.match(/^a+a+X/); // $ Alert[js/polynomial-redos] + tainted.match(/\wa+X/); // $ Alert[js/polynomial-redos] + tainted.match(/a+b+c+/); // $ Alert[js/polynomial-redos] tainted.match(/a+a+a+a+/); - tainted.match(/^([3-7]|A)+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^\d+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/^([3-7]|A)+\d+X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^([3-7]|A)+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] + tainted.match(/^\d+([2-5]|B)+X/); // $ Alert[js/polynomial-redos] + tainted.match(/^([3-7]|A)+\d+X/); // $ Alert[js/polynomial-redos] - tainted.match(/\s*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - tainted.match(/\s+$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/\s*$/); // $ Alert[js/polynomial-redos] + tainted.match(/\s+$/); // $ Alert[js/polynomial-redos] - tainted.match(/^\d*5\w*$/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/^\d*5\w*$/); // $ Alert[js/polynomial-redos] - tainted.match(/\/\*[\d\D]*?\*\//g); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/\/\*[\d\D]*?\*\//g); // $ Alert[js/polynomial-redos] - tainted.match(/(#\d+)+/); // $ Sink[js/polynomial-redos] SPURIOUS: Alert[js/polynomial-redos] - flagged due to insufficient suffix-checking. + tainted.match(/(#\d+)+/); // $ SPURIOUS: Alert[js/polynomial-redos] - flagged due to insufficient suffix-checking. (function foo() { var replaced = tainted.replace(/[^\w\s\-\.\_~]/g, ''); var result = "" result += replaced; - result = result.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + result = result.replace(/^\s+|\s+$/g, ''); // $ Alert[js/polynomial-redos] })(); tainted.match(/(https?:\/\/[^\s]+)/gm); var modified = tainted.replace(/a/g, "b"); - modified.replace(/cc+D/g, "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified.replace(/cc+D/g, "b"); // $ Alert[js/polynomial-redos] var modified2 = tainted.replace(/a|b|c|\d/g, "e"); - modified2.replace(/ff+G/g, "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified2.replace(/ff+G/g, "b"); // $ Alert[js/polynomial-redos] var modified3 = tainted.replace(/\s+/g, ""); - modified3.replace(/hh+I/g, "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified3.replace(/hh+I/g, "b"); // $ Alert[js/polynomial-redos] - tainted.match(/(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)C.*X/); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + tainted.match(/(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)(AA|BB)C.*X/); // $ Alert[js/polynomial-redos] - modified3.replace(new RegExp("hh+I", "g"), "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - modified3.replace(new RegExp("hh+I", unknownFlags()), "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] - modified3.replace(new RegExp("hh+I", ""), "b"); // $ Alert[js/polynomial-redos] Sink[js/polynomial-redos] + modified3.replace(new RegExp("hh+I", "g"), "b"); // $ Alert[js/polynomial-redos] + modified3.replace(new RegExp("hh+I", unknownFlags()), "b"); // $ Alert[js/polynomial-redos] + modified3.replace(new RegExp("hh+I", ""), "b"); // $ Alert[js/polynomial-redos] }); diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts index f3d05b7e5aa..b06ac98b9b3 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route.serverSide.ts @@ -1,5 +1,5 @@ export async function POST(req: Request) { const { url } = await req.json(); // $ Source[js/request-forgery] - const res = await fetch(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(url); // $ Alert[js/request-forgery] return new Response(res.body, { headers: res.headers }); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts index 051ba67e401..82cdcc509fc 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/app/api/proxy/route2.serverSide.ts @@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) { const { url } = await req.json(); // $ Source[js/request-forgery] - const res = await fetch(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(url); // $ Alert[js/request-forgery] const data = await res.text(); return new NextResponse(data, { headers: res.headers }); } diff --git a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts index 3db3a4bae3b..50444849780 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/Request/middleware.ts @@ -4,15 +4,14 @@ export async function middleware(req: NextRequest) { const target = req.nextUrl // $ Source[js/request-forgery] const target2 = target.searchParams.get('target'); // $ Source[js/request-forgery] if (target) { - const res = await fetch(target) // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(target) // $ Alert[js/request-forgery] const data = await res.text() return new NextResponse(data) } if (target2) { - const res = await fetch(target2); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const res = await fetch(target2); // $ Alert[js/request-forgery] const data = await res.text(); return new NextResponse(data); } return NextResponse.next() } - \ No newline at end of file diff --git a/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts b/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts index 0f1c4afa554..da4c5a9693d 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts +++ b/javascript/ql/test/query-tests/Security/CWE-918/apollo.serverSide.ts @@ -5,7 +5,7 @@ function createApolloServer(typeDefs) { const resolvers = { Mutation: { downloadFiles: async (_, { files }) => { // $ Source[js/request-forgery] - files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] Sink[js/request-forgery] + files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] return true; }, }, @@ -15,7 +15,7 @@ function createApolloServer(typeDefs) { const resolvers2 = { Mutation: { downloadFiles: async (_, { files }) => { // $ Source[js/request-forgery] - files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] Sink[js/request-forgery] + files.forEach((file) => { get(file.url, (res) => {}); }); // $ Alert[js/request-forgery] return true; }, }, diff --git a/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js b/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js index d546d809a9d..aa4174cd9ab 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js +++ b/javascript/ql/test/query-tests/Security/CWE-918/clientSide.js @@ -9,16 +9,16 @@ export function MyComponent() { request(params.foo); // Possibly problematic, but not currently flagged. const query = window.location.search.substring(1); // $ Source[js/client-side-request-forgery] - request('https://example.com/api/' + query + '/id'); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] + request('https://example.com/api/' + query + '/id'); // $ Alert[js/client-side-request-forgery] request('https://example.com/api?q=' + query); - request('https://example.com/api/' + window.location.search); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] - likely OK - but currently flagged anyway + request('https://example.com/api/' + window.location.search); // $ Alert[js/client-side-request-forgery] - likely OK - but currently flagged anyway const fragment = window.location.hash.substring(1); // $ Source[js/client-side-request-forgery] - request('https://example.com/api/' + fragment + '/id'); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] + request('https://example.com/api/' + fragment + '/id'); // $ Alert[js/client-side-request-forgery] request('https://example.com/api?q=' + fragment); const name = window.name; // $ Source[js/client-side-request-forgery] - request('https://example.com/api/' + name + '/id'); // $ Alert[js/client-side-request-forgery] Sink[js/client-side-request-forgery] + request('https://example.com/api/' + name + '/id'); // $ Alert[js/client-side-request-forgery] request('https://example.com/api?q=' + name); request(window.location.href + '?q=123'); diff --git a/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js b/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js index fce76208445..3f9392c5d99 100644 --- a/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js +++ b/javascript/ql/test/query-tests/Security/CWE-918/serverSide.js @@ -15,34 +15,34 @@ var server = http.createServer(function(req, res) { request("example.com"); - request(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request(tainted); // $ Alert[js/request-forgery] - request.get(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request.get(tainted); // $ Alert[js/request-forgery] var options = {}; options.url = tainted; // $ Sink[js/request-forgery] request(options); // $ Alert[js/request-forgery] - request("http://" + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request("http://" + tainted); // $ Alert[js/request-forgery] - request("http://example.com" + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request("http://example.com" + tainted); // $ Alert[js/request-forgery] - request("http://example.com/" + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request("http://example.com/" + tainted); // $ Alert[js/request-forgery] request("http://example.com/?" + tainted); - http.get(relativeUrl, {host: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + http.get(relativeUrl, {host: tainted}); // $ Alert[js/request-forgery] - XhrIo.send(new Uri(tainted)); // $ Alert[js/request-forgery] Sink[js/request-forgery] - new XhrIo().send(new Uri(tainted)); // $ Alert[js/request-forgery] Sink[js/request-forgery] + XhrIo.send(new Uri(tainted)); // $ Alert[js/request-forgery] + new XhrIo().send(new Uri(tainted)); // $ Alert[js/request-forgery] let base = require('./config').base; - request(`http://example.com/${base}/${tainted}`); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request(`http://example.com/${base}/${tainted}`); // $ Alert[js/request-forgery] - request(`http://example.com/${base}/v1/${tainted}`); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request(`http://example.com/${base}/v1/${tainted}`); // $ Alert[js/request-forgery] - request('http://example.com/' + base + '/' + tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + request('http://example.com/' + base + '/' + tainted); // $ Alert[js/request-forgery] request('http://example.com/' + base + ('/' + tainted)); // $ MISSING: Alert @@ -58,14 +58,14 @@ var server = http.createServer(async function(req, res) { var tainted = url.parse(req.url, true).query.url; // $ Source[js/request-forgery] var client = await CDP(options); - client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] CDP(options).catch((ignored) => {}).then((client) => { - client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] }) CDP(options, (client) => { - client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] Sink[js/request-forgery] + client.Page.navigate({url: tainted}); // $ Alert[js/request-forgery] }); }) @@ -73,7 +73,7 @@ import {JSDOM} from "jsdom"; var server = http.createServer(async function(req, res) { var tainted = url.parse(req.url, true).query.url; // $ Source[js/request-forgery] - JSDOM.fromURL(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(tainted); // $ Alert[js/request-forgery] }); var route = require('koa-route'); @@ -81,15 +81,15 @@ var Koa = require('koa'); var app = new Koa(); app.use(route.get('/pets', (context, param1, param2, param3) => { // $ Source[js/request-forgery] - JSDOM.fromURL(param1); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(param1); // $ Alert[js/request-forgery] })); const router = require('koa-router')(); const app = new Koa(); router.get('/', async (ctx, next) => { - JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] }).post('/', async (ctx, next) => { - JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] Sink[js/request-forgery] + JSDOM.fromURL(ctx.params.foo); // $ Alert[js/request-forgery] }); app.use(router.routes()); @@ -97,7 +97,7 @@ import {JSDOM} from "jsdom"; var server = http.createServer(async function(req, res) { var tainted = url.parse(req.url, true).query.url; // $ Source[js/request-forgery] - new WebSocket(tainted); // $ Alert[js/request-forgery] Sink[js/request-forgery] + new WebSocket(tainted); // $ Alert[js/request-forgery] }); @@ -106,7 +106,7 @@ import * as ws from 'ws'; new ws.Server({ port: 8080 }).on('connection', function(socket, request) { socket.on('message', function(message) { const url = request.url; // $ Source[js/request-forgery] - const socket = new ws(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const socket = new ws(url); // $ Alert[js/request-forgery] }); }); @@ -114,7 +114,7 @@ new ws.Server({ port: 8080 }).on('connection', function (socket, request) { socket.on('message', function (message) { const url = new URL(request.url, base); // $ Source[js/request-forgery] const target = new URL(url.pathname, base); - const socket = new ws(url); // $ Alert[js/request-forgery] Sink[js/request-forgery] + const socket = new ws(url); // $ Alert[js/request-forgery] }); }); @@ -128,8 +128,8 @@ var server2 = http.createServer(function(req, res) { }) // $ Alert[js/request-forgery] var myUrl = `${something}/bla/${tainted}`; - axios.get(myUrl); // $ Alert[js/request-forgery] Sink[js/request-forgery] + axios.get(myUrl); // $ Alert[js/request-forgery] var myEncodedUrl = `${something}/bla/${encodeURIComponent(tainted)}`; axios.get(myEncodedUrl); -}) \ No newline at end of file +}) From df3282c204c90da970254ad29782c54a09207746 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 11 Apr 2025 14:50:14 +0200 Subject: [PATCH 328/372] C++: Support C23 `typeof` and `typeof_unqual` --- cpp/ql/lib/semmle/code/cpp/Print.qll | 24 ++ cpp/ql/lib/semmle/code/cpp/Type.qll | 228 +++++++++++++++++- cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll | 2 + .../raw/internal/SideEffects.qll | 8 + cpp/ql/lib/semmlecode.cpp.dbscheme | 51 +++- .../SuspiciousCallToMemset.ql | 6 + 6 files changed, 307 insertions(+), 12 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/Print.qll b/cpp/ql/lib/semmle/code/cpp/Print.qll index 5aafe1c2b65..90be4fb8339 100644 --- a/cpp/ql/lib/semmle/code/cpp/Print.qll +++ b/cpp/ql/lib/semmle/code/cpp/Print.qll @@ -176,6 +176,30 @@ private class DecltypeDumpType extends DumpType, Decltype { } } +private class TypeofDumpType extends DumpType, TypeofType { + override string getTypeSpecifier() { result = this.getBaseType().(DumpType).getTypeSpecifier() } + + override string getDeclaratorPrefix() { + result = this.getBaseType().(DumpType).getDeclaratorPrefix() + } + + override string getDeclaratorSuffix() { + result = this.getBaseType().(DumpType).getDeclaratorSuffix() + } +} + +private class IntrinsicTransformedDumpType extends DumpType, IntrinsicTransformedType { + override string getTypeSpecifier() { result = this.getBaseType().(DumpType).getTypeSpecifier() } + + override string getDeclaratorPrefix() { + result = this.getBaseType().(DumpType).getDeclaratorPrefix() + } + + override string getDeclaratorSuffix() { + result = this.getBaseType().(DumpType).getDeclaratorSuffix() + } +} + private class PointerIshDumpType extends DerivedDumpType { PointerIshDumpType() { this instanceof PointerType or diff --git a/cpp/ql/lib/semmle/code/cpp/Type.qll b/cpp/ql/lib/semmle/code/cpp/Type.qll index fbc894a7e07..aa3fa54835c 100644 --- a/cpp/ql/lib/semmle/code/cpp/Type.qll +++ b/cpp/ql/lib/semmle/code/cpp/Type.qll @@ -92,8 +92,9 @@ class Type extends Locatable, @type { /** * Gets this type after typedefs have been resolved. * - * The result of this predicate will be the type itself, except in the case of a TypedefType or a Decltype, - * in which case the result will be type which results from (possibly recursively) resolving typedefs. + * The result of this predicate will be the type itself, except in the case of a TypedefType, a Decltype, + * or a TypeofType, in which case the result will be type which results from (possibly recursively) + * resolving typedefs. */ pragma[nomagic] Type getUnderlyingType() { result = this } @@ -1117,18 +1118,20 @@ class DerivedType extends Type, @derivedtype { * decltype(a) b; * ``` */ -class Decltype extends Type, @decltype { +class Decltype extends Type { + Decltype() { decltypes(underlyingElement(this), _, 0, _, _) } + override string getAPrimaryQlClass() { result = "Decltype" } /** - * The expression whose type is being obtained by this decltype. + * Gets the expression whose type is being obtained by this decltype. */ - Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _) } + Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _, _) } /** - * The type immediately yielded by this decltype. + * Gets the type immediately yielded by this decltype. */ - Type getBaseType() { decltypes(underlyingElement(this), _, unresolveElement(result), _) } + Type getBaseType() { decltypes(underlyingElement(this), _, _, unresolveElement(result), _) } /** * Whether an extra pair of parentheses around the expression would change the semantics of this decltype. @@ -1142,7 +1145,7 @@ class Decltype extends Type, @decltype { * ``` * Please consult the C++11 standard for more details. */ - predicate parenthesesWouldChangeMeaning() { decltypes(underlyingElement(this), _, _, true) } + predicate parenthesesWouldChangeMeaning() { decltypes(underlyingElement(this), _, _, _, true) } override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } @@ -1183,6 +1186,215 @@ class Decltype extends Type, @decltype { } } +/** + * An instance of the C23 `typeof` or `typeof_unqual` operator. For example: + * ``` + * int a; + * typeof(a) b; + * typeof_unqual(const int) b; + * ``` + */ +class TypeofType extends Type { + TypeofType() { + decltypes(underlyingElement(this), _, 1, _, _) or + type_operators(underlyingElement(this), _, 0, _) + } + + /** + * Gets the type immediately yielded by this typeof. + */ + Type getBaseType() { + decltypes(underlyingElement(this), _, _, unresolveElement(result), _) + or + type_operators(underlyingElement(this), _, _, unresolveElement(result)) + } + + override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } + + override Type stripTopLevelSpecifiers() { result = this.getBaseType().stripTopLevelSpecifiers() } + + override Type stripType() { result = this.getBaseType().stripType() } + + override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() } + + override string toString() { result = "typeof(...)" } + + override string getName() { none() } + + override int getSize() { result = this.getBaseType().getSize() } + + override int getAlignment() { result = this.getBaseType().getAlignment() } + + override int getPointerIndirectionLevel() { + result = this.getBaseType().getPointerIndirectionLevel() + } + + override string explain() { + result = "typeof resulting in {" + this.getBaseType().explain() + "}" + } + + override predicate involvesReference() { this.getBaseType().involvesReference() } + + override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() } + + override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() } + + override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConstBelow() } + + override Specifier internal_getAnAdditionalSpecifier() { + result = this.getBaseType().getASpecifier() + } +} + +/** + * An instance of the C23 `typeof` or `typeof_unqual` operator taking an expression + * as its argument. For example: + * ``` + * int a; + * typeof(a) b; + * ``` + */ +class TypeofExprType extends TypeofType { + TypeofExprType() { decltypes(underlyingElement(this), _, 1, _, _) } + + override string getAPrimaryQlClass() { result = "TypeofExprType" } + + /** + * Gets the expression whose type is being obtained by this typeof. + */ + Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _, _) } + + override Location getLocation() { result = this.getExpr().getLocation() } +} + +/** + * A type obtained by C23 `typeof` or `typeof_unqual` operator taking a type as its + * argument. For example: + * ``` + * typeof_unqual(const int) b; + * ``` + */ +class TypeofTypeType extends TypeofType { + TypeofTypeType() { type_operators(underlyingElement(this), _, 0, _) } + + /** + * Gets the expression whose type is being obtained by this typeof. + */ + Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) } + + override string getAPrimaryQlClass() { result = "TypeofTypeType" } + + override string toString() { result = "typeof(...)" } +} + +/** + * A type obtained by applying a type transforming intrinsic. For example: + * ``` + * __make_unsigned(int) x; + * ``` + */ +class IntrinsicTransformedType extends Type { + int intrinsic; + + IntrinsicTransformedType() { + type_operators(underlyingElement(this), _, intrinsic, _) and + intrinsic in [1 .. 19] + } + + override string getAPrimaryQlClass() { result = "IntrinsicTransformedType" } + + override string toString() { result = this.getIntrinsicName() + "(...)" } + + /** + * Gets the type immediately yielded by this transformation. + */ + Type getBaseType() { type_operators(underlyingElement(this), _, _, unresolveElement(result)) } + + /** + * Gets the type that is transformed. + */ + Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) } + + /** + * Gets the name of the intrinsic used to transform the type. + */ + string getIntrinsicName() { + intrinsic = 1 and result = "__underlying_type" + or + intrinsic = 2 and result = "__bases" + or + intrinsic = 3 and result = "__direct_bases" + or + intrinsic = 4 and result = "__add_lvalue_reference" + or + intrinsic = 5 and result = "__add_pointer" + or + intrinsic = 6 and result = "__add_rvalue_reference" + or + intrinsic = 7 and result = "__decay" + or + intrinsic = 8 and result = "__make_signed" + or + intrinsic = 9 and result = "__make_unsigned" + or + intrinsic = 10 and result = "__remove_all_extents" + or + intrinsic = 11 and result = "__remove_const" + or + intrinsic = 12 and result = "__remove_cv" + or + intrinsic = 13 and result = "__remove_cvref" + or + intrinsic = 14 and result = "__remove_extent" + or + intrinsic = 15 and result = "__remove_pointer" + or + intrinsic = 16 and result = "__remove_reference_t" + or + intrinsic = 17 and result = "__remove_restrict" + or + intrinsic = 18 and result = "__remove_volatile" + or + intrinsic = 19 and result = "__remove_reference" + } + + override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() } + + override Type stripTopLevelSpecifiers() { result = this.getBaseType().stripTopLevelSpecifiers() } + + override Type stripType() { result = this.getBaseType().stripType() } + + override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() } + + override string getName() { none() } + + override int getSize() { result = this.getBaseType().getSize() } + + override int getAlignment() { result = this.getBaseType().getAlignment() } + + override int getPointerIndirectionLevel() { + result = this.getBaseType().getPointerIndirectionLevel() + } + + override string explain() { + result = + "application of " + this.getIntrinsicName() + " resulting in {" + this.getBaseType().explain() + + "}" + } + + override predicate involvesReference() { this.getBaseType().involvesReference() } + + override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() } + + override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() } + + override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConstBelow() } + + override Specifier internal_getAnAdditionalSpecifier() { + result = this.getBaseType().getASpecifier() + } +} + /** * A C/C++ pointer type. See 4.9.1. * ``` diff --git a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll index 8ae18239418..2b9fb2649d5 100644 --- a/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll +++ b/cpp/ql/lib/semmle/code/cpp/exprs/Expr.qll @@ -310,6 +310,8 @@ class Expr extends StmtParent, @expr { or exists(Decltype d | d.getExpr() = this.getParentWithConversions*()) or + exists(TypeofExprType t | t.getExpr() = this.getParentWithConversions*()) + or exists(ConstexprIfStmt constIf | constIf.getControllingExpr() = this.getParentWithConversions*() ) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll index 187cde6e700..1b63322610a 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/SideEffects.qll @@ -16,6 +16,10 @@ private predicate isDeeplyConst(Type t) { or isDeeplyConst(t.(Decltype).getBaseType()) or + isDeeplyConst(t.(TypeofType).getBaseType()) + or + isDeeplyConst(t.(IntrinsicTransformedType).getBaseType()) + or isDeeplyConst(t.(ReferenceType).getBaseType()) or exists(SpecifiedType specType | specType = t | @@ -36,6 +40,10 @@ private predicate isDeeplyConstBelow(Type t) { or isDeeplyConstBelow(t.(Decltype).getBaseType()) or + isDeeplyConstBelow(t.(TypeofType).getBaseType()) + or + isDeeplyConstBelow(t.(IntrinsicTransformedType).getBaseType()) + or isDeeplyConst(t.(PointerType).getBaseType()) or isDeeplyConst(t.(ReferenceType).getBaseType()) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme b/cpp/ql/lib/semmlecode.cpp.dbscheme index 2e2d805ef93..9a7c3c14c10 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme @@ -743,15 +743,17 @@ typedefbase( ); /** - * An instance of the C++11 `decltype` operator. For example: + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: * ``` * int a; * decltype(1+a) b; + * typeof(1+a) c; * ``` * Here `expr` is `1+a`. * * Sometimes an additional pair of parentheses around the expression - * would change the semantics of this decltype, e.g. + * changes the semantics of the decltype, e.g. * ``` * struct A { double x; }; * const A* a = new A(); @@ -761,14 +763,55 @@ typedefbase( * (Please consult the C++11 standard for more details). * `parentheses_would_change_meaning` is `true` iff that is the case. */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + #keyset[id, expr] decltypes( int id: @decltype, int expr: @expr ref, + int kind: int ref, int base_type: @type ref, boolean parentheses_would_change_meaning: boolean ref ); +/* +case @type_operator.kind of +| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; +*/ + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type ref +) + /* case @usertype.kind of | 0 = @unknown_usertype @@ -1103,10 +1146,10 @@ stmtattributes( @type = @builtintype | @derivedtype | @usertype - /* TODO | @fixedpointtype */ | @routinetype | @ptrtomember - | @decltype; + | @decltype + | @type_operator; unspecifiedtype( unique int type_id: @type ref, diff --git a/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql b/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql index cb495f939fb..d485666ea4c 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql @@ -47,11 +47,17 @@ Type stripType(Type t) { or result = stripType(t.(Decltype).getBaseType()) or + result = stripType(t.(TypeofType).getBaseType()) + or + result = stripType(t.(IntrinsicTransformedType).getBaseType()) + or not t instanceof TypedefType and not t instanceof ArrayType and not t instanceof ReferenceType and not t instanceof SpecifiedType and not t instanceof Decltype and + not t instanceof TypeofType and + not t instanceof IntrinsicTransformedType and result = t } From e97f9495d086e37eea4685430dc6444754baaac5 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 11 Apr 2025 15:55:37 +0200 Subject: [PATCH 329/372] C++: Update expected test results --- cpp/ql/test/library-tests/declstmt/getDeclaration.expected | 2 ++ .../test/library-tests/declstmt/getDeclarationEntry.expected | 1 + cpp/ql/test/library-tests/enums/typedefs/exprs.expected | 3 ++- .../library-tests/syntax-zoo/dataflow-consistency.expected | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/ql/test/library-tests/declstmt/getDeclaration.expected b/cpp/ql/test/library-tests/declstmt/getDeclaration.expected index 995816ef677..4cfe46b8839 100644 --- a/cpp/ql/test/library-tests/declstmt/getDeclaration.expected +++ b/cpp/ql/test/library-tests/declstmt/getDeclaration.expected @@ -1,5 +1,7 @@ | cpp.cpp:3:5:3:51 | declaration | 0 | cpp.cpp:3:19:3:24 | twisty | | cpp.cpp:3:5:3:51 | declaration | 0 | cpp.cpp:3:43:3:48 | twisty | +| cpp.cpp:3:15:3:27 | declaration | 0 | cpp.cpp:3:19:3:24 | twisty | +| cpp.cpp:3:15:3:27 | declaration | 0 | cpp.cpp:3:43:3:48 | twisty | | cpp.cpp:5:5:5:62 | declaration | 0 | cpp.cpp:5:61:5:61 | i | | cpp.cpp:5:38:5:51 | declaration | 0 | cpp.cpp:5:44:5:44 | t | | declstmt.c:7:5:7:19 | declaration | 0 | declstmt.c:7:9:7:12 | fun1 | diff --git a/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected b/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected index 198e8ccf9fe..ce2b3d3576e 100644 --- a/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected +++ b/cpp/ql/test/library-tests/declstmt/getDeclarationEntry.expected @@ -1,4 +1,5 @@ | cpp.cpp:3:5:3:51 | declaration | 0 | cpp.cpp:3:43:3:48 | declaration of twisty | +| cpp.cpp:3:15:3:27 | declaration | 0 | cpp.cpp:3:19:3:24 | declaration of twisty | | cpp.cpp:5:5:5:62 | declaration | 0 | cpp.cpp:5:61:5:61 | definition of i | | cpp.cpp:5:38:5:51 | declaration | 0 | cpp.cpp:5:44:5:44 | declaration of t | | declstmt.c:7:5:7:19 | declaration | 0 | declstmt.c:7:9:7:12 | definition of fun1 | diff --git a/cpp/ql/test/library-tests/enums/typedefs/exprs.expected b/cpp/ql/test/library-tests/enums/typedefs/exprs.expected index 7a9ce45b403..0613d9e4c2f 100644 --- a/cpp/ql/test/library-tests/enums/typedefs/exprs.expected +++ b/cpp/ql/test/library-tests/enums/typedefs/exprs.expected @@ -1,2 +1,3 @@ | file://:0:0:0:0 | 0 | file://:0:0:0:0 | int | -| test.c:7:20:7:21 | E | file://:0:0:0:0 | int | +| test.c:7:14:7:14 | E | file://:0:0:0:0 | int | +| test.c:7:20:7:21 | E | test.c:7:14:7:14 | typeof(...) | diff --git a/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected b/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected index 9fbef1167a4..064c4e01e2b 100644 --- a/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected +++ b/cpp/ql/test/library-tests/syntax-zoo/dataflow-consistency.expected @@ -8,7 +8,10 @@ uniqueEnclosingCallable | misc.c:210:24:210:24 | 0 | Node should have one enclosing callable but has 0. | | misc.c:210:24:210:28 | ... + ... | Node should have one enclosing callable but has 0. | | misc.c:210:28:210:28 | 1 | Node should have one enclosing callable but has 0. | +| stmt_in_type.cpp:3:12:3:40 | (statement expression) | Node should have one enclosing callable but has 0. | +| stmt_in_type.cpp:3:29:3:34 | call to twisty | Node should have one enclosing callable but has 0. | uniqueCallEnclosingCallable +| stmt_in_type.cpp:3:29:3:34 | call to twisty | Call should have one enclosing callable but has 0. | uniqueType uniqueNodeLocation | file://:0:0:0:0 | (unnamed parameter 2) | Node should have one location but has 0. | From a3e0c15c10126e93bde706b3169c87c3bafba7a1 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 13:26:12 +0200 Subject: [PATCH 330/372] C++: Add upgrade and downgrade scripts --- .../decltypes.ql | 11 + .../derivedtypes.ql | 19 + .../old.dbscheme | 2491 +++++++++++++++++ .../semmlecode.cpp.dbscheme | 2448 ++++++++++++++++ .../upgrade.properties | 5 + .../decltypes.ql | 11 + .../old.dbscheme | 2448 ++++++++++++++++ .../semmlecode.cpp.dbscheme | 2491 +++++++++++++++++ .../upgrade.properties | 3 + 9 files changed, 9927 insertions(+) create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme create mode 100644 cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme create mode 100644 cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql new file mode 100644 index 00000000000..483f3b18190 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/decltypes.ql @@ -0,0 +1,11 @@ +class Type extends @type { + string toString() { none() } +} + +class Expr extends @expr { + string toString() { none() } +} + +from Type decltype, Expr expr, Type basetype, boolean parentheses +where decltypes(decltype, expr, _, basetype, parentheses) +select decltype, expr, basetype, parentheses diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql new file mode 100644 index 00000000000..8ab6ba52557 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/derivedtypes.ql @@ -0,0 +1,19 @@ +class Type extends @type { + string toString() { none() } +} + +predicate derivedType(Type type, string name, int kind, Type type_id) { + derivedtypes(type, name, kind, type_id) +} + +predicate typeTransformation(Type type, string name, int kind, Type type_id) { + type_operators(type, _, _, type_id) and + name = "" and + kind = 3 // @type_with_specifiers +} + +from Type type, string name, int kind, Type type_id +where + derivedType(type, name, kind, type_id) or + typeTransformation(type, name, kind, type_id) +select type, name, kind, type_id diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme new file mode 100644 index 00000000000..9a7c3c14c10 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/old.dbscheme @@ -0,0 +1,2491 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @type_operator.kind of +| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; +*/ + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type ref +) + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme new file mode 100644 index 00000000000..2e2d805ef93 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/semmlecode.cpp.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties new file mode 100644 index 00000000000..48949a6e6e6 --- /dev/null +++ b/cpp/downgrades/9a7c3c14c1076f64b871719117a558733d987b48/upgrade.properties @@ -0,0 +1,5 @@ +description: Support C23 typeof and typeof_unqual +compatibility: backwards +decltypes.rel: run decltypes.qlo +derivedtypes.rel: run derivedtypes.qlo +type_operators.rel: delete diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql new file mode 100644 index 00000000000..6ca3c7e8936 --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/decltypes.ql @@ -0,0 +1,11 @@ +class Type extends @type { + string toString() { none() } +} + +class Expr extends @expr { + string toString() { none() } +} + +from Type decltype, Expr expr, Type basetype, boolean parentheses +where decltypes(decltype, expr, basetype, parentheses) +select decltype, expr, 0, basetype, parentheses diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme new file mode 100644 index 00000000000..2e2d805ef93 --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/old.dbscheme @@ -0,0 +1,2448 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator. For example: + * ``` + * int a; + * decltype(1+a) b; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * would change the semantics of this decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + /* TODO | @fixedpointtype */ + | @routinetype + | @ptrtomember + | @decltype; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme new file mode 100644 index 00000000000..9a7c3c14c10 --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/semmlecode.cpp.dbscheme @@ -0,0 +1,2491 @@ + +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * gcc -c f1.c f2.c f3.c + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * gcc -c f1.c f2.c f3.c + */ + unique int id : @compilation, + string cwd : string ref +); + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--mimic` + * 2 | `/usr/bin/gcc` + * 3 | `-c` + * 4 | f1.c + * 5 | f2.c + * 6 | f3.c + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * Optionally, record the build mode for each compilation. + */ +compilation_build_mode( + unique int id : @compilation ref, + int mode : int ref +); + +/* +case @compilation_build_mode.mode of + 0 = @build_mode_none +| 1 = @build_mode_manual +| 2 = @build_mode_auto +; +*/ + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * gcc -c f1.c f2.c f3.c + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | f1.c + * 1 | f2.c + * 2 | f3.c + * + * Note that even if those files `#include` headers, those headers + * do not appear as rows. + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + + +/** + * External data, loaded from CSV files during snapshot creation. See + * [Tutorial: Incorporating external data](https://help.semmle.com/wiki/display/SD/Tutorial%3A+Incorporating+external+data) + * for more information. + */ +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +/** + * The source location of the snapshot. + */ +sourceLocationPrefix(string prefix : string ref); + +/** + * Information about packages that provide code used during compilation. + * The `id` is just a unique identifier. + * The `namespace` is typically the name of the package manager that + * provided the package (e.g. "dpkg" or "yum"). + * The `package_name` is the name of the package, and `version` is its + * version (as a string). + */ +external_packages( + unique int id: @external_package, + string namespace : string ref, + string package_name : string ref, + string version : string ref +); + +/** + * Holds if File `fileid` was provided by package `package`. + */ +header_to_external_package( + int fileid : @file ref, + int package : @external_package ref +); + +/* + * Version history + */ + +svnentries( + unique int id : @svnentry, + string revision : string ref, + string author : string ref, + date revisionDate : date ref, + int changeSize : int ref +) + +svnaffectedfiles( + int id : @svnentry ref, + int file : @file ref, + string action : string ref +) + +svnentrymsg( + unique int id : @svnentry ref, + string message : string ref +) + +svnchurn( + int commit : @svnentry ref, + int file : @file ref, + int addedLines : int ref, + int deletedLines : int ref +) + +/* + * C++ dbscheme + */ + +extractor_version( + string codeql_version: string ref, + string frontend_version: string ref +) + +@location = @location_stmt | @location_expr | @location_default ; + +/** + * The location of an element that is not an expression or a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_default( + /** The location of an element that is not an expression or a statement. */ + unique int id: @location_default, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of a statement. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_stmt( + /** The location of a statement. */ + unique int id: @location_stmt, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** + * The location of an expression. + * The location spans column `startcolumn` of line `startline` to + * column `endcolumn` of line `endline` in file `file`. + * For more information, see + * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). + */ +locations_expr( + /** The location of an expression. */ + unique int id: @location_expr, + int container: @container ref, + int startLine: int ref, + int startColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +/** An element for which line-count information is available. */ +@sourceline = @file | @function | @variable | @enumconstant | @xmllocatable; + +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int 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_default ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +fileannotations( + int id: @file ref, + int kind: int ref, + string name: string ref, + string value: string ref +); + +inmacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +affectedbymacroexpansion( + int id: @element ref, + int inv: @macroinvocation ref +); + +case @macroinvocation.kind of + 1 = @macro_expansion +| 2 = @other_macro_reference +; + +macroinvocations( + unique int id: @macroinvocation, + int macro_id: @ppd_define ref, + int location: @location_default ref, + int kind: int ref +); + +macroparent( + unique int id: @macroinvocation ref, + int parent_id: @macroinvocation ref +); + +// a macroinvocation may be part of another location +// the way to find a constant expression that uses a macro +// is thus to find a constant expression that has a location +// to which a macro invocation is bound +macrolocationbind( + int id: @macroinvocation ref, + int location: @location ref +); + +#keyset[invocation, argument_index] +macro_argument_unexpanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +#keyset[invocation, argument_index] +macro_argument_expanded( + int invocation: @macroinvocation ref, + int argument_index: int ref, + string text: string ref +); + +/* +case @function.kind of + 1 = @normal_function +| 2 = @constructor +| 3 = @destructor +| 4 = @conversion_function +| 5 = @operator +| 6 = @builtin_function // GCC built-in functions, e.g. __builtin___memcpy_chk +| 7 = @user_defined_literal +| 8 = @deduction_guide +; +*/ + +functions( + unique int id: @function, + string name: string ref, + int kind: int ref +); + +function_entry_point( + int id: @function ref, + unique int entry_point: @stmt ref +); + +function_return_type( + int id: @function ref, + int return_type: @type ref +); + +/** + * If `function` is a coroutine, then this gives the `std::experimental::resumable_traits` + * instance associated with it, and the variables representing the `handle` and `promise` + * for it. + */ +coroutine( + unique int function: @function ref, + int traits: @type ref +); + +/* +case @coroutine_placeholder_variable.kind of + 1 = @handle +| 2 = @promise +| 3 = @init_await_resume +; +*/ + +coroutine_placeholder_variable( + unique int placeholder_variable: @variable ref, + int kind: int ref, + int function: @function ref +) + +/** The `new` function used for allocating the coroutine state, if any. */ +coroutine_new( + unique int function: @function ref, + int new: @function ref +); + +/** The `delete` function used for deallocating the coroutine state, if any. */ +coroutine_delete( + unique int function: @function ref, + int delete: @function ref +); + +purefunctions(unique int id: @function ref); + +function_deleted(unique int id: @function ref); + +function_defaulted(unique int id: @function ref); + +function_prototyped(unique int id: @function ref) + +deduction_guide_for_class( + int id: @function ref, + int class_template: @usertype ref +) + +member_function_this_type( + unique int id: @function ref, + int this_type: @type ref +); + +#keyset[id, type_id] +fun_decls( + int id: @fun_decl, + int function: @function ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +fun_def(unique int id: @fun_decl ref); +fun_specialized(unique int id: @fun_decl ref); +fun_implicit(unique int id: @fun_decl ref); +fun_decl_specifiers( + int id: @fun_decl ref, + string name: string ref +) +#keyset[fun_decl, index] +fun_decl_throws( + int fun_decl: @fun_decl ref, + int index: int ref, + int type_id: @type ref +); +/* an empty throw specification is different from none */ +fun_decl_empty_throws(unique int fun_decl: @fun_decl ref); +fun_decl_noexcept( + int fun_decl: @fun_decl ref, + int constant: @expr ref +); +fun_decl_empty_noexcept(int fun_decl: @fun_decl ref); +fun_decl_typedef_type( + unique int fun_decl: @fun_decl ref, + int typedeftype_id: @usertype ref +); + +/* +case @fun_requires.kind of + 1 = @template_attached +| 2 = @function_attached +; +*/ + +fun_requires( + int id: @fun_decl ref, + int kind: int ref, + int constraint: @expr ref +); + +param_decl_bind( + unique int id: @var_decl ref, + int index: int ref, + int fun_decl: @fun_decl ref +); + +#keyset[id, type_id] +var_decls( + int id: @var_decl, + int variable: @variable ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); +var_def(unique int id: @var_decl ref); +var_specialized(int id: @var_decl ref); +var_decl_specifiers( + int id: @var_decl ref, + string name: string ref +) +is_structured_binding(unique int id: @variable ref); +var_requires( + int id: @var_decl ref, + int constraint: @expr ref +); + +type_decls( + unique int id: @type_decl, + int type_id: @type ref, + int location: @location_default ref +); +type_def(unique int id: @type_decl ref); +type_decl_top( + unique int type_decl: @type_decl ref +); +type_requires( + int id: @type_decl ref, + int constraint: @expr ref +); + +namespace_decls( + unique int id: @namespace_decl, + int namespace_id: @namespace ref, + int location: @location_default ref, + int bodylocation: @location_default ref +); + +case @using.kind of + 1 = @using_declaration +| 2 = @using_directive +| 3 = @using_enum_declaration +; + +usings( + unique int id: @using, + int element_id: @element ref, + int location: @location_default ref, + int kind: int ref +); + +/** The element which contains the `using` declaration. */ +using_container( + int parent: @element ref, + int child: @using ref +); + +static_asserts( + unique int id: @static_assert, + int condition : @expr ref, + string message : string ref, + int location: @location_default ref, + int enclosing : @element ref +); + +// each function has an ordered list of parameters +#keyset[id, type_id] +#keyset[function, index, type_id] +params( + int id: @parameter, + int function: @parameterized_element ref, + int index: int ref, + int type_id: @type ref +); + +overrides( + int new: @function ref, + int old: @function ref +); + +#keyset[id, type_id] +membervariables( + int id: @membervariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +globalvariables( + int id: @globalvariable, + int type_id: @type ref, + string name: string ref +); + +#keyset[id, type_id] +localvariables( + int id: @localvariable, + int type_id: @type ref, + string name: string ref +); + +autoderivation( + unique int var: @variable ref, + int derivation_type: @type ref +); + +orphaned_variables( + int var: @localvariable ref, + int function: @function ref +) + +enumconstants( + unique int id: @enumconstant, + int parent: @usertype ref, + int index: int ref, + int type_id: @type ref, + string name: string ref, + int location: @location_default ref +); + +@variable = @localscopevariable | @globalvariable | @membervariable; + +@localscopevariable = @localvariable | @parameter; + +/** + * Built-in types are the fundamental types, e.g., integral, floating, and void. + */ +case @builtintype.kind of + 1 = @errortype +| 2 = @unknowntype +| 3 = @void +| 4 = @boolean +| 5 = @char +| 6 = @unsigned_char +| 7 = @signed_char +| 8 = @short +| 9 = @unsigned_short +| 10 = @signed_short +| 11 = @int +| 12 = @unsigned_int +| 13 = @signed_int +| 14 = @long +| 15 = @unsigned_long +| 16 = @signed_long +| 17 = @long_long +| 18 = @unsigned_long_long +| 19 = @signed_long_long +// ... 20 Microsoft-specific __int8 +// ... 21 Microsoft-specific __int16 +// ... 22 Microsoft-specific __int32 +// ... 23 Microsoft-specific __int64 +| 24 = @float +| 25 = @double +| 26 = @long_double +| 27 = @complex_float // C99-specific _Complex float +| 28 = @complex_double // C99-specific _Complex double +| 29 = @complex_long_double // C99-specific _Complex long double +| 30 = @imaginary_float // C99-specific _Imaginary float +| 31 = @imaginary_double // C99-specific _Imaginary double +| 32 = @imaginary_long_double // C99-specific _Imaginary long double +| 33 = @wchar_t // Microsoft-specific +| 34 = @decltype_nullptr // C++11 +| 35 = @int128 // __int128 +| 36 = @unsigned_int128 // unsigned __int128 +| 37 = @signed_int128 // signed __int128 +| 38 = @float128 // __float128 +| 39 = @complex_float128 // _Complex __float128 +| 40 = @decimal32 // _Decimal32 +| 41 = @decimal64 // _Decimal64 +| 42 = @decimal128 // _Decimal128 +| 43 = @char16_t +| 44 = @char32_t +| 45 = @std_float32 // _Float32 +| 46 = @float32x // _Float32x +| 47 = @std_float64 // _Float64 +| 48 = @float64x // _Float64x +| 49 = @std_float128 // _Float128 +// ... 50 _Float128x +| 51 = @char8_t +| 52 = @float16 // _Float16 +| 53 = @complex_float16 // _Complex _Float16 +| 54 = @fp16 // __fp16 +| 55 = @std_bfloat16 // __bf16 +| 56 = @std_float16 // std::float16_t +| 57 = @complex_std_float32 // _Complex _Float32 +| 58 = @complex_float32x // _Complex _Float32x +| 59 = @complex_std_float64 // _Complex _Float64 +| 60 = @complex_float64x // _Complex _Float64x +| 61 = @complex_std_float128 // _Complex _Float128 +; + +builtintypes( + unique int id: @builtintype, + string name: string ref, + int kind: int ref, + int size: int ref, + int sign: int ref, + int alignment: int ref +); + +/** + * Derived types are types that are directly derived from existing types and + * point to, refer to, transform type data to return a new type. + */ +case @derivedtype.kind of + 1 = @pointer +| 2 = @reference +| 3 = @type_with_specifiers +| 4 = @array +| 5 = @gnu_vector +| 6 = @routineptr +| 7 = @routinereference +| 8 = @rvalue_reference // C++11 +// ... 9 type_conforming_to_protocols deprecated +| 10 = @block +; + +derivedtypes( + unique int id: @derivedtype, + string name: string ref, + int kind: int ref, + int type_id: @type ref +); + +pointerishsize(unique int id: @derivedtype ref, + int size: int ref, + int alignment: int ref); + +arraysizes( + unique int id: @derivedtype ref, + int num_elements: int ref, + int bytesize: int ref, + int alignment: int ref +); + +typedefbase( + unique int id: @usertype ref, + int type_id: @type ref +); + +/** + * An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual` + * operator taking an expression as its argument. For example: + * ``` + * int a; + * decltype(1+a) b; + * typeof(1+a) c; + * ``` + * Here `expr` is `1+a`. + * + * Sometimes an additional pair of parentheses around the expression + * changes the semantics of the decltype, e.g. + * ``` + * struct A { double x; }; + * const A* a = new A(); + * decltype( a->x ); // type is double + * decltype((a->x)); // type is const double& + * ``` + * (Please consult the C++11 standard for more details). + * `parentheses_would_change_meaning` is `true` iff that is the case. + */ + +/* +case @decltype.kind of +| 0 = @decltype +| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +; +*/ + +#keyset[id, expr] +decltypes( + int id: @decltype, + int expr: @expr ref, + int kind: int ref, + int base_type: @type ref, + boolean parentheses_would_change_meaning: boolean ref +); + +/* +case @type_operator.kind of +| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual +| 1 = @underlying_type +| 2 = @bases +| 3 = @direct_bases +| 4 = @add_lvalue_reference +| 5 = @add_pointer +| 6 = @add_rvalue_reference +| 7 = @decay +| 8 = @make_signed +| 9 = @make_unsigned +| 10 = @remove_all_extents +| 11 = @remove_const +| 12 = @remove_cv +| 13 = @remove_cvref +| 14 = @remove_extent +| 15 = @remove_pointer +| 16 = @remove_reference_t +| 17 = @remove_restrict +| 18 = @remove_volatile +| 19 = @remove_reference +; +*/ + +type_operators( + unique int id: @type_operator, + int arg_type: @type ref, + int kind: int ref, + int base_type: @type ref +) + +/* +case @usertype.kind of +| 0 = @unknown_usertype +| 1 = @struct +| 2 = @class +| 3 = @union +| 4 = @enum +// ... 5 = @typedef deprecated // classic C: typedef typedef type name +// ... 6 = @template deprecated +| 7 = @template_parameter +| 8 = @template_template_parameter +| 9 = @proxy_class // a proxy class associated with a template parameter +// ... 10 objc_class deprecated +// ... 11 objc_protocol deprecated +// ... 12 objc_category deprecated +| 13 = @scoped_enum +// ... 14 = @using_alias deprecated // a using name = type style typedef +| 15 = @template_struct +| 16 = @template_class +| 17 = @template_union +| 18 = @alias +; +*/ + +usertypes( + unique int id: @usertype, + string name: string ref, + int kind: int ref +); + +usertypesize( + unique int id: @usertype ref, + int size: int ref, + int alignment: int ref +); + +usertype_final(unique int id: @usertype ref); + +usertype_uuid( + unique int id: @usertype ref, + string uuid: string ref +); + +/* +case @usertype.alias_kind of +| 0 = @typedef +| 1 = @alias +*/ + +usertype_alias_kind( + int id: @usertype ref, + int alias_kind: int ref +) + +nontype_template_parameters( + int id: @expr ref +); + +type_template_type_constraint( + int id: @usertype ref, + int constraint: @expr ref +); + +mangled_name( + unique int id: @declaration ref, + int mangled_name : @mangledname, + boolean is_complete: boolean ref +); + +is_pod_class(unique int id: @usertype ref); +is_standard_layout_class(unique int id: @usertype ref); + +is_complete(unique int id: @usertype ref); + +is_class_template(unique int id: @usertype ref); +class_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +class_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +class_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@user_or_decltype = @usertype | @decltype; + +is_proxy_class_for( + unique int id: @usertype ref, + int templ_param_id: @user_or_decltype ref +); + +type_mentions( + unique int id: @type_mention, + int type_id: @type ref, + int location: @location ref, + // a_symbol_reference_kind from the frontend. + int kind: int ref +); + +is_function_template(unique int id: @function ref); +function_instantiation( + unique int to: @function ref, + int from: @function ref +); +function_template_argument( + int function_id: @function ref, + int index: int ref, + int arg_type: @type ref +); +function_template_argument_value( + int function_id: @function ref, + int index: int ref, + int arg_value: @expr ref +); + +is_variable_template(unique int id: @variable ref); +variable_instantiation( + unique int to: @variable ref, + int from: @variable ref +); +variable_template_argument( + int variable_id: @variable ref, + int index: int ref, + int arg_type: @type ref +); +variable_template_argument_value( + int variable_id: @variable ref, + int index: int ref, + int arg_value: @expr ref +); + +template_template_instantiation( + int to: @usertype ref, + int from: @usertype ref +); +template_template_argument( + int type_id: @usertype ref, + int index: int ref, + int arg_type: @type ref +); +template_template_argument_value( + int type_id: @usertype ref, + int index: int ref, + int arg_value: @expr ref +); + +@concept = @concept_template | @concept_id; + +concept_templates( + unique int concept_id: @concept_template, + string name: string ref, + int location: @location_default ref +); +concept_instantiation( + unique int to: @concept_id ref, + int from: @concept_template ref +); +is_type_constraint(int concept_id: @concept_id ref); +concept_template_argument( + int concept_id: @concept ref, + int index: int ref, + int arg_type: @type ref +); +concept_template_argument_value( + int concept_id: @concept ref, + int index: int ref, + int arg_value: @expr ref +); + +routinetypes( + unique int id: @routinetype, + int return_type: @type ref +); + +routinetypeargs( + int routine: @routinetype ref, + int index: int ref, + int type_id: @type ref +); + +ptrtomembers( + unique int id: @ptrtomember, + int type_id: @type ref, + int class_id: @type ref +); + +/* + specifiers for types, functions, and variables + + "public", + "protected", + "private", + + "const", + "volatile", + "static", + + "pure", + "virtual", + "sealed", // Microsoft + "__interface", // Microsoft + "inline", + "explicit", + + "near", // near far extension + "far", // near far extension + "__ptr32", // Microsoft + "__ptr64", // Microsoft + "__sptr", // Microsoft + "__uptr", // Microsoft + "dllimport", // Microsoft + "dllexport", // Microsoft + "thread", // Microsoft + "naked", // Microsoft + "microsoft_inline", // Microsoft + "forceinline", // Microsoft + "selectany", // Microsoft + "nothrow", // Microsoft + "novtable", // Microsoft + "noreturn", // Microsoft + "noinline", // Microsoft + "noalias", // Microsoft + "restrict", // Microsoft +*/ + +specifiers( + unique int id: @specifier, + unique string str: string ref +); + +typespecifiers( + int type_id: @type ref, + int spec_id: @specifier ref +); + +funspecifiers( + int func_id: @function ref, + int spec_id: @specifier ref +); + +varspecifiers( + int var_id: @accessible ref, + int spec_id: @specifier ref +); + +explicit_specifier_exprs( + unique int func_id: @function ref, + int constant: @expr ref +) + +attributes( + unique int id: @attribute, + int kind: int ref, + string name: string ref, + string name_space: string ref, + int location: @location_default ref +); + +case @attribute.kind of + 0 = @gnuattribute +| 1 = @stdattribute +| 2 = @declspec +| 3 = @msattribute +| 4 = @alignas +// ... 5 @objc_propertyattribute deprecated +; + +attribute_args( + unique int id: @attribute_arg, + int kind: int ref, + int attribute: @attribute ref, + int index: int ref, + int location: @location_default ref +); + +case @attribute_arg.kind of + 0 = @attribute_arg_empty +| 1 = @attribute_arg_token +| 2 = @attribute_arg_constant +| 3 = @attribute_arg_type +| 4 = @attribute_arg_constant_expr +| 5 = @attribute_arg_expr +; + +attribute_arg_value( + unique int arg: @attribute_arg ref, + string value: string ref +); +attribute_arg_type( + unique int arg: @attribute_arg ref, + int type_id: @type ref +); +attribute_arg_constant( + unique int arg: @attribute_arg ref, + int constant: @expr ref +) +attribute_arg_expr( + unique int arg: @attribute_arg ref, + int expr: @expr ref +) +attribute_arg_name( + unique int arg: @attribute_arg ref, + string name: string ref +); + +typeattributes( + int type_id: @type ref, + int spec_id: @attribute ref +); + +funcattributes( + int func_id: @function ref, + int spec_id: @attribute ref +); + +varattributes( + int var_id: @accessible ref, + int spec_id: @attribute ref +); + +stmtattributes( + int stmt_id: @stmt ref, + int spec_id: @attribute ref +); + +@type = @builtintype + | @derivedtype + | @usertype + | @routinetype + | @ptrtomember + | @decltype + | @type_operator; + +unspecifiedtype( + unique int type_id: @type ref, + int unspecified_type_id: @type ref +); + +member( + int parent: @type ref, + int index: int ref, + int child: @member ref +); + +@enclosingfunction_child = @usertype | @variable | @namespace + +enclosingfunction( + unique int child: @enclosingfunction_child ref, + int parent: @function ref +); + +derivations( + unique int derivation: @derivation, + int sub: @type ref, + int index: int ref, + int super: @type ref, + int location: @location_default ref +); + +derspecifiers( + int der_id: @derivation ref, + int spec_id: @specifier ref +); + +/** + * Contains the byte offset of the base class subobject within the derived + * class. Only holds for non-virtual base classes, but see table + * `virtual_base_offsets` for offsets of virtual base class subobjects. + */ +direct_base_offsets( + unique int der_id: @derivation ref, + int offset: int ref +); + +/** + * Contains the byte offset of the virtual base class subobject for class + * `super` within a most-derived object of class `sub`. `super` can be either a + * direct or indirect base class. + */ +#keyset[sub, super] +virtual_base_offsets( + int sub: @usertype ref, + int super: @usertype ref, + int offset: int ref +); + +frienddecls( + unique int id: @frienddecl, + int type_id: @type ref, + int decl_id: @declaration ref, + int location: @location_default ref +); + +@declaredtype = @usertype ; + +@declaration = @function + | @declaredtype + | @variable + | @enumconstant + | @frienddecl + | @concept_template; + +@member = @membervariable + | @function + | @declaredtype + | @enumconstant; + +@locatable = @diagnostic + | @declaration + | @ppd_include + | @ppd_define + | @macroinvocation + /*| @funcall*/ + | @xmllocatable + | @attribute + | @attribute_arg; + +@namedscope = @namespace | @usertype; + +@element = @locatable + | @file + | @folder + | @specifier + | @type + | @expr + | @namespace + | @initialiser + | @stmt + | @derivation + | @comment + | @preprocdirect + | @fun_decl + | @var_decl + | @type_decl + | @namespace_decl + | @using + | @namequalifier + | @specialnamequalifyingelement + | @static_assert + | @type_mention + | @lambdacapture; + +@exprparent = @element; + +comments( + unique int id: @comment, + string contents: string ref, + int location: @location_default ref +); + +commentbinding( + int id: @comment ref, + int element: @element ref +); + +exprconv( + int converted: @expr ref, + unique int conversion: @expr ref +); + +compgenerated(unique int id: @element ref); + +/** + * `destructor_call` destructs the `i`'th entity that should be + * destructed following `element`. Note that entities should be + * destructed in reverse construction order, so for a given `element` + * these should be called from highest to lowest `i`. + */ +#keyset[element, destructor_call] +#keyset[element, i] +synthetic_destructor_call( + int element: @element ref, + int i: int ref, + int destructor_call: @routineexpr ref +); + +namespaces( + unique int id: @namespace, + string name: string ref +); + +namespace_inline( + unique int id: @namespace ref +); + +namespacembrs( + int parentid: @namespace ref, + unique int memberid: @namespacembr ref +); + +@namespacembr = @declaration | @namespace; + +exprparents( + int expr_id: @expr ref, + int child_index: int ref, + int parent_id: @exprparent ref +); + +expr_isload(unique int expr_id: @expr ref); + +@cast = @c_style_cast + | @const_cast + | @dynamic_cast + | @reinterpret_cast + | @static_cast + ; + +/* +case @conversion.kind of + 0 = @simple_conversion // a numeric conversion, qualification conversion, or a reinterpret_cast +| 1 = @bool_conversion // conversion to 'bool' +| 2 = @base_class_conversion // a derived-to-base conversion +| 3 = @derived_class_conversion // a base-to-derived conversion +| 4 = @pm_base_class_conversion // a derived-to-base conversion of a pointer to member +| 5 = @pm_derived_class_conversion // a base-to-derived conversion of a pointer to member +| 6 = @glvalue_adjust // an adjustment of the type of a glvalue +| 7 = @prvalue_adjust // an adjustment of the type of a prvalue +; +*/ +/** + * Describes the semantics represented by a cast expression. This is largely + * independent of the source syntax of the cast, so it is separate from the + * regular expression kind. + */ +conversionkinds( + unique int expr_id: @cast ref, + int kind: int ref +); + +@conversion = @cast + | @array_to_pointer + | @parexpr + | @reference_to + | @ref_indirect + | @temp_init + | @c11_generic + ; + +/* +case @funbindexpr.kind of + 0 = @normal_call // a normal call +| 1 = @virtual_call // a virtual call +| 2 = @adl_call // a call whose target is only found by ADL +; +*/ +iscall( + unique int caller: @funbindexpr ref, + int kind: int ref +); + +numtemplatearguments( + unique int expr_id: @expr ref, + int num: int ref +); + +specialnamequalifyingelements( + unique int id: @specialnamequalifyingelement, + unique string name: string ref +); + +@namequalifiableelement = @expr | @namequalifier; +@namequalifyingelement = @namespace + | @specialnamequalifyingelement + | @usertype; + +namequalifiers( + unique int id: @namequalifier, + unique int qualifiableelement: @namequalifiableelement ref, + int qualifyingelement: @namequalifyingelement ref, + int location: @location_default ref +); + +varbind( + int expr: @varbindexpr ref, + int var: @accessible ref +); + +funbind( + int expr: @funbindexpr ref, + int fun: @function ref +); + +@any_new_expr = @new_expr + | @new_array_expr; + +@new_or_delete_expr = @any_new_expr + | @delete_expr + | @delete_array_expr; + +@prefix_crement_expr = @preincrexpr | @predecrexpr; + +@postfix_crement_expr = @postincrexpr | @postdecrexpr; + +@increment_expr = @preincrexpr | @postincrexpr; + +@decrement_expr = @predecrexpr | @postdecrexpr; + +@crement_expr = @increment_expr | @decrement_expr; + +@un_arith_op_expr = @arithnegexpr + | @unaryplusexpr + | @conjugation + | @realpartexpr + | @imagpartexpr + | @crement_expr + ; + +@un_bitwise_op_expr = @complementexpr; + +@un_log_op_expr = @notexpr; + +@un_op_expr = @address_of + | @indirect + | @un_arith_op_expr + | @un_bitwise_op_expr + | @builtinaddressof + | @vec_fill + | @un_log_op_expr + | @co_await + | @co_yield + ; + +@bin_log_op_expr = @andlogicalexpr | @orlogicalexpr; + +@cmp_op_expr = @eq_op_expr | @rel_op_expr; + +@eq_op_expr = @eqexpr | @neexpr; + +@rel_op_expr = @gtexpr + | @ltexpr + | @geexpr + | @leexpr + | @spaceshipexpr + ; + +@bin_bitwise_op_expr = @lshiftexpr + | @rshiftexpr + | @andexpr + | @orexpr + | @xorexpr + ; + +@p_arith_op_expr = @paddexpr + | @psubexpr + | @pdiffexpr + ; + +@bin_arith_op_expr = @addexpr + | @subexpr + | @mulexpr + | @divexpr + | @remexpr + | @jmulexpr + | @jdivexpr + | @fjaddexpr + | @jfaddexpr + | @fjsubexpr + | @jfsubexpr + | @minexpr + | @maxexpr + | @p_arith_op_expr + ; + +@bin_op_expr = @bin_arith_op_expr + | @bin_bitwise_op_expr + | @cmp_op_expr + | @bin_log_op_expr + ; + +@op_expr = @un_op_expr + | @bin_op_expr + | @assign_expr + | @conditionalexpr + ; + +@assign_arith_expr = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + ; + +@assign_bitwise_expr = @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + ; + +@assign_pointer_expr = @assignpaddexpr + | @assignpsubexpr + ; + +@assign_op_expr = @assign_arith_expr + | @assign_bitwise_expr + | @assign_pointer_expr + ; + +@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr + +/* + Binary encoding of the allocator form. + + case @allocator.form of + 0 = plain + | 1 = alignment + ; +*/ + +/** + * The allocator function associated with a `new` or `new[]` expression. + * The `form` column specified whether the allocation call contains an alignment + * argument. + */ +expr_allocator( + unique int expr: @any_new_expr ref, + int func: @function ref, + int form: int ref +); + +/* + Binary encoding of the deallocator form. + + case @deallocator.form of + 0 = plain + | 1 = size + | 2 = alignment + | 4 = destroying_delete + ; +*/ + +/** + * The deallocator function associated with a `delete`, `delete[]`, `new`, or + * `new[]` expression. For a `new` or `new[]` expression, the deallocator is the + * one used to free memory if the initialization throws an exception. + * The `form` column specifies whether the deallocation call contains a size + * argument, and alignment argument, or both. + */ +expr_deallocator( + unique int expr: @new_or_delete_expr ref, + int func: @function ref, + int form: int ref +); + +/** + * Holds if the `@conditionalexpr` is of the two operand form + * `guard ? : false`. + */ +expr_cond_two_operand( + unique int cond: @conditionalexpr ref +); + +/** + * The guard of `@conditionalexpr` `guard ? true : false` + */ +expr_cond_guard( + unique int cond: @conditionalexpr ref, + int guard: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` holds. For the two operand form + * `guard ?: false` consider using `expr_cond_guard` instead. + */ +expr_cond_true( + unique int cond: @conditionalexpr ref, + int true: @expr ref +); + +/** + * The expression used when the guard of `@conditionalexpr` + * `guard ? true : false` does not hold. + */ +expr_cond_false( + unique int cond: @conditionalexpr ref, + int false: @expr ref +); + +/** A string representation of the value. */ +values( + unique int id: @value, + string str: string ref +); + +/** The actual text in the source code for the value, if any. */ +valuetext( + unique int id: @value ref, + string text: string ref +); + +valuebind( + int val: @value ref, + unique int expr: @expr ref +); + +fieldoffsets( + unique int id: @variable ref, + int byteoffset: int ref, + int bitoffset: int ref +); + +bitfield( + unique int id: @variable ref, + int bits: int ref, + int declared_bits: int ref +); + +/* TODO +memberprefix( + int member: @expr ref, + int prefix: @expr ref +); +*/ + +/* + kind(1) = mbrcallexpr + kind(2) = mbrptrcallexpr + kind(3) = mbrptrmbrcallexpr + kind(4) = ptrmbrptrmbrcallexpr + kind(5) = mbrreadexpr // x.y + kind(6) = mbrptrreadexpr // p->y + kind(7) = mbrptrmbrreadexpr // x.*pm + kind(8) = mbrptrmbrptrreadexpr // x->*pm + kind(9) = staticmbrreadexpr // static x.y + kind(10) = staticmbrptrreadexpr // static p->y +*/ +/* TODO +memberaccess( + int member: @expr ref, + int kind: int ref +); +*/ + +initialisers( + unique int init: @initialiser, + int var: @accessible ref, + unique int expr: @expr ref, + int location: @location_expr ref +); + +braced_initialisers( + int init: @initialiser ref +); + +/** + * An ancestor for the expression, for cases in which we cannot + * otherwise find the expression's parent. + */ +expr_ancestor( + int exp: @expr ref, + int ancestor: @element ref +); + +exprs( + unique int id: @expr, + int kind: int ref, + int location: @location_expr ref +); + +expr_reuse( + int reuse: @expr ref, + int original: @expr ref, + int value_category: int ref +) + +/* + case @value.category of + 1 = prval + | 2 = xval + | 3 = lval + ; +*/ +expr_types( + int id: @expr ref, + int typeid: @type ref, + int value_category: int ref +); + +case @expr.kind of + 1 = @errorexpr +| 2 = @address_of // & AddressOfExpr +| 3 = @reference_to // ReferenceToExpr (implicit?) +| 4 = @indirect // * PointerDereferenceExpr +| 5 = @ref_indirect // ReferenceDereferenceExpr (implicit?) +// ... +| 8 = @array_to_pointer // (???) +| 9 = @vacuous_destructor_call // VacuousDestructorCall +// ... +| 11 = @assume // Microsoft +| 12 = @parexpr +| 13 = @arithnegexpr +| 14 = @unaryplusexpr +| 15 = @complementexpr +| 16 = @notexpr +| 17 = @conjugation // GNU ~ operator +| 18 = @realpartexpr // GNU __real +| 19 = @imagpartexpr // GNU __imag +| 20 = @postincrexpr +| 21 = @postdecrexpr +| 22 = @preincrexpr +| 23 = @predecrexpr +| 24 = @conditionalexpr +| 25 = @addexpr +| 26 = @subexpr +| 27 = @mulexpr +| 28 = @divexpr +| 29 = @remexpr +| 30 = @jmulexpr // C99 mul imaginary +| 31 = @jdivexpr // C99 div imaginary +| 32 = @fjaddexpr // C99 add real + imaginary +| 33 = @jfaddexpr // C99 add imaginary + real +| 34 = @fjsubexpr // C99 sub real - imaginary +| 35 = @jfsubexpr // C99 sub imaginary - real +| 36 = @paddexpr // pointer add (pointer + int or int + pointer) +| 37 = @psubexpr // pointer sub (pointer - integer) +| 38 = @pdiffexpr // difference between two pointers +| 39 = @lshiftexpr +| 40 = @rshiftexpr +| 41 = @andexpr +| 42 = @orexpr +| 43 = @xorexpr +| 44 = @eqexpr +| 45 = @neexpr +| 46 = @gtexpr +| 47 = @ltexpr +| 48 = @geexpr +| 49 = @leexpr +| 50 = @minexpr // GNU minimum +| 51 = @maxexpr // GNU maximum +| 52 = @assignexpr +| 53 = @assignaddexpr +| 54 = @assignsubexpr +| 55 = @assignmulexpr +| 56 = @assigndivexpr +| 57 = @assignremexpr +| 58 = @assignlshiftexpr +| 59 = @assignrshiftexpr +| 60 = @assignandexpr +| 61 = @assignorexpr +| 62 = @assignxorexpr +| 63 = @assignpaddexpr // assign pointer add +| 64 = @assignpsubexpr // assign pointer sub +| 65 = @andlogicalexpr +| 66 = @orlogicalexpr +| 67 = @commaexpr +| 68 = @subscriptexpr // access to member of an array, e.g., a[5] +// ... 69 @objc_subscriptexpr deprecated +// ... 70 @cmdaccess deprecated +// ... +| 73 = @virtfunptrexpr +| 74 = @callexpr +// ... 75 @msgexpr_normal deprecated +// ... 76 @msgexpr_super deprecated +// ... 77 @atselectorexpr deprecated +// ... 78 @atprotocolexpr deprecated +| 79 = @vastartexpr +| 80 = @vaargexpr +| 81 = @vaendexpr +| 82 = @vacopyexpr +// ... 83 @atencodeexpr deprecated +| 84 = @varaccess +| 85 = @thisaccess +// ... 86 @objc_box_expr deprecated +| 87 = @new_expr +| 88 = @delete_expr +| 89 = @throw_expr +| 90 = @condition_decl // a variable declared in a condition, e.g., if(int x = y > 2) +| 91 = @braced_init_list +| 92 = @type_id +| 93 = @runtime_sizeof +| 94 = @runtime_alignof +| 95 = @sizeof_pack +| 96 = @expr_stmt // GNU extension +| 97 = @routineexpr +| 98 = @type_operand // used to access a type in certain contexts (haven't found any examples yet....) +| 99 = @offsetofexpr // offsetof ::= type and field +| 100 = @hasassignexpr // __has_assign ::= type +| 101 = @hascopyexpr // __has_copy ::= type +| 102 = @hasnothrowassign // __has_nothrow_assign ::= type +| 103 = @hasnothrowconstr // __has_nothrow_constructor ::= type +| 104 = @hasnothrowcopy // __has_nothrow_copy ::= type +| 105 = @hastrivialassign // __has_trivial_assign ::= type +| 106 = @hastrivialconstr // __has_trivial_constructor ::= type +| 107 = @hastrivialcopy // __has_trivial_copy ::= type +| 108 = @hasuserdestr // __has_user_destructor ::= type +| 109 = @hasvirtualdestr // __has_virtual_destructor ::= type +| 110 = @isabstractexpr // __is_abstract ::= type +| 111 = @isbaseofexpr // __is_base_of ::= type type +| 112 = @isclassexpr // __is_class ::= type +| 113 = @isconvtoexpr // __is_convertible_to ::= type type +| 114 = @isemptyexpr // __is_empty ::= type +| 115 = @isenumexpr // __is_enum ::= type +| 116 = @ispodexpr // __is_pod ::= type +| 117 = @ispolyexpr // __is_polymorphic ::= type +| 118 = @isunionexpr // __is_union ::= type +| 119 = @typescompexpr // GNU __builtin_types_compatible ::= type type +| 120 = @intaddrexpr // frontend internal builtin, used to implement offsetof +// ... +| 122 = @hastrivialdestructor // __has_trivial_destructor ::= type +| 123 = @literal +| 124 = @uuidof +| 127 = @aggregateliteral +| 128 = @delete_array_expr +| 129 = @new_array_expr +// ... 130 @objc_array_literal deprecated +// ... 131 @objc_dictionary_literal deprecated +| 132 = @foldexpr +// ... +| 200 = @ctordirectinit +| 201 = @ctorvirtualinit +| 202 = @ctorfieldinit +| 203 = @ctordelegatinginit +| 204 = @dtordirectdestruct +| 205 = @dtorvirtualdestruct +| 206 = @dtorfielddestruct +// ... +| 210 = @static_cast +| 211 = @reinterpret_cast +| 212 = @const_cast +| 213 = @dynamic_cast +| 214 = @c_style_cast +| 215 = @lambdaexpr +| 216 = @param_ref +| 217 = @noopexpr +// ... +| 294 = @istriviallyconstructibleexpr +| 295 = @isdestructibleexpr +| 296 = @isnothrowdestructibleexpr +| 297 = @istriviallydestructibleexpr +| 298 = @istriviallyassignableexpr +| 299 = @isnothrowassignableexpr +| 300 = @istrivialexpr +| 301 = @isstandardlayoutexpr +| 302 = @istriviallycopyableexpr +| 303 = @isliteraltypeexpr +| 304 = @hastrivialmoveconstructorexpr +| 305 = @hastrivialmoveassignexpr +| 306 = @hasnothrowmoveassignexpr +| 307 = @isconstructibleexpr +| 308 = @isnothrowconstructibleexpr +| 309 = @hasfinalizerexpr +| 310 = @isdelegateexpr +| 311 = @isinterfaceclassexpr +| 312 = @isrefarrayexpr +| 313 = @isrefclassexpr +| 314 = @issealedexpr +| 315 = @issimplevalueclassexpr +| 316 = @isvalueclassexpr +| 317 = @isfinalexpr +| 319 = @noexceptexpr +| 320 = @builtinshufflevector +| 321 = @builtinchooseexpr +| 322 = @builtinaddressof +| 323 = @vec_fill +| 324 = @builtinconvertvector +| 325 = @builtincomplex +| 326 = @spaceshipexpr +| 327 = @co_await +| 328 = @co_yield +| 329 = @temp_init +| 330 = @isassignable +| 331 = @isaggregate +| 332 = @hasuniqueobjectrepresentations +| 333 = @builtinbitcast +| 334 = @builtinshuffle +| 335 = @blockassignexpr +| 336 = @issame +| 337 = @isfunction +| 338 = @islayoutcompatible +| 339 = @ispointerinterconvertiblebaseof +| 340 = @isarray +| 341 = @arrayrank +| 342 = @arrayextent +| 343 = @isarithmetic +| 344 = @iscompletetype +| 345 = @iscompound +| 346 = @isconst +| 347 = @isfloatingpoint +| 348 = @isfundamental +| 349 = @isintegral +| 350 = @islvaluereference +| 351 = @ismemberfunctionpointer +| 352 = @ismemberobjectpointer +| 353 = @ismemberpointer +| 354 = @isobject +| 355 = @ispointer +| 356 = @isreference +| 357 = @isrvaluereference +| 358 = @isscalar +| 359 = @issigned +| 360 = @isunsigned +| 361 = @isvoid +| 362 = @isvolatile +| 363 = @reuseexpr +| 364 = @istriviallycopyassignable +| 365 = @isassignablenopreconditioncheck +| 366 = @referencebindstotemporary +| 367 = @issameas +| 368 = @builtinhasattribute +| 369 = @ispointerinterconvertiblewithclass +| 370 = @builtinispointerinterconvertiblewithclass +| 371 = @iscorrespondingmember +| 372 = @builtiniscorrespondingmember +| 373 = @isboundedarray +| 374 = @isunboundedarray +| 375 = @isreferenceable +| 378 = @isnothrowconvertible +| 379 = @referenceconstructsfromtemporary +| 380 = @referenceconvertsfromtemporary +| 381 = @isconvertible +| 382 = @isvalidwinrttype +| 383 = @iswinclass +| 384 = @iswininterface +| 385 = @istriviallyequalitycomparable +| 386 = @isscopedenum +| 387 = @istriviallyrelocatable +| 388 = @datasizeof +| 389 = @c11_generic +| 390 = @requires_expr +| 391 = @nested_requirement +| 392 = @compound_requirement +| 393 = @concept_id +; + +@var_args_expr = @vastartexpr + | @vaendexpr + | @vaargexpr + | @vacopyexpr + ; + +@builtin_op = @var_args_expr + | @noopexpr + | @offsetofexpr + | @intaddrexpr + | @hasassignexpr + | @hascopyexpr + | @hasnothrowassign + | @hasnothrowconstr + | @hasnothrowcopy + | @hastrivialassign + | @hastrivialconstr + | @hastrivialcopy + | @hastrivialdestructor + | @hasuserdestr + | @hasvirtualdestr + | @isabstractexpr + | @isbaseofexpr + | @isclassexpr + | @isconvtoexpr + | @isemptyexpr + | @isenumexpr + | @ispodexpr + | @ispolyexpr + | @isunionexpr + | @typescompexpr + | @builtinshufflevector + | @builtinconvertvector + | @builtinaddressof + | @istriviallyconstructibleexpr + | @isdestructibleexpr + | @isnothrowdestructibleexpr + | @istriviallydestructibleexpr + | @istriviallyassignableexpr + | @isnothrowassignableexpr + | @istrivialexpr + | @isstandardlayoutexpr + | @istriviallycopyableexpr + | @isliteraltypeexpr + | @hastrivialmoveconstructorexpr + | @hastrivialmoveassignexpr + | @hasnothrowmoveassignexpr + | @isconstructibleexpr + | @isnothrowconstructibleexpr + | @hasfinalizerexpr + | @isdelegateexpr + | @isinterfaceclassexpr + | @isrefarrayexpr + | @isrefclassexpr + | @issealedexpr + | @issimplevalueclassexpr + | @isvalueclassexpr + | @isfinalexpr + | @builtinchooseexpr + | @builtincomplex + | @isassignable + | @isaggregate + | @hasuniqueobjectrepresentations + | @builtinbitcast + | @builtinshuffle + | @issame + | @isfunction + | @islayoutcompatible + | @ispointerinterconvertiblebaseof + | @isarray + | @arrayrank + | @arrayextent + | @isarithmetic + | @iscompletetype + | @iscompound + | @isconst + | @isfloatingpoint + | @isfundamental + | @isintegral + | @islvaluereference + | @ismemberfunctionpointer + | @ismemberobjectpointer + | @ismemberpointer + | @isobject + | @ispointer + | @isreference + | @isrvaluereference + | @isscalar + | @issigned + | @isunsigned + | @isvoid + | @isvolatile + | @istriviallycopyassignable + | @isassignablenopreconditioncheck + | @referencebindstotemporary + | @issameas + | @builtinhasattribute + | @ispointerinterconvertiblewithclass + | @builtinispointerinterconvertiblewithclass + | @iscorrespondingmember + | @builtiniscorrespondingmember + | @isboundedarray + | @isunboundedarray + | @isreferenceable + | @isnothrowconvertible + | @referenceconstructsfromtemporary + | @referenceconvertsfromtemporary + | @isconvertible + | @isvalidwinrttype + | @iswinclass + | @iswininterface + | @istriviallyequalitycomparable + | @isscopedenum + | @istriviallyrelocatable + ; + +compound_requirement_is_noexcept( + int expr: @compound_requirement ref +); + +new_allocated_type( + unique int expr: @new_expr ref, + int type_id: @type ref +); + +new_array_allocated_type( + unique int expr: @new_array_expr ref, + int type_id: @type ref +); + +/** + * The field being initialized by an initializer expression within an aggregate + * initializer for a class/struct/union. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_field_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int field: @membervariable ref, + int position: int ref, + boolean is_designated: boolean ref +); + +/** + * The index of the element being initialized by an initializer expression + * within an aggregate initializer for an array. Position is used to sort repeated initializers. + */ +#keyset[aggregate, position] +aggregate_array_init( + int aggregate: @aggregateliteral ref, + int initializer: @expr ref, + int element_index: int ref, + int position: int ref, + boolean is_designated: boolean ref +); + +@ctorinit = @ctordirectinit + | @ctorvirtualinit + | @ctorfieldinit + | @ctordelegatinginit; +@dtordestruct = @dtordirectdestruct + | @dtorvirtualdestruct + | @dtorfielddestruct; + + +condition_decl_bind( + unique int expr: @condition_decl ref, + unique int decl: @declaration ref +); + +typeid_bind( + unique int expr: @type_id ref, + int type_id: @type ref +); + +uuidof_bind( + unique int expr: @uuidof ref, + int type_id: @type ref +); + +@sizeof_or_alignof = @runtime_sizeof | @runtime_alignof | @datasizeof | @sizeof_pack; + +sizeof_bind( + unique int expr: @sizeof_or_alignof ref, + int type_id: @type ref +); + +code_block( + unique int block: @literal ref, + unique int routine: @function ref +); + +lambdas( + unique int expr: @lambdaexpr ref, + string default_capture: string ref, + boolean has_explicit_return_type: boolean ref +); + +lambda_capture( + unique int id: @lambdacapture, + int lambda: @lambdaexpr ref, + int index: int ref, + int field: @membervariable ref, + boolean captured_by_reference: boolean ref, + boolean is_implicit: boolean ref, + int location: @location_default ref +); + +@funbindexpr = @routineexpr + | @new_expr + | @delete_expr + | @delete_array_expr + | @ctordirectinit + | @ctorvirtualinit + | @ctordelegatinginit + | @dtordirectdestruct + | @dtorvirtualdestruct; + +@varbindexpr = @varaccess | @ctorfieldinit | @dtorfielddestruct; +@addressable = @function | @variable ; +@accessible = @addressable | @enumconstant ; + +@access = @varaccess | @routineexpr ; + +fold( + int expr: @foldexpr ref, + string operator: string ref, + boolean is_left_fold: boolean ref +); + +stmts( + unique int id: @stmt, + int kind: int ref, + int location: @location_stmt ref +); + +case @stmt.kind of + 1 = @stmt_expr +| 2 = @stmt_if +| 3 = @stmt_while +| 4 = @stmt_goto +| 5 = @stmt_label +| 6 = @stmt_return +| 7 = @stmt_block +| 8 = @stmt_end_test_while // do { ... } while ( ... ) +| 9 = @stmt_for +| 10 = @stmt_switch_case +| 11 = @stmt_switch +| 13 = @stmt_asm // "asm" statement or the body of an asm function +| 15 = @stmt_try_block +| 16 = @stmt_microsoft_try // Microsoft +| 17 = @stmt_decl +| 18 = @stmt_set_vla_size // C99 +| 19 = @stmt_vla_decl // C99 +| 25 = @stmt_assigned_goto // GNU +| 26 = @stmt_empty +| 27 = @stmt_continue +| 28 = @stmt_break +| 29 = @stmt_range_based_for // C++11 +// ... 30 @stmt_at_autoreleasepool_block deprecated +// ... 31 @stmt_objc_for_in deprecated +// ... 32 @stmt_at_synchronized deprecated +| 33 = @stmt_handler +// ... 34 @stmt_finally_end deprecated +| 35 = @stmt_constexpr_if +| 37 = @stmt_co_return +| 38 = @stmt_consteval_if +| 39 = @stmt_not_consteval_if +; + +type_vla( + int type_id: @type ref, + int decl: @stmt_vla_decl ref +); + +variable_vla( + int var: @variable ref, + int decl: @stmt_vla_decl ref +); + +type_is_vla(unique int type_id: @derivedtype ref) + +if_initialization( + unique int if_stmt: @stmt_if ref, + int init_id: @stmt ref +); + +if_then( + unique int if_stmt: @stmt_if ref, + int then_id: @stmt ref +); + +if_else( + unique int if_stmt: @stmt_if ref, + int else_id: @stmt ref +); + +constexpr_if_initialization( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int init_id: @stmt ref +); + +constexpr_if_then( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int then_id: @stmt ref +); + +constexpr_if_else( + unique int constexpr_if_stmt: @stmt_constexpr_if ref, + int else_id: @stmt ref +); + +@stmt_consteval_or_not_consteval_if = @stmt_consteval_if | @stmt_not_consteval_if; + +consteval_if_then( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int then_id: @stmt ref +); + +consteval_if_else( + unique int constexpr_if_stmt: @stmt_consteval_or_not_consteval_if ref, + int else_id: @stmt ref +); + +while_body( + unique int while_stmt: @stmt_while ref, + int body_id: @stmt ref +); + +do_body( + unique int do_stmt: @stmt_end_test_while ref, + int body_id: @stmt ref +); + +switch_initialization( + unique int switch_stmt: @stmt_switch ref, + int init_id: @stmt ref +); + +#keyset[switch_stmt, index] +switch_case( + int switch_stmt: @stmt_switch ref, + int index: int ref, + int case_id: @stmt_switch_case ref +); + +switch_body( + unique int switch_stmt: @stmt_switch ref, + int body_id: @stmt ref +); + +@stmt_for_or_range_based_for = @stmt_for + | @stmt_range_based_for; + +for_initialization( + unique int for_stmt: @stmt_for_or_range_based_for ref, + int init_id: @stmt ref +); + +for_condition( + unique int for_stmt: @stmt_for ref, + int condition_id: @expr ref +); + +for_update( + unique int for_stmt: @stmt_for ref, + int update_id: @expr ref +); + +for_body( + unique int for_stmt: @stmt_for ref, + int body_id: @stmt ref +); + +@stmtparent = @stmt | @expr_stmt ; +stmtparents( + unique int id: @stmt ref, + int index: int ref, + int parent: @stmtparent ref +); + +ishandler(unique int block: @stmt_block ref); + +@cfgnode = @stmt | @expr | @function | @initialiser ; + +stmt_decl_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl: @declaration ref +); + +stmt_decl_entry_bind( + int stmt: @stmt_decl ref, + int num: int ref, + int decl_entry: @element ref +); + +@parameterized_element = @function | @stmt_block | @requires_expr; + +blockscope( + unique int block: @stmt_block ref, + int enclosing: @parameterized_element ref +); + +@jump = @stmt_goto | @stmt_break | @stmt_continue; + +@jumporlabel = @jump | @stmt_label | @literal; + +jumpinfo( + unique int id: @jumporlabel ref, + string str: string ref, + int target: @stmt ref +); + +preprocdirects( + unique int id: @preprocdirect, + int kind: int ref, + int location: @location_default ref +); +case @preprocdirect.kind of + 0 = @ppd_if +| 1 = @ppd_ifdef +| 2 = @ppd_ifndef +| 3 = @ppd_elif +| 4 = @ppd_else +| 5 = @ppd_endif +| 6 = @ppd_plain_include +| 7 = @ppd_define +| 8 = @ppd_undef +| 9 = @ppd_line +| 10 = @ppd_error +| 11 = @ppd_pragma +| 12 = @ppd_objc_import +| 13 = @ppd_include_next +| 14 = @ppd_ms_import +| 15 = @ppd_elifdef +| 16 = @ppd_elifndef +| 18 = @ppd_warning +; + +@ppd_include = @ppd_plain_include | @ppd_objc_import | @ppd_include_next | @ppd_ms_import; + +@ppd_branch = @ppd_if | @ppd_ifdef | @ppd_ifndef | @ppd_elif | @ppd_elifdef | @ppd_elifndef; + +preprocpair( + int begin : @ppd_branch ref, + int elseelifend : @preprocdirect ref +); + +preproctrue(int branch : @ppd_branch ref); +preprocfalse(int branch : @ppd_branch ref); + +preproctext( + unique int id: @preprocdirect ref, + string head: string ref, + string body: string ref +); + +includes( + unique int id: @ppd_include ref, + int included: @file ref +); + +link_targets( + int id: @link_target, + int binary: @file ref +); + +link_parent( + int element : @element ref, + int link_target : @link_target 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; diff --git a/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties new file mode 100644 index 00000000000..9f42c57a59b --- /dev/null +++ b/cpp/ql/lib/upgrades/2e2d805ef93d060b813403cb9b51dc72455a4c68/upgrade.properties @@ -0,0 +1,3 @@ +description: Support C23 typeof and typeof_unqual +compatibility: partial +decltypes.rel: run decltypes.qlo From 0c313463b4f9a393e60c60fc6ee0c0b9bf766536 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 15:30:35 +0200 Subject: [PATCH 331/372] C++: Update stats file --- cpp/ql/lib/semmlecode.cpp.dbscheme.stats | 5871 ++++++++++++---------- 1 file changed, 3134 insertions(+), 2737 deletions(-) diff --git a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats index 1a4c6b8c5c9..201725ec5d1 100644 --- a/cpp/ql/lib/semmlecode.cpp.dbscheme.stats +++ b/cpp/ql/lib/semmlecode.cpp.dbscheme.stats @@ -2,7 +2,7 @@ @compilation - 16216 + 16209 @externalDataElement @@ -18,63 +18,63 @@ @location_default - 31650363 + 31651328 @location_stmt - 5202903 + 5201796 @location_expr - 17958919 + 17955097 @diagnostic - 1591 + 1590 @file - 83640 + 83605 @folder - 15890 + 15884 @macro_expansion - 40299816 + 40282895 @other_macro_reference - 314184 + 313754 @function - 3356874 + 3352272 @fun_decl - 3388838 + 3384193 @var_decl - 6733822 + 6734162 @type_decl - 1890806 + 1889998 @namespace_decl - 425650 + 425663 @using_declaration - 333262 + 333109 @using_directive - 8162 + 8151 @using_enum_declaration @@ -82,15 +82,15 @@ @static_assert - 183983 + 183988 @parameter - 4798867 + 4792289 @membervariable - 1441833 + 1441877 @globalvariable @@ -98,11 +98,11 @@ @localvariable - 735322 + 735182 @enumconstant - 330365 + 330375 @errortype @@ -330,71 +330,75 @@ @pointer - 472799 + 472813 @type_with_specifiers - 725882 + 725904 @array - 95663 + 95666 @routineptr - 862686 + 861504 @reference - 1024846 + 1024877 @gnu_vector - 867 + 866 @routinereference - 472 + 471 @rvalue_reference - 292102 + 292111 @block 10 + + @type_operator + 8530 + @decltype - 22068 + 102046 @usertype - 4987509 + 4985429 @mangledname - 5807194 + 5807372 @type_mention - 5507858 + 5508026 @concept_template - 3874 + 3873 @routinetype - 762068 + 761024 @ptrtomember - 12084 + 12079 @specifier - 8341 + 8342 @gnuattribute @@ -402,11 +406,11 @@ @stdattribute - 346324 + 346335 @declspec - 326924 + 326934 @msattribute @@ -418,11 +422,11 @@ @attribute_arg_token - 21051 + 21022 @attribute_arg_constant_expr - 89384 + 89401 @attribute_arg_expr @@ -442,19 +446,19 @@ @derivation - 599885 + 599063 @frienddecl - 883308 + 881497 @comment - 11290131 + 11290475 @namespace - 11095 + 11090 @specialnamequalifyingelement @@ -462,147 +466,147 @@ @namequalifier - 3258067 + 3257060 @value - 14099248 + 13198553 @initialiser - 2336670 + 2336741 @address_of - 595215 + 595216 @indirect - 399727 + 402982 @array_to_pointer - 1951447 + 1948138 @parexpr - 4895377 + 4901077 @arithnegexpr - 585842 + 584849 @unaryplusexpr - 4125 + 4124 @complementexpr - 38095 + 38088 @notexpr - 381104 + 357988 @postincrexpr - 84816 + 84819 @postdecrexpr - 57327 + 57229 @preincrexpr - 96450 + 96430 @predecrexpr - 35723 + 35715 @conditionalexpr - 896444 + 895300 @addexpr - 636624 + 569732 @subexpr - 466248 + 465458 @mulexpr - 487054 + 434352 @divexpr - 60353 + 60327 @remexpr - 19891 + 19864 @paddexpr - 118343 + 118322 @psubexpr - 68214 + 68216 @pdiffexpr - 46015 + 46016 @lshiftexpr - 610848 + 550128 @rshiftexpr - 223512 + 199984 @andexpr - 536665 + 479850 @orexpr - 218106 + 193504 @xorexpr - 74057 + 74060 @eqexpr - 641621 + 641484 @neexpr - 411384 + 410687 @gtexpr - 110846 + 110823 @ltexpr - 139049 + 139020 @geexpr - 80993 + 80996 @leexpr - 291234 + 291182 @assignexpr - 1277658 + 1277386 @assignaddexpr @@ -610,15 +614,15 @@ @assignsubexpr - 15266 + 15262 @assignmulexpr - 14129 + 14123 @assigndivexpr - 6826 + 6827 @assignremexpr @@ -634,19 +638,19 @@ @assignandexpr - 6661 + 6509 @assignorexpr - 21379 + 19572 @assignxorexpr - 29827 + 29822 @assignpaddexpr - 18577 + 18573 @assignpsubexpr @@ -654,23 +658,23 @@ @andlogicalexpr - 345646 + 345572 @orlogicalexpr - 1203317 + 1101612 @commaexpr - 167780 + 167785 @subscriptexpr - 433958 + 433866 @callexpr - 302370 + 301955 @vastartexpr @@ -678,7 +682,7 @@ @vaargexpr - 1300 + 1299 @vaendexpr @@ -690,39 +694,39 @@ @varaccess - 8226107 + 8230416 @runtime_sizeof - 397855 + 400615 @runtime_alignof - 61479 + 61395 @expr_stmt - 159816 + 147937 @routineexpr - 6144489 + 6142593 @type_operand - 1532453 + 1402930 @offsetofexpr - 167297 + 148600 @typescompexpr - 765411 + 700718 @literal - 6101411 + 6101426 @aggregateliteral @@ -730,27 +734,27 @@ @c_style_cast - 6024778 + 6024780 @temp_init - 1076142 + 1076374 @errorexpr - 57612 + 57533 @reference_to - 2194481 + 2191473 @ref_indirect - 2657402 + 2653759 @vacuous_destructor_call - 9881 + 9867 @assume @@ -806,35 +810,35 @@ @thisaccess - 1525359 + 1525406 @new_expr - 58257 + 58177 @delete_expr - 14478 + 14458 @throw_expr - 26260 + 26147 @condition_decl - 438294 + 438155 @braced_init_list - 2335 + 2334 @type_id - 60405 + 60322 @sizeof_pack - 2191 + 2188 @hasassignexpr @@ -918,15 +922,15 @@ @hastrivialdestructor - 558 + 557 @uuidof - 27727 + 27728 @delete_array_expr - 1598 + 1597 @new_array_expr @@ -934,19 +938,19 @@ @foldexpr - 1374 + 1372 @ctordirectinit - 142248 + 142053 @ctorvirtualinit - 5069 + 5062 @ctorfieldinit - 259364 + 259009 @ctordelegatinginit @@ -954,39 +958,39 @@ @dtordirectdestruct - 49707 + 49639 @dtorvirtualdestruct - 5026 + 5019 @dtorfielddestruct - 50223 + 50154 @static_cast - 335484 + 335397 @reinterpret_cast - 43189 + 43190 @const_cast - 47226 + 47227 @dynamic_cast - 1016 + 1015 @lambdaexpr - 17829 + 17804 @param_ref - 177994 + 177909 @noopexpr @@ -1014,11 +1018,11 @@ @isnothrowassignableexpr - 5381 + 5382 @istrivialexpr - 830 + 829 @isstandardlayoutexpr @@ -1050,7 +1054,7 @@ @isnothrowconstructibleexpr - 18567 + 18568 @hasfinalizerexpr @@ -1086,11 +1090,11 @@ @isfinalexpr - 1718 + 1716 @noexceptexpr - 30772 + 30758 @builtinshufflevector @@ -1098,7 +1102,7 @@ @builtinchooseexpr - 9758 + 20636 @builtinaddressof @@ -1142,7 +1146,7 @@ @builtinbitcast - 149 + 148 @builtinshuffle @@ -1154,7 +1158,7 @@ @issame - 4866 + 4864 @isfunction @@ -1262,7 +1266,7 @@ @reuseexpr - 907883 + 907596 @istriviallycopyassignable @@ -1358,11 +1362,11 @@ @c11_generic - 2901 + 30031 @requires_expr - 17688 + 17682 @nested_requirement @@ -1370,11 +1374,11 @@ @compound_requirement - 11738 + 11734 @concept_id - 96929 + 96899 @lambdacapture @@ -1382,71 +1386,71 @@ @stmt_expr - 2026085 + 2025654 @stmt_if - 987520 + 987309 @stmt_while - 39540 + 39531 @stmt_goto - 151171 + 151145 @stmt_label - 72506 + 72493 @stmt_return - 1515845 + 1513767 @stmt_block - 1897789 + 1897847 @stmt_end_test_while - 258278 + 232977 @stmt_for - 84159 + 84141 @stmt_switch_case - 896214 + 895930 @stmt_switch - 441453 + 441314 @stmt_asm - 72114 + 64016 @stmt_decl - 770907 + 770583 @stmt_empty - 460249 + 460103 @stmt_continue - 30631 + 28042 @stmt_break - 140998 + 141003 @stmt_try_block - 29068 + 28960 @stmt_microsoft_try @@ -1462,19 +1466,19 @@ @stmt_assigned_goto - 12392 + 12390 @stmt_range_based_for - 7432 + 7422 @stmt_handler - 47531 + 47453 @stmt_constexpr_if - 72386 + 72388 @stmt_co_return @@ -1490,43 +1494,43 @@ @ppd_if - 511548 + 511564 @ppd_ifdef - 227250 + 227257 @ppd_ifndef - 154177 + 154182 @ppd_elif - 28110 + 28098 @ppd_else - 241108 + 241116 @ppd_endif - 846302 + 846328 @ppd_plain_include - 408585 + 408414 @ppd_define - 3130376 + 3130472 @ppd_undef - 93375 + 93378 @ppd_pragma - 405256 + 405268 @ppd_include_next @@ -1534,7 +1538,7 @@ @ppd_line - 19068 + 19065 @ppd_error @@ -1562,7 +1566,7 @@ @link_target - 948 + 947 @xmldtd @@ -1592,11 +1596,11 @@ compilations - 16216 + 16209 id - 16216 + 16209 cwd @@ -1614,7 +1618,7 @@ 1 2 - 16216 + 16209 @@ -1640,19 +1644,19 @@ compilation_args - 1298248 + 1297703 id - 16216 + 16209 num - 1883 + 1882 arg - 37539 + 37523 @@ -1676,22 +1680,22 @@ 43 44 - 921 + 920 44 45 - 650 + 649 45 51 - 1219 + 1218 51 70 - 623 + 622 71 @@ -1711,7 +1715,7 @@ 98 99 - 1720 + 1719 100 @@ -1721,17 +1725,17 @@ 103 104 - 2560 + 2559 104 119 - 1368 + 1367 120 138 - 1192 + 1191 139 @@ -1757,7 +1761,7 @@ 38 39 - 1923 + 1922 39 @@ -1767,12 +1771,12 @@ 40 42 - 1395 + 1394 42 53 - 772 + 771 53 @@ -1797,7 +1801,7 @@ 68 70 - 1246 + 1245 70 @@ -1807,12 +1811,12 @@ 73 79 - 1219 + 1218 79 89 - 1449 + 1448 89 @@ -1838,7 +1842,7 @@ 90 108 - 149 + 148 108 @@ -1848,7 +1852,7 @@ 198 422 - 149 + 148 422 @@ -1863,17 +1867,17 @@ 605 749 - 149 + 148 750 778 - 149 + 148 781 883 - 149 + 148 930 @@ -1904,7 +1908,7 @@ 5 7 - 149 + 148 9 @@ -1914,7 +1918,7 @@ 12 15 - 149 + 148 15 @@ -1924,7 +1928,7 @@ 18 22 - 149 + 148 22 @@ -1939,7 +1943,7 @@ 29 34 - 149 + 148 34 @@ -1949,17 +1953,17 @@ 45 63 - 149 + 148 67 94 - 149 + 148 94 164 - 149 + 148 171 @@ -1980,17 +1984,17 @@ 1 2 - 17191 + 17184 2 3 - 16270 + 16263 3 103 - 2817 + 2816 104 @@ -2011,17 +2015,17 @@ 1 2 - 24859 + 24848 2 3 - 11190 + 11185 3 62 - 1490 + 1489 @@ -2031,11 +2035,11 @@ compilation_build_mode - 16216 + 16209 id - 16216 + 16209 mode @@ -2053,7 +2057,7 @@ 1 2 - 16216 + 16209 @@ -2079,11 +2083,11 @@ compilation_compiling_files - 16216 + 16209 id - 16216 + 16209 num @@ -2091,7 +2095,7 @@ file - 7423 + 7420 @@ -2105,7 +2109,7 @@ 1 2 - 16216 + 16209 @@ -2121,7 +2125,7 @@ 1 2 - 16216 + 16209 @@ -2174,7 +2178,7 @@ 2 3 - 7220 + 7217 28 @@ -2195,7 +2199,7 @@ 1 2 - 7423 + 7420 @@ -2205,11 +2209,11 @@ compilation_time - 64593 + 64566 id - 16148 + 16141 num @@ -2221,7 +2225,7 @@ seconds - 17652 + 17604 @@ -2235,7 +2239,7 @@ 1 2 - 16148 + 16141 @@ -2251,7 +2255,7 @@ 4 5 - 16148 + 16141 @@ -2267,17 +2271,17 @@ 2 3 - 203 + 189 3 4 - 8250 + 8179 4 5 - 7694 + 7772 @@ -2323,8 +2327,8 @@ 12 - 1303 - 1304 + 1300 + 1301 13 @@ -2371,23 +2375,23 @@ 12 - 8 - 9 + 9 + 10 13 - 10 - 11 + 11 + 12 13 - 710 - 711 + 716 + 717 13 - 769 - 770 + 775 + 776 13 @@ -2404,27 +2408,27 @@ 1 2 - 11162 + 11293 2 3 - 3508 + 3493 3 4 - 1598 + 1340 4 - 55 + 20 1327 - 77 - 700 - 54 + 21 + 699 + 148 @@ -2440,7 +2444,7 @@ 1 2 - 17652 + 17604 @@ -2456,16 +2460,16 @@ 1 2 - 15051 + 14760 2 3 - 2587 + 2830 - 4 - 5 + 3 + 4 13 @@ -2476,11 +2480,11 @@ diagnostic_for - 4450 + 4449 diagnostic - 1591 + 1590 compilation @@ -2506,7 +2510,7 @@ 1 2 - 1545 + 1544 63 @@ -2527,7 +2531,7 @@ 1 2 - 1591 + 1590 @@ -2543,7 +2547,7 @@ 1 2 - 1591 + 1590 @@ -2722,15 +2726,15 @@ compilation_finished - 16216 + 16209 id - 16216 + 16209 cpu_seconds - 12165 + 11821 elapsed_seconds @@ -2748,7 +2752,7 @@ 1 2 - 16216 + 16209 @@ -2764,7 +2768,7 @@ 1 2 - 16216 + 16209 @@ -2780,17 +2784,17 @@ 1 2 - 10241 + 9736 2 3 - 1408 + 1530 3 - 38 - 514 + 36 + 555 @@ -2806,7 +2810,7 @@ 1 2 - 11311 + 10968 2 @@ -2832,16 +2836,16 @@ 2 3 + 27 + + + 5 + 6 13 - 3 - 4 - 13 - - - 4 - 5 + 7 + 8 13 @@ -2855,23 +2859,18 @@ 13 - 10 - 11 - 27 - - - 13 - 14 + 11 + 12 13 19 20 - 13 + 27 - 28 - 29 + 23 + 24 13 @@ -2880,23 +2879,23 @@ 13 - 142 - 143 + 136 + 137 13 - 272 - 273 + 269 + 270 13 - 296 - 297 + 314 + 315 13 - 336 - 337 + 328 + 329 13 @@ -2918,16 +2917,16 @@ 2 3 + 27 + + + 5 + 6 13 - 3 - 4 - 13 - - - 4 - 5 + 7 + 8 13 @@ -2941,48 +2940,43 @@ 13 - 10 - 11 - 27 - - - 13 - 14 + 11 + 12 13 19 20 + 27 + + + 23 + 24 13 - 28 - 29 + 40 + 41 13 - 42 - 43 + 127 + 128 13 - 136 - 137 + 156 + 157 13 - 183 - 184 + 240 + 241 13 - 245 - 246 - 13 - - - 246 - 247 + 265 + 266 13 @@ -4755,31 +4749,31 @@ locations_default - 31650363 + 31651328 id - 31650363 + 31651328 container - 41844 + 41845 startLine - 7709289 + 7709525 startColumn - 22469 + 22470 endLine - 7708617 + 7708852 endColumn - 56240 + 56242 @@ -4793,7 +4787,7 @@ 1 2 - 31650363 + 31651328 @@ -4809,7 +4803,7 @@ 1 2 - 31650363 + 31651328 @@ -4825,7 +4819,7 @@ 1 2 - 31650363 + 31651328 @@ -4841,7 +4835,7 @@ 1 2 - 31650363 + 31651328 @@ -4857,7 +4851,7 @@ 1 2 - 31650363 + 31651328 @@ -4933,7 +4927,7 @@ 2212 55160 - 2690 + 2691 @@ -5258,27 +5252,27 @@ 1 2 - 5187066 + 5187224 2 3 - 787639 + 787663 3 4 - 633852 + 633871 4 10 - 618379 + 618398 10 414 - 482351 + 482366 @@ -5294,27 +5288,27 @@ 1 2 - 5247612 + 5247772 2 3 - 1198816 + 1198852 3 5 - 636004 + 636024 5 54 - 579764 + 579781 54 312 - 47091 + 47092 @@ -5330,27 +5324,27 @@ 1 2 - 5929498 + 5929679 2 3 - 579495 + 579512 3 5 - 581378 + 581396 5 42 - 579495 + 579512 42 71 - 39422 + 39423 @@ -5366,12 +5360,12 @@ 1 2 - 7558596 + 7558827 2 82 - 150692 + 150697 @@ -5387,27 +5381,27 @@ 1 2 - 5256089 + 5256249 2 3 - 764363 + 764386 3 4 - 626990 + 627009 4 10 - 600619 + 600637 10 225 - 461228 + 461242 @@ -5803,27 +5797,27 @@ 1 2 - 5183433 + 5183591 2 3 - 792752 + 792776 3 4 - 630892 + 630911 4 9 - 579495 + 579512 9 412 - 522043 + 522059 @@ -5839,27 +5833,27 @@ 1 2 - 5242903 + 5243063 2 3 - 1200968 + 1201005 3 5 - 638830 + 638849 5 54 - 579629 + 579647 54 312 - 46284 + 46285 @@ -5875,12 +5869,12 @@ 1 2 - 7545276 + 7545506 2 7 - 163340 + 163345 @@ -5896,27 +5890,27 @@ 1 2 - 5929632 + 5929813 2 3 - 578956 + 578974 3 5 - 581513 + 581531 5 42 - 578956 + 578974 42 71 - 39556 + 39558 @@ -5932,27 +5926,27 @@ 1 2 - 5253129 + 5253289 2 3 - 768803 + 768826 3 4 - 624030 + 624049 4 10 - 600484 + 600502 10 225 - 462169 + 462183 @@ -5968,7 +5962,7 @@ 1 2 - 15203 + 15204 2 @@ -6034,7 +6028,7 @@ 1 2 - 17356 + 17357 2 @@ -6054,7 +6048,7 @@ 6 8 - 4170 + 4171 8 @@ -6206,7 +6200,7 @@ 60 69 - 4170 + 4171 @@ -6282,19 +6276,19 @@ locations_stmt - 5202903 + 5201796 id - 5202903 + 5201796 container - 4153 + 4152 startLine - 272851 + 272793 startColumn @@ -6302,11 +6296,11 @@ endLine - 265022 + 264966 endColumn - 3227 + 3226 @@ -6320,7 +6314,7 @@ 1 2 - 5202903 + 5201796 @@ -6336,7 +6330,7 @@ 1 2 - 5202903 + 5201796 @@ -6352,7 +6346,7 @@ 1 2 - 5202903 + 5201796 @@ -6368,7 +6362,7 @@ 1 2 - 5202903 + 5201796 @@ -6384,7 +6378,7 @@ 1 2 - 5202903 + 5201796 @@ -6785,67 +6779,67 @@ 1 2 - 29409 + 29403 2 3 - 20878 + 20874 3 4 - 17033 + 17030 4 6 - 19727 + 19723 6 8 - 17090 + 17086 8 11 - 22814 + 22809 11 16 - 23572 + 23567 16 22 - 20934 + 20930 22 29 - 23235 + 23230 29 37 - 23684 + 23679 37 45 - 20625 + 20621 45 56 - 22141 + 22136 56 73 - 11702 + 11699 @@ -6861,67 +6855,67 @@ 1 2 - 30447 + 30441 2 3 - 21467 + 21463 3 4 - 17314 + 17310 4 6 - 19643 + 19639 6 8 - 17370 + 17367 8 11 - 23993 + 23988 11 16 - 22337 + 22333 16 22 - 22141 + 22136 22 29 - 23151 + 23146 29 36 - 21860 + 21856 36 44 - 22309 + 22304 44 54 - 21664 + 21659 54 68 - 9148 + 9146 @@ -6937,57 +6931,57 @@ 1 2 - 36621 + 36613 2 3 - 28455 + 28449 3 4 - 22955 + 22950 4 5 - 21972 + 21968 5 6 - 23797 + 23791 6 7 - 27108 + 27102 7 8 - 31065 + 31058 8 9 - 27894 + 27888 9 10 - 20429 + 20425 10 12 - 22702 + 22697 12 18 - 9849 + 9847 @@ -7003,67 +6997,67 @@ 1 2 - 47229 + 47219 2 3 - 35218 + 35210 3 4 - 25172 + 25166 4 5 - 22113 + 22108 5 6 - 17454 + 17451 6 7 - 16472 + 16469 7 8 - 13919 + 13916 8 9 - 15069 + 15066 9 10 - 14732 + 14729 10 11 - 14396 + 14393 11 12 - 13862 + 13859 12 14 - 21580 + 21575 14 24 - 15630 + 15627 @@ -7079,62 +7073,62 @@ 1 2 - 30223 + 30216 2 3 - 22113 + 22108 3 4 - 17679 + 17675 4 6 - 21944 + 21940 6 8 - 20064 + 20060 8 10 - 18016 + 18012 10 14 - 24947 + 24942 14 18 - 23235 + 23230 18 22 - 24077 + 24072 22 26 - 25228 + 25222 26 30 - 22534 + 22529 30 36 - 20682 + 20677 36 @@ -7525,67 +7519,67 @@ 1 2 - 23768 + 23763 2 3 - 19671 + 19667 3 4 - 15686 + 15683 4 6 - 21299 + 21294 6 8 - 17062 + 17058 8 11 - 21103 + 21098 11 15 - 20008 + 20004 15 21 - 21944 + 21940 21 27 - 21074 + 21070 27 34 - 20373 + 20369 34 42 - 21552 + 21547 42 51 - 19924 + 19920 51 68 - 20261 + 20256 68 @@ -7606,62 +7600,62 @@ 1 2 - 34067 + 34060 2 3 - 22029 + 22024 3 4 - 17426 + 17423 4 6 - 21383 + 21379 6 8 - 20485 + 20481 8 11 - 21692 + 21687 11 16 - 23797 + 23791 16 20 - 19924 + 19920 20 26 - 23432 + 23427 26 32 - 22225 + 22220 32 39 - 20457 + 20453 39 58 - 18100 + 18096 @@ -7677,62 +7671,62 @@ 1 2 - 44338 + 44329 2 3 - 32412 + 32405 3 4 - 25200 + 25194 4 5 - 20794 + 20789 5 6 - 18858 + 18854 6 7 - 15855 + 15851 7 8 - 16248 + 16244 8 9 - 14929 + 14926 9 10 - 13919 + 13916 10 12 - 24442 + 24437 12 15 - 24189 + 24184 15 100 - 13834 + 13831 @@ -7748,57 +7742,57 @@ 1 2 - 34067 + 34060 2 3 - 27838 + 27832 3 4 - 22983 + 22978 4 5 - 24330 + 24325 5 6 - 25340 + 25335 6 7 - 27950 + 27944 7 8 - 30616 + 30609 8 9 - 25593 + 25587 9 10 - 17623 + 17619 10 12 - 20457 + 20453 12 18 - 8222 + 8220 @@ -7814,67 +7808,67 @@ 1 2 - 33731 + 33723 2 3 - 22702 + 22697 3 4 - 17118 + 17114 4 6 - 24330 + 24325 6 8 - 20934 + 20930 8 10 - 17482 + 17479 10 13 - 19699 + 19695 13 16 - 20513 + 20509 16 19 - 20064 + 20060 19 22 - 18970 + 18966 22 26 - 23684 + 23679 26 31 - 20962 + 20958 31 39 - 4826 + 4825 @@ -8274,31 +8268,31 @@ locations_expr - 17958919 + 17955097 id - 17958919 + 17955097 container - 6342 + 6340 startLine - 262019 + 261964 startColumn - 3367 + 3366 endLine - 261991 + 261935 endColumn - 3816 + 3815 @@ -8312,7 +8306,7 @@ 1 2 - 17958919 + 17955097 @@ -8328,7 +8322,7 @@ 1 2 - 17958919 + 17955097 @@ -8344,7 +8338,7 @@ 1 2 - 17958919 + 17955097 @@ -8360,7 +8354,7 @@ 1 2 - 17958919 + 17955097 @@ -8376,7 +8370,7 @@ 1 2 - 17958919 + 17955097 @@ -8397,12 +8391,12 @@ 2 6 - 477 + 476 6 11 - 477 + 476 12 @@ -8412,47 +8406,47 @@ 27 87 - 477 + 476 95 514 - 477 + 476 525 1401 - 477 + 476 1526 2343 - 477 + 476 2404 3615 - 477 + 476 3668 5162 - 477 + 476 5341 7345 - 477 + 476 7399 9307 - 477 + 476 9382 16759 - 477 + 476 18811 @@ -8478,7 +8472,7 @@ 2 4 - 477 + 476 4 @@ -8493,42 +8487,42 @@ 20 66 - 477 + 476 67 162 - 477 + 476 166 362 - 477 + 476 376 591 - 477 + 476 593 929 - 477 + 476 960 1269 - 477 + 476 1291 1782 - 477 + 476 1851 2492 - 477 + 476 2594 @@ -8564,7 +8558,7 @@ 7 16 - 477 + 476 16 @@ -8574,7 +8568,7 @@ 36 59 - 477 + 476 59 @@ -8640,7 +8634,7 @@ 2 4 - 477 + 476 4 @@ -8655,42 +8649,42 @@ 20 68 - 477 + 476 68 163 - 477 + 476 166 362 - 477 + 476 376 592 - 477 + 476 593 931 - 477 + 476 960 1273 - 477 + 476 1292 1786 - 477 + 476 1855 2501 - 477 + 476 2593 @@ -8716,7 +8710,7 @@ 2 4 - 477 + 476 4 @@ -8726,17 +8720,17 @@ 7 15 - 477 + 476 15 36 - 477 + 476 36 62 - 477 + 476 62 @@ -8751,7 +8745,7 @@ 73 75 - 449 + 448 75 @@ -8766,12 +8760,12 @@ 77 79 - 477 + 476 79 84 - 477 + 476 84 @@ -8792,67 +8786,67 @@ 1 5 - 22001 + 21996 5 9 - 22506 + 22501 9 15 - 21888 + 21884 15 23 - 20625 + 20621 23 32 - 20682 + 20677 32 44 - 20485 + 20481 44 60 - 20148 + 20144 60 80 - 20289 + 20284 80 103 - 19952 + 19948 103 130 - 20092 + 20088 130 159 - 19896 + 19892 159 194 - 19952 + 19948 194 297 - 13498 + 13495 @@ -8868,62 +8862,62 @@ 1 2 - 32103 + 32096 2 3 - 21327 + 21322 3 4 - 15490 + 15487 4 6 - 22337 + 22333 6 8 - 18605 + 18601 8 11 - 22421 + 22417 11 16 - 23684 + 23679 16 21 - 22506 + 22501 21 28 - 22674 + 22669 28 35 - 21636 + 21631 35 43 - 21776 + 21771 43 61 - 17454 + 17451 @@ -8939,62 +8933,62 @@ 1 4 - 21804 + 21799 4 7 - 23937 + 23932 7 11 - 22786 + 22781 11 16 - 23768 + 23763 16 21 - 23909 + 23904 21 26 - 20569 + 20565 26 31 - 22085 + 22080 31 36 - 24105 + 24100 36 40 - 21467 + 21463 40 44 - 22618 + 22613 44 49 - 22758 + 22753 49 63 - 12207 + 12204 @@ -9010,27 +9004,27 @@ 1 2 - 138965 + 138936 2 3 - 61120 + 61107 3 4 - 37687 + 37679 4 6 - 19980 + 19976 6 23 - 4265 + 4264 @@ -9046,62 +9040,62 @@ 1 4 - 23151 + 23146 4 7 - 22730 + 22725 7 11 - 22421 + 22417 11 16 - 22141 + 22136 16 21 - 22450 + 22445 21 27 - 22870 + 22866 27 33 - 22478 + 22473 33 38 - 19756 + 19751 38 43 - 21299 + 21294 43 47 - 19952 + 19948 47 52 - 23039 + 23034 52 66 - 19671 + 19667 68 @@ -9198,7 +9192,7 @@ 1 2 - 449 + 448 2 @@ -9426,7 +9420,7 @@ 1 2 - 449 + 448 2 @@ -9502,67 +9496,67 @@ 1 5 - 22029 + 22024 5 9 - 22506 + 22501 9 15 - 21580 + 21575 15 23 - 20597 + 20593 23 32 - 21355 + 21351 32 44 - 20120 + 20116 44 60 - 19784 + 19779 60 80 - 20878 + 20874 80 103 - 19812 + 19807 103 130 - 20008 + 20004 130 159 - 19952 + 19948 159 193 - 19671 + 19667 193 296 - 13694 + 13691 @@ -9578,67 +9572,67 @@ 1 2 - 32103 + 32096 2 3 - 21243 + 21238 3 4 - 15490 + 15487 4 6 - 21916 + 21912 6 8 - 18409 + 18405 8 11 - 22506 + 22501 11 15 - 19784 + 19779 15 20 - 22814 + 22809 20 26 - 20457 + 20453 26 33 - 21916 + 21912 33 40 - 19896 + 19892 40 49 - 20036 + 20032 49 61 - 5416 + 5414 @@ -9654,27 +9648,27 @@ 1 2 - 130266 + 130238 2 3 - 68219 + 68205 3 4 - 40157 + 40148 4 6 - 21383 + 21379 6 11 - 1964 + 1963 @@ -9690,62 +9684,62 @@ 1 4 - 21608 + 21603 4 7 - 23825 + 23820 7 11 - 22506 + 22501 11 16 - 23684 + 23679 16 21 - 23628 + 23623 21 26 - 20682 + 20677 26 31 - 22281 + 22276 31 36 - 24077 + 24072 36 40 - 20878 + 20874 40 44 - 22590 + 22585 44 49 - 23151 + 23146 49 63 - 13077 + 13074 @@ -9761,62 +9755,62 @@ 1 4 - 23460 + 23455 4 7 - 22927 + 22922 7 11 - 22421 + 22417 11 16 - 23039 + 23034 16 21 - 21860 + 21856 21 26 - 19812 + 19807 26 32 - 22057 + 22052 32 38 - 23881 + 23876 38 43 - 22113 + 22108 43 47 - 19784 + 19779 47 52 - 22758 + 22753 52 69 - 17875 + 17872 @@ -9908,7 +9902,7 @@ 1 2 - 449 + 448 2 @@ -10201,19 +10195,19 @@ numlines - 860968 + 860994 element_id - 859622 + 859648 num_lines - 40095 + 40096 num_code - 35924 + 35925 num_comment @@ -10231,7 +10225,7 @@ 1 2 - 858277 + 858303 2 @@ -10252,7 +10246,7 @@ 1 2 - 858277 + 858303 2 @@ -10273,7 +10267,7 @@ 1 2 - 859353 + 859379 2 @@ -10294,7 +10288,7 @@ 1 2 - 26909 + 26910 2 @@ -10330,7 +10324,7 @@ 1 2 - 27178 + 27179 2 @@ -10407,7 +10401,7 @@ 1 2 - 23814 + 23815 2 @@ -10443,7 +10437,7 @@ 1 2 - 24083 + 24084 2 @@ -10458,7 +10452,7 @@ 5 8 - 2690 + 2691 8 @@ -10479,7 +10473,7 @@ 1 2 - 23949 + 23950 2 @@ -10632,11 +10626,11 @@ diagnostics - 1591 + 1590 id - 1591 + 1590 severity @@ -10670,7 +10664,7 @@ 1 2 - 1591 + 1590 @@ -10686,7 +10680,7 @@ 1 2 - 1591 + 1590 @@ -10702,7 +10696,7 @@ 1 2 - 1591 + 1590 @@ -10718,7 +10712,7 @@ 1 2 - 1591 + 1590 @@ -10734,7 +10728,7 @@ 1 2 - 1591 + 1590 @@ -11189,15 +11183,15 @@ files - 83640 + 83605 id - 83640 + 83605 name - 83640 + 83605 @@ -11211,7 +11205,7 @@ 1 2 - 83640 + 83605 @@ -11227,7 +11221,7 @@ 1 2 - 83640 + 83605 @@ -11237,15 +11231,15 @@ folders - 15890 + 15884 id - 15890 + 15884 name - 15890 + 15884 @@ -11259,7 +11253,7 @@ 1 2 - 15890 + 15884 @@ -11275,7 +11269,7 @@ 1 2 - 15890 + 15884 @@ -11285,15 +11279,15 @@ containerparent - 99504 + 99462 parent - 15890 + 15884 child - 99504 + 99462 @@ -11307,12 +11301,12 @@ 1 2 - 7735 + 7732 2 3 - 1950 + 1949 3 @@ -11327,7 +11321,7 @@ 6 10 - 1246 + 1245 10 @@ -11337,7 +11331,7 @@ 16 44 - 1192 + 1191 44 @@ -11358,7 +11352,7 @@ 1 2 - 99504 + 99462 @@ -11368,11 +11362,11 @@ fileannotations - 5387560 + 5385298 id - 7396 + 7393 kind @@ -11380,11 +11374,11 @@ name - 75309 + 75277 value - 50680 + 50659 @@ -11403,7 +11397,7 @@ 2 3 - 7139 + 7136 @@ -11449,7 +11443,7 @@ 480 549 - 325 + 324 550 @@ -11629,62 +11623,62 @@ 1 2 - 14143 + 14137 2 3 - 5595 + 5592 3 5 - 6489 + 6486 5 7 - 5256 + 5254 7 9 - 5893 + 5890 9 16 - 5554 + 5552 16 19 - 6272 + 6269 19 27 - 5459 + 5457 27 47 - 6204 + 6202 47 128 - 6313 + 6310 128 459 - 5933 + 5931 459 546 - 2194 + 2193 @@ -11700,7 +11694,7 @@ 1 2 - 75309 + 75277 @@ -11716,57 +11710,57 @@ 1 2 - 14861 + 14855 2 3 - 9862 + 9858 3 4 - 5256 + 5254 4 6 - 5215 + 5213 6 8 - 4389 + 4387 8 11 - 6082 + 6080 11 17 - 6922 + 6919 17 23 - 6028 + 6026 23 41 - 6001 + 5998 41 95 - 5730 + 5728 95 1726 - 4958 + 4956 @@ -11782,72 +11776,72 @@ 1 2 - 4308 + 4306 2 4 - 2099 + 2098 4 5 - 4091 + 4089 5 8 - 3156 + 3155 8 14 - 3806 + 3805 14 17 - 2479 + 2478 17 24 - 3901 + 3899 24 51 - 4538 + 4536 51 58 - 3888 + 3886 58 80 - 3820 + 3818 81 151 - 3955 + 3954 151 334 - 3820 + 3818 334 473 - 3847 + 3845 473 547 - 2966 + 2965 @@ -11863,7 +11857,7 @@ 1 2 - 50666 + 50645 2 @@ -11884,67 +11878,67 @@ 1 2 - 4362 + 4360 2 4 - 2452 + 2451 4 5 - 3915 + 3913 5 8 - 3183 + 3182 8 14 - 4470 + 4468 14 18 - 4429 + 4428 18 28 - 4104 + 4103 28 34 - 4037 + 4035 34 41 - 4104 + 4103 41 66 - 3833 + 3832 66 92 - 3942 + 3940 92 113 - 3833 + 3832 113 145 - 3888 + 3886 145 @@ -11959,15 +11953,15 @@ inmacroexpansion - 149742219 + 149563577 id - 24596888 + 24598516 inv - 3698096 + 3693134 @@ -11981,37 +11975,37 @@ 1 3 - 2167547 + 2201563 3 5 - 1469286 + 1470740 5 6 - 1617555 + 1615714 6 7 - 6573991 + 6563635 7 8 - 8708717 + 8693954 8 9 - 3552853 + 3546830 9 22 - 506936 + 506076 @@ -12027,57 +12021,57 @@ 1 2 - 529537 + 528641 2 3 - 743634 + 741073 3 4 - 479644 + 480129 4 7 - 273727 + 274512 7 8 - 282495 + 281342 8 9 - 329912 + 329298 9 10 - 2984 + 3037 10 11 - 443915 + 443373 11 337 - 306934 + 306914 339 423 - 281411 + 280946 423 7616 - 23899 + 23866 @@ -12087,15 +12081,15 @@ affectedbymacroexpansion - 48676725 + 48595837 id - 7035600 + 7024503 inv - 3798613 + 3792196 @@ -12109,37 +12103,37 @@ 1 2 - 3842142 + 3835659 2 3 - 764599 + 764103 3 4 - 361415 + 360802 4 5 - 771825 + 770516 5 12 - 534529 + 533623 12 50 - 555611 + 554669 50 9900 - 205476 + 205128 @@ -12155,67 +12149,67 @@ 1 4 - 312858 + 312348 4 7 - 316262 + 315698 7 9 - 300716 + 300223 9 12 - 342528 + 341953 12 13 - 455466 + 454694 13 14 - 225832 + 225450 14 15 - 407557 + 406866 15 16 - 166232 + 165950 16 17 - 377232 + 376592 17 18 - 200400 + 200060 18 20 - 343849 + 343266 20 25 - 285056 + 284573 25 - 109 - 64618 + 207 + 64516 @@ -12225,19 +12219,19 @@ macroinvocations - 40601906 + 40584859 id - 40601906 + 40584859 macro_id - 109909 + 109862 location - 1070112 + 1069663 kind @@ -12255,7 +12249,7 @@ 1 2 - 40601906 + 40584859 @@ -12271,7 +12265,7 @@ 1 2 - 40601906 + 40584859 @@ -12287,7 +12281,7 @@ 1 2 - 40601906 + 40584859 @@ -12303,52 +12297,52 @@ 1 2 - 23518 + 23508 2 3 - 20429 + 20420 3 4 - 7491 + 7488 4 6 - 10106 + 10102 6 11 - 9455 + 9452 11 21 - 9185 + 9181 21 48 - 8250 + 8246 48 145 - 8304 + 8300 145 952 - 8250 + 8246 954 175299 - 4917 + 4915 @@ -12364,37 +12358,37 @@ 1 2 - 60258 + 60232 2 3 - 13642 + 13636 3 4 - 6882 + 6879 4 6 - 8724 + 8720 6 13 - 9442 + 9438 13 67 - 8290 + 8287 67 4815 - 2668 + 2667 @@ -12410,12 +12404,12 @@ 1 2 - 101455 + 101412 2 3 - 8453 + 8449 @@ -12431,37 +12425,37 @@ 1 2 - 426617 + 426438 2 3 - 252710 + 252604 3 4 - 113201 + 113153 4 6 - 77503 + 77471 6 11 - 82760 + 82725 11 42 - 80457 + 80423 42 226288 - 36862 + 36846 @@ -12477,12 +12471,12 @@ 1 2 - 1009664 + 1009240 2 367 - 60447 + 60422 @@ -12498,7 +12492,7 @@ 1 2 - 1070112 + 1069663 @@ -12571,15 +12565,15 @@ macroparent - 35811564 + 35796528 id - 35811564 + 35796528 parent_id - 28060505 + 28048724 @@ -12593,7 +12587,7 @@ 1 2 - 35811564 + 35796528 @@ -12609,17 +12603,17 @@ 1 2 - 21858334 + 21849156 2 3 - 5174353 + 5172181 3 91 - 1027818 + 1027386 @@ -12629,15 +12623,15 @@ macrolocationbind - 5543848 + 5543165 id - 3882182 + 3881794 location - 2758856 + 2758367 @@ -12651,22 +12645,22 @@ 1 2 - 3056758 + 3056516 2 3 - 469908 + 469825 3 7 - 314961 + 314905 7 57 - 40553 + 40546 @@ -12682,22 +12676,22 @@ 1 2 - 2198772 + 2198082 2 3 - 239729 + 239987 3 8 - 216594 + 216556 8 723 - 103759 + 103740 @@ -12707,19 +12701,19 @@ macro_argument_unexpanded - 103253896 + 103210542 invocation - 31226557 + 31213446 argument_index - 894 + 893 text - 440272 + 440087 @@ -12733,22 +12727,22 @@ 1 2 - 9979611 + 9975421 2 3 - 12505256 + 12500006 3 4 - 6395613 + 6392927 4 67 - 2346075 + 2345090 @@ -12764,22 +12758,22 @@ 1 2 - 10213857 + 10209569 2 3 - 12526756 + 12521496 3 4 - 6195695 + 6193094 4 67 - 2290247 + 2289286 @@ -12847,57 +12841,57 @@ 1 2 - 52021 + 51999 2 3 - 79996 + 79963 3 4 - 29682 + 29669 4 5 - 44448 + 44429 5 6 - 50219 + 50198 6 9 - 36591 + 36575 9 15 - 36848 + 36833 15 27 - 33515 + 33501 27 57 - 34125 + 34111 57 517 - 33245 + 33231 518 485091 - 9577 + 9573 @@ -12913,17 +12907,17 @@ 1 2 - 311898 + 311767 2 3 - 115273 + 115225 3 9 - 13100 + 13094 @@ -12933,19 +12927,19 @@ macro_argument_expanded - 103253896 + 103210542 invocation - 31226557 + 31213446 argument_index - 894 + 893 text - 266691 + 266579 @@ -12959,22 +12953,22 @@ 1 2 - 9979611 + 9975421 2 3 - 12505256 + 12500006 3 4 - 6395613 + 6392927 4 67 - 2346075 + 2345090 @@ -12990,22 +12984,22 @@ 1 2 - 13763324 + 13757545 2 3 - 10789914 + 10785384 3 4 - 5404074 + 5401805 4 9 - 1269243 + 1268711 @@ -13047,7 +13041,7 @@ 1 2 - 772 + 771 2 @@ -13073,57 +13067,57 @@ 1 2 - 28300 + 28288 2 3 - 35155 + 35140 3 4 - 58510 + 58486 4 5 - 20564 + 20556 5 6 - 3996 + 3994 6 7 - 23314 + 23305 7 10 - 21770 + 21761 10 19 - 22949 + 22939 19 51 - 20077 + 20068 51 253 - 20090 + 20082 254 990266 - 11962 + 11957 @@ -13139,17 +13133,17 @@ 1 2 - 134781 + 134725 2 3 - 114040 + 113993 3 66 - 17868 + 17861 @@ -13159,15 +13153,15 @@ functions - 3356874 + 3352272 id - 3356874 + 3352272 name - 466658 + 466018 kind @@ -13185,7 +13179,7 @@ 1 2 - 3356874 + 3352272 @@ -13201,7 +13195,7 @@ 1 2 - 3356874 + 3352272 @@ -13217,22 +13211,22 @@ 1 2 - 372699 + 372188 2 3 - 31835 + 31791 3 9 - 36045 + 35996 9 4916 - 26078 + 26042 @@ -13248,12 +13242,12 @@ 1 2 - 465412 + 464774 2 4 - 1245 + 1244 @@ -13365,15 +13359,15 @@ function_entry_point - 1438642 + 1436670 id - 1433916 + 1431950 entry_point - 1438642 + 1436670 @@ -13387,12 +13381,12 @@ 1 2 - 1429877 + 1427917 2 17 - 4038 + 4032 @@ -13408,7 +13402,7 @@ 1 2 - 1438642 + 1436670 @@ -13418,15 +13412,15 @@ function_return_type - 3363190 + 3358579 id - 3356874 + 3352272 return_type - 631806 + 630940 @@ -13440,12 +13434,12 @@ 1 2 - 3351074 + 3346480 2 5 - 5799 + 5791 @@ -13461,22 +13455,22 @@ 1 2 - 436971 + 436372 2 3 - 120423 + 120258 3 6 - 52070 + 51999 6 36283 - 22340 + 22309 @@ -13756,44 +13750,44 @@ purefunctions - 137885 + 137889 id - 137885 + 137889 function_deleted - 94416 + 94386 id - 94416 + 94386 function_defaulted - 55395 + 55377 id - 55395 + 55377 function_prototyped - 3352750 + 3348154 id - 3352750 + 3348154 @@ -13873,15 +13867,15 @@ member_function_this_type - 674425 + 673500 id - 674425 + 673500 this_type - 233544 + 233223 @@ -13895,7 +13889,7 @@ 1 2 - 674425 + 673500 @@ -13911,32 +13905,32 @@ 1 2 - 82831 + 82718 2 3 - 61135 + 61051 3 4 - 36518 + 36468 4 5 - 16927 + 16904 5 7 - 19204 + 19177 7 66 - 16927 + 16904 @@ -13946,27 +13940,27 @@ fun_decls - 3392748 + 3388097 id - 3388838 + 3384193 function - 3232283 + 3227852 type_id - 600787 + 599963 name - 462018 + 461385 location - 932372 + 931093 @@ -13980,7 +13974,7 @@ 1 2 - 3388838 + 3384193 @@ -13996,12 +13990,12 @@ 1 2 - 3385444 + 3380803 2 5 - 3394 + 3389 @@ -14017,7 +14011,7 @@ 1 2 - 3388838 + 3384193 @@ -14033,7 +14027,7 @@ 1 2 - 3388838 + 3384193 @@ -14049,12 +14043,12 @@ 1 2 - 3101892 + 3097640 2 7 - 130391 + 130212 @@ -14070,12 +14064,12 @@ 1 2 - 3221929 + 3217512 2 5 - 10353 + 10339 @@ -14091,7 +14085,7 @@ 1 2 - 3232283 + 3227852 @@ -14107,12 +14101,12 @@ 1 2 - 3146959 + 3142645 2 6 - 85323 + 85206 @@ -14128,22 +14122,22 @@ 1 2 - 397059 + 396515 2 3 - 127254 + 127080 3 6 - 53359 + 53286 6 37538 - 23113 + 23082 @@ -14159,22 +14153,22 @@ 1 2 - 415404 + 414834 2 3 - 112733 + 112579 3 6 - 52285 + 52213 6 35946 - 20364 + 20336 @@ -14190,22 +14184,22 @@ 1 2 - 472630 + 471982 2 3 - 73422 + 73322 3 7 - 45153 + 45091 7 3213 - 9580 + 9567 @@ -14221,22 +14215,22 @@ 1 2 - 441310 + 440705 2 3 - 90221 + 90097 3 6 - 51383 + 51312 6 7079 - 17872 + 17847 @@ -14252,27 +14246,27 @@ 1 2 - 347652 + 347175 2 3 - 37978 + 37926 3 6 - 37592 + 37540 6 110 - 34756 + 34709 110 4996 - 4038 + 4032 @@ -14288,22 +14282,22 @@ 1 2 - 369348 + 368842 2 3 - 32050 + 32006 3 9 - 35615 + 35567 9 4900 - 25004 + 24969 @@ -14319,12 +14313,12 @@ 1 2 - 427519 + 426933 2 3435 - 34498 + 34451 @@ -14340,22 +14334,22 @@ 1 2 - 355514 + 355027 2 3 - 50738 + 50669 3 6 - 35787 + 35738 6 1706 - 19977 + 19950 @@ -14371,22 +14365,22 @@ 1 2 - 736892 + 735882 2 3 - 90264 + 90140 3 13 - 70630 + 70533 13 1516 - 34584 + 34537 @@ -14402,22 +14396,22 @@ 1 2 - 777793 + 776726 2 4 - 73251 + 73150 4 66 - 71017 + 70919 66 1516 - 10310 + 10296 @@ -14433,17 +14427,17 @@ 1 2 - 854395 + 853223 2 19 - 70286 + 70190 19 1509 - 7690 + 7679 @@ -14459,12 +14453,12 @@ 1 2 - 884769 + 883556 2 10 - 47602 + 47537 @@ -14474,11 +14468,11 @@ fun_def - 1592190 + 1590007 id - 1592190 + 1590007 @@ -14507,11 +14501,11 @@ fun_decl_specifiers - 2464552 + 2464627 id - 1197759 + 1197795 name @@ -14529,17 +14523,17 @@ 1 2 - 267558 + 267566 2 3 - 596777 + 596795 3 4 - 330256 + 330266 4 @@ -14716,26 +14710,26 @@ fun_decl_empty_throws - 435234 + 435248 fun_decl - 435234 + 435248 fun_decl_noexcept - 178852 + 178607 fun_decl - 178852 + 178607 constant - 178251 + 178007 @@ -14749,7 +14743,7 @@ 1 2 - 178852 + 178607 @@ -14765,12 +14759,12 @@ 1 2 - 177692 + 177449 2 4 - 558 + 557 @@ -14780,11 +14774,11 @@ fun_decl_empty_noexcept - 1063865 + 1063897 fun_decl - 1063865 + 1063897 @@ -14889,11 +14883,11 @@ fun_requires - 31202 + 31193 id - 10839 + 10835 kind @@ -14901,7 +14895,7 @@ constraint - 30949 + 30939 @@ -14915,7 +14909,7 @@ 1 2 - 10769 + 10766 2 @@ -14936,7 +14930,7 @@ 1 2 - 7794 + 7792 2 @@ -14956,7 +14950,7 @@ 13 14 - 1222 + 1221 19 @@ -15019,7 +15013,7 @@ 1 2 - 30695 + 30685 2 @@ -15040,7 +15034,7 @@ 1 2 - 30949 + 30939 @@ -15050,19 +15044,19 @@ param_decl_bind - 4870873 + 4864195 id - 4870873 + 4864195 index - 859 + 858 fun_decl - 2664662 + 2661010 @@ -15076,7 +15070,7 @@ 1 2 - 4870873 + 4864195 @@ -15092,7 +15086,7 @@ 1 2 - 4870873 + 4864195 @@ -15270,22 +15264,22 @@ 1 2 - 1370804 + 1368925 2 3 - 667766 + 666850 3 4 - 449001 + 448385 4 21 - 177091 + 176848 @@ -15301,22 +15295,22 @@ 1 2 - 1370804 + 1368925 2 3 - 667766 + 666850 3 4 - 449001 + 448385 4 21 - 177091 + 176848 @@ -15326,27 +15320,27 @@ var_decls - 6738800 + 6739140 id - 6733822 + 6734162 variable - 6565772 + 6565972 type_id - 1513118 + 1513164 name - 829080 + 829105 location - 3605463 + 3605573 @@ -15360,7 +15354,7 @@ 1 2 - 6733822 + 6734162 @@ -15376,7 +15370,7 @@ 1 2 - 6728843 + 6729183 2 @@ -15397,7 +15391,7 @@ 1 2 - 6733822 + 6734162 @@ -15413,7 +15407,7 @@ 1 2 - 6733822 + 6734162 @@ -15429,12 +15423,12 @@ 1 2 - 6408890 + 6408951 2 4 - 156882 + 157021 @@ -15450,7 +15444,7 @@ 1 2 - 6551241 + 6551441 2 @@ -15471,7 +15465,7 @@ 1 2 - 6548550 + 6548750 2 @@ -15492,12 +15486,12 @@ 1 2 - 6434723 + 6434919 2 4 - 131049 + 131053 @@ -15513,27 +15507,27 @@ 1 2 - 890164 + 890191 2 3 - 294254 + 294129 3 5 - 133067 + 133205 5 12 - 116517 + 116521 12 1800 - 79113 + 79116 @@ -15549,27 +15543,27 @@ 1 2 - 909405 + 909432 2 3 - 280531 + 280539 3 5 - 129165 + 129169 5 12 - 116383 + 116386 12 1756 - 77633 + 77636 @@ -15585,22 +15579,22 @@ 1 2 - 1159932 + 1159967 2 3 - 207740 + 207747 3 7 - 115979 + 115983 7 981 - 29465 + 29466 @@ -15616,27 +15610,27 @@ 1 2 - 1026326 + 1026357 2 3 - 228595 + 228602 3 5 - 112481 + 112484 5 17 - 114365 + 114368 17 1756 - 31349 + 31350 @@ -15652,32 +15646,32 @@ 1 2 - 457998 + 458012 2 3 - 157016 + 157021 3 4 - 58124 + 58126 4 7 - 65389 + 65391 7 28 - 62833 + 62835 28 - 6408 - 27716 + 6409 + 27717 @@ -15693,27 +15687,27 @@ 1 2 - 471857 + 471871 2 3 - 156343 + 156348 3 4 - 51935 + 51936 4 8 - 69830 + 69832 8 47 - 62564 + 62566 47 @@ -15734,22 +15728,22 @@ 1 2 - 640175 + 640195 2 3 - 101448 + 101451 3 10 - 62968 + 62970 10 3216 - 24487 + 24488 @@ -15765,27 +15759,27 @@ 1 2 - 487733 + 487748 2 3 - 170067 + 170072 3 4 - 51800 + 51802 4 8 - 63371 + 63373 8 1866 - 56106 + 56107 @@ -15801,17 +15795,17 @@ 1 2 - 3120824 + 3120919 2 4 - 290622 + 290630 4 - 2757 - 194017 + 2758 + 194023 @@ -15827,17 +15821,17 @@ 1 2 - 3145715 + 3145811 2 5 - 299771 + 299780 5 2752 - 159976 + 159981 @@ -15853,17 +15847,17 @@ 1 2 - 3312957 + 3313058 2 13 - 271516 + 271524 13 2391 - 20989 + 20990 @@ -15879,12 +15873,12 @@ 1 2 - 3594430 + 3594540 2 5 - 11032 + 11033 @@ -15894,11 +15888,11 @@ var_def - 3747410 + 3747525 id - 3747410 + 3747525 @@ -15916,11 +15910,11 @@ var_decl_specifiers - 487061 + 487076 id - 487061 + 487076 name @@ -15938,7 +15932,7 @@ 1 2 - 487061 + 487076 @@ -15990,7 +15984,7 @@ var_requires - 415 + 414 id @@ -15998,7 +15992,7 @@ constraint - 415 + 414 @@ -16038,7 +16032,7 @@ 1 2 - 415 + 414 @@ -16048,19 +16042,19 @@ type_decls - 1890806 + 1889998 id - 1890806 + 1889998 type_id - 1849392 + 1848615 location - 1485539 + 1484915 @@ -16074,7 +16068,7 @@ 1 2 - 1890806 + 1889998 @@ -16090,7 +16084,7 @@ 1 2 - 1890806 + 1889998 @@ -16106,12 +16100,12 @@ 1 2 - 1819601 + 1818837 2 24 - 29790 + 29777 @@ -16127,12 +16121,12 @@ 1 2 - 1820929 + 1820164 2 24 - 28462 + 28450 @@ -16148,12 +16142,12 @@ 1 2 - 1409011 + 1408419 2 651 - 76528 + 76496 @@ -16169,12 +16163,12 @@ 1 2 - 1410352 + 1409760 2 651 - 75187 + 75155 @@ -16184,29 +16178,29 @@ type_def - 1297381 + 1296836 id - 1297381 + 1296836 type_decl_top - 652211 + 652231 type_decl - 652211 + 652231 type_requires - 8233 + 8230 id @@ -16214,7 +16208,7 @@ constraint - 8210 + 8207 @@ -16264,7 +16258,7 @@ 1 2 - 8187 + 8184 2 @@ -16279,11 +16273,11 @@ namespace_decls - 425650 + 425663 id - 425650 + 425663 namespace_id @@ -16291,11 +16285,11 @@ location - 425650 + 425663 bodylocation - 425650 + 425663 @@ -16309,7 +16303,7 @@ 1 2 - 425650 + 425663 @@ -16325,7 +16319,7 @@ 1 2 - 425650 + 425663 @@ -16341,7 +16335,7 @@ 1 2 - 425650 + 425663 @@ -16555,7 +16549,7 @@ 1 2 - 425650 + 425663 @@ -16571,7 +16565,7 @@ 1 2 - 425650 + 425663 @@ -16587,7 +16581,7 @@ 1 2 - 425650 + 425663 @@ -16603,7 +16597,7 @@ 1 2 - 425650 + 425663 @@ -16619,7 +16613,7 @@ 1 2 - 425650 + 425663 @@ -16635,7 +16629,7 @@ 1 2 - 425650 + 425663 @@ -16645,19 +16639,19 @@ usings - 338586 + 338431 id - 338586 + 338431 element_id - 65352 + 65311 location - 33922 + 33908 kind @@ -16675,7 +16669,7 @@ 1 2 - 338586 + 338431 @@ -16691,7 +16685,7 @@ 1 2 - 338586 + 338431 @@ -16707,7 +16701,7 @@ 1 2 - 338586 + 338431 @@ -16723,17 +16717,17 @@ 1 2 - 55435 + 55398 2 4 - 5608 + 5606 4 134 - 4308 + 4306 @@ -16749,17 +16743,17 @@ 1 2 - 55435 + 55398 2 4 - 5608 + 5606 4 134 - 4308 + 4306 @@ -16775,7 +16769,7 @@ 1 2 - 65352 + 65311 @@ -16791,22 +16785,22 @@ 1 2 - 26810 + 26798 2 4 - 2844 + 2857 4 145 - 2479 + 2464 145 289 - 1788 + 1787 @@ -16822,22 +16816,22 @@ 1 2 - 26810 + 26798 2 4 - 2844 + 2857 4 145 - 2479 + 2464 145 289 - 1788 + 1787 @@ -16853,7 +16847,7 @@ 1 2 - 33922 + 33908 @@ -16872,8 +16866,8 @@ 13 - 24600 - 24601 + 24599 + 24600 13 @@ -16893,8 +16887,8 @@ 13 - 4610 - 4611 + 4609 + 4610 13 @@ -16926,15 +16920,15 @@ using_container - 732121 + 731800 parent - 26484 + 26473 child - 338586 + 338431 @@ -16948,27 +16942,27 @@ 1 2 - 12328 + 12322 2 4 - 2424 + 2437 4 6 - 1612 + 1597 6 7 - 2899 + 2897 7 27 - 1991 + 1990 27 @@ -16978,12 +16972,12 @@ 145 146 - 3359 + 3358 146 437 - 867 + 866 @@ -16999,27 +16993,27 @@ 1 2 - 114189 + 114128 2 3 - 154262 + 154198 3 4 - 25238 + 25227 4 5 - 34233 + 34219 5 65 - 10661 + 10657 @@ -17029,23 +17023,23 @@ static_asserts - 183983 + 183988 id - 183983 + 183988 condition - 183983 + 183988 message - 41292 + 41294 location - 23998 + 23999 enclosing @@ -17063,7 +17057,7 @@ 1 2 - 183983 + 183988 @@ -17079,7 +17073,7 @@ 1 2 - 183983 + 183988 @@ -17095,7 +17089,7 @@ 1 2 - 183983 + 183988 @@ -17111,7 +17105,7 @@ 1 2 - 183983 + 183988 @@ -17127,7 +17121,7 @@ 1 2 - 183983 + 183988 @@ -17143,7 +17137,7 @@ 1 2 - 183983 + 183988 @@ -17159,7 +17153,7 @@ 1 2 - 183983 + 183988 @@ -17175,7 +17169,7 @@ 1 2 - 183983 + 183988 @@ -17191,7 +17185,7 @@ 1 2 - 30381 + 30382 2 @@ -17201,12 +17195,12 @@ 3 4 - 3928 + 3929 4 12 - 2202 + 2203 12 @@ -17232,7 +17226,7 @@ 1 2 - 30381 + 30382 2 @@ -17242,12 +17236,12 @@ 3 4 - 3928 + 3929 4 12 - 2202 + 2203 12 @@ -17273,12 +17267,12 @@ 1 2 - 38265 + 38266 2 33 - 3026 + 3027 @@ -17294,7 +17288,7 @@ 1 2 - 32333 + 32334 2 @@ -17462,7 +17456,7 @@ 3 4 - 8308 + 8309 4 @@ -17637,23 +17631,23 @@ params - 4808534 + 4801942 id - 4798867 + 4792289 function - 2659163 + 2655518 index - 859 + 858 type_id - 862085 + 860903 @@ -17667,7 +17661,7 @@ 1 2 - 4798867 + 4792289 @@ -17683,7 +17677,7 @@ 1 2 - 4798867 + 4792289 @@ -17699,12 +17693,12 @@ 1 2 - 4789545 + 4782979 2 4 - 9322 + 9310 @@ -17720,22 +17714,22 @@ 1 2 - 1392113 + 1390205 2 3 - 661149 + 660243 3 4 - 439592 + 438989 4 21 - 166307 + 166079 @@ -17751,22 +17745,22 @@ 1 2 - 1392113 + 1390205 2 3 - 661149 + 660243 3 4 - 439592 + 438989 4 21 - 166307 + 166079 @@ -17782,22 +17776,22 @@ 1 2 - 1481046 + 1479015 2 3 - 669914 + 668995 3 4 - 403847 + 403293 4 10 - 104355 + 104212 @@ -18056,32 +18050,32 @@ 1 2 - 449172 + 448557 2 3 - 180012 + 179766 3 4 - 53144 + 53071 4 6 - 77762 + 77655 6 15 - 65603 + 65513 15 3702 - 36389 + 36339 @@ -18097,32 +18091,32 @@ 1 2 - 492092 + 491417 2 3 - 152345 + 152136 3 4 - 53230 + 53157 4 6 - 69384 + 69289 6 18 - 66248 + 66157 18 3701 - 28784 + 28745 @@ -18138,17 +18132,17 @@ 1 2 - 634470 + 633600 2 3 - 187746 + 187488 3 17 - 39869 + 39814 @@ -18158,15 +18152,15 @@ overrides - 170557 + 170562 new - 161259 + 161264 old - 19193 + 19194 @@ -18180,12 +18174,12 @@ 1 2 - 151970 + 151975 2 4 - 9288 + 9289 @@ -18236,19 +18230,19 @@ membervariables - 1444291 + 1444335 id - 1441833 + 1441877 type_id - 448060 + 448074 name - 617366 + 617385 @@ -18262,7 +18256,7 @@ 1 2 - 1439484 + 1439528 2 @@ -18283,7 +18277,7 @@ 1 2 - 1441833 + 1441877 @@ -18299,22 +18293,22 @@ 1 2 - 332331 + 332341 2 3 - 70890 + 70892 3 10 - 34898 + 34899 10 4153 - 9939 + 9940 @@ -18330,17 +18324,17 @@ 1 2 - 349043 + 349054 2 3 - 63462 + 63464 3 40 - 33642 + 33643 41 @@ -18361,22 +18355,22 @@ 1 2 - 403713 + 403725 2 3 - 118295 + 118299 3 5 - 56307 + 56309 5 646 - 39049 + 39050 @@ -18392,17 +18386,17 @@ 1 2 - 502839 + 502854 2 3 - 70726 + 70728 3 650 - 43801 + 43802 @@ -18583,19 +18577,19 @@ localvariables - 735322 + 735182 id - 735322 + 735182 type_id - 54078 + 54092 name - 102826 + 102807 @@ -18609,7 +18603,7 @@ 1 2 - 735322 + 735182 @@ -18625,7 +18619,7 @@ 1 2 - 735322 + 735182 @@ -18641,17 +18635,17 @@ 1 2 - 29229 + 29248 2 3 - 7925 + 7924 3 4 - 4076 + 4075 4 @@ -18661,17 +18655,17 @@ 6 12 - 4202 + 4201 12 - 165 - 4056 + 166 + 4059 - 165 + 168 19320 - 486 + 482 @@ -18687,22 +18681,22 @@ 1 2 - 38830 + 38847 2 3 - 6786 + 6784 3 5 - 4522 + 4521 5 3502 - 3938 + 3937 @@ -18718,27 +18712,27 @@ 1 2 - 63261 + 63250 2 3 - 16249 + 16246 3 4 - 6615 + 6614 4 8 - 8234 + 8232 8 135 - 7715 + 7713 135 @@ -18759,17 +18753,17 @@ 1 2 - 85563 + 85547 2 3 - 8526 + 8524 3 15 - 7771 + 7770 15 @@ -18784,11 +18778,11 @@ autoderivation - 202090 + 202096 var - 202090 + 202096 derivation_type @@ -18806,7 +18800,7 @@ 1 2 - 202090 + 202096 @@ -18852,15 +18846,15 @@ orphaned_variables - 55894 + 55817 var - 55894 + 55817 function - 51769 + 51698 @@ -18874,7 +18868,7 @@ 1 2 - 55894 + 55817 @@ -18890,12 +18884,12 @@ 1 2 - 50695 + 50626 2 47 - 1074 + 1072 @@ -18905,15 +18899,15 @@ enumconstants - 330365 + 330375 id - 330365 + 330375 parent - 38995 + 38996 index @@ -18925,11 +18919,11 @@ name - 329983 + 329993 location - 302894 + 302903 @@ -18943,7 +18937,7 @@ 1 2 - 330365 + 330375 @@ -18959,7 +18953,7 @@ 1 2 - 330365 + 330375 @@ -18975,7 +18969,7 @@ 1 2 - 330365 + 330375 @@ -18991,7 +18985,7 @@ 1 2 - 330365 + 330375 @@ -19007,7 +19001,7 @@ 1 2 - 330365 + 330375 @@ -19058,7 +19052,7 @@ 8 11 - 3549 + 3550 11 @@ -19124,7 +19118,7 @@ 8 11 - 3549 + 3550 11 @@ -19155,7 +19149,7 @@ 1 2 - 38995 + 38996 @@ -19206,7 +19200,7 @@ 8 11 - 3549 + 3550 11 @@ -19247,7 +19241,7 @@ 3 4 - 7973 + 7974 4 @@ -19618,7 +19612,7 @@ 1 2 - 329600 + 329610 2 @@ -19639,7 +19633,7 @@ 1 2 - 329600 + 329610 2 @@ -19660,7 +19654,7 @@ 1 2 - 329983 + 329993 @@ -19676,7 +19670,7 @@ 1 2 - 329983 + 329993 @@ -19692,7 +19686,7 @@ 1 2 - 329600 + 329610 2 @@ -19713,7 +19707,7 @@ 1 2 - 301856 + 301865 2 @@ -19734,7 +19728,7 @@ 1 2 - 302894 + 302903 @@ -19750,7 +19744,7 @@ 1 2 - 301856 + 301865 2 @@ -19771,7 +19765,7 @@ 1 2 - 302894 + 302903 @@ -19787,7 +19781,7 @@ 1 2 - 301856 + 301865 2 @@ -20479,15 +20473,15 @@ derivedtypes - 3188501 + 3188598 id - 3188501 + 3188598 name - 1506660 + 1506706 kind @@ -20495,7 +20489,7 @@ type_id - 2055209 + 2055272 @@ -20509,7 +20503,7 @@ 1 2 - 3188501 + 3188598 @@ -20525,7 +20519,7 @@ 1 2 - 3188501 + 3188598 @@ -20541,7 +20535,7 @@ 1 2 - 3188501 + 3188598 @@ -20557,17 +20551,17 @@ 1 2 - 1369018 + 1369060 2 10 - 113826 + 113830 10 4291 - 23814 + 23815 @@ -20583,7 +20577,7 @@ 1 2 - 1506660 + 1506706 @@ -20599,17 +20593,17 @@ 1 2 - 1369153 + 1369194 2 10 - 113692 + 113695 10 4291 - 23814 + 23815 @@ -20748,22 +20742,22 @@ 1 2 - 1388258 + 1388301 2 3 - 410100 + 410112 3 4 - 122572 + 122576 4 124 - 134278 + 134282 @@ -20779,22 +20773,22 @@ 1 2 - 1389873 + 1389915 2 3 - 410100 + 410112 3 4 - 120958 + 120961 4 124 - 134278 + 134282 @@ -20810,22 +20804,22 @@ 1 2 - 1390142 + 1390184 2 3 - 410907 + 410919 3 4 - 122707 + 122710 4 6 - 131452 + 131456 @@ -20835,11 +20829,11 @@ pointerishsize - 2366955 + 2367027 id - 2366955 + 2367027 size @@ -20861,7 +20855,7 @@ 1 2 - 2366955 + 2367027 @@ -20877,7 +20871,7 @@ 1 2 - 2366955 + 2367027 @@ -20961,15 +20955,15 @@ arraysizes - 86379 + 86381 id - 86379 + 86381 num_elements - 18567 + 18568 bytesize @@ -20991,7 +20985,7 @@ 1 2 - 86379 + 86381 @@ -21007,7 +21001,7 @@ 1 2 - 86379 + 86381 @@ -21023,7 +21017,7 @@ 1 2 - 86379 + 86381 @@ -21085,12 +21079,12 @@ 1 2 - 9283 + 9284 2 3 - 6861 + 6862 3 @@ -21116,12 +21110,12 @@ 1 2 - 9283 + 9284 2 3 - 6861 + 6862 3 @@ -21357,15 +21351,15 @@ typedefbase - 2175706 + 2172724 id - 2175706 + 2172724 type_id - 905391 + 904236 @@ -21379,7 +21373,7 @@ 1 2 - 2175706 + 2172724 @@ -21395,22 +21389,22 @@ 1 2 - 730534 + 729661 2 3 - 81714 + 81602 3 6 - 70028 + 69889 6 2848 - 23113 + 23082 @@ -21420,23 +21414,27 @@ decltypes - 175650 + 813065 id - 15374 + 27516 expr - 161629 + 813065 + + + kind + 21 base_type - 11280 + 3335 parentheses_would_change_meaning - 16 + 21 @@ -21450,37 +21448,63 @@ 1 2 - 2137 + 9720 2 3 - 6659 - - - 3 - 4 - 2162 + 3642 4 5 - 1056 + 3620 - 5 + 6 9 - 1213 + 548 - 9 - 22 - 1204 + 23 + 24 + 3247 - 22 - 1808 - 940 + 29 + 30 + 3137 + + + 32 + 33 + 131 + + + 171 + 172 + 3071 + + + 173 + 224 + 394 + + + + + + + id + kind + + + 12 + + + 1 + 2 + 27516 @@ -21496,7 +21520,7 @@ 1 2 - 15374 + 27516 @@ -21512,7 +21536,7 @@ 1 2 - 15374 + 27516 @@ -21528,17 +21552,23 @@ 1 2 - 148087 + 813065 + + + + + + expr + kind + + + 12 + - 2 - 3 - 13063 - - - 3 - 4 - 478 + 1 + 2 + 813065 @@ -21554,17 +21584,7 @@ 1 2 - 148087 - - - 2 - 3 - 13063 - - - 3 - 4 - 478 + 813065 @@ -21580,41 +21600,63 @@ 1 2 - 161629 + 813065 - base_type + kind id 12 - 1 - 2 - 9787 - - - 2 - 3 - 1320 - - - 3 - 269 - 173 + 1254 + 1255 + 21 - base_type + kind expr + + + 12 + + + 37054 + 37055 + 21 + + + + + + + kind + base_type + + + 12 + + + 152 + 153 + 21 + + + + + + + kind + parentheses_would_change_meaning 12 @@ -21622,37 +21664,115 @@ 1 2 - 965 + 21 + + + + + + + base_type + id + + + 12 + + + 1 + 2 + 1206 2 3 - 5504 + 1031 3 4 - 1600 + 351 4 5 - 1114 + 175 5 8 - 949 + 285 8 - 41 - 858 + 166 + 263 - 42 - 5498 - 288 + 245 + 246 + 21 + + + + + + + base_type + expr + + + 12 + + + 1 + 2 + 1162 + + + 2 + 3 + 855 + + + 3 + 4 + 329 + + + 4 + 7 + 285 + + + 7 + 201 + 307 + + + 340 + 1601 + 263 + + + 2800 + 8194 + 131 + + + + + + + base_type + kind + + + 12 + + + 1 + 2 + 3335 @@ -21668,7 +21788,7 @@ 1 2 - 11280 + 3335 @@ -21682,14 +21802,9 @@ 12 - 2 - 3 - 8 - - - 1861 - 1862 - 8 + 1254 + 1255 + 21 @@ -21703,14 +21818,25 @@ 12 - 2 - 3 - 8 + 37054 + 37055 + 21 + + + + + + parentheses_would_change_meaning + kind + + + 12 + - 19584 - 19585 - 8 + 1 + 2 + 21 @@ -21724,14 +21850,325 @@ 12 - 2 - 3 - 8 + 152 + 153 + 21 + + + + + + + + + type_operators + 8530 + + + id + 8530 + + + arg_type + 7700 + + + kind + 92 + + + base_type + 5625 + + + + + id + arg_type + + + 12 + + + 1 + 2 + 8530 + + + + + + + id + kind + + + 12 + + + 1 + 2 + 8530 + + + + + + + id + base_type + + + 12 + + + 1 + 2 + 8530 + + + + + + + arg_type + id + + + 12 + + + 1 + 2 + 6870 - 1365 - 1366 - 8 + 2 + 3 + 829 + + + + + + + arg_type + kind + + + 12 + + + 1 + 2 + 6870 + + + 2 + 3 + 829 + + + + + + + arg_type + base_type + + + 12 + + + 1 + 2 + 7677 + + + 2 + 3 + 23 + + + + + + + kind + id + + + 12 + + + 1 + 2 + 23 + + + 7 + 8 + 23 + + + 96 + 97 + 23 + + + 266 + 267 + 23 + + + + + + + kind + arg_type + + + 12 + + + 1 + 2 + 23 + + + 7 + 8 + 23 + + + 96 + 97 + 23 + + + 266 + 267 + 23 + + + + + + + kind + base_type + + + 12 + + + 1 + 2 + 23 + + + 4 + 5 + 23 + + + 72 + 73 + 23 + + + 222 + 223 + 23 + + + + + + + base_type + id + + + 12 + + + 1 + 2 + 3896 + + + 2 + 3 + 968 + + + 3 + 4 + 368 + + + 4 + 6 + 391 + + + + + + + base_type + arg_type + + + 12 + + + 1 + 2 + 4057 + + + 2 + 3 + 1060 + + + 3 + 4 + 484 + + + 4 + 5 + 23 + + + + + + + base_type + kind + + + 12 + + + 1 + 2 + 4380 + + + 2 + 3 + 1221 + + + 3 + 4 + 23 @@ -21741,15 +22178,15 @@ usertypes - 4987509 + 4985429 id - 4987509 + 4985429 name - 1074799 + 1074389 kind @@ -21767,7 +22204,7 @@ 1 2 - 4987509 + 4985429 @@ -21783,7 +22220,7 @@ 1 2 - 4987509 + 4985429 @@ -21799,22 +22236,22 @@ 1 2 - 743244 + 742972 2 3 - 196950 + 196894 3 7 - 86025 + 85961 7 30181 - 48580 + 48560 @@ -21830,12 +22267,12 @@ 1 2 - 1008445 + 1008062 2 10 - 66354 + 66326 @@ -21899,8 +22336,8 @@ 13 - 85548 - 85549 + 85549 + 85550 13 @@ -21965,8 +22402,8 @@ 13 - 10827 - 10828 + 10829 + 10830 13 @@ -21975,8 +22412,8 @@ 13 - 51345 - 51346 + 51346 + 51347 13 @@ -21987,15 +22424,15 @@ usertypesize - 1632161 + 1631490 id - 1632161 + 1631490 size - 1896 + 1895 alignment @@ -22013,7 +22450,7 @@ 1 2 - 1632161 + 1631490 @@ -22029,7 +22466,7 @@ 1 2 - 1632161 + 1631490 @@ -22045,7 +22482,7 @@ 1 2 - 596 + 595 2 @@ -22065,31 +22502,31 @@ 6 8 - 149 + 148 8 14 - 149 + 148 14 26 - 149 + 148 26 86 - 149 + 148 96 1592 - 149 + 148 1733 - 92729 + 92730 67 @@ -22165,8 +22602,8 @@ 13 - 107915 - 107916 + 107916 + 107917 13 @@ -22223,26 +22660,26 @@ usertype_final - 12243 + 12244 id - 12243 + 12244 usertype_uuid - 50061 + 50062 id - 50061 + 50062 uuid - 49549 + 49551 @@ -22256,7 +22693,7 @@ 1 2 - 50061 + 50062 @@ -22272,7 +22709,7 @@ 1 2 - 49037 + 49039 2 @@ -22287,11 +22724,11 @@ usertype_alias_kind - 2175749 + 2172767 id - 2175706 + 2172724 alias_kind @@ -22309,7 +22746,7 @@ 1 2 - 2175663 + 2172681 2 @@ -22345,26 +22782,26 @@ nontype_template_parameters - 966312 + 964987 id - 966312 + 964987 type_template_type_constraint - 29104 + 29095 id - 14344 + 14340 constraint - 27882 + 27873 @@ -22378,7 +22815,7 @@ 1 2 - 10954 + 10951 2 @@ -22393,7 +22830,7 @@ 5 14 - 1199 + 1198 14 @@ -22414,12 +22851,12 @@ 1 2 - 26659 + 26651 2 3 - 1222 + 1221 @@ -22429,15 +22866,15 @@ mangled_name - 7776283 + 7773031 id - 7776283 + 7773031 mangled_name - 5327221 + 5323548 is_complete @@ -22455,7 +22892,7 @@ 1 2 - 7776283 + 7773031 @@ -22471,7 +22908,7 @@ 1 2 - 7776283 + 7773031 @@ -22487,17 +22924,17 @@ 1 2 - 4733728 + 4730278 2 3 - 459564 + 459154 3 9032 - 133928 + 134115 @@ -22513,7 +22950,7 @@ 1 2 - 5327221 + 5323548 @@ -22527,13 +22964,13 @@ 12 - 4842 - 4843 + 4956 + 4957 13 - 570790 - 570791 + 570682 + 570683 13 @@ -22548,13 +22985,13 @@ 12 - 1515 - 1516 + 1518 + 1519 13 - 391717 - 391718 + 391608 + 391609 13 @@ -22565,59 +23002,59 @@ is_pod_class - 747547 + 746522 id - 747547 + 746522 is_standard_layout_class - 1344878 + 1344327 id - 1344878 + 1344327 is_complete - 1611299 + 1610636 id - 1611299 + 1610636 is_class_template - 292187 + 292064 id - 292187 + 292064 class_instantiation - 1327050 + 1326506 to - 1323148 + 1322606 from - 91606 + 91568 @@ -22631,12 +23068,12 @@ 1 2 - 1320411 + 1319871 2 8 - 2736 + 2735 @@ -22652,47 +23089,47 @@ 1 2 - 26728 + 26717 2 3 - 16622 + 16615 3 4 - 9103 + 9099 4 5 - 5974 + 5971 5 7 - 7694 + 7691 7 10 - 6949 + 6946 10 17 - 7356 + 7353 17 53 - 6936 + 6933 53 4219 - 4240 + 4238 @@ -22702,19 +23139,19 @@ class_template_argument - 3501753 + 3500296 type_id - 1631240 + 1630569 index - 1517 + 1516 arg_type - 1034483 + 1034048 @@ -22728,27 +23165,27 @@ 1 2 - 678894 + 678622 2 3 - 490113 + 489907 3 4 - 308755 + 308626 4 7 - 124120 + 124067 7 113 - 29356 + 29344 @@ -22764,22 +23201,22 @@ 1 2 - 713453 + 713167 2 3 - 505462 + 505250 3 4 - 306818 + 306689 4 113 - 105506 + 105461 @@ -22824,7 +23261,7 @@ 11329 - 120409 + 120410 54 @@ -22887,27 +23324,27 @@ 1 2 - 649090 + 648817 2 3 - 212190 + 212101 3 4 - 62154 + 62128 4 11 - 78669 + 78635 11 11553 - 32377 + 32364 @@ -22923,17 +23360,17 @@ 1 2 - 912395 + 912012 2 3 - 98854 + 98812 3 22 - 23233 + 23223 @@ -22943,11 +23380,11 @@ class_template_argument_value - 643234 + 642352 type_id - 259536 + 259180 index @@ -22955,7 +23392,7 @@ arg_value - 643062 + 642181 @@ -22969,17 +23406,17 @@ 1 2 - 196467 + 196198 2 3 - 54691 + 54616 3 8 - 8377 + 8366 @@ -22995,22 +23432,22 @@ 1 2 - 186543 + 186287 2 3 - 51039 + 50969 3 45 - 19590 + 19564 45 154 - 2362 + 2359 @@ -23138,7 +23575,7 @@ 1 2 - 642890 + 642009 2 @@ -23159,7 +23596,7 @@ 1 2 - 643062 + 642181 @@ -23169,15 +23606,15 @@ is_proxy_class_for - 62060 + 62033 id - 62060 + 62033 templ_param_id - 58632 + 58607 @@ -23191,7 +23628,7 @@ 1 2 - 62060 + 62033 @@ -23207,12 +23644,12 @@ 1 2 - 57711 + 57687 2 79 - 921 + 920 @@ -23222,19 +23659,19 @@ type_mentions - 5507858 + 5508026 id - 5507858 + 5508026 type_id - 270944 + 270952 location - 5462036 + 5462202 kind @@ -23252,7 +23689,7 @@ 1 2 - 5507858 + 5508026 @@ -23268,7 +23705,7 @@ 1 2 - 5507858 + 5508026 @@ -23284,7 +23721,7 @@ 1 2 - 5507858 + 5508026 @@ -23300,17 +23737,17 @@ 1 2 - 133424 + 133428 2 3 - 29710 + 29711 3 4 - 11250 + 11251 4 @@ -23330,12 +23767,12 @@ 12 27 - 20753 + 20754 27 8555 - 19715 + 19716 @@ -23351,17 +23788,17 @@ 1 2 - 133424 + 133428 2 3 - 29710 + 29711 3 4 - 11250 + 11251 4 @@ -23381,12 +23818,12 @@ 12 27 - 20753 + 20754 27 8555 - 19715 + 19716 @@ -23402,7 +23839,7 @@ 1 2 - 270944 + 270952 @@ -23418,12 +23855,12 @@ 1 2 - 5416214 + 5416379 2 3 - 45821 + 45823 @@ -23439,12 +23876,12 @@ 1 2 - 5416214 + 5416379 2 3 - 45821 + 45823 @@ -23460,7 +23897,7 @@ 1 2 - 5462036 + 5462202 @@ -23518,26 +23955,26 @@ is_function_template - 1418397 + 1418440 id - 1418397 + 1418440 function_instantiation - 1226965 + 1225283 to - 1226965 + 1225283 from - 230193 + 229877 @@ -23551,7 +23988,7 @@ 1 2 - 1226965 + 1225283 @@ -23567,27 +24004,27 @@ 1 2 - 140014 + 139822 2 3 - 53273 + 53200 3 9 - 18130 + 18105 9 103 - 17270 + 17247 103 1532 - 1503 + 1501 @@ -23597,19 +24034,19 @@ function_template_argument - 3133426 + 3129131 function_id - 1832651 + 1830138 index - 601 + 600 arg_type - 375792 + 375277 @@ -23623,22 +24060,22 @@ 1 2 - 987407 + 986053 2 3 - 521006 + 520291 3 4 - 216659 + 216362 4 15 - 107578 + 107430 @@ -23654,22 +24091,22 @@ 1 2 - 1011551 + 1010165 2 3 - 518600 + 517889 3 4 - 213910 + 213617 4 9 - 88588 + 88467 @@ -23807,37 +24244,37 @@ 1 2 - 220397 + 220095 2 3 - 33210 + 33164 3 4 - 25218 + 25184 4 6 - 28570 + 28530 6 11 - 29300 + 29260 11 76 - 29472 + 29431 79 2452 - 9623 + 9610 @@ -23853,17 +24290,17 @@ 1 2 - 323851 + 323407 2 3 - 40513 + 40458 3 15 - 11428 + 11412 @@ -23873,19 +24310,19 @@ function_template_argument_value - 570971 + 570188 function_id - 248151 + 247811 index - 601 + 600 arg_value - 567577 + 566799 @@ -23899,17 +24336,17 @@ 1 2 - 190925 + 190663 2 3 - 54089 + 54015 3 8 - 3136 + 3131 @@ -23925,22 +24362,22 @@ 1 2 - 182203 + 181954 2 3 - 46270 + 46207 3 54 - 18731 + 18705 54 113 - 945 + 943 @@ -24078,12 +24515,12 @@ 1 2 - 564183 + 563410 2 3 - 3394 + 3389 @@ -24099,7 +24536,7 @@ 1 2 - 567577 + 566799 @@ -24109,26 +24546,26 @@ is_variable_template - 55029 + 55031 id - 55029 + 55031 variable_instantiation - 279051 + 279059 to - 279051 + 279059 from - 34040 + 34041 @@ -24142,7 +24579,7 @@ 1 2 - 279051 + 279059 @@ -24158,7 +24595,7 @@ 1 2 - 16683 + 16684 2 @@ -24203,11 +24640,11 @@ variable_template_argument - 525810 + 525826 variable_id - 267210 + 267219 index @@ -24215,7 +24652,7 @@ arg_type - 257119 + 257127 @@ -24229,17 +24666,17 @@ 1 2 - 116248 + 116252 2 3 - 97277 + 97280 3 4 - 39422 + 39423 4 @@ -24260,17 +24697,17 @@ 1 2 - 122168 + 122172 2 3 - 99295 + 99298 3 4 - 32829 + 32830 4 @@ -24408,17 +24845,17 @@ 1 2 - 199668 + 199674 2 3 - 30542 + 30543 3 11 - 19643 + 19644 11 @@ -24439,17 +24876,17 @@ 1 2 - 233439 + 233446 2 3 - 20989 + 20990 3 7 - 2690 + 2691 @@ -24463,7 +24900,7 @@ variable_id - 11032 + 11033 index @@ -24485,7 +24922,7 @@ 1 2 - 10494 + 10495 2 @@ -24506,7 +24943,7 @@ 1 2 - 6592 + 6593 2 @@ -24620,15 +25057,15 @@ template_template_instantiation - 7437 + 7434 to - 6976 + 6973 from - 4931 + 4929 @@ -24642,12 +25079,12 @@ 1 2 - 6827 + 6824 2 15 - 149 + 148 @@ -24663,7 +25100,7 @@ 1 2 - 3224 + 3222 2 @@ -24683,11 +25120,11 @@ template_template_argument - 12409 + 12404 type_id - 7843 + 7840 index @@ -24695,7 +25132,7 @@ arg_type - 11650 + 11645 @@ -24709,7 +25146,7 @@ 1 2 - 6434 + 6432 2 @@ -24719,7 +25156,7 @@ 3 8 - 650 + 649 8 @@ -24740,17 +25177,17 @@ 1 2 - 6462 + 6459 2 4 - 718 + 717 4 10 - 596 + 595 10 @@ -24893,7 +25330,7 @@ 1 2 - 11610 + 11605 3 @@ -24914,7 +25351,7 @@ 1 2 - 11623 + 11618 2 @@ -24929,7 +25366,7 @@ template_template_argument_value - 799 + 798 type_id @@ -24941,7 +25378,7 @@ arg_value - 799 + 798 @@ -25039,7 +25476,7 @@ 1 2 - 799 + 798 @@ -25055,7 +25492,7 @@ 1 2 - 799 + 798 @@ -25065,19 +25502,19 @@ concept_templates - 3874 + 3873 concept_id - 3874 + 3873 name - 3874 + 3873 location - 3874 + 3873 @@ -25091,7 +25528,7 @@ 1 2 - 3874 + 3873 @@ -25107,7 +25544,7 @@ 1 2 - 3874 + 3873 @@ -25123,7 +25560,7 @@ 1 2 - 3874 + 3873 @@ -25139,7 +25576,7 @@ 1 2 - 3874 + 3873 @@ -25155,7 +25592,7 @@ 1 2 - 3874 + 3873 @@ -25171,7 +25608,7 @@ 1 2 - 3874 + 3873 @@ -25181,15 +25618,15 @@ concept_instantiation - 96929 + 96899 to - 96929 + 96899 from - 3689 + 3688 @@ -25203,7 +25640,7 @@ 1 2 - 96929 + 96899 @@ -25229,7 +25666,7 @@ 3 4 - 392 + 391 4 @@ -25299,22 +25736,22 @@ is_type_constraint - 39551 + 39538 concept_id - 39551 + 39538 concept_template_argument - 121167 + 121129 concept_id - 81870 + 81844 index @@ -25322,7 +25759,7 @@ arg_type - 22969 + 22962 @@ -25336,17 +25773,17 @@ 1 2 - 49814 + 49798 2 3 - 26452 + 26443 3 7 - 5604 + 5602 @@ -25362,17 +25799,17 @@ 1 2 - 53688 + 53671 2 3 - 23984 + 23976 3 7 - 4197 + 4195 @@ -25470,17 +25907,17 @@ 1 2 - 11138 + 11135 2 3 - 3182 + 3181 3 4 - 1130 + 1129 4 @@ -25490,7 +25927,7 @@ 5 6 - 1245 + 1244 6 @@ -25521,12 +25958,12 @@ 1 2 - 19325 + 19319 2 3 - 3505 + 3504 3 @@ -25583,7 +26020,7 @@ 1 2 - 66 + 65 2 @@ -25672,15 +26109,15 @@ routinetypes - 762068 + 761024 id - 762068 + 761024 return_type - 357963 + 357472 @@ -25694,7 +26131,7 @@ 1 2 - 762068 + 761024 @@ -25710,17 +26147,17 @@ 1 2 - 295367 + 294962 2 3 - 44251 + 44190 3 4676 - 18344 + 18319 @@ -25730,11 +26167,11 @@ routinetypeargs - 1165645 + 1165681 routine - 411414 + 411426 index @@ -25742,7 +26179,7 @@ type_id - 110813 + 110817 @@ -25756,32 +26193,32 @@ 1 2 - 81430 + 81433 2 3 - 125395 + 125399 3 4 - 106717 + 106720 4 5 - 48934 + 48936 5 7 - 32441 + 32442 7 19 - 16493 + 16494 @@ -25797,27 +26234,27 @@ 1 2 - 87383 + 87386 2 3 - 138121 + 138125 3 4 - 113435 + 113438 4 5 - 40141 + 40143 5 10 - 32222 + 32223 10 @@ -26015,7 +26452,7 @@ 1 2 - 33096 + 33097 2 @@ -26025,7 +26462,7 @@ 3 4 - 13052 + 13053 4 @@ -26040,12 +26477,12 @@ 6 8 - 9502 + 9503 8 13 - 9502 + 9503 13 @@ -26071,7 +26508,7 @@ 1 2 - 78153 + 78156 2 @@ -26081,7 +26518,7 @@ 3 5 - 9502 + 9503 5 @@ -26096,19 +26533,19 @@ ptrtomembers - 12084 + 12079 id - 12084 + 12079 type_id - 10160 + 10156 class_id - 5987 + 5985 @@ -26122,7 +26559,7 @@ 1 2 - 12084 + 12079 @@ -26138,7 +26575,7 @@ 1 2 - 12084 + 12079 @@ -26154,7 +26591,7 @@ 1 2 - 9875 + 9871 2 @@ -26175,7 +26612,7 @@ 1 2 - 9875 + 9871 2 @@ -26196,7 +26633,7 @@ 1 2 - 4877 + 4874 2 @@ -26227,7 +26664,7 @@ 1 2 - 4877 + 4874 2 @@ -26252,15 +26689,15 @@ specifiers - 8341 + 8342 id - 8341 + 8342 str - 8341 + 8342 @@ -26274,7 +26711,7 @@ 1 2 - 8341 + 8342 @@ -26290,7 +26727,7 @@ 1 2 - 8341 + 8342 @@ -26300,11 +26737,11 @@ typespecifiers - 991511 + 991095 type_id - 984927 + 984513 spec_id @@ -26322,12 +26759,12 @@ 1 2 - 978343 + 977932 2 3 - 6583 + 6581 @@ -26388,15 +26825,15 @@ funspecifiers - 9728384 + 9715091 func_id - 3340505 + 3335926 spec_id - 816 + 815 @@ -26410,32 +26847,32 @@ 1 2 - 437873 + 437273 2 3 - 677303 + 676332 3 4 - 1424163 + 1422254 4 5 - 459483 + 458854 5 6 - 225080 + 224771 6 8 - 116600 + 116440 @@ -26524,8 +26961,8 @@ 42 - 42406 - 42407 + 42407 + 42408 42 @@ -26546,11 +26983,11 @@ varspecifiers - 2898085 + 2898173 var_id - 2545054 + 2545132 spec_id @@ -26568,12 +27005,12 @@ 1 2 - 2192023 + 2192090 2 3 - 353030 + 353041 @@ -26629,15 +27066,15 @@ explicit_specifier_exprs - 44535 + 44536 func_id - 44535 + 44536 constant - 44535 + 44536 @@ -26651,7 +27088,7 @@ 1 2 - 44535 + 44536 @@ -26667,7 +27104,7 @@ 1 2 - 44535 + 44536 @@ -26677,11 +27114,11 @@ attributes - 629815 + 629835 id - 629815 + 629835 kind @@ -26697,7 +27134,7 @@ location - 623357 + 623376 @@ -26711,7 +27148,7 @@ 1 2 - 629815 + 629835 @@ -26727,7 +27164,7 @@ 1 2 - 629815 + 629835 @@ -26743,7 +27180,7 @@ 1 2 - 629815 + 629835 @@ -26759,7 +27196,7 @@ 1 2 - 629815 + 629835 @@ -27147,7 +27584,7 @@ 1 2 - 617033 + 617052 2 @@ -27168,7 +27605,7 @@ 1 2 - 623357 + 623376 @@ -27184,7 +27621,7 @@ 1 2 - 617841 + 617859 2 @@ -27205,7 +27642,7 @@ 1 2 - 623357 + 623376 @@ -27215,11 +27652,11 @@ attribute_args - 98908 + 98921 id - 98908 + 98921 kind @@ -27227,7 +27664,7 @@ attribute - 85334 + 85298 index @@ -27235,7 +27672,7 @@ location - 91945 + 91906 @@ -27249,7 +27686,7 @@ 1 2 - 98908 + 98921 @@ -27265,7 +27702,7 @@ 1 2 - 98908 + 98921 @@ -27281,7 +27718,7 @@ 1 2 - 98908 + 98921 @@ -27297,7 +27734,7 @@ 1 2 - 98908 + 98921 @@ -27326,8 +27763,8 @@ 13 - 6598 - 6599 + 6602 + 6603 13 @@ -27432,12 +27869,12 @@ 1 2 - 77395 + 77308 2 4 - 6583 + 6635 4 @@ -27458,12 +27895,12 @@ 1 2 - 83031 + 82996 2 3 - 2303 + 2302 @@ -27479,12 +27916,12 @@ 1 2 - 79048 + 79015 2 6 - 6285 + 6283 @@ -27500,12 +27937,12 @@ 1 2 - 80660 + 80626 2 6 - 4673 + 4671 @@ -27539,8 +27976,8 @@ 13 - 6481 - 6482 + 6485 + 6486 13 @@ -27655,12 +28092,12 @@ 1 2 - 89547 + 89455 2 23 - 2397 + 2451 @@ -27676,7 +28113,7 @@ 1 2 - 91728 + 91690 2 @@ -27697,7 +28134,7 @@ 1 2 - 91538 + 91500 2 @@ -27718,7 +28155,7 @@ 1 2 - 91389 + 91351 2 @@ -27733,15 +28170,15 @@ attribute_arg_value - 21051 + 21022 arg - 21051 + 21022 value - 644 + 643 @@ -27755,7 +28192,7 @@ 1 2 - 21051 + 21022 @@ -27864,7 +28301,7 @@ 1 2 - 73 + 72 2 @@ -27889,15 +28326,15 @@ attribute_arg_constant - 89384 + 89401 arg - 89384 + 89401 constant - 89384 + 89401 @@ -27911,7 +28348,7 @@ 1 2 - 89384 + 89401 @@ -27927,7 +28364,7 @@ 1 2 - 89384 + 89401 @@ -28038,15 +28475,15 @@ typeattributes - 84495 + 84498 type_id - 83957 + 83960 spec_id - 26909 + 26910 @@ -28060,7 +28497,7 @@ 1 2 - 83419 + 83421 2 @@ -28106,15 +28543,15 @@ funcattributes - 824909 + 824934 func_id - 776472 + 776496 spec_id - 598600 + 598619 @@ -28128,12 +28565,12 @@ 1 2 - 732879 + 732901 2 7 - 43593 + 43594 @@ -28149,12 +28586,12 @@ 1 2 - 555007 + 555024 2 202 - 43593 + 43594 @@ -28227,11 +28664,11 @@ stmtattributes - 2375 + 2374 stmt_id - 2375 + 2374 spec_id @@ -28249,7 +28686,7 @@ 1 2 - 2375 + 2374 @@ -28295,15 +28732,15 @@ unspecifiedtype - 8345729 + 8343173 type_id - 8345729 + 8343173 unspecified_type_id - 4799107 + 4797160 @@ -28317,7 +28754,7 @@ 1 2 - 8345729 + 8343173 @@ -28333,17 +28770,17 @@ 1 2 - 3198511 + 3197208 2 3 - 1309032 + 1308496 3 6271 - 291564 + 291455 @@ -28353,19 +28790,19 @@ member - 4687208 + 4680740 parent - 562422 + 561651 index - 10740 + 10725 child - 4570006 + 4563699 @@ -28379,52 +28816,52 @@ 1 2 - 233200 + 232880 2 3 - 25949 + 25913 3 4 - 29429 + 29388 4 5 - 37764 + 37712 5 7 - 47860 + 47794 7 11 - 43349 + 43289 11 14 - 41759 + 41702 14 19 - 45368 + 45306 19 53 - 42318 + 42260 53 251 - 15423 + 15402 @@ -28440,52 +28877,52 @@ 1 2 - 233071 + 232752 2 3 - 26078 + 26042 3 4 - 29472 + 29431 4 5 - 37849 + 37798 5 7 - 47645 + 47580 7 11 - 43778 + 43718 11 14 - 41673 + 41616 14 19 - 45153 + 45091 19 53 - 42318 + 42260 53 255 - 15380 + 15359 @@ -28501,57 +28938,57 @@ 1 2 - 2835 + 2831 2 4 - 816 + 815 4 22 - 816 + 815 22 31 - 816 + 815 31 53 - 859 + 858 53 108 - 816 + 815 110 218 - 816 + 815 223 328 - 816 + 815 328 581 - 816 + 815 653 2518 - 816 + 815 2884 12742 - 515 + 514 @@ -28567,57 +29004,57 @@ 1 2 - 1761 + 1759 2 3 - 1374 + 1372 3 8 - 816 + 815 8 31 - 859 + 858 31 41 - 859 + 858 41 97 - 816 + 815 97 161 - 816 + 815 164 314 - 859 + 858 318 386 - 816 + 815 435 1127 - 816 + 815 1139 6168 - 816 + 815 6500 @@ -28638,7 +29075,7 @@ 1 2 - 4570006 + 4563699 @@ -28654,12 +29091,12 @@ 1 2 - 4482148 + 4475961 2 13 - 87858 + 87737 @@ -28669,15 +29106,15 @@ enclosingfunction - 144783 + 144585 child - 144783 + 144585 parent - 89963 + 89840 @@ -28691,7 +29128,7 @@ 1 2 - 144783 + 144585 @@ -28707,22 +29144,22 @@ 1 2 - 62209 + 62124 2 3 - 5842 + 5834 3 4 - 19376 + 19349 4 37 - 2534 + 2531 @@ -28732,15 +29169,15 @@ derivations - 599885 + 599063 derivation - 599885 + 599063 sub - 572475 + 571690 index @@ -28748,11 +29185,11 @@ super - 296054 + 295648 location - 44638 + 44576 @@ -28766,7 +29203,7 @@ 1 2 - 599885 + 599063 @@ -28782,7 +29219,7 @@ 1 2 - 599885 + 599063 @@ -28798,7 +29235,7 @@ 1 2 - 599885 + 599063 @@ -28814,7 +29251,7 @@ 1 2 - 599885 + 599063 @@ -28830,12 +29267,12 @@ 1 2 - 551638 + 550882 2 9 - 20836 + 20808 @@ -28851,12 +29288,12 @@ 1 2 - 551638 + 550882 2 8 - 20836 + 20808 @@ -28872,12 +29309,12 @@ 1 2 - 551638 + 550882 2 9 - 20836 + 20808 @@ -28893,12 +29330,12 @@ 1 2 - 551638 + 550882 2 8 - 20836 + 20808 @@ -29053,12 +29490,12 @@ 1 2 - 283939 + 283549 2 1655 - 12115 + 12098 @@ -29074,12 +29511,12 @@ 1 2 - 283939 + 283549 2 1655 - 12115 + 12098 @@ -29095,12 +29532,12 @@ 1 2 - 295496 + 295090 2 4 - 558 + 557 @@ -29116,12 +29553,12 @@ 1 2 - 289524 + 289127 2 81 - 6530 + 6521 @@ -29137,22 +29574,22 @@ 1 2 - 33510 + 33464 2 5 - 3995 + 3990 5 22 - 3394 + 3389 23 383 - 3351 + 3346 388 @@ -29173,22 +29610,22 @@ 1 2 - 33510 + 33464 2 5 - 3995 + 3990 5 22 - 3394 + 3389 23 383 - 3351 + 3346 388 @@ -29209,7 +29646,7 @@ 1 2 - 44638 + 44576 @@ -29225,22 +29662,22 @@ 1 2 - 36303 + 36253 2 4 - 3308 + 3303 4 26 - 3479 + 3475 26 928 - 1546 + 1544 @@ -29250,11 +29687,11 @@ derspecifiers - 602119 + 601293 der_id - 599326 + 598505 spec_id @@ -29272,12 +29709,12 @@ 1 2 - 596534 + 595716 2 3 - 2792 + 2788 @@ -29318,15 +29755,15 @@ direct_base_offsets - 565944 + 565169 der_id - 565944 + 565169 offset - 644 + 643 @@ -29340,7 +29777,7 @@ 1 2 - 565944 + 565169 @@ -29401,11 +29838,11 @@ virtual_base_offsets - 7346 + 7336 sub - 7346 + 7336 super @@ -29427,7 +29864,7 @@ 1 2 - 7346 + 7336 @@ -29443,7 +29880,7 @@ 1 2 - 7346 + 7336 @@ -29537,23 +29974,23 @@ frienddecls - 883308 + 881497 id - 883308 + 881497 type_id - 53488 + 53414 decl_id - 98040 + 98034 location - 7690 + 7679 @@ -29567,7 +30004,7 @@ 1 2 - 883308 + 881497 @@ -29583,7 +30020,7 @@ 1 2 - 883308 + 881497 @@ -29599,7 +30036,7 @@ 1 2 - 883308 + 881497 @@ -29615,47 +30052,47 @@ 1 2 - 7776 + 7808 2 3 - 17614 + 17590 3 7 - 4511 + 4504 7 12 - 4339 + 4333 12 20 - 4596 + 4547 20 32 - 4167 + 4161 33 50 - 4768 + 4762 50 80 - 4768 + 4762 101 120 - 945 + 943 @@ -29671,47 +30108,47 @@ 1 2 - 7776 + 7808 2 3 - 17614 + 17590 3 7 - 4511 + 4504 7 12 - 4339 + 4333 12 20 - 4596 + 4547 20 32 - 4167 + 4161 33 50 - 4768 + 4762 50 80 - 4768 + 4762 101 120 - 945 + 943 @@ -29727,12 +30164,12 @@ 1 2 - 51769 + 51698 2 13 - 1718 + 1716 @@ -29748,32 +30185,32 @@ 1 2 - 60362 + 60579 2 3 - 7647 + 7465 3 8 - 7561 + 7551 8 15 - 7647 + 7636 15 40 - 7647 + 7636 40 164 - 7174 + 7164 @@ -29789,32 +30226,32 @@ 1 2 - 60362 + 60579 2 3 - 7647 + 7465 3 8 - 7561 + 7551 8 15 - 7647 + 7636 15 40 - 7647 + 7636 40 164 - 7174 + 7164 @@ -29830,12 +30267,12 @@ 1 2 - 97181 + 97176 2 5 - 859 + 858 @@ -29851,12 +30288,12 @@ 1 2 - 7217 + 7207 2 - 20371 - 472 + 20357 + 471 @@ -29872,7 +30309,7 @@ 1 2 - 7518 + 7508 2 @@ -29893,11 +30330,11 @@ 1 2 - 7260 + 7250 2 - 2129 + 2132 429 @@ -29908,19 +30345,19 @@ comments - 11290131 + 11290475 id - 11290131 + 11290475 contents - 4299054 + 4299185 location - 11290131 + 11290475 @@ -29934,7 +30371,7 @@ 1 2 - 11290131 + 11290475 @@ -29950,7 +30387,7 @@ 1 2 - 11290131 + 11290475 @@ -29966,17 +30403,17 @@ 1 2 - 3932682 + 3932802 2 7 - 323182 + 323192 7 32784 - 43189 + 43190 @@ -29992,17 +30429,17 @@ 1 2 - 3932682 + 3932802 2 7 - 323182 + 323192 7 32784 - 43189 + 43190 @@ -30018,7 +30455,7 @@ 1 2 - 11290131 + 11290475 @@ -30034,7 +30471,7 @@ 1 2 - 11290131 + 11290475 @@ -30044,15 +30481,15 @@ commentbinding - 3316590 + 3316691 id - 3263040 + 3263140 element - 3173566 + 3173663 @@ -30066,12 +30503,12 @@ 1 2 - 3231287 + 3231385 2 85 - 31753 + 31754 @@ -30087,12 +30524,12 @@ 1 2 - 3030542 + 3030635 2 3 - 143023 + 143028 @@ -30102,15 +30539,15 @@ exprconv - 9603735 + 9605400 converted - 9603630 + 9605295 conversion - 9603735 + 9605400 @@ -30124,7 +30561,7 @@ 1 2 - 9603525 + 9605190 2 @@ -30145,7 +30582,7 @@ 1 2 - 9603735 + 9605400 @@ -30155,30 +30592,30 @@ compgenerated - 10716063 + 10710519 id - 10716063 + 10710519 synthetic_destructor_call - 1791782 + 1791215 element - 1334392 + 1333971 i - 415 + 414 destructor_call - 1791782 + 1791215 @@ -30192,17 +30629,17 @@ 1 2 - 888211 + 887930 2 3 - 438893 + 438754 3 19 - 7287 + 7285 @@ -30218,17 +30655,17 @@ 1 2 - 888211 + 887930 2 3 - 438893 + 438754 3 19 - 7287 + 7285 @@ -30376,7 +30813,7 @@ 1 2 - 1791782 + 1791215 @@ -30392,7 +30829,7 @@ 1 2 - 1791782 + 1791215 @@ -30402,15 +30839,15 @@ namespaces - 11095 + 11090 id - 11095 + 11090 name - 5865 + 5863 @@ -30424,7 +30861,7 @@ 1 2 - 11095 + 11090 @@ -30440,7 +30877,7 @@ 1 2 - 4795 + 4793 2 @@ -30471,15 +30908,15 @@ namespacembrs - 2025696 + 2024859 parentid - 10363 + 10359 memberid - 2025696 + 2024859 @@ -30493,7 +30930,7 @@ 1 2 - 1124 + 1123 2 @@ -30508,17 +30945,17 @@ 4 5 - 772 + 771 5 8 - 894 + 893 8 14 - 894 + 893 14 @@ -30528,12 +30965,12 @@ 22 37 - 799 + 798 37 57 - 799 + 798 57 @@ -30569,7 +31006,7 @@ 1 2 - 2025696 + 2024859 @@ -30579,19 +31016,19 @@ exprparents - 19401276 + 19397147 expr_id - 19401276 + 19397147 child_index - 19980 + 19976 parent_id - 12904774 + 12902028 @@ -30605,7 +31042,7 @@ 1 2 - 19401276 + 19397147 @@ -30621,7 +31058,7 @@ 1 2 - 19401276 + 19397147 @@ -30637,7 +31074,7 @@ 1 2 - 3844 + 3843 2 @@ -30652,7 +31089,7 @@ 4 5 - 8951 + 8950 5 @@ -30688,7 +31125,7 @@ 1 2 - 3844 + 3843 2 @@ -30703,7 +31140,7 @@ 4 5 - 8951 + 8950 5 @@ -30739,17 +31176,17 @@ 1 2 - 7374634 + 7373064 2 3 - 5068849 + 5067770 3 712 - 461291 + 461193 @@ -30765,17 +31202,17 @@ 1 2 - 7374634 + 7373064 2 3 - 5068849 + 5067770 3 712 - 461291 + 461193 @@ -30785,22 +31222,22 @@ expr_isload - 6961476 + 6961688 expr_id - 6961476 + 6961688 conversionkinds - 6048225 + 6048227 expr_id - 6048225 + 6048227 kind @@ -30818,7 +31255,7 @@ 1 2 - 6048225 + 6048227 @@ -30862,8 +31299,8 @@ 1 - 5829770 - 5829771 + 5829772 + 5829773 1 @@ -30874,11 +31311,11 @@ iscall - 6219948 + 6218005 caller - 6219948 + 6218005 kind @@ -30896,7 +31333,7 @@ 1 2 - 6219948 + 6218005 @@ -30920,8 +31357,8 @@ 23 - 268067 - 268068 + 268068 + 268069 23 @@ -30932,11 +31369,11 @@ numtemplatearguments - 723402 + 722410 expr_id - 723402 + 722410 num @@ -30954,7 +31391,7 @@ 1 2 - 723402 + 722410 @@ -31063,23 +31500,23 @@ namequalifiers - 3258067 + 3257060 id - 3258067 + 3257060 qualifiableelement - 3258067 + 3257060 qualifyingelement - 50413 + 50397 location - 591864 + 591677 @@ -31093,7 +31530,7 @@ 1 2 - 3258067 + 3257060 @@ -31109,7 +31546,7 @@ 1 2 - 3258067 + 3257060 @@ -31125,7 +31562,7 @@ 1 2 - 3258067 + 3257060 @@ -31141,7 +31578,7 @@ 1 2 - 3258067 + 3257060 @@ -31157,7 +31594,7 @@ 1 2 - 3258067 + 3257060 @@ -31173,7 +31610,7 @@ 1 2 - 3258067 + 3257060 @@ -31189,25 +31626,25 @@ 1 2 - 33832 + 33821 2 3 - 8417 + 8414 3 5 - 4266 + 4265 5 1601 - 3782 + 3780 - 6806 + 6807 41956 115 @@ -31225,25 +31662,25 @@ 1 2 - 33832 + 33821 2 3 - 8417 + 8414 3 5 - 4266 + 4265 5 1601 - 3782 + 3780 - 6806 + 6807 41956 115 @@ -31261,22 +31698,22 @@ 1 2 - 36714 + 36703 2 3 - 7587 + 7585 3 6 - 3782 + 3780 6 20057 - 2329 + 2328 @@ -31292,22 +31729,22 @@ 1 2 - 85006 + 84956 2 6 - 40543 + 40553 6 7 - 427777 + 427642 7 192 - 38536 + 38524 @@ -31323,22 +31760,22 @@ 1 2 - 85006 + 84956 2 6 - 40543 + 40553 6 7 - 427777 + 427642 7 192 - 38536 + 38524 @@ -31354,22 +31791,22 @@ 1 2 - 119346 + 119308 2 4 - 14252 + 14247 4 5 - 445212 + 445072 5 33 - 13053 + 13048 @@ -31379,15 +31816,15 @@ varbind - 8226107 + 8230416 expr - 8226107 + 8230416 var - 1047517 + 1047294 @@ -31401,7 +31838,7 @@ 1 2 - 8226107 + 8230416 @@ -31417,52 +31854,52 @@ 1 2 - 171069 + 171032 2 3 - 188187 + 188147 3 4 - 145251 + 145220 4 5 - 116319 + 116294 5 6 - 82924 + 82907 6 7 - 65638 + 65624 7 9 - 80595 + 80578 9 13 - 82139 + 81335 13 - 28 - 80286 + 27 + 78895 - 28 + 27 5137 - 35106 + 37259 @@ -31472,15 +31909,15 @@ funbind - 6230372 + 6228425 expr - 6227720 + 6225774 fun - 295540 + 295469 @@ -31494,12 +31931,12 @@ 1 2 - 6225068 + 6223123 2 3 - 2652 + 2651 @@ -31515,27 +31952,27 @@ 1 2 - 194320 + 194282 2 3 - 41557 + 41544 3 4 - 18403 + 18397 4 8 - 24376 + 24368 8 37798 - 16881 + 16876 @@ -31545,11 +31982,11 @@ expr_allocator - 57054 + 56975 expr - 57054 + 56975 func @@ -31571,7 +32008,7 @@ 1 2 - 57054 + 56975 @@ -31587,7 +32024,7 @@ 1 2 - 57054 + 56975 @@ -31671,11 +32108,11 @@ expr_deallocator - 67880 + 67787 expr - 67880 + 67787 func @@ -31697,7 +32134,7 @@ 1 2 - 67880 + 67787 @@ -31713,7 +32150,7 @@ 1 2 - 67880 + 67787 @@ -31807,26 +32244,26 @@ expr_cond_two_operand - 722 + 652 cond - 722 + 652 expr_cond_guard - 896444 + 895300 cond - 896444 + 895300 guard - 896444 + 895300 @@ -31840,7 +32277,7 @@ 1 2 - 896444 + 895300 @@ -31856,7 +32293,7 @@ 1 2 - 896444 + 895300 @@ -31866,15 +32303,15 @@ expr_cond_true - 896441 + 895297 cond - 896441 + 895297 true - 896441 + 895297 @@ -31888,7 +32325,7 @@ 1 2 - 896441 + 895297 @@ -31904,7 +32341,7 @@ 1 2 - 896441 + 895297 @@ -31914,15 +32351,15 @@ expr_cond_false - 896444 + 895300 cond - 896444 + 895300 false - 896444 + 895300 @@ -31936,7 +32373,7 @@ 1 2 - 896444 + 895300 @@ -31952,7 +32389,7 @@ 1 2 - 896444 + 895300 @@ -31962,15 +32399,15 @@ values - 14099248 + 13198553 id - 14099248 + 13198553 str - 128199 + 113721 @@ -31984,7 +32421,7 @@ 1 2 - 14099248 + 13198553 @@ -32000,27 +32437,27 @@ 1 2 - 88599 + 78593 2 3 - 17382 + 15419 3 7 - 11000 + 9741 7 - 359 - 9621 + 351 + 8529 - 360 - 562781 - 1593 + 352 + 660247 + 1436 @@ -32030,11 +32467,11 @@ valuetext - 6605580 + 6605633 id - 6605580 + 6605633 text @@ -32052,7 +32489,7 @@ 1 2 - 6605580 + 6605633 @@ -32082,7 +32519,7 @@ 7 - 593260 + 593269 27560 @@ -32093,15 +32530,15 @@ valuebind - 14484483 + 13543087 val - 14099248 + 13198553 expr - 14484483 + 13543087 @@ -32115,12 +32552,12 @@ 1 2 - 13735579 + 12873876 2 6 - 363669 + 324676 @@ -32136,7 +32573,7 @@ 1 2 - 14484483 + 13543087 @@ -32146,15 +32583,15 @@ fieldoffsets - 1441833 + 1441877 id - 1441833 + 1441877 byteoffset - 31021 + 31022 bitoffset @@ -32172,7 +32609,7 @@ 1 2 - 1441833 + 1441877 @@ -32188,7 +32625,7 @@ 1 2 - 1441833 + 1441877 @@ -32204,7 +32641,7 @@ 1 2 - 17804 + 17805 2 @@ -32250,7 +32687,7 @@ 1 2 - 30092 + 30093 2 @@ -32347,19 +32784,19 @@ bitfield - 27388 + 26910 id - 27388 + 26910 bits - 279 + 3363 declared_bits - 279 + 3363 @@ -32373,7 +32810,7 @@ 1 2 - 27388 + 26910 @@ -32389,7 +32826,7 @@ 1 2 - 27388 + 26910 @@ -32405,62 +32842,42 @@ 1 2 - 58 + 941 2 3 - 32 + 807 3 4 - 26 + 269 4 5 - 19 + 269 5 6 - 19 + 269 6 - 7 - 19 + 8 + 269 - 10 + 8 11 - 19 + 269 - 18 - 21 - 19 - - - 26 - 33 - 19 - - - 36 - 79 - 19 - - - 82 - 1081 - 19 - - - 2547 - 2548 - 6 + 12 + 115 + 269 @@ -32476,7 +32893,7 @@ 1 2 - 279 + 3363 @@ -32492,62 +32909,42 @@ 1 2 - 58 + 941 2 3 - 32 + 807 3 4 - 26 + 269 4 5 - 19 + 269 5 6 - 19 + 269 6 - 7 - 19 + 8 + 269 - 10 + 8 11 - 19 + 269 - 18 - 21 - 19 - - - 26 - 33 - 19 - - - 36 - 79 - 19 - - - 82 - 1081 - 19 - - - 2547 - 2548 - 6 + 12 + 115 + 269 @@ -32563,7 +32960,7 @@ 1 2 - 279 + 3363 @@ -32573,23 +32970,23 @@ initialisers - 2336670 + 2336741 init - 2336670 + 2336741 var - 983090 + 983120 expr - 2336670 + 2336741 location - 539034 + 539051 @@ -32603,7 +33000,7 @@ 1 2 - 2336670 + 2336741 @@ -32619,7 +33016,7 @@ 1 2 - 2336670 + 2336741 @@ -32635,7 +33032,7 @@ 1 2 - 2336670 + 2336741 @@ -32651,17 +33048,17 @@ 1 2 - 865933 + 865959 2 15 - 39245 + 39247 16 25 - 77910 + 77913 @@ -32677,17 +33074,17 @@ 1 2 - 865933 + 865959 2 15 - 39245 + 39247 16 25 - 77910 + 77913 @@ -32703,7 +33100,7 @@ 1 2 - 983081 + 983111 2 @@ -32724,7 +33121,7 @@ 1 2 - 2336670 + 2336741 @@ -32740,7 +33137,7 @@ 1 2 - 2336670 + 2336741 @@ -32756,7 +33153,7 @@ 1 2 - 2336670 + 2336741 @@ -32772,22 +33169,22 @@ 1 2 - 439415 + 439428 2 3 - 32732 + 32733 3 15 - 42316 + 42317 15 111551 - 24570 + 24571 @@ -32803,12 +33200,12 @@ 1 2 - 470681 + 470696 2 4 - 49306 + 49308 4 @@ -32829,22 +33226,22 @@ 1 2 - 439415 + 439428 2 3 - 32732 + 32733 3 15 - 42316 + 42317 15 111551 - 24570 + 24571 @@ -32854,26 +33251,26 @@ braced_initialisers - 74303 + 74268 init - 74303 + 74268 expr_ancestor - 1798193 + 1797625 exp - 1798193 + 1797625 ancestor - 899973 + 899688 @@ -32887,7 +33284,7 @@ 1 2 - 1798193 + 1797625 @@ -32903,17 +33300,17 @@ 1 2 - 18311 + 18305 2 3 - 870868 + 870593 3 19 - 10793 + 10789 @@ -32923,19 +33320,19 @@ exprs - 25135853 + 25136620 id - 25135853 + 25136620 kind - 1581 + 1448 location - 11535468 + 10563688 @@ -32949,7 +33346,7 @@ 1 2 - 25135853 + 25136620 @@ -32965,7 +33362,7 @@ 1 2 - 25135853 + 25136620 @@ -32981,72 +33378,72 @@ 1 10 - 119 + 109 12 18 - 119 + 109 26 100 - 119 + 109 105 305 - 119 + 109 323 - 417 - 119 + 467 + 109 - 466 - 876 - 119 + 607 + 893 + 109 - 892 + 906 1658 - 119 + 109 - 1680 + 1781 2386 - 119 + 109 3210 - 4067 - 119 + 4267 + 109 - 4299 + 4809 5185 - 119 + 109 5187 - 20392 - 119 + 22126 + 109 26363 50205 - 119 + 109 - 61894 - 137424 - 119 + 63936 + 144106 + 109 - 286226 - 286227 - 23 + 312846 + 312847 + 21 @@ -33062,72 +33459,72 @@ 1 9 - 119 + 109 9 15 - 119 + 109 17 96 - 119 + 109 99 222 - 119 + 109 260 383 - 119 + 109 408 594 - 119 + 109 599 749 - 119 + 109 864 1774 - 119 + 109 1812 2545 - 119 + 109 2623 2919 - 119 + 109 3419 4913 - 119 + 109 5471 21139 - 119 + 109 26254 76840 - 119 + 109 - 223932 - 223933 - 23 + 224078 + 224079 + 21 @@ -33143,22 +33540,22 @@ 1 2 - 9705660 + 8887659 2 3 - 898509 + 818573 3 16 - 866990 + 793536 16 71733 - 64307 + 63919 @@ -33174,17 +33571,17 @@ 1 2 - 9853403 + 9023791 2 3 - 844292 + 772932 3 32 - 837773 + 766964 @@ -33194,15 +33591,15 @@ expr_reuse - 907883 + 907596 reuse - 907883 + 907596 original - 907883 + 907596 value_category @@ -33220,7 +33617,7 @@ 1 2 - 907883 + 907596 @@ -33236,7 +33633,7 @@ 1 2 - 907883 + 907596 @@ -33252,7 +33649,7 @@ 1 2 - 907883 + 907596 @@ -33268,7 +33665,7 @@ 1 2 - 907883 + 907596 @@ -33320,19 +33717,19 @@ expr_types - 25135853 + 25136620 id - 25135853 + 25136620 typeid - 200113 + 213831 value_category - 47 + 43 @@ -33346,7 +33743,7 @@ 1 2 - 25135853 + 25136620 @@ -33362,7 +33759,7 @@ 1 2 - 25135853 + 25136620 @@ -33378,52 +33775,52 @@ 1 2 - 50525 + 52421 2 3 - 34227 + 35130 3 4 - 15819 + 14504 4 5 - 11696 + 14504 5 - 7 - 14045 + 8 + 17510 - 7 - 11 - 16658 + 8 + 14 + 17378 - 11 - 19 - 16130 + 14 + 24 + 16391 - 19 - 37 - 15124 + 24 + 49 + 16084 - 37 + 49 134 - 15076 + 16105 134 - 467220 - 10809 + 440938 + 13801 @@ -33439,12 +33836,12 @@ 1 2 - 168858 + 185591 2 3 - 31255 + 28240 @@ -33458,14 +33855,14 @@ 12 - 110354 - 110355 - 23 + 153383 + 153384 + 21 - 938347 - 938348 - 23 + 992173 + 992174 + 21 @@ -33479,14 +33876,14 @@ 12 - 2274 - 2275 - 23 + 2282 + 2283 + 21 - 7379 - 7380 - 23 + 8750 + 8751 + 21 @@ -33507,15 +33904,15 @@ new_allocated_type - 58257 + 58177 expr - 58257 + 58177 type_id - 34541 + 34494 @@ -33529,7 +33926,7 @@ 1 2 - 58257 + 58177 @@ -33545,17 +33942,17 @@ 1 2 - 14521 + 14501 2 3 - 18259 + 18234 3 19 - 1761 + 1759 @@ -34964,15 +35361,15 @@ condition_decl_bind - 438294 + 438155 expr - 438294 + 438155 decl - 438294 + 438155 @@ -34986,7 +35383,7 @@ 1 2 - 438294 + 438155 @@ -35002,7 +35399,7 @@ 1 2 - 438294 + 438155 @@ -35012,15 +35409,15 @@ typeid_bind - 60405 + 60322 expr - 60405 + 60322 type_id - 20106 + 20078 @@ -35034,7 +35431,7 @@ 1 2 - 60405 + 60322 @@ -35050,17 +35447,17 @@ 1 2 - 3737 + 3732 2 3 - 15853 + 15831 3 328 - 515 + 514 @@ -35070,11 +35467,11 @@ uuidof_bind - 27727 + 27728 expr - 27727 + 27728 type_id @@ -35092,7 +35489,7 @@ 1 2 - 27727 + 27728 @@ -35108,7 +35505,7 @@ 1 2 - 27233 + 27234 2 @@ -35123,15 +35520,15 @@ sizeof_bind - 245234 + 241252 expr - 245234 + 241252 type_id - 12607 + 11189 @@ -35145,7 +35542,7 @@ 1 2 - 245234 + 241252 @@ -35161,42 +35558,42 @@ 1 2 - 4410 + 3901 2 3 - 3103 + 2758 3 4 - 1164 + 1021 4 5 - 1340 + 1136 5 6 - 318 + 294 6 7 - 1164 + 1061 7 - 42 - 949 + 40 + 848 - 42 - 5351 - 156 + 40 + 6061 + 167 @@ -35254,11 +35651,11 @@ lambdas - 17829 + 17804 expr - 17829 + 17804 default_capture @@ -35280,7 +35677,7 @@ 1 2 - 17829 + 17804 @@ -35296,7 +35693,7 @@ 1 2 - 17829 + 17804 @@ -35423,7 +35820,7 @@ location - 18603 + 18604 @@ -36509,7 +36906,7 @@ 1 2 - 17380 + 17381 2 @@ -36530,7 +36927,7 @@ 1 2 - 17857 + 17858 2 @@ -36577,7 +36974,7 @@ 1 2 - 18577 + 18578 2 @@ -36598,7 +36995,7 @@ 1 2 - 18603 + 18604 @@ -36608,11 +37005,11 @@ fold - 1374 + 1372 expr - 1374 + 1372 operator @@ -36634,7 +37031,7 @@ 1 2 - 1374 + 1372 @@ -36650,7 +37047,7 @@ 1 2 - 1374 + 1372 @@ -36729,11 +37126,11 @@ stmts - 6324260 + 6324453 id - 6324260 + 6324453 kind @@ -36741,7 +37138,7 @@ location - 2966229 + 2966319 @@ -36755,7 +37152,7 @@ 1 2 - 6324260 + 6324453 @@ -36771,7 +37168,7 @@ 1 2 - 6324260 + 6324453 @@ -36999,22 +37396,22 @@ 1 2 - 2357133 + 2357205 2 3 - 243530 + 243538 3 8 - 228595 + 228602 8 653 - 136969 + 136973 @@ -37030,12 +37427,12 @@ 1 2 - 2892631 + 2892720 2 8 - 73597 + 73599 @@ -37141,11 +37538,11 @@ type_is_vla - 47 + 43 type_id - 47 + 43 @@ -37200,15 +37597,15 @@ if_then - 987520 + 987309 if_stmt - 987520 + 987309 then_id - 987520 + 987309 @@ -37222,7 +37619,7 @@ 1 2 - 987520 + 987309 @@ -37238,7 +37635,7 @@ 1 2 - 987520 + 987309 @@ -37248,15 +37645,15 @@ if_else - 468505 + 468357 if_stmt - 468505 + 468357 else_id - 468505 + 468357 @@ -37270,7 +37667,7 @@ 1 2 - 468505 + 468357 @@ -37286,7 +37683,7 @@ 1 2 - 468505 + 468357 @@ -37344,15 +37741,15 @@ constexpr_if_then - 72386 + 72388 constexpr_if_stmt - 72386 + 72388 then_id - 72386 + 72388 @@ -37366,7 +37763,7 @@ 1 2 - 72386 + 72388 @@ -37382,7 +37779,7 @@ 1 2 - 72386 + 72388 @@ -37392,15 +37789,15 @@ constexpr_if_else - 41978 + 41980 constexpr_if_stmt - 41978 + 41980 else_id - 41978 + 41980 @@ -37414,7 +37811,7 @@ 1 2 - 41978 + 41980 @@ -37430,7 +37827,7 @@ 1 2 - 41978 + 41980 @@ -37536,15 +37933,15 @@ while_body - 39540 + 39531 while_stmt - 39540 + 39531 body_id - 39540 + 39531 @@ -37558,7 +37955,7 @@ 1 2 - 39540 + 39531 @@ -37574,7 +37971,7 @@ 1 2 - 39540 + 39531 @@ -37584,15 +37981,15 @@ do_body - 258278 + 232977 do_stmt - 258278 + 232977 body_id - 258278 + 232977 @@ -37606,7 +38003,7 @@ 1 2 - 258278 + 232977 @@ -37622,7 +38019,7 @@ 1 2 - 258278 + 232977 @@ -37680,19 +38077,19 @@ switch_case - 896214 + 895930 switch_stmt - 441453 + 441314 index - 415 + 414 case_id - 896214 + 895930 @@ -37711,12 +38108,12 @@ 2 3 - 438363 + 438224 3 19 - 3067 + 3066 @@ -37737,12 +38134,12 @@ 2 3 - 438363 + 438224 3 19 - 3067 + 3066 @@ -37900,7 +38297,7 @@ 1 2 - 896214 + 895930 @@ -37916,7 +38313,7 @@ 1 2 - 896214 + 895930 @@ -37926,15 +38323,15 @@ switch_body - 441453 + 441314 switch_stmt - 441453 + 441314 body_id - 441453 + 441314 @@ -37948,7 +38345,7 @@ 1 2 - 441453 + 441314 @@ -37964,7 +38361,7 @@ 1 2 - 441453 + 441314 @@ -37974,15 +38371,15 @@ for_initialization - 73046 + 73031 for_stmt - 73046 + 73031 init_id - 73046 + 73031 @@ -37996,7 +38393,7 @@ 1 2 - 73046 + 73031 @@ -38012,7 +38409,7 @@ 1 2 - 73046 + 73031 @@ -38022,15 +38419,15 @@ for_condition - 76133 + 76117 for_stmt - 76133 + 76117 condition_id - 76133 + 76117 @@ -38044,7 +38441,7 @@ 1 2 - 76133 + 76117 @@ -38060,7 +38457,7 @@ 1 2 - 76133 + 76117 @@ -38070,15 +38467,15 @@ for_update - 73187 + 73171 for_stmt - 73187 + 73171 update_id - 73187 + 73171 @@ -38092,7 +38489,7 @@ 1 2 - 73187 + 73171 @@ -38108,7 +38505,7 @@ 1 2 - 73187 + 73171 @@ -38118,15 +38515,15 @@ for_body - 84159 + 84141 for_stmt - 84159 + 84141 body_id - 84159 + 84141 @@ -38140,7 +38537,7 @@ 1 2 - 84159 + 84141 @@ -38156,7 +38553,7 @@ 1 2 - 84159 + 84141 @@ -38166,11 +38563,11 @@ stmtparents - 5536437 + 5536606 id - 5536437 + 5536606 index @@ -38178,7 +38575,7 @@ parent - 2349072 + 2349144 @@ -38192,7 +38589,7 @@ 1 2 - 5536437 + 5536606 @@ -38208,7 +38605,7 @@ 1 2 - 5536437 + 5536606 @@ -38346,32 +38743,32 @@ 1 2 - 1349052 + 1349093 2 3 - 508947 + 508963 3 4 - 144286 + 144290 4 6 - 151883 + 151888 6 17 - 178119 + 178125 17 1943 - 16782 + 16783 @@ -38387,32 +38784,32 @@ 1 2 - 1349052 + 1349093 2 3 - 508947 + 508963 3 4 - 144286 + 144290 4 6 - 151883 + 151888 6 17 - 178119 + 178125 17 1943 - 16782 + 16783 @@ -38422,22 +38819,22 @@ ishandler - 47531 + 47453 block - 47531 + 47453 stmt_decl_bind - 730759 + 730619 stmt - 690289 + 690157 num @@ -38445,7 +38842,7 @@ decl - 730690 + 730550 @@ -38459,12 +38856,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38480,12 +38877,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38545,7 +38942,7 @@ 5480 - 170179 + 170178 8 @@ -38606,7 +39003,7 @@ 5480 - 170162 + 170161 8 @@ -38623,7 +39020,7 @@ 1 2 - 730666 + 730526 2 @@ -38644,7 +39041,7 @@ 1 2 - 730690 + 730550 @@ -38654,11 +39051,11 @@ stmt_decl_entry_bind - 730759 + 730619 stmt - 690289 + 690157 num @@ -38666,7 +39063,7 @@ decl_entry - 730759 + 730619 @@ -38680,12 +39077,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38701,12 +39098,12 @@ 1 2 - 668061 + 667933 2 32 - 22228 + 22224 @@ -38766,7 +39163,7 @@ 5480 - 170179 + 170178 8 @@ -38827,7 +39224,7 @@ 5480 - 170179 + 170178 8 @@ -38844,7 +39241,7 @@ 1 2 - 730759 + 730619 @@ -38860,7 +39257,7 @@ 1 2 - 730759 + 730619 @@ -38870,15 +39267,15 @@ blockscope - 1838723 + 1838779 block - 1838723 + 1838779 enclosing - 1575683 + 1575731 @@ -38892,7 +39289,7 @@ 1 2 - 1838723 + 1838779 @@ -38908,17 +39305,17 @@ 1 2 - 1400368 + 1400410 2 3 - 129838 + 129842 3 28 - 45476 + 45478 @@ -38928,19 +39325,19 @@ jumpinfo - 347364 + 347302 id - 347364 + 347302 str - 28869 + 28864 target - 72506 + 72493 @@ -38954,7 +39351,7 @@ 1 2 - 347364 + 347302 @@ -38970,7 +39367,7 @@ 1 2 - 347364 + 347302 @@ -38986,12 +39383,12 @@ 2 3 - 13559 + 13557 3 4 - 6042 + 6041 4 @@ -39016,7 +39413,7 @@ 25 13711 - 1000 + 999 @@ -39032,7 +39429,7 @@ 1 2 - 23127 + 23122 2 @@ -39042,7 +39439,7 @@ 3 3321 - 2125 + 2124 @@ -39063,27 +39460,27 @@ 2 3 - 36111 + 36105 3 4 - 17584 + 17581 4 5 - 7358 + 7357 5 8 - 6400 + 6399 8 2124 - 5017 + 5016 @@ -39099,7 +39496,7 @@ 1 2 - 72506 + 72493 @@ -39109,11 +39506,11 @@ preprocdirects - 5704669 + 5704844 id - 5704669 + 5704844 kind @@ -39121,7 +39518,7 @@ location - 5701306 + 5701480 @@ -39135,7 +39532,7 @@ 1 2 - 5704669 + 5704844 @@ -39151,7 +39548,7 @@ 1 2 - 5704669 + 5704844 @@ -39299,7 +39696,7 @@ 1 2 - 5701171 + 5701345 26 @@ -39320,7 +39717,7 @@ 1 2 - 5701306 + 5701480 @@ -39330,15 +39727,15 @@ preprocpair - 1103825 + 1103859 begin - 846302 + 846328 elseelifend - 1103825 + 1103859 @@ -39352,12 +39749,12 @@ 1 2 - 601560 + 601579 2 3 - 235592 + 235599 3 @@ -39378,7 +39775,7 @@ 1 2 - 1103825 + 1103859 @@ -39388,41 +39785,41 @@ preproctrue - 388572 + 388584 branch - 388572 + 388584 preprocfalse - 273265 + 273273 branch - 273265 + 273273 preproctext - 4690318 + 4690461 id - 4690318 + 4690461 head - 3333139 + 3333241 body - 1948244 + 1948304 @@ -39436,7 +39833,7 @@ 1 2 - 4690318 + 4690461 @@ -39452,7 +39849,7 @@ 1 2 - 4690318 + 4690461 @@ -39468,12 +39865,12 @@ 1 2 - 3143697 + 3143793 2 740 - 189442 + 189448 @@ -39489,12 +39886,12 @@ 1 2 - 3252949 + 3253048 2 5 - 80190 + 80192 @@ -39510,17 +39907,17 @@ 1 2 - 1763645 + 1763699 2 6 - 146118 + 146122 6 12303 - 38480 + 38481 @@ -39536,17 +39933,17 @@ 1 2 - 1767547 + 1767601 2 7 - 146521 + 146526 7 2977 - 34175 + 34176 @@ -39556,15 +39953,15 @@ includes - 408680 + 408508 id - 408680 + 408508 included - 75282 + 75250 @@ -39578,7 +39975,7 @@ 1 2 - 408680 + 408508 @@ -39594,37 +39991,37 @@ 1 2 - 37254 + 37239 2 3 - 12111 + 12106 3 4 - 6353 + 6351 4 6 - 6868 + 6865 6 11 - 5798 + 5795 11 47 - 5649 + 5646 47 793 - 1246 + 1245 @@ -39634,15 +40031,15 @@ link_targets - 948 + 947 id - 948 + 947 binary - 948 + 947 @@ -39656,7 +40053,7 @@ 1 2 - 948 + 947 @@ -39672,7 +40069,7 @@ 1 2 - 948 + 947 @@ -39682,11 +40079,11 @@ link_parent - 38313696 + 38261175 element - 4873064 + 4866384 link_target @@ -39704,17 +40101,17 @@ 1 2 - 668840 + 667923 2 9 - 33983 + 33936 9 10 - 4170240 + 4164523 From 1ac47a892b6ef5f70d858df4531f663f509ec68f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 15 Apr 2025 17:39:23 +0200 Subject: [PATCH 332/372] Swift: make extractor compile again after 6.1 upgrade --- swift/extractor/SwiftExtractor.cpp | 2 +- swift/extractor/infra/SwiftLocationExtractor.h | 1 + swift/extractor/infra/SwiftTagTraits.h | 7 +++++-- swift/extractor/mangler/SwiftMangler.cpp | 11 ++++------- swift/extractor/mangler/SwiftMangler.h | 1 - swift/extractor/translators/DeclTranslator.cpp | 8 -------- swift/extractor/translators/DeclTranslator.h | 1 - swift/extractor/translators/ExprTranslator.cpp | 2 +- swift/extractor/translators/TypeTranslator.cpp | 6 ------ swift/extractor/translators/TypeTranslator.h | 1 - swift/ql/.generated.list | 6 +++--- swift/ql/lib/codeql/swift/elements/MacroRole.qll | 2 +- swift/ql/lib/codeql/swift/generated/MacroRole.qll | 12 ++++++------ swift/ql/lib/codeql/swift/generated/Raw.qll | 2 +- swift/ql/lib/swift.dbscheme | 7 +------ swift/schema.py | 2 +- swift/third_party/load.bzl | 4 ++++ 17 files changed, 29 insertions(+), 46 deletions(-) diff --git a/swift/extractor/SwiftExtractor.cpp b/swift/extractor/SwiftExtractor.cpp index b0de6a7a2a4..3b994ee63ad 100644 --- a/swift/extractor/SwiftExtractor.cpp +++ b/swift/extractor/SwiftExtractor.cpp @@ -155,7 +155,7 @@ static std::unordered_set extractDeclarations( if (primaryFile && primaryFile->getBufferID()) { auto& sourceManager = compiler.getSourceMgr(); auto tokens = swift::tokenize(compiler.getInvocation().getLangOptions(), sourceManager, - *primaryFile->getBufferID()); + primaryFile->getBufferID()); for (auto& token : tokens) { if (token.getKind() == swift::tok::comment) { comments.push_back(token); diff --git a/swift/extractor/infra/SwiftLocationExtractor.h b/swift/extractor/infra/SwiftLocationExtractor.h index dd015a94c8d..3a96cdcf619 100644 --- a/swift/extractor/infra/SwiftLocationExtractor.h +++ b/swift/extractor/infra/SwiftLocationExtractor.h @@ -1,6 +1,7 @@ #pragma once #include +#include // needed (but not included) by the following header #include #include #include diff --git a/swift/extractor/infra/SwiftTagTraits.h b/swift/extractor/infra/SwiftTagTraits.h index 6c7e2309e84..b95cec8d7d9 100644 --- a/swift/extractor/infra/SwiftTagTraits.h +++ b/swift/extractor/infra/SwiftTagTraits.h @@ -177,6 +177,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::ABISafeConversionExpr, AbiSafeConversionExprTag) // different acronym convention MAP(swift::ActorIsolationErasureExpr, ActorIsolationErasureExprTag) MAP(swift::UnreachableExpr, UnreachableExprTag) + MAP(swift::UnsafeCastExpr, void) // TODO swift 6.1 MAP(swift::ExplicitCastExpr, ExplicitCastExprTag) MAP(swift::CheckedCastExpr, CheckedCastExprTag) MAP(swift::ForcedCheckedCastExpr, ForcedCheckedCastExprTag) @@ -204,6 +205,7 @@ MAP(swift::Expr, ExprTag) MAP(swift::SingleValueStmtExpr, SingleValueStmtExprTag) MAP(swift::ExtractFunctionIsolationExpr, ExtractFunctionIsolationExprTag) MAP(swift::CurrentContextIsolationExpr, CurrentContextIsolationExprTag) + MAP(swift::TypeValueExpr, void) // TODO swift 6.1 MAP(swift::Decl, DeclTag) MAP(swift::ValueDecl, ValueDeclTag) MAP(swift::TypeDecl, TypeDeclTag) @@ -235,7 +237,6 @@ MAP(swift::Decl, DeclTag) MAP(swift::ExtensionDecl, ExtensionDeclTag) MAP(swift::TopLevelCodeDecl, TopLevelCodeDeclTag) MAP(swift::ImportDecl, ImportDeclTag) - MAP(swift::IfConfigDecl, IfConfigDeclTag) MAP(swift::PoundDiagnosticDecl, PoundDiagnosticDeclTag) MAP(swift::PrecedenceGroupDecl, PrecedenceGroupDeclTag) MAP(swift::MissingMemberDecl, MissingMemberDeclTag) @@ -284,6 +285,8 @@ MAP(swift::TypeBase, TypeTag) MAP(swift::BuiltinVectorType, BuiltinVectorTypeTag) MAP(swift::BuiltinPackIndexType, void) // SIL type, cannot really appear in the frontend run MAP(swift::BuiltinNonDefaultDistributedActorStorageType, void) // Does not appear in AST/SIL, only used during IRGen + MAP(swift::BuiltinFixedArrayType, void) // TODO swift 6.1 + MAP(swift::BuiltinUnboundGenericType, void) // TODO swift 6.1 MAP(swift::TupleType, TupleTypeTag) MAP(swift::ReferenceStorageType, ReferenceStorageTypeTag) MAP(swift::WeakStorageType, WeakStorageTypeTag) @@ -336,8 +339,8 @@ MAP(swift::TypeBase, TypeTag) MAP(swift::PackElementType, PackElementTypeTag) MAP(swift::TypeVariableType, void) // created during type checking and only used for constraint checking MAP(swift::ErrorUnionType, void) // created during type checking and only used for constraint checking + MAP(swift::IntegerType, void) // TODO swift 6.1 MAP(swift::SugarType, SugarTypeTag) - MAP(swift::ParenType, ParenTypeTag) MAP(swift::TypeAliasType, TypeAliasTypeTag) MAP(swift::SyntaxSugarType, SyntaxSugarTypeTag) MAP(swift::UnarySyntaxSugarType, UnarySyntaxSugarTypeTag) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 02465b1988a..313c7c0a21e 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -353,9 +353,10 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType( } SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) { - llvm::SmallVector uuid; - type->getOpenedExistentialID().toString(uuid); - return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); + // llvm::SmallVector uuid; + // type->getOpenedExistentialID().toString(uuid); // <- doesn't compile any more + // return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); + return visitArchetypeType(type); } SwiftMangledName SwiftMangler::visitProtocolCompositionType( @@ -370,10 +371,6 @@ SwiftMangledName SwiftMangler::visitProtocolCompositionType( return ret; } -SwiftMangledName SwiftMangler::visitParenType(const swift::ParenType* type) { - return initMangled(type) << fetch(type->getUnderlyingType()); -} - SwiftMangledName SwiftMangler::visitLValueType(const swift::LValueType* type) { return initMangled(type) << fetch(type->getObjectType()); } diff --git a/swift/extractor/mangler/SwiftMangler.h b/swift/extractor/mangler/SwiftMangler.h index 6cf909db03b..e4eb19345ed 100644 --- a/swift/extractor/mangler/SwiftMangler.h +++ b/swift/extractor/mangler/SwiftMangler.h @@ -94,7 +94,6 @@ class SwiftMangler : private swift::TypeVisitor, SwiftMangledName visitOpaqueTypeArchetypeType(const swift::OpaqueTypeArchetypeType* type); SwiftMangledName visitOpenedArchetypeType(const swift::OpenedArchetypeType* type); SwiftMangledName visitProtocolCompositionType(const swift::ProtocolCompositionType* type); - SwiftMangledName visitParenType(const swift::ParenType* type); SwiftMangledName visitLValueType(const swift::LValueType* type); SwiftMangledName visitDynamicSelfType(const swift::DynamicSelfType* type); SwiftMangledName visitUnboundGenericType(const swift::UnboundGenericType* type); diff --git a/swift/extractor/translators/DeclTranslator.cpp b/swift/extractor/translators/DeclTranslator.cpp index 77f9bd18b13..ab50777babb 100644 --- a/swift/extractor/translators/DeclTranslator.cpp +++ b/swift/extractor/translators/DeclTranslator.cpp @@ -334,14 +334,6 @@ void DeclTranslator::fillAbstractStorageDecl(const swift::AbstractStorageDecl& d fillValueDecl(decl, entry); } -codeql::IfConfigDecl DeclTranslator::translateIfConfigDecl(const swift::IfConfigDecl& decl) { - auto entry = createEntry(decl); - if (auto activeClause = decl.getActiveClause()) { - entry.active_elements = dispatcher.fetchRepeatedLabels(activeClause->Elements); - } - return entry; -} - codeql::OpaqueTypeDecl DeclTranslator::translateOpaqueTypeDecl(const swift::OpaqueTypeDecl& decl) { auto entry = createEntry(decl); fillTypeDecl(decl, entry); diff --git a/swift/extractor/translators/DeclTranslator.h b/swift/extractor/translators/DeclTranslator.h index 1c61c89aa45..57a6fdb9a2f 100644 --- a/swift/extractor/translators/DeclTranslator.h +++ b/swift/extractor/translators/DeclTranslator.h @@ -44,7 +44,6 @@ class DeclTranslator : public AstTranslatorBase { codeql::ExtensionDecl translateExtensionDecl(const swift::ExtensionDecl& decl); codeql::ImportDecl translateImportDecl(const swift::ImportDecl& decl); codeql::ModuleDecl translateModuleDecl(const swift::ModuleDecl& decl); - codeql::IfConfigDecl translateIfConfigDecl(const swift::IfConfigDecl& decl); codeql::OpaqueTypeDecl translateOpaqueTypeDecl(const swift::OpaqueTypeDecl& decl); codeql::PoundDiagnosticDecl translatePoundDiagnosticDecl(const swift::PoundDiagnosticDecl& decl); codeql::MissingMemberDecl translateMissingMemberDecl(const swift::MissingMemberDecl& decl); diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index 915d26b3373..e3b8c17c52a 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -624,7 +624,7 @@ codeql::AppliedPropertyWrapperExpr ExprTranslator::translateAppliedPropertyWrapp codeql::RegexLiteralExpr ExprTranslator::translateRegexLiteralExpr( const swift::RegexLiteralExpr& expr) { auto entry = createExprEntry(expr); - auto pattern = expr.getRegexText(); + auto pattern = expr.getParsedRegexText(); // TODO: there is now this and getRegexToEmit // the pattern has enclosing '/' delimiters, we'd rather get it without entry.pattern = pattern.substr(1, pattern.size() - 2); entry.version = expr.getVersion(); diff --git a/swift/extractor/translators/TypeTranslator.cpp b/swift/extractor/translators/TypeTranslator.cpp index 46e32a5bdee..3404bb7d95a 100644 --- a/swift/extractor/translators/TypeTranslator.cpp +++ b/swift/extractor/translators/TypeTranslator.cpp @@ -76,12 +76,6 @@ codeql::DependentMemberType TypeTranslator::translateDependentMemberType( return entry; } -codeql::ParenType TypeTranslator::translateParenType(const swift::ParenType& type) { - auto entry = createTypeEntry(type); - entry.type = dispatcher.fetchLabel(type.getUnderlyingType()); - return entry; -} - codeql::OptionalType TypeTranslator::translateOptionalType(const swift::OptionalType& type) { auto entry = createTypeEntry(type); fillUnarySyntaxSugarType(type, entry); diff --git a/swift/extractor/translators/TypeTranslator.h b/swift/extractor/translators/TypeTranslator.h index 6e5acf53546..02eb24632f4 100644 --- a/swift/extractor/translators/TypeTranslator.h +++ b/swift/extractor/translators/TypeTranslator.h @@ -24,7 +24,6 @@ class TypeTranslator : public TypeTranslatorBase { const swift::ExistentialMetatypeType& type); codeql::TypeAliasType translateTypeAliasType(const swift::TypeAliasType& type); codeql::DependentMemberType translateDependentMemberType(const swift::DependentMemberType& type); - codeql::ParenType translateParenType(const swift::ParenType& type); codeql::UnarySyntaxSugarType translateUnarySyntaxSugarType( const swift::UnarySyntaxSugarType& type); codeql::OptionalType translateOptionalType(const swift::OptionalType& type); diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 61bc11662f5..04ed47ffe92 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -12,7 +12,7 @@ lib/codeql/swift/elements/File.qll 642fde19ad366151c71ccb44c32b6063c3374d7169ada lib/codeql/swift/elements/KeyPathComponent.qll cc64d5a3cc6e6aa12faee7dfc95e6b5e10d0adb9bc10d815a93a3a61fd70e535 ab82cebb73753bf72ef8f79c271851dc7e738a25c7100b634630f4363ceec061 lib/codeql/swift/elements/Locatable.qll a4e01abd3f337a60e3741705cede50be974ccffcb707a53f2b378972838c5977 89ba4dbebcfa291797407c27087d91a18b1ec1bc97140a14ec08dbb12cef7395 lib/codeql/swift/elements/Location.qll db213e8e27f8d732ad472c16929f2c503634c622d4d7b6b6977ed8b7b3c71c5b 9b951af94891848ecea9a690741e4a401c4b7ad676fd1fcee703fce4dcee2da4 -lib/codeql/swift/elements/MacroRole.qll 2e814f75c578763570addab34c423245e4e68dba651ac9df05441b25c7ce6186 8822c126e2e19e9f7a2eb7035408acff3ac1d99ccb87def2a3b1d26dcfaeccfe +lib/codeql/swift/elements/MacroRole.qll d55500010c47fab14fb2110db0afadef5f1f01115d05c803c9fd114508aca6da 858a7fe124cb8874e1fe62b3b36153740b0bb1cd1e9ed0005b36d01040960ed8 lib/codeql/swift/elements/OtherAvailabilitySpec.qll b3e3aafc7b1f7b1ff2efa2bc9ff64370cc6847760a46ff5594f5144caee858ab 6630e73998c9359b6cefd265222cb72274b4484d6904b4a9f949bdb7a2781c0f lib/codeql/swift/elements/PlatformVersionAvailabilitySpec.qll 1a94d317cbb1731844986b57bbdc4095d90957c671d5248bc581bc1fdbb18f8b 3888eb1afc641d365c30fa514962f1a31b9b9c04383836e0062445e566003d34 lib/codeql/swift/elements/UnknownFile.qll 29e9f59c24c3ee6c2b01ea19390dd6730192628e5e4a541c3c00a42d16daad78 0ec046d67ebdc1722915b0d952468d1d3c3dfdf2c61e7fa215c7ba2fb91de04c @@ -719,12 +719,12 @@ lib/codeql/swift/generated/File.qll 476ac95566ef0080e0ad8c3da144b1be1d945d2f33a2 lib/codeql/swift/generated/KeyPathComponent.qll 5276acdc9a4ff0ec0cc8af615c04043391fb99613731ddcc86db4e47b37c8c5a ccc0931bbd6cc2cfae5037c2ee17bbdcbd87536f5fed90d07e73065c016c4382 lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fda2d2008700f955ad82ce109a7 e97d4d4fb8a4800e0008cc00f60c8ed9b1ebd5f1140fd85e68b034616178d721 lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa -lib/codeql/swift/generated/MacroRole.qll 0d8fa6b0b6e2045d9097a87d53888cae2ea5371b2fa7d140341cf206f575b556 ea3b8a7c0a88851809f9a5a5aa80b0d2da3c4779bb29044cdba2b60246a2722c +lib/codeql/swift/generated/MacroRole.qll facf907e75490d69cd401c491215e4719324d751f40ea46c86ccf24cf3663c1f 969d8d4b44e3f1a9c193a152a4d83a303e56d2dbb871fc920c47a33f699cf018 lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f lib/codeql/swift/generated/ParentChild.qll 7c9537f74a4c5a02622ce28c3de4b0ce02a7027d2e9aea9a860ece6a1e2ec340 49c1993b2a96df66903bffde78d63d8f4c68b2d604c419b20d88b63406366156 lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 -lib/codeql/swift/generated/Raw.qll 522f8500ce46d62fca22730ade5fa4716452adece25ffc36c50582b653f2fe6f 4d870e0695fff541c1a14eadc8ba51960a264ba2e6e53d0ccc32b34c7fd2cadd +lib/codeql/swift/generated/Raw.qll 6012194c54f8992401dffc0916b5790cdf581f18ac7b884379362dc807a52706 f9538fdfb326b715fdbc47e9e8b310df684d5a34519f751a65b3a4a75e430ce9 lib/codeql/swift/generated/Synth.qll a14dddab40979df82d30b2d73407fe0058a803ed6e1a882cd9a6ae5ffd240526 0879d2476a42123b46eee216d4ea03523e0c04fe0b68d9a68e0046253edb1bc9 lib/codeql/swift/generated/SynthConstructors.qll f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b f64121911e082aa15478eb8779025cee96e97503724c02aff31741e65a894a4b lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d diff --git a/swift/ql/lib/codeql/swift/elements/MacroRole.qll b/swift/ql/lib/codeql/swift/elements/MacroRole.qll index 222644e05e0..bb1f9e7519a 100644 --- a/swift/ql/lib/codeql/swift/elements/MacroRole.qll +++ b/swift/ql/lib/codeql/swift/elements/MacroRole.qll @@ -5,7 +5,7 @@ private import internal.MacroRoleImpl import codeql.swift.elements.AstNode -import codeql.swift.elements.expr.TypeExpr +import codeql.swift.elements.expr.Expr /** * The role of a macro, for example #freestanding(declaration) or @attached(member). diff --git a/swift/ql/lib/codeql/swift/generated/MacroRole.qll b/swift/ql/lib/codeql/swift/generated/MacroRole.qll index e3a66dc1e05..47153ab6bfe 100644 --- a/swift/ql/lib/codeql/swift/generated/MacroRole.qll +++ b/swift/ql/lib/codeql/swift/generated/MacroRole.qll @@ -7,7 +7,7 @@ private import codeql.swift.generated.Synth private import codeql.swift.generated.Raw import codeql.swift.elements.internal.AstNodeImpl::Impl as AstNodeImpl -import codeql.swift.elements.expr.TypeExpr +import codeql.swift.elements.expr.Expr /** * INTERNAL: This module contains the fully generated definition of `MacroRole` and should not @@ -44,9 +44,9 @@ module Generated { * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the * behavior of both the `Immediate` and non-`Immediate` versions. */ - TypeExpr getImmediateConformance(int index) { + Expr getImmediateConformance(int index) { result = - Synth::convertTypeExprFromRaw(Synth::convertMacroRoleToRaw(this) + Synth::convertExprFromRaw(Synth::convertMacroRoleToRaw(this) .(Raw::MacroRole) .getConformance(index)) } @@ -54,8 +54,8 @@ module Generated { /** * Gets the `index`th conformance of this macro role (0-based). */ - final TypeExpr getConformance(int index) { - exists(TypeExpr immediate | + final Expr getConformance(int index) { + exists(Expr immediate | immediate = this.getImmediateConformance(index) and result = immediate.resolve() ) @@ -64,7 +64,7 @@ module Generated { /** * Gets any of the conformances of this macro role. */ - final TypeExpr getAConformance() { result = this.getConformance(_) } + final Expr getAConformance() { result = this.getConformance(_) } /** * Gets the number of conformances of this macro role. diff --git a/swift/ql/lib/codeql/swift/generated/Raw.qll b/swift/ql/lib/codeql/swift/generated/Raw.qll index 2e0e08599ce..c59c831a1ee 100644 --- a/swift/ql/lib/codeql/swift/generated/Raw.qll +++ b/swift/ql/lib/codeql/swift/generated/Raw.qll @@ -266,7 +266,7 @@ module Raw { /** * Gets the `index`th conformance of this macro role (0-based). */ - TypeExpr getConformance(int index) { macro_role_conformances(this, index, result) } + Expr getConformance(int index) { macro_role_conformances(this, index, result) } /** * Gets the `index`th name of this macro role (0-based). diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index be2357fd002..4dd3d5ca8a8 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -210,7 +210,7 @@ macro_roles( macro_role_conformances( int id: @macro_role ref, int index: int ref, - int conformance: @type_expr_or_none ref + int conformance: @expr_or_none ref ); #keyset[id, index] @@ -2794,11 +2794,6 @@ variadic_sequence_types( //dir=type | @unspecified_element ; -@type_expr_or_none = - @type_expr -| @unspecified_element -; - @type_repr_or_none = @type_repr | @unspecified_element diff --git a/swift/schema.py b/swift/schema.py index d99a00c2e67..78750ae2baa 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1394,7 +1394,7 @@ class MacroRole(AstNode): """ kind: int | doc("kind of this macro role (declaration, expression, member, etc.)") | ql.internal macro_syntax: int | doc("#freestanding or @attached") | ql.internal - conformances: list[TypeExpr] | doc("conformances of this macro role") + conformances: list[Expr] | doc("conformances of this macro role") names: list[string] | doc("names of this macro role") class MacroDecl(GenericContext, ValueDecl): diff --git a/swift/third_party/load.bzl b/swift/third_party/load.bzl index d19345a1880..8c891a26fc3 100644 --- a/swift/third_party/load.bzl +++ b/swift/third_party/load.bzl @@ -5,6 +5,10 @@ load("//misc/bazel:lfs.bzl", "lfs_archive", "lfs_files") _override = { # these are used to test new artifacts. Must be empty before merging to main + "swift-prebuilt-macOS-swift-6.1-RELEASE-78.tar.zst": "4dcfe858b5519327c9b0c99735b47fe75c7a5090793d917de1ba6e42795aa86d", + "swift-prebuilt-Linux-swift-6.1-RELEASE-78.tar.zst": "d01b90bccfec46995bdf98a59339bd94e64257da99b4963148869c4a108bc2a9", + "resource-dir-macOS-swift-6.1-RELEASE-91.zip": "12bef89163486ac24d9ca00a5cc6ef3851b633e6fa63b7493c518e4d426e036c", + "resource-dir-Linux-swift-6.1-RELEASE-91.zip": "874932f93c4ca6269ae3a9e9c841916b3fd88f65f5018eec8777a52dde56901d", } _staging_url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/staging-{}/{}" From 4fc5a73bac430e85e886288c954a42f98f274872 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 10:34:17 +0200 Subject: [PATCH 333/372] Swift: Update mangling of `OpenedArchetypeType` --- swift/extractor/mangler/SwiftMangler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 313c7c0a21e..81678256db2 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -6,8 +6,8 @@ #include #include #include +#include #include -#include using namespace codeql; @@ -353,10 +353,10 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType( } SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) { - // llvm::SmallVector uuid; - // type->getOpenedExistentialID().toString(uuid); // <- doesn't compile any more - // return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); - return visitArchetypeType(type); + auto *env = type->getGenericEnvironment(); + llvm::SmallVector uuid; + env->getOpenedExistentialUUID().toString(uuid); + return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); } SwiftMangledName SwiftMangler::visitProtocolCompositionType( From 30242ed6fb3c7fca0bf478feb83dd64294f0c666 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 17 Apr 2025 10:34:48 +0200 Subject: [PATCH 334/372] Swift: Remove "to do" comment --- swift/extractor/translators/ExprTranslator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index e3b8c17c52a..c57cfd5b9ee 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -624,7 +624,7 @@ codeql::AppliedPropertyWrapperExpr ExprTranslator::translateAppliedPropertyWrapp codeql::RegexLiteralExpr ExprTranslator::translateRegexLiteralExpr( const swift::RegexLiteralExpr& expr) { auto entry = createExprEntry(expr); - auto pattern = expr.getParsedRegexText(); // TODO: there is now this and getRegexToEmit + auto pattern = expr.getParsedRegexText(); // the pattern has enclosing '/' delimiters, we'd rather get it without entry.pattern = pattern.substr(1, pattern.size() - 2); entry.version = expr.getVersion(); From 7834a3d9e4f02b8d03d099a4a5b33beac49b23ee Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 17 Apr 2025 15:46:35 +0200 Subject: [PATCH 335/372] Swift: expand mangling of `ExistentialMetatypeType` --- swift/extractor/mangler/SwiftMangler.cpp | 8 +++++++- swift/extractor/mangler/SwiftMangler.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 81678256db2..5771f243679 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -298,6 +298,12 @@ SwiftMangledName SwiftMangler::visitAnyMetatypeType(const swift::AnyMetatypeType return initMangled(type) << fetch(type->getInstanceType()); } +SwiftMangledName SwiftMangler::visitExistentialMetatypeType( + const swift::ExistentialMetatypeType* type) { + return visitAnyMetatypeType(type) + << fetch(const_cast(type)->getExistentialInstanceType()); +} + SwiftMangledName SwiftMangler::visitDependentMemberType(const swift::DependentMemberType* type) { return initMangled(type) << fetch(type->getBase()) << fetch(type->getAssocType()); } @@ -353,7 +359,7 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType( } SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) { - auto *env = type->getGenericEnvironment(); + auto* env = type->getGenericEnvironment(); llvm::SmallVector uuid; env->getOpenedExistentialUUID().toString(uuid); return visitArchetypeType(type) << std::string_view(uuid.data(), uuid.size()); diff --git a/swift/extractor/mangler/SwiftMangler.h b/swift/extractor/mangler/SwiftMangler.h index e4eb19345ed..2e3acbb9103 100644 --- a/swift/extractor/mangler/SwiftMangler.h +++ b/swift/extractor/mangler/SwiftMangler.h @@ -84,6 +84,7 @@ class SwiftMangler : private swift::TypeVisitor, SwiftMangledName visitGenericFunctionType(const swift::GenericFunctionType* type); SwiftMangledName visitGenericTypeParamType(const swift::GenericTypeParamType* type); SwiftMangledName visitAnyMetatypeType(const swift::AnyMetatypeType* type); + SwiftMangledName visitExistentialMetatypeType(const swift::ExistentialMetatypeType* type); SwiftMangledName visitDependentMemberType(const swift::DependentMemberType* type); SwiftMangledName visitInOutType(const swift::InOutType* type); SwiftMangledName visitExistentialType(const swift::ExistentialType* type); From 36672f44b94ad63b0ef2b1b82f17b14116d4efc9 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 12:57:53 +0200 Subject: [PATCH 336/372] Swift: Take inverses into account when mangling `ProtocolCompositionType`s --- swift/extractor/mangler/SwiftMangler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swift/extractor/mangler/SwiftMangler.cpp b/swift/extractor/mangler/SwiftMangler.cpp index 5771f243679..6357a58beca 100644 --- a/swift/extractor/mangler/SwiftMangler.cpp +++ b/swift/extractor/mangler/SwiftMangler.cpp @@ -371,6 +371,9 @@ SwiftMangledName SwiftMangler::visitProtocolCompositionType( for (auto composed : type->getMembers()) { ret << fetch(composed); } + for (auto inverse : type->getInverses()) { + ret << (uint8_t)inverse << "_"; + } if (type->hasExplicitAnyObject()) { ret << "&AnyObject"; } From 1b21e4c667addabdb63260e249816f41f83bcf6c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 16:26:23 +0200 Subject: [PATCH 337/372] Swift: Update test results for `IfConfigDecl` no longer being extracted --- .../extractor-tests/declarations/all.expected | 3 -- .../decl/IfConfigDecl/IfConfigDecl.expected | 1 - .../IfConfigDecl_getActiveElement.expected | 3 -- .../test/library-tests/ast/PrintAst.expected | 30 ++++++++----------- .../controlflow/graph/Cfg.expected | 9 ++---- 5 files changed, 15 insertions(+), 31 deletions(-) diff --git a/swift/ql/test/extractor-tests/declarations/all.expected b/swift/ql/test/extractor-tests/declarations/all.expected index f06a19299a2..98b94895345 100644 --- a/swift/ql/test/extractor-tests/declarations/all.expected +++ b/swift/ql/test/extractor-tests/declarations/all.expected @@ -264,9 +264,6 @@ | declarations.swift:155:1:155:28 | { ... } | | | declarations.swift:155:5:155:5 | d | | | declarations.swift:157:1:180:1 | ifConfig() | | -| declarations.swift:158:3:166:3 | #if ... | | -| declarations.swift:168:3:171:3 | #if ... | | -| declarations.swift:173:3:179:3 | #if ... | | | declarations.swift:182:1:182:10 | B | | | declarations.swift:182:7:182:7 | B.deinit() | | | declarations.swift:182:7:182:7 | B.init() | | diff --git a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected index a4cad96aacc..e69de29bb2d 100644 --- a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected +++ b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl.expected @@ -1 +0,0 @@ -| if_config.swift:1:1:10:1 | #if ... | getModule: | file://:0:0:0:0 | if_config | getNumberOfMembers: | 0 | getNumberOfActiveElements: | 3 | diff --git a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected index 93c9f638a8b..e69de29bb2d 100644 --- a/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected +++ b/swift/ql/test/extractor-tests/generated/decl/IfConfigDecl/IfConfigDecl_getActiveElement.expected @@ -1,3 +0,0 @@ -| if_config.swift:1:1:10:1 | #if ... | 0 | if_config.swift:8:1:8:16 | { ... } | -| if_config.swift:1:1:10:1 | #if ... | 1 | if_config.swift:8:5:8:5 | baz | -| if_config.swift:1:1:10:1 | #if ... | 2 | if_config.swift:9:1:9:12 | { ... } | diff --git a/swift/ql/test/library-tests/ast/PrintAst.expected b/swift/ql/test/library-tests/ast/PrintAst.expected index 879de94c833..cc72595a451 100644 --- a/swift/ql/test/library-tests/ast/PrintAst.expected +++ b/swift/ql/test/library-tests/ast/PrintAst.expected @@ -3109,16 +3109,13 @@ cfg.swift: # 467| [NamedFunction] testIfConfig() # 467| InterfaceType = () -> () # 467| getBody(): [BraceStmt] { ... } -# 468| getElement(0): [IfConfigDecl] #if ... -# 472| getElement(1): [IntegerLiteralExpr] 3 -# 473| getElement(2): [IntegerLiteralExpr] 4 -# 476| getElement(3): [IntegerLiteralExpr] 5 -# 478| getElement(4): [IfConfigDecl] #if ... -# 483| getElement(5): [IntegerLiteralExpr] 8 -# 485| getElement(6): [IfConfigDecl] #if ... -# 489| getElement(7): [IntegerLiteralExpr] 11 -# 490| getElement(8): [IntegerLiteralExpr] 12 -# 493| getElement(9): [IntegerLiteralExpr] 13 +# 472| getElement(0): [IntegerLiteralExpr] 3 +# 473| getElement(1): [IntegerLiteralExpr] 4 +# 476| getElement(2): [IntegerLiteralExpr] 5 +# 483| getElement(3): [IntegerLiteralExpr] 8 +# 489| getElement(4): [IntegerLiteralExpr] 11 +# 490| getElement(5): [IntegerLiteralExpr] 12 +# 493| getElement(6): [IntegerLiteralExpr] 13 # 496| [NamedFunction] testAvailable() # 496| InterfaceType = () -> Int # 496| getBody(): [BraceStmt] { ... } @@ -4587,14 +4584,11 @@ declarations.swift: # 157| [NamedFunction] ifConfig() # 157| InterfaceType = () -> () # 157| getBody(): [BraceStmt] { ... } -# 158| getElement(0): [IfConfigDecl] #if ... -# 163| getElement(1): [IntegerLiteralExpr] 4 -# 164| getElement(2): [IntegerLiteralExpr] 5 -# 165| getElement(3): [IntegerLiteralExpr] 6 -# 168| getElement(4): [IfConfigDecl] #if ... -# 173| getElement(5): [IfConfigDecl] #if ... -# 174| getElement(6): [IntegerLiteralExpr] 9 -# 175| getElement(7): [IntegerLiteralExpr] 10 +# 163| getElement(0): [IntegerLiteralExpr] 4 +# 164| getElement(1): [IntegerLiteralExpr] 5 +# 165| getElement(2): [IntegerLiteralExpr] 6 +# 174| getElement(3): [IntegerLiteralExpr] 9 +# 175| getElement(4): [IntegerLiteralExpr] 10 # 182| [ClassDecl] B # 182| getMember(0): [Deinitializer] B.deinit() # 182| InterfaceType = (B) -> () -> () diff --git a/swift/ql/test/library-tests/controlflow/graph/Cfg.expected b/swift/ql/test/library-tests/controlflow/graph/Cfg.expected index 05f14b3082e..41f64f27d71 100644 --- a/swift/ql/test/library-tests/controlflow/graph/Cfg.expected +++ b/swift/ql/test/library-tests/controlflow/graph/Cfg.expected @@ -1902,14 +1902,11 @@ | cfg.swift:464:39:464:39 | kpGet_mayB_x | cfg.swift:464:39:464:39 | (KeyPath) ... | | | cfg.swift:467:1:494:1 | enter testIfConfig() | cfg.swift:467:1:494:1 | testIfConfig() | | | cfg.swift:467:1:494:1 | exit testIfConfig() (normal) | cfg.swift:467:1:494:1 | exit testIfConfig() | | -| cfg.swift:467:1:494:1 | testIfConfig() | cfg.swift:468:1:474:1 | #if ... | | -| cfg.swift:468:1:474:1 | #if ... | cfg.swift:472:3:472:3 | 3 | | +| cfg.swift:467:1:494:1 | testIfConfig() | cfg.swift:472:3:472:3 | 3 | | | cfg.swift:472:3:472:3 | 3 | cfg.swift:473:3:473:3 | 4 | | | cfg.swift:473:3:473:3 | 4 | cfg.swift:476:3:476:3 | 5 | | -| cfg.swift:476:3:476:3 | 5 | cfg.swift:478:1:481:1 | #if ... | | -| cfg.swift:478:1:481:1 | #if ... | cfg.swift:483:3:483:3 | 8 | | -| cfg.swift:483:3:483:3 | 8 | cfg.swift:485:1:491:1 | #if ... | | -| cfg.swift:485:1:491:1 | #if ... | cfg.swift:489:3:489:3 | 11 | | +| cfg.swift:476:3:476:3 | 5 | cfg.swift:483:3:483:3 | 8 | | +| cfg.swift:483:3:483:3 | 8 | cfg.swift:489:3:489:3 | 11 | | | cfg.swift:489:3:489:3 | 11 | cfg.swift:490:3:490:3 | 12 | | | cfg.swift:490:3:490:3 | 12 | cfg.swift:493:3:493:3 | 13 | | | cfg.swift:493:3:493:3 | 13 | cfg.swift:467:1:494:1 | exit testIfConfig() (normal) | | From b6076c04811634994f60cfdd96555be374808b0c Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:01:20 +0200 Subject: [PATCH 338/372] Swift: Update test results for `ParenType` no longer being extracted --- .../decl/CapturedDecl/PrintAst.expected | 6 +-- .../IdentityExpr_getType.expected | 8 ++-- .../ProtocolCompositionType.expected | 1 - ...ProtocolCompositionType_getMember.expected | 2 - .../extractor-tests/patterns/types.expected | 48 +++++++++---------- .../test/library-tests/ast/PrintAst.expected | 18 +++---- 6 files changed, 40 insertions(+), 43 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected b/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected index c3ae0bba4c0..3b815eb1842 100644 --- a/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected +++ b/swift/ql/test/extractor-tests/generated/decl/CapturedDecl/PrintAst.expected @@ -101,7 +101,7 @@ closures.swift: # 24| getSubExpr(): [CallExpr] call to ... # 24| getFunction(): [BindOptionalExpr] ...? # 24| getSubExpr(): [DeclRefExpr] escape -# 24| getFunction().getFullyConverted(): [LoadExpr] ((() -> ())) ... +# 24| getFunction().getFullyConverted(): [LoadExpr] (() -> ()) ... # 24| getSubExpr().getFullyConverted(): [InjectIntoOptionalExpr] (()?) ... # 24| getCapture(0): [CapturedDecl] escape # 27| [NamedFunction] logical() @@ -145,8 +145,8 @@ closures.swift: # 30| getArgument(0): [Argument] : ... .!=(_:_:) ... # 30| getExpr(): [BinaryExpr] ... .!=(_:_:) ... # 30| getFunction(): [MethodLookupExpr] .!=(_:_:) -# 30| getBase(): [TypeExpr] Optional<((Int) -> Int)>.Type -# 30| getTypeRepr(): [TypeRepr] Optional<((Int) -> Int)> +# 30| getBase(): [TypeExpr] Optional<(Int) -> Int>.Type +# 30| getTypeRepr(): [TypeRepr] Optional<(Int) -> Int> # 30| getMethodRef(): [DeclRefExpr] !=(_:_:) # 30| getArgument(0): [Argument] : f # 30| getExpr(): [DeclRefExpr] f diff --git a/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected index d4c7bd3ee97..7922f8fdeed 100644 --- a/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected +++ b/swift/ql/test/extractor-tests/generated/expr/IdentityExpr/IdentityExpr_getType.expected @@ -1,9 +1,9 @@ | identity_expressions.swift:5:9:5:14 | .self | A | | identity_expressions.swift:5:9:5:21 | .self | @lvalue Int | -| identity_expressions.swift:5:28:5:31 | (...) | (Int) | -| identity_expressions.swift:9:5:9:9 | (...) | (A) | -| identity_expressions.swift:12:28:12:43 | (...) | (A) | +| identity_expressions.swift:5:28:5:31 | (...) | Int | +| identity_expressions.swift:9:5:9:9 | (...) | A | +| identity_expressions.swift:12:28:12:43 | (...) | A | | identity_expressions.swift:12:29:12:42 | await ... | A | | identity_expressions.swift:15:5:15:21 | await ... | () | -| identity_expressions.swift:15:11:15:19 | (...) | (() async -> ()) | +| identity_expressions.swift:15:11:15:19 | (...) | () async -> () | | identity_expressions.swift:18:9:18:17 | BorrowExpr | Int | diff --git a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected index 5cda96eb6fe..f8278a6bae9 100644 --- a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected +++ b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType.expected @@ -1,4 +1,3 @@ -| P1 & (P2 & P3) | getName: | P1 & (P2 & P3) | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 2 | | P1 & P2 & P3 | getName: | P1 & P2 & P3 | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 3 | | P1 & P23 | getName: | P1 & P23 | getCanonicalType: | P1 & P2 & P3 | getNumberOfMembers: | 2 | | P2 & P4 | getName: | P2 & P4 | getCanonicalType: | P2 & P4 | getNumberOfMembers: | 2 | diff --git a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected index 4792394a757..40aa86c2da1 100644 --- a/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected +++ b/swift/ql/test/extractor-tests/generated/type/ProtocolCompositionType/ProtocolCompositionType_getMember.expected @@ -1,5 +1,3 @@ -| P1 & (P2 & P3) | 0 | P1 | -| P1 & (P2 & P3) | 1 | (P2 & P3) | | P1 & P2 & P3 | 0 | P1 | | P1 & P2 & P3 | 1 | P2 | | P1 & P2 & P3 | 2 | P3 | diff --git a/swift/ql/test/extractor-tests/patterns/types.expected b/swift/ql/test/extractor-tests/patterns/types.expected index 0fececfa922..2d7dfd00dac 100644 --- a/swift/ql/test/extractor-tests/patterns/types.expected +++ b/swift/ql/test/extractor-tests/patterns/types.expected @@ -63,9 +63,9 @@ | patterns.swift:78:9:78:13 | ... as ... | MyEnum | | patterns.swift:81:10:81:11 | .myNone | MyEnum | | patterns.swift:83:10:83:25 | .mySingle(...) | MyEnum | -| patterns.swift:83:19:83:25 | (...) | (Int) | -| patterns.swift:83:20:83:24 | let ... | (Int) | -| patterns.swift:83:24:83:24 | a | (Int) | +| patterns.swift:83:19:83:25 | (...) | Int | +| patterns.swift:83:20:83:24 | let ... | Int | +| patterns.swift:83:24:83:24 | a | Int | | patterns.swift:85:10:85:30 | .myPair(...) | MyEnum | | patterns.swift:85:17:85:30 | (...) | (Int, Int) | | patterns.swift:85:18:85:22 | let ... | Int | @@ -78,9 +78,9 @@ | patterns.swift:88:22:88:22 | a | Int | | patterns.swift:88:25:88:25 | _ | MyEnum | | patterns.swift:92:13:92:28 | .mySingle(...) | MyEnum | -| patterns.swift:92:22:92:28 | (...) | (Int) | -| patterns.swift:92:23:92:27 | let ... | (Int) | -| patterns.swift:92:27:92:27 | x | (Int) | +| patterns.swift:92:22:92:28 | (...) | Int | +| patterns.swift:92:23:92:27 | let ... | Int | +| patterns.swift:92:27:92:27 | x | Int | | patterns.swift:95:13:95:33 | .myPair(...) | MyEnum | | patterns.swift:95:20:95:33 | (...) | (Int, Int) | | patterns.swift:95:21:95:25 | let ... | Int | @@ -89,9 +89,9 @@ | patterns.swift:95:32:95:32 | y | Int | | patterns.swift:103:10:103:11 | .myNone | MyEnum | | patterns.swift:105:10:105:25 | .mySingle(...) | MyEnum | -| patterns.swift:105:19:105:25 | (...) | (Int) | -| patterns.swift:105:20:105:24 | let ... | (Int) | -| patterns.swift:105:24:105:24 | a | (Int) | +| patterns.swift:105:19:105:25 | (...) | Int | +| patterns.swift:105:20:105:24 | let ... | Int | +| patterns.swift:105:24:105:24 | a | Int | | patterns.swift:107:10:107:30 | .myPair(...) | MyEnum | | patterns.swift:107:17:107:30 | (...) | (Int, Int) | | patterns.swift:107:18:107:22 | let ... | Int | @@ -104,9 +104,9 @@ | patterns.swift:110:22:110:22 | a | Int | | patterns.swift:110:25:110:25 | _ | MyEnum | | patterns.swift:114:13:114:28 | .mySingle(...) | MyEnum | -| patterns.swift:114:22:114:28 | (...) | (Int) | -| patterns.swift:114:23:114:27 | let ... | (Int) | -| patterns.swift:114:27:114:27 | x | (Int) | +| patterns.swift:114:22:114:28 | (...) | Int | +| patterns.swift:114:23:114:27 | let ... | Int | +| patterns.swift:114:27:114:27 | x | Int | | patterns.swift:117:13:117:33 | .myPair(...) | MyEnum | | patterns.swift:117:20:117:33 | (...) | (Int, Int) | | patterns.swift:117:21:117:25 | let ... | Int | @@ -115,9 +115,9 @@ | patterns.swift:117:32:117:32 | y | Int | | patterns.swift:125:10:125:11 | .myNone | MyEnum | | patterns.swift:127:10:127:25 | .mySingle(...) | MyEnum | -| patterns.swift:127:19:127:25 | (...) | (Int) | -| patterns.swift:127:20:127:24 | let ... | (Int) | -| patterns.swift:127:24:127:24 | a | (Int) | +| patterns.swift:127:19:127:25 | (...) | Int | +| patterns.swift:127:20:127:24 | let ... | Int | +| patterns.swift:127:24:127:24 | a | Int | | patterns.swift:129:10:129:30 | .myPair(...) | MyEnum | | patterns.swift:129:17:129:30 | (...) | (Int, Int) | | patterns.swift:129:18:129:22 | let ... | Int | @@ -130,9 +130,9 @@ | patterns.swift:132:22:132:22 | a | Int | | patterns.swift:132:25:132:25 | _ | MyEnum | | patterns.swift:136:13:136:28 | .mySingle(...) | MyEnum | -| patterns.swift:136:22:136:28 | (...) | (Int) | -| patterns.swift:136:23:136:27 | let ... | (Int) | -| patterns.swift:136:27:136:27 | x | (Int) | +| patterns.swift:136:22:136:28 | (...) | Int | +| patterns.swift:136:23:136:27 | let ... | Int | +| patterns.swift:136:27:136:27 | x | Int | | patterns.swift:139:13:139:33 | .myPair(...) | MyEnum | | patterns.swift:139:20:139:33 | (...) | (Int, Int) | | patterns.swift:139:21:139:25 | let ... | Int | @@ -143,9 +143,9 @@ | patterns.swift:144:9:144:12 | ... as ... | MyEnum | | patterns.swift:147:10:147:11 | .myNone | MyEnum | | patterns.swift:149:10:149:25 | .mySingle(...) | MyEnum | -| patterns.swift:149:19:149:25 | (...) | (Int) | -| patterns.swift:149:20:149:24 | let ... | (Int) | -| patterns.swift:149:24:149:24 | a | (Int) | +| patterns.swift:149:19:149:25 | (...) | Int | +| patterns.swift:149:20:149:24 | let ... | Int | +| patterns.swift:149:24:149:24 | a | Int | | patterns.swift:151:10:151:30 | .myPair(...) | MyEnum | | patterns.swift:151:17:151:30 | (...) | (Int, Int) | | patterns.swift:151:18:151:22 | let ... | Int | @@ -166,9 +166,9 @@ | patterns.swift:158:22:158:22 | a | Int | | patterns.swift:158:25:158:25 | _ | MyEnum | | patterns.swift:162:13:162:28 | .mySingle(...) | MyEnum | -| patterns.swift:162:22:162:28 | (...) | (Int) | -| patterns.swift:162:23:162:27 | let ... | (Int) | -| patterns.swift:162:27:162:27 | x | (Int) | +| patterns.swift:162:22:162:28 | (...) | Int | +| patterns.swift:162:23:162:27 | let ... | Int | +| patterns.swift:162:27:162:27 | x | Int | | patterns.swift:165:13:165:39 | .myPair(...) | MyEnum | | patterns.swift:165:26:165:39 | (...) | (Int, Int) | | patterns.swift:165:27:165:31 | let ... | Int | diff --git a/swift/ql/test/library-tests/ast/PrintAst.expected b/swift/ql/test/library-tests/ast/PrintAst.expected index cc72595a451..f3f0aa1cfd2 100644 --- a/swift/ql/test/library-tests/ast/PrintAst.expected +++ b/swift/ql/test/library-tests/ast/PrintAst.expected @@ -853,7 +853,7 @@ cfg.swift: # 144| [ConcreteVarDecl] $match # 144| Type = Int # 156| [ConcreteVarDecl] x -# 156| Type = (Int) +# 156| Type = Int # 163| [NamedFunction] testDefer(x:) # 163| InterfaceType = (inout Int) -> () # 163| getParam(0): [ParamDecl] x @@ -6399,7 +6399,7 @@ patterns.swift: # 83| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 83| getSubPattern(): [BindingPattern] let ... # 83| getVariable(0): [ConcreteVarDecl] a -# 83| Type = (Int) +# 83| Type = Int # 84| getBody(): [BraceStmt] { ... } # 84| getElement(0): [CallExpr] call to sink(arg:) # 84| getFunction(): [DeclRefExpr] sink(arg:) @@ -6499,7 +6499,7 @@ patterns.swift: # 105| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 105| getSubPattern(): [BindingPattern] let ... # 105| getVariable(0): [ConcreteVarDecl] a -# 105| Type = (Int) +# 105| Type = Int # 106| getBody(): [BraceStmt] { ... } # 106| getElement(0): [CallExpr] call to sink(arg:) # 106| getFunction(): [DeclRefExpr] sink(arg:) @@ -6601,7 +6601,7 @@ patterns.swift: # 127| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 127| getSubPattern(): [BindingPattern] let ... # 127| getVariable(0): [ConcreteVarDecl] a -# 127| Type = (Int) +# 127| Type = Int # 128| getBody(): [BraceStmt] { ... } # 128| getElement(0): [CallExpr] call to sink(arg:) # 128| getFunction(): [DeclRefExpr] sink(arg:) @@ -6704,7 +6704,7 @@ patterns.swift: # 149| getSubPattern().getFullyUnresolved(): [ParenPattern] (...) # 149| getSubPattern(): [BindingPattern] let ... # 149| getVariable(0): [ConcreteVarDecl] a -# 149| Type = (Int) +# 149| Type = Int # 150| getBody(): [BraceStmt] { ... } # 150| getElement(0): [CallExpr] call to sink(arg:) # 150| getFunction(): [DeclRefExpr] sink(arg:) @@ -6898,25 +6898,25 @@ patterns.swift: # 181| getBody(): [BraceStmt] { ... } # 181| getElement(0): [TupleExpr] (...) # 92| [ConcreteVarDecl] x -# 92| Type = (Int) +# 92| Type = Int # 95| [ConcreteVarDecl] x # 95| Type = Int # 95| [ConcreteVarDecl] y # 95| Type = Int # 114| [ConcreteVarDecl] x -# 114| Type = (Int) +# 114| Type = Int # 117| [ConcreteVarDecl] x # 117| Type = Int # 117| [ConcreteVarDecl] y # 117| Type = Int # 136| [ConcreteVarDecl] x -# 136| Type = (Int) +# 136| Type = Int # 139| [ConcreteVarDecl] x # 139| Type = Int # 139| [ConcreteVarDecl] y # 139| Type = Int # 162| [ConcreteVarDecl] x -# 162| Type = (Int) +# 162| Type = Int # 165| [ConcreteVarDecl] x # 165| Type = Int # 165| [ConcreteVarDecl] y From e135f5ddf61a8a6fe9e239d5e050badc79145ed5 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:39:09 +0200 Subject: [PATCH 339/372] Swift: Update `ObjectLiteralExpr` test The entities now have proper error types instead of missing types. --- .../expr/ObjectLiteralExpr/ObjectLiteralExpr.expected | 6 +++--- .../ObjectLiteralExpr/ObjectLiteralExpr_getType.expected | 3 +++ .../generated/expr/ObjectLiteralExpr/object_literals.swift | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected index d303c7a2f76..46cfc6b8a79 100644 --- a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected +++ b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr.expected @@ -1,3 +1,3 @@ -| object_literals.swift:5:5:5:42 | #fileLiteral(...) | hasType: | no | getKind: | 0 | getNumberOfArguments: | 1 | -| object_literals.swift:6:5:6:61 | #colorLiteral(...) | hasType: | no | getKind: | 2 | getNumberOfArguments: | 4 | -| object_literals.swift:7:5:7:44 | #imageLiteral(...) | hasType: | no | getKind: | 1 | getNumberOfArguments: | 1 | +| object_literals.swift:5:5:5:42 | #fileLiteral(...) | hasType: | yes | getKind: | 0 | getNumberOfArguments: | 1 | +| object_literals.swift:6:5:6:61 | #colorLiteral(...) | hasType: | yes | getKind: | 2 | getNumberOfArguments: | 4 | +| object_literals.swift:7:5:7:44 | #imageLiteral(...) | hasType: | yes | getKind: | 1 | getNumberOfArguments: | 1 | diff --git a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected index e69de29bb2d..49fcd7db593 100644 --- a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected +++ b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/ObjectLiteralExpr_getType.expected @@ -0,0 +1,3 @@ +| object_literals.swift:5:5:5:42 | #fileLiteral(...) | <> | +| object_literals.swift:6:5:6:61 | #colorLiteral(...) | <> | +| object_literals.swift:7:5:7:44 | #imageLiteral(...) | <> | diff --git a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift index cb537323448..5cb9163bfe3 100644 --- a/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift +++ b/swift/ql/test/extractor-tests/generated/expr/ObjectLiteralExpr/object_literals.swift @@ -1,7 +1,7 @@ //codeql-extractor-expected-status: 1 // These require Foundation and UIKit/AppKit to really work -// That is why compilation will fail and the entities will not have a type +// That is why compilation will fail and the entities will have error types _ = #fileLiteral(resourceName: "file.txt") _ = #colorLiteral(red: 255, green: 255, blue: 255, alpha: 50) _ = #imageLiteral(resourceName: "image.gif") From 9a21b0dc5ca6e8c93b382e32b82217d9652c5cb6 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:42:18 +0200 Subject: [PATCH 340/372] Swift: Update `SuccessfullyExtractedLines` for external code being extracted --- .../query-tests/Diagnostics/SuccessfullyExtractedLines.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected b/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected index b5a514b9ffa..3516ff5eb5d 100644 --- a/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected +++ b/swift/ql/test/query-tests/Diagnostics/SuccessfullyExtractedLines.expected @@ -1 +1 @@ -| 4 | +| 287 | From 10d86c9708b0599776d782b6b10209283e642c17 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 17:56:57 +0200 Subject: [PATCH 341/372] Swift: Disable parts of tests that crash with Swift 6.1 --- .../generated/decl/ParamDecl/ParamDecl.expected | 4 ---- ...mDecl_getAttachedPropertyWrapperType.expected | 2 -- ...ramDecl_getPropertyWrapperBackingVar.expected | 2 -- ...cl_getPropertyWrapperLocalWrappedVar.expected | 2 -- ...Decl_getPropertyWrapperProjectionVar.expected | 2 -- ...tPropertyWrapperProjectionVarBinding.expected | 2 -- .../generated/decl/ParamDecl/param_decls.swift | 4 ++-- .../AppliedPropertyWrapperExpr.expected | 3 --- .../AppliedPropertyWrapperExpr_getType.expected | 3 --- .../applied_property_wrapper.swift | 16 +++++++++++----- 10 files changed, 13 insertions(+), 27 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected index a83bdc80b26..ffb1fa02072 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl.expected @@ -57,7 +57,3 @@ | param_decls.swift:41:10:41:26 | projectedValue | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Bool | getNumberOfAccessors: | 0 | getName: | projectedValue | getType: | Bool | hasAttachedPropertyWrapperType: | no | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | no | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | no | | param_decls.swift:48:18:48:22 | p1 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p1 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | yes | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | | param_decls.swift:49:26:49:30 | p2 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p2 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | yes | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | -| param_decls.swift:50:31:50:31 | value | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Bool | getNumberOfAccessors: | 0 | getName: | value | getType: | Bool | hasAttachedPropertyWrapperType: | no | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | no | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | no | -| param_decls.swift:50:31:50:35 | p3 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p3 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | yes | hasPropertyWrapperProjectionVar: | yes | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | -| param_decls.swift:51:38:51:38 | value | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Bool | getNumberOfAccessors: | 0 | getName: | value | getType: | Bool | hasAttachedPropertyWrapperType: | no | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | no | hasPropertyWrapperProjectionVarBinding: | no | hasPropertyWrapperProjectionVar: | no | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | no | -| param_decls.swift:51:38:51:42 | p4 | getModule: | file://:0:0:0:0 | param_decls | getNumberOfMembers: | 0 | getInterfaceType: | Int | getNumberOfAccessors: | 0 | getName: | p4 | getType: | Int | hasAttachedPropertyWrapperType: | yes | hasParentPattern: | no | hasParentInitializer: | no | hasPropertyWrapperBackingVarBinding: | no | hasPropertyWrapperBackingVar: | yes | hasPropertyWrapperProjectionVarBinding: | yes | hasPropertyWrapperProjectionVar: | yes | isInout: | no | hasPropertyWrapperLocalWrappedVarBinding: | no | hasPropertyWrapperLocalWrappedVar: | yes | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected index 0e5bd101964..b8a99db3f8f 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getAttachedPropertyWrapperType.expected @@ -1,4 +1,2 @@ | param_decls.swift:48:18:48:22 | p1 | Wrapper | | param_decls.swift:49:26:49:30 | p2 | WrapperWithInit | -| param_decls.swift:50:31:50:35 | p3 | WrapperWithProjected | -| param_decls.swift:51:38:51:42 | p4 | WrapperWithProjectedAndInit | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected index 6595e3ae3ba..5a58e14fe48 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperBackingVar.expected @@ -1,4 +1,2 @@ | param_decls.swift:48:18:48:22 | p1 | param_decls.swift:48:18:48:18 | _p1 | | param_decls.swift:49:26:49:30 | p2 | param_decls.swift:49:26:49:26 | _p2 | -| param_decls.swift:50:31:50:35 | p3 | file://:0:0:0:0 | _p3 | -| param_decls.swift:51:38:51:42 | p4 | file://:0:0:0:0 | _p4 | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected index b58494d1f8d..e1b555437d3 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperLocalWrappedVar.expected @@ -1,4 +1,2 @@ | param_decls.swift:48:18:48:22 | p1 | param_decls.swift:48:18:48:18 | p1 | | param_decls.swift:49:26:49:30 | p2 | param_decls.swift:49:26:49:26 | p2 | -| param_decls.swift:50:31:50:35 | p3 | param_decls.swift:50:31:50:31 | p3 | -| param_decls.swift:51:38:51:42 | p4 | param_decls.swift:51:38:51:38 | p4 | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected index 99679a1c64b..e69de29bb2d 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVar.expected @@ -1,2 +0,0 @@ -| param_decls.swift:50:31:50:35 | p3 | param_decls.swift:50:31:50:31 | $p3 | -| param_decls.swift:51:38:51:42 | p4 | param_decls.swift:51:38:51:38 | $p4 | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected index 0ebae7b813a..e69de29bb2d 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/ParamDecl_getPropertyWrapperProjectionVarBinding.expected @@ -1,2 +0,0 @@ -| param_decls.swift:50:31:50:35 | p3 | file://:0:0:0:0 | var ... = ... | -| param_decls.swift:51:38:51:42 | p4 | file://:0:0:0:0 | var ... = ... | diff --git a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift index aa001dfeca7..42d2b4980fa 100644 --- a/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift +++ b/swift/ql/test/extractor-tests/generated/decl/ParamDecl/param_decls.swift @@ -47,6 +47,6 @@ func closures() { func f2( @Wrapper p1: Int, @WrapperWithInit p2: Int, - @WrapperWithProjected p3: Int, - @WrapperWithProjectedAndInit p4: Int + // @WrapperWithProjected p3: Int, // Disabled causes crashes with Swift 6.1 + // @WrapperWithProjectedAndInit p4: Int // Disabled causes crashes with Swift 6.1 ) {} diff --git a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected index d8f0d8f98c3..e69de29bb2d 100644 --- a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected +++ b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr.expected @@ -1,3 +0,0 @@ -| applied_property_wrapper.swift:14:8:14:8 | AppliedPropertyWrapperExpr | hasType: | yes | getKind: | 1 | getValue: | applied_property_wrapper.swift:14:8:14:8 | 42 | getParam: | applied_property_wrapper.swift:12:19:12:22 | x | -| applied_property_wrapper.swift:15:9:15:9 | AppliedPropertyWrapperExpr | hasType: | yes | getKind: | 2 | getValue: | applied_property_wrapper.swift:15:9:15:9 | true | getParam: | applied_property_wrapper.swift:12:19:12:22 | x | -| file://:0:0:0:0 | AppliedPropertyWrapperExpr | hasType: | yes | getKind: | 1 | getValue: | file://:0:0:0:0 | y | getParam: | applied_property_wrapper.swift:17:26:17:29 | y | diff --git a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected index 9ccffc69505..e69de29bb2d 100644 --- a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected +++ b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/AppliedPropertyWrapperExpr_getType.expected @@ -1,3 +0,0 @@ -| applied_property_wrapper.swift:14:8:14:8 | AppliedPropertyWrapperExpr | Wrapper | -| applied_property_wrapper.swift:15:9:15:9 | AppliedPropertyWrapperExpr | Wrapper | -| file://:0:0:0:0 | AppliedPropertyWrapperExpr | Wrapper | diff --git a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift index 4fe83a65c5b..a90ac69e1d4 100644 --- a/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift +++ b/swift/ql/test/extractor-tests/generated/expr/AppliedPropertyWrapperExpr/applied_property_wrapper.swift @@ -9,11 +9,17 @@ init(projectedValue: Bool) {} } -func foo(@Wrapper x: Int) {} +func foo( + // @Wrapper x: Int // Disabled causes crashes with Swift 6.1 +) {} -foo(x: 42) -foo($x: true) +// foo(x: 42) +// foo($x: true) -let closure = {(@Wrapper y: Int) in return } +let closure = { + ( + // @Wrapper y: Int // Disabled causes crashes with Swift 6.1 + ) in return + } -closure(41) +// closure(41) From 59faf9fbdf66e2256a1f92abf5e641e671d6f4af Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 22 Apr 2025 18:07:02 +0200 Subject: [PATCH 342/372] Swift: Update `errors` test The representation of the errors seems to have changed somewhat in Swift 6.1. --- .../extractor-tests/errors/CONSISTENCY/CfgConsistency.expected | 2 -- swift/ql/test/extractor-tests/errors/Errors.expected | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected b/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected index 770537cf684..16bf95f6bb9 100644 --- a/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected +++ b/swift/ql/test/extractor-tests/errors/CONSISTENCY/CfgConsistency.expected @@ -1,5 +1,3 @@ deadEnd -| file://:0:0:0:0 | ... = ... | -| file://:0:0:0:0 | ... = ... | | unspecified.swift:12:20:12:21 | (...) | | unspecified.swift:25:9:28:9 | switch ErrorExpr { ... } | diff --git a/swift/ql/test/extractor-tests/errors/Errors.expected b/swift/ql/test/extractor-tests/errors/Errors.expected index 4ecfbef31da..50ab8ec658b 100644 --- a/swift/ql/test/extractor-tests/errors/Errors.expected +++ b/swift/ql/test/extractor-tests/errors/Errors.expected @@ -1,4 +1,5 @@ -| file://:0:0:0:0 | ... .combine(_:) | UnresolvedDotExpr | +| file://:0:0:0:0 | <> | ErrorType | +| file://:0:0:0:0 | <> | ErrorType | | file://:0:0:0:0 | <> | ErrorType | | overloaded.swift:6:5:6:5 | OverloadedDeclRefExpr | OverloadedDeclRefExpr | | unresolved.swift:5:1:5:14 | UnresolvedSpecializeExpr | UnresolvedSpecializeExpr | From a74b38c0ec82cbc2627d792fcc032b4bbd0e955d Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 09:48:00 +0200 Subject: [PATCH 343/372] Swift: Replace deprecated `@_moveOnly` in test by `~Copyable` --- .../extractor-tests/generated/stmt/DiscardStmt/test.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift b/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift index 517cacc442e..c4602ebb724 100644 --- a/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift +++ b/swift/ql/test/extractor-tests/generated/stmt/DiscardStmt/test.swift @@ -1,5 +1,5 @@ -@_moveOnly -struct S { + +struct S : ~Copyable { __consuming func f() { discard self } From eea963e3f4fa3a3df04384a3ff3b83b39a77f29d Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 10:01:22 +0200 Subject: [PATCH 344/372] Swift: Add upgrade and downgrade scripts --- .../macro_role_conformances.ql | 21 + .../old.dbscheme | 2810 ++++++++++++++++ .../swift.dbscheme | 2815 +++++++++++++++++ .../upgrade.properties | 3 + .../old.dbscheme | 2815 +++++++++++++++++ .../swift.dbscheme | 2810 ++++++++++++++++ .../upgrade.properties | 2 + 7 files changed, 11276 insertions(+) create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme create mode 100644 swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties create mode 100644 swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme create mode 100644 swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme create mode 100644 swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql new file mode 100644 index 00000000000..898847141ab --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/macro_role_conformances.ql @@ -0,0 +1,21 @@ +class MacroRole extends @macro_role { + string toString() { none() } +} + +class ExprOrNone extends @expr_or_none { + string toString() { none() } +} + +class TypeExpr extends @type_expr { + string toString() { none() } +} + +class UnspecifiedElement extends @unspecified_element { + string toString() { none() } +} + +from MacroRole role, int index, ExprOrNone conformance +where + macro_role_conformances(role, index, conformance) and + (conformance instanceof TypeExpr or conformance instanceof UnspecifiedElement) +select role, index, conformance diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme new file mode 100644 index 00000000000..4dd3d5ca8a8 --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/old.dbscheme @@ -0,0 +1,2810 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme new file mode 100644 index 00000000000..be2357fd002 --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/swift.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties new file mode 100644 index 00000000000..823e68c73a1 --- /dev/null +++ b/swift/downgrades/4dd3d5ca8a89952485b3e3b2141b6bb8c22cf945/upgrade.properties @@ -0,0 +1,3 @@ +description: Upgrade to Swift 6.1 +compatibility: partial +macro_role_conformances.rel: run macro_role_conformances.qlo diff --git a/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme new file mode 100644 index 00000000000..be2357fd002 --- /dev/null +++ b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/old.dbscheme @@ -0,0 +1,2815 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @type_expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_expr_or_none = + @type_expr +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme new file mode 100644 index 00000000000..4dd3d5ca8a8 --- /dev/null +++ b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/swift.dbscheme @@ -0,0 +1,2810 @@ +// generated by codegen/codegen.py, do not edit + +// from prefix.dbscheme +/** + * The source location of the snapshot. + */ +sourceLocationPrefix( + string prefix: string ref +); + + +// from schema.py + +@element = + @file +| @generic_context +| @locatable +| @location +| @type +; + +#keyset[id] +element_is_unknown( + int id: @element ref +); + +@file = + @db_file +; + +#keyset[id] +files( + int id: @file ref, + string name: string ref +); + +#keyset[id] +file_is_successfully_extracted( + int id: @file ref +); + +@locatable = + @argument +| @ast_node +| @comment +| @diagnostics +| @error_element +; + +#keyset[id] +locatable_locations( + int id: @locatable ref, + int location: @location_or_none ref +); + +@location = + @db_location +; + +#keyset[id] +locations( + int id: @location ref, + int file: @file_or_none ref, + int start_line: int ref, + int start_column: int ref, + int end_line: int ref, + int end_column: int ref +); + +@ast_node = + @availability_info +| @availability_spec +| @callable +| @case_label_item +| @condition_element +| @decl +| @expr +| @key_path_component +| @macro_role +| @pattern +| @stmt +| @stmt_condition +| @type_repr +; + +comments( + unique int id: @comment, + string text: string ref +); + +db_files( + unique int id: @db_file +); + +db_locations( + unique int id: @db_location +); + +diagnostics( + unique int id: @diagnostics, + string text: string ref, + int kind: int ref +); + +@error_element = + @error_expr +| @error_type +| @overloaded_decl_ref_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_chain_result_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @unresolved_type +| @unresolved_type_conversion_expr +| @unspecified_element +; + +availability_infos( + unique int id: @availability_info +); + +#keyset[id] +availability_info_is_unavailable( + int id: @availability_info ref +); + +#keyset[id, index] +availability_info_specs( + int id: @availability_info ref, + int index: int ref, + int spec: @availability_spec_or_none ref +); + +@availability_spec = + @other_availability_spec +| @platform_version_availability_spec +; + +@callable = + @closure_expr +| @function +; + +#keyset[id] +callable_names( + int id: @callable ref, + string name: string ref +); + +#keyset[id] +callable_self_params( + int id: @callable ref, + int self_param: @param_decl_or_none ref +); + +#keyset[id, index] +callable_params( + int id: @callable ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +#keyset[id] +callable_bodies( + int id: @callable ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +callable_captures( + int id: @callable ref, + int index: int ref, + int capture: @captured_decl_or_none ref +); + +key_path_components( + unique int id: @key_path_component, + int kind: int ref, + int component_type: @type_or_none ref +); + +#keyset[id, index] +key_path_component_subscript_arguments( + int id: @key_path_component ref, + int index: int ref, + int subscript_argument: @argument_or_none ref +); + +#keyset[id] +key_path_component_tuple_indices( + int id: @key_path_component ref, + int tuple_index: int ref +); + +#keyset[id] +key_path_component_decl_refs( + int id: @key_path_component ref, + int decl_ref: @value_decl_or_none ref +); + +macro_roles( + unique int id: @macro_role, + int kind: int ref, + int macro_syntax: int ref +); + +#keyset[id, index] +macro_role_conformances( + int id: @macro_role ref, + int index: int ref, + int conformance: @expr_or_none ref +); + +#keyset[id, index] +macro_role_names( + int id: @macro_role ref, + int index: int ref, + string name: string ref +); + +unspecified_elements( + unique int id: @unspecified_element, + string property: string ref, + string error: string ref +); + +#keyset[id] +unspecified_element_parents( + int id: @unspecified_element ref, + int parent: @element ref +); + +#keyset[id] +unspecified_element_indices( + int id: @unspecified_element ref, + int index: int ref +); + +#keyset[id, index] +unspecified_element_children( + int id: @unspecified_element ref, + int index: int ref, + int child: @ast_node_or_none ref +); + +other_availability_specs( + unique int id: @other_availability_spec +); + +platform_version_availability_specs( + unique int id: @platform_version_availability_spec, + string platform: string ref, + string version: string ref +); + +@decl = + @captured_decl +| @enum_case_decl +| @extension_decl +| @if_config_decl +| @import_decl +| @missing_member_decl +| @operator_decl +| @pattern_binding_decl +| @pound_diagnostic_decl +| @precedence_group_decl +| @top_level_code_decl +| @value_decl +; + +#keyset[id] +decls( //dir=decl + int id: @decl ref, + int module: @module_decl_or_none ref +); + +#keyset[id, index] +decl_members( //dir=decl + int id: @decl ref, + int index: int ref, + int member: @decl_or_none ref +); + +@generic_context = + @extension_decl +| @function +| @generic_type_decl +| @macro_decl +| @subscript_decl +; + +#keyset[id, index] +generic_context_generic_type_params( //dir=decl + int id: @generic_context ref, + int index: int ref, + int generic_type_param: @generic_type_param_decl_or_none ref +); + +captured_decls( //dir=decl + unique int id: @captured_decl, + int decl: @value_decl_or_none ref +); + +#keyset[id] +captured_decl_is_direct( //dir=decl + int id: @captured_decl ref +); + +#keyset[id] +captured_decl_is_escaping( //dir=decl + int id: @captured_decl ref +); + +enum_case_decls( //dir=decl + unique int id: @enum_case_decl +); + +#keyset[id, index] +enum_case_decl_elements( //dir=decl + int id: @enum_case_decl ref, + int index: int ref, + int element: @enum_element_decl_or_none ref +); + +extension_decls( //dir=decl + unique int id: @extension_decl, + int extended_type_decl: @nominal_type_decl_or_none ref +); + +#keyset[id, index] +extension_decl_protocols( //dir=decl + int id: @extension_decl ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +if_config_decls( //dir=decl + unique int id: @if_config_decl +); + +#keyset[id, index] +if_config_decl_active_elements( //dir=decl + int id: @if_config_decl ref, + int index: int ref, + int active_element: @ast_node_or_none ref +); + +import_decls( //dir=decl + unique int id: @import_decl +); + +#keyset[id] +import_decl_is_exported( //dir=decl + int id: @import_decl ref +); + +#keyset[id] +import_decl_imported_modules( //dir=decl + int id: @import_decl ref, + int imported_module: @module_decl_or_none ref +); + +#keyset[id, index] +import_decl_declarations( //dir=decl + int id: @import_decl ref, + int index: int ref, + int declaration: @value_decl_or_none ref +); + +missing_member_decls( //dir=decl + unique int id: @missing_member_decl, + string name: string ref +); + +@operator_decl = + @infix_operator_decl +| @postfix_operator_decl +| @prefix_operator_decl +; + +#keyset[id] +operator_decls( //dir=decl + int id: @operator_decl ref, + string name: string ref +); + +pattern_binding_decls( //dir=decl + unique int id: @pattern_binding_decl +); + +#keyset[id, index] +pattern_binding_decl_inits( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int init: @expr_or_none ref +); + +#keyset[id, index] +pattern_binding_decl_patterns( //dir=decl + int id: @pattern_binding_decl ref, + int index: int ref, + int pattern: @pattern_or_none ref +); + +pound_diagnostic_decls( //dir=decl + unique int id: @pound_diagnostic_decl, + int kind: int ref, + int message: @string_literal_expr_or_none ref +); + +precedence_group_decls( //dir=decl + unique int id: @precedence_group_decl +); + +top_level_code_decls( //dir=decl + unique int id: @top_level_code_decl, + int body: @brace_stmt_or_none ref +); + +@value_decl = + @abstract_storage_decl +| @enum_element_decl +| @function +| @macro_decl +| @type_decl +; + +#keyset[id] +value_decls( //dir=decl + int id: @value_decl ref, + int interface_type: @type_or_none ref +); + +@abstract_storage_decl = + @subscript_decl +| @var_decl +; + +#keyset[id, index] +abstract_storage_decl_accessors( //dir=decl + int id: @abstract_storage_decl ref, + int index: int ref, + int accessor: @accessor_or_none ref +); + +enum_element_decls( //dir=decl + unique int id: @enum_element_decl, + string name: string ref +); + +#keyset[id, index] +enum_element_decl_params( //dir=decl + int id: @enum_element_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@function = + @accessor_or_named_function +| @deinitializer +| @initializer +; + +infix_operator_decls( //dir=decl + unique int id: @infix_operator_decl +); + +#keyset[id] +infix_operator_decl_precedence_groups( //dir=decl + int id: @infix_operator_decl ref, + int precedence_group: @precedence_group_decl_or_none ref +); + +macro_decls( //dir=decl + unique int id: @macro_decl, + string name: string ref +); + +#keyset[id, index] +macro_decl_parameters( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int parameter: @param_decl_or_none ref +); + +#keyset[id, index] +macro_decl_roles( //dir=decl + int id: @macro_decl ref, + int index: int ref, + int role: @macro_role_or_none ref +); + +postfix_operator_decls( //dir=decl + unique int id: @postfix_operator_decl +); + +prefix_operator_decls( //dir=decl + unique int id: @prefix_operator_decl +); + +@type_decl = + @abstract_type_param_decl +| @generic_type_decl +| @module_decl +; + +#keyset[id] +type_decls( //dir=decl + int id: @type_decl ref, + string name: string ref +); + +#keyset[id, index] +type_decl_inherited_types( //dir=decl + int id: @type_decl ref, + int index: int ref, + int inherited_type: @type_or_none ref +); + +@abstract_type_param_decl = + @associated_type_decl +| @generic_type_param_decl +; + +@accessor_or_named_function = + @accessor +| @named_function +; + +deinitializers( //dir=decl + unique int id: @deinitializer +); + +@generic_type_decl = + @nominal_type_decl +| @opaque_type_decl +| @type_alias_decl +; + +initializers( //dir=decl + unique int id: @initializer +); + +module_decls( //dir=decl + unique int id: @module_decl +); + +#keyset[id] +module_decl_is_builtin_module( //dir=decl + int id: @module_decl ref +); + +#keyset[id] +module_decl_is_system_module( //dir=decl + int id: @module_decl ref +); + +module_decl_imported_modules( //dir=decl + int id: @module_decl ref, + int imported_module: @module_decl_or_none ref +); + +module_decl_exported_modules( //dir=decl + int id: @module_decl ref, + int exported_module: @module_decl_or_none ref +); + +subscript_decls( //dir=decl + unique int id: @subscript_decl, + int element_type: @type_or_none ref +); + +#keyset[id, index] +subscript_decl_params( //dir=decl + int id: @subscript_decl ref, + int index: int ref, + int param: @param_decl_or_none ref +); + +@var_decl = + @concrete_var_decl +| @param_decl +; + +#keyset[id] +var_decls( //dir=decl + int id: @var_decl ref, + string name: string ref, + int type_: @type_or_none ref +); + +#keyset[id] +var_decl_attached_property_wrapper_types( //dir=decl + int id: @var_decl ref, + int attached_property_wrapper_type: @type_or_none ref +); + +#keyset[id] +var_decl_parent_patterns( //dir=decl + int id: @var_decl ref, + int parent_pattern: @pattern_or_none ref +); + +#keyset[id] +var_decl_parent_initializers( //dir=decl + int id: @var_decl ref, + int parent_initializer: @expr_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_backing_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_backing_var: @var_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_var_bindings( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +var_decl_property_wrapper_projection_vars( //dir=decl + int id: @var_decl ref, + int property_wrapper_projection_var: @var_decl_or_none ref +); + +accessors( //dir=decl + unique int id: @accessor +); + +#keyset[id] +accessor_is_getter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_setter( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_will_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_did_set( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_read( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_modify( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_address( //dir=decl + int id: @accessor ref +); + +#keyset[id] +accessor_is_unsafe_mutable_address( //dir=decl + int id: @accessor ref +); + +associated_type_decls( //dir=decl + unique int id: @associated_type_decl +); + +concrete_var_decls( //dir=decl + unique int id: @concrete_var_decl, + int introducer_int: int ref +); + +generic_type_param_decls( //dir=decl + unique int id: @generic_type_param_decl +); + +named_functions( //dir=decl + unique int id: @named_function +); + +@nominal_type_decl = + @class_decl +| @enum_decl +| @protocol_decl +| @struct_decl +; + +#keyset[id] +nominal_type_decls( //dir=decl + int id: @nominal_type_decl ref, + int type_: @type_or_none ref +); + +opaque_type_decls( //dir=decl + unique int id: @opaque_type_decl, + int naming_declaration: @value_decl_or_none ref +); + +#keyset[id, index] +opaque_type_decl_opaque_generic_params( //dir=decl + int id: @opaque_type_decl ref, + int index: int ref, + int opaque_generic_param: @generic_type_param_type_or_none ref +); + +param_decls( //dir=decl + unique int id: @param_decl +); + +#keyset[id] +param_decl_is_inout( //dir=decl + int id: @param_decl ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_var_bindings( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var_binding: @pattern_binding_decl_or_none ref +); + +#keyset[id] +param_decl_property_wrapper_local_wrapped_vars( //dir=decl + int id: @param_decl ref, + int property_wrapper_local_wrapped_var: @var_decl_or_none ref +); + +type_alias_decls( //dir=decl + unique int id: @type_alias_decl, + int aliased_type: @type_or_none ref +); + +class_decls( //dir=decl + unique int id: @class_decl +); + +enum_decls( //dir=decl + unique int id: @enum_decl +); + +protocol_decls( //dir=decl + unique int id: @protocol_decl +); + +struct_decls( //dir=decl + unique int id: @struct_decl +); + +arguments( //dir=expr + unique int id: @argument, + string label: string ref, + int expr: @expr_or_none ref +); + +@expr = + @any_try_expr +| @applied_property_wrapper_expr +| @apply_expr +| @assign_expr +| @bind_optional_expr +| @capture_list_expr +| @closure_expr +| @collection_expr +| @consume_expr +| @copy_expr +| @current_context_isolation_expr +| @decl_ref_expr +| @default_argument_expr +| @discard_assignment_expr +| @dot_syntax_base_ignored_expr +| @dynamic_type_expr +| @enum_is_case_expr +| @error_expr +| @explicit_cast_expr +| @extract_function_isolation_expr +| @force_value_expr +| @identity_expr +| @if_expr +| @implicit_conversion_expr +| @in_out_expr +| @key_path_application_expr +| @key_path_dot_expr +| @key_path_expr +| @lazy_initialization_expr +| @literal_expr +| @lookup_expr +| @make_temporarily_escapable_expr +| @materialize_pack_expr +| @obj_c_selector_expr +| @one_way_expr +| @opaque_value_expr +| @open_existential_expr +| @optional_evaluation_expr +| @other_initializer_ref_expr +| @overloaded_decl_ref_expr +| @pack_element_expr +| @pack_expansion_expr +| @property_wrapper_value_placeholder_expr +| @rebind_self_in_initializer_expr +| @sequence_expr +| @single_value_stmt_expr +| @super_ref_expr +| @tap_expr +| @tuple_element_expr +| @tuple_expr +| @type_expr +| @unresolved_decl_ref_expr +| @unresolved_dot_expr +| @unresolved_member_expr +| @unresolved_pattern_expr +| @unresolved_specialize_expr +| @vararg_expansion_expr +; + +#keyset[id] +expr_types( //dir=expr + int id: @expr ref, + int type_: @type_or_none ref +); + +@any_try_expr = + @force_try_expr +| @optional_try_expr +| @try_expr +; + +#keyset[id] +any_try_exprs( //dir=expr + int id: @any_try_expr ref, + int sub_expr: @expr_or_none ref +); + +applied_property_wrapper_exprs( //dir=expr + unique int id: @applied_property_wrapper_expr, + int kind: int ref, + int value: @expr_or_none ref, + int param: @param_decl_or_none ref +); + +@apply_expr = + @binary_expr +| @call_expr +| @postfix_unary_expr +| @prefix_unary_expr +| @self_apply_expr +; + +#keyset[id] +apply_exprs( //dir=expr + int id: @apply_expr ref, + int function: @expr_or_none ref +); + +#keyset[id, index] +apply_expr_arguments( //dir=expr + int id: @apply_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +assign_exprs( //dir=expr + unique int id: @assign_expr, + int dest: @expr_or_none ref, + int source: @expr_or_none ref +); + +bind_optional_exprs( //dir=expr + unique int id: @bind_optional_expr, + int sub_expr: @expr_or_none ref +); + +capture_list_exprs( //dir=expr + unique int id: @capture_list_expr, + int closure_body: @closure_expr_or_none ref +); + +#keyset[id, index] +capture_list_expr_binding_decls( //dir=expr + int id: @capture_list_expr ref, + int index: int ref, + int binding_decl: @pattern_binding_decl_or_none ref +); + +@closure_expr = + @auto_closure_expr +| @explicit_closure_expr +; + +@collection_expr = + @array_expr +| @dictionary_expr +; + +consume_exprs( //dir=expr + unique int id: @consume_expr, + int sub_expr: @expr_or_none ref +); + +copy_exprs( //dir=expr + unique int id: @copy_expr, + int sub_expr: @expr_or_none ref +); + +current_context_isolation_exprs( //dir=expr + unique int id: @current_context_isolation_expr, + int actor: @expr_or_none ref +); + +decl_ref_exprs( //dir=expr + unique int id: @decl_ref_expr, + int decl: @decl_or_none ref +); + +#keyset[id, index] +decl_ref_expr_replacement_types( //dir=expr + int id: @decl_ref_expr ref, + int index: int ref, + int replacement_type: @type_or_none ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_ordinary_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +#keyset[id] +decl_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @decl_ref_expr ref +); + +default_argument_exprs( //dir=expr + unique int id: @default_argument_expr, + int param_decl: @param_decl_or_none ref, + int param_index: int ref +); + +#keyset[id] +default_argument_expr_caller_side_defaults( //dir=expr + int id: @default_argument_expr ref, + int caller_side_default: @expr_or_none ref +); + +discard_assignment_exprs( //dir=expr + unique int id: @discard_assignment_expr +); + +dot_syntax_base_ignored_exprs( //dir=expr + unique int id: @dot_syntax_base_ignored_expr, + int qualifier: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +dynamic_type_exprs( //dir=expr + unique int id: @dynamic_type_expr, + int base: @expr_or_none ref +); + +enum_is_case_exprs( //dir=expr + unique int id: @enum_is_case_expr, + int sub_expr: @expr_or_none ref, + int element: @enum_element_decl_or_none ref +); + +error_exprs( //dir=expr + unique int id: @error_expr +); + +@explicit_cast_expr = + @checked_cast_expr +| @coerce_expr +; + +#keyset[id] +explicit_cast_exprs( //dir=expr + int id: @explicit_cast_expr ref, + int sub_expr: @expr_or_none ref +); + +extract_function_isolation_exprs( //dir=expr + unique int id: @extract_function_isolation_expr, + int function_expr: @expr_or_none ref +); + +force_value_exprs( //dir=expr + unique int id: @force_value_expr, + int sub_expr: @expr_or_none ref +); + +@identity_expr = + @await_expr +| @borrow_expr +| @dot_self_expr +| @paren_expr +| @unresolved_member_chain_result_expr +; + +#keyset[id] +identity_exprs( //dir=expr + int id: @identity_expr ref, + int sub_expr: @expr_or_none ref +); + +if_exprs( //dir=expr + unique int id: @if_expr, + int condition: @expr_or_none ref, + int then_expr: @expr_or_none ref, + int else_expr: @expr_or_none ref +); + +@implicit_conversion_expr = + @abi_safe_conversion_expr +| @actor_isolation_erasure_expr +| @any_hashable_erasure_expr +| @archetype_to_super_expr +| @array_to_pointer_expr +| @bridge_from_obj_c_expr +| @bridge_to_obj_c_expr +| @class_metatype_to_object_expr +| @collection_upcast_conversion_expr +| @conditional_bridge_from_obj_c_expr +| @covariant_function_conversion_expr +| @covariant_return_conversion_expr +| @derived_to_base_expr +| @destructure_tuple_expr +| @differentiable_function_expr +| @differentiable_function_extract_original_expr +| @erasure_expr +| @existential_metatype_to_object_expr +| @foreign_object_conversion_expr +| @function_conversion_expr +| @in_out_to_pointer_expr +| @inject_into_optional_expr +| @linear_function_expr +| @linear_function_extract_original_expr +| @linear_to_differentiable_function_expr +| @load_expr +| @metatype_conversion_expr +| @pointer_to_pointer_expr +| @protocol_metatype_to_object_expr +| @string_to_pointer_expr +| @underlying_to_opaque_expr +| @unevaluated_instance_expr +| @unreachable_expr +| @unresolved_type_conversion_expr +; + +#keyset[id] +implicit_conversion_exprs( //dir=expr + int id: @implicit_conversion_expr ref, + int sub_expr: @expr_or_none ref +); + +in_out_exprs( //dir=expr + unique int id: @in_out_expr, + int sub_expr: @expr_or_none ref +); + +key_path_application_exprs( //dir=expr + unique int id: @key_path_application_expr, + int base: @expr_or_none ref, + int key_path: @expr_or_none ref +); + +key_path_dot_exprs( //dir=expr + unique int id: @key_path_dot_expr +); + +key_path_exprs( //dir=expr + unique int id: @key_path_expr +); + +#keyset[id] +key_path_expr_roots( //dir=expr + int id: @key_path_expr ref, + int root: @type_repr_or_none ref +); + +#keyset[id, index] +key_path_expr_components( //dir=expr + int id: @key_path_expr ref, + int index: int ref, + int component: @key_path_component_or_none ref +); + +lazy_initialization_exprs( //dir=expr + unique int id: @lazy_initialization_expr, + int sub_expr: @expr_or_none ref +); + +@literal_expr = + @builtin_literal_expr +| @interpolated_string_literal_expr +| @nil_literal_expr +| @object_literal_expr +| @regex_literal_expr +; + +@lookup_expr = + @dynamic_lookup_expr +| @member_ref_expr +| @subscript_expr +; + +#keyset[id] +lookup_exprs( //dir=expr + int id: @lookup_expr ref, + int base: @expr_or_none ref +); + +#keyset[id] +lookup_expr_members( //dir=expr + int id: @lookup_expr ref, + int member: @decl_or_none ref +); + +make_temporarily_escapable_exprs( //dir=expr + unique int id: @make_temporarily_escapable_expr, + int escaping_closure: @opaque_value_expr_or_none ref, + int nonescaping_closure: @expr_or_none ref, + int sub_expr: @expr_or_none ref +); + +materialize_pack_exprs( //dir=expr + unique int id: @materialize_pack_expr, + int sub_expr: @expr_or_none ref +); + +obj_c_selector_exprs( //dir=expr + unique int id: @obj_c_selector_expr, + int sub_expr: @expr_or_none ref, + int method: @function_or_none ref +); + +one_way_exprs( //dir=expr + unique int id: @one_way_expr, + int sub_expr: @expr_or_none ref +); + +opaque_value_exprs( //dir=expr + unique int id: @opaque_value_expr +); + +open_existential_exprs( //dir=expr + unique int id: @open_existential_expr, + int sub_expr: @expr_or_none ref, + int existential: @expr_or_none ref, + int opaque_expr: @opaque_value_expr_or_none ref +); + +optional_evaluation_exprs( //dir=expr + unique int id: @optional_evaluation_expr, + int sub_expr: @expr_or_none ref +); + +other_initializer_ref_exprs( //dir=expr + unique int id: @other_initializer_ref_expr, + int initializer: @initializer_or_none ref +); + +overloaded_decl_ref_exprs( //dir=expr + unique int id: @overloaded_decl_ref_expr +); + +#keyset[id, index] +overloaded_decl_ref_expr_possible_declarations( //dir=expr + int id: @overloaded_decl_ref_expr ref, + int index: int ref, + int possible_declaration: @value_decl_or_none ref +); + +pack_element_exprs( //dir=expr + unique int id: @pack_element_expr, + int sub_expr: @expr_or_none ref +); + +pack_expansion_exprs( //dir=expr + unique int id: @pack_expansion_expr, + int pattern_expr: @expr_or_none ref +); + +property_wrapper_value_placeholder_exprs( //dir=expr + unique int id: @property_wrapper_value_placeholder_expr, + int placeholder: @opaque_value_expr_or_none ref +); + +#keyset[id] +property_wrapper_value_placeholder_expr_wrapped_values( //dir=expr + int id: @property_wrapper_value_placeholder_expr ref, + int wrapped_value: @expr_or_none ref +); + +rebind_self_in_initializer_exprs( //dir=expr + unique int id: @rebind_self_in_initializer_expr, + int sub_expr: @expr_or_none ref, + int self: @var_decl_or_none ref +); + +sequence_exprs( //dir=expr + unique int id: @sequence_expr +); + +#keyset[id, index] +sequence_expr_elements( //dir=expr + int id: @sequence_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +single_value_stmt_exprs( //dir=expr + unique int id: @single_value_stmt_expr, + int stmt: @stmt_or_none ref +); + +super_ref_exprs( //dir=expr + unique int id: @super_ref_expr, + int self: @var_decl_or_none ref +); + +tap_exprs( //dir=expr + unique int id: @tap_expr, + int body: @brace_stmt_or_none ref, + int var: @var_decl_or_none ref +); + +#keyset[id] +tap_expr_sub_exprs( //dir=expr + int id: @tap_expr ref, + int sub_expr: @expr_or_none ref +); + +tuple_element_exprs( //dir=expr + unique int id: @tuple_element_expr, + int sub_expr: @expr_or_none ref, + int index: int ref +); + +tuple_exprs( //dir=expr + unique int id: @tuple_expr +); + +#keyset[id, index] +tuple_expr_elements( //dir=expr + int id: @tuple_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +type_exprs( //dir=expr + unique int id: @type_expr +); + +#keyset[id] +type_expr_type_reprs( //dir=expr + int id: @type_expr ref, + int type_repr: @type_repr_or_none ref +); + +unresolved_decl_ref_exprs( //dir=expr + unique int id: @unresolved_decl_ref_expr +); + +#keyset[id] +unresolved_decl_ref_expr_names( //dir=expr + int id: @unresolved_decl_ref_expr ref, + string name: string ref +); + +unresolved_dot_exprs( //dir=expr + unique int id: @unresolved_dot_expr, + int base: @expr_or_none ref, + string name: string ref +); + +unresolved_member_exprs( //dir=expr + unique int id: @unresolved_member_expr, + string name: string ref +); + +unresolved_pattern_exprs( //dir=expr + unique int id: @unresolved_pattern_expr, + int sub_pattern: @pattern_or_none ref +); + +unresolved_specialize_exprs( //dir=expr + unique int id: @unresolved_specialize_expr, + int sub_expr: @expr_or_none ref +); + +vararg_expansion_exprs( //dir=expr + unique int id: @vararg_expansion_expr, + int sub_expr: @expr_or_none ref +); + +abi_safe_conversion_exprs( //dir=expr + unique int id: @abi_safe_conversion_expr +); + +actor_isolation_erasure_exprs( //dir=expr + unique int id: @actor_isolation_erasure_expr +); + +any_hashable_erasure_exprs( //dir=expr + unique int id: @any_hashable_erasure_expr +); + +archetype_to_super_exprs( //dir=expr + unique int id: @archetype_to_super_expr +); + +array_exprs( //dir=expr + unique int id: @array_expr +); + +#keyset[id, index] +array_expr_elements( //dir=expr + int id: @array_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +array_to_pointer_exprs( //dir=expr + unique int id: @array_to_pointer_expr +); + +auto_closure_exprs( //dir=expr + unique int id: @auto_closure_expr +); + +await_exprs( //dir=expr + unique int id: @await_expr +); + +binary_exprs( //dir=expr + unique int id: @binary_expr +); + +borrow_exprs( //dir=expr + unique int id: @borrow_expr +); + +bridge_from_obj_c_exprs( //dir=expr + unique int id: @bridge_from_obj_c_expr +); + +bridge_to_obj_c_exprs( //dir=expr + unique int id: @bridge_to_obj_c_expr +); + +@builtin_literal_expr = + @boolean_literal_expr +| @magic_identifier_literal_expr +| @number_literal_expr +| @string_literal_expr +; + +call_exprs( //dir=expr + unique int id: @call_expr +); + +@checked_cast_expr = + @conditional_checked_cast_expr +| @forced_checked_cast_expr +| @is_expr +; + +class_metatype_to_object_exprs( //dir=expr + unique int id: @class_metatype_to_object_expr +); + +coerce_exprs( //dir=expr + unique int id: @coerce_expr +); + +collection_upcast_conversion_exprs( //dir=expr + unique int id: @collection_upcast_conversion_expr +); + +conditional_bridge_from_obj_c_exprs( //dir=expr + unique int id: @conditional_bridge_from_obj_c_expr +); + +covariant_function_conversion_exprs( //dir=expr + unique int id: @covariant_function_conversion_expr +); + +covariant_return_conversion_exprs( //dir=expr + unique int id: @covariant_return_conversion_expr +); + +derived_to_base_exprs( //dir=expr + unique int id: @derived_to_base_expr +); + +destructure_tuple_exprs( //dir=expr + unique int id: @destructure_tuple_expr +); + +dictionary_exprs( //dir=expr + unique int id: @dictionary_expr +); + +#keyset[id, index] +dictionary_expr_elements( //dir=expr + int id: @dictionary_expr ref, + int index: int ref, + int element: @expr_or_none ref +); + +differentiable_function_exprs( //dir=expr + unique int id: @differentiable_function_expr +); + +differentiable_function_extract_original_exprs( //dir=expr + unique int id: @differentiable_function_extract_original_expr +); + +dot_self_exprs( //dir=expr + unique int id: @dot_self_expr +); + +@dynamic_lookup_expr = + @dynamic_member_ref_expr +| @dynamic_subscript_expr +; + +erasure_exprs( //dir=expr + unique int id: @erasure_expr +); + +existential_metatype_to_object_exprs( //dir=expr + unique int id: @existential_metatype_to_object_expr +); + +explicit_closure_exprs( //dir=expr + unique int id: @explicit_closure_expr +); + +force_try_exprs( //dir=expr + unique int id: @force_try_expr +); + +foreign_object_conversion_exprs( //dir=expr + unique int id: @foreign_object_conversion_expr +); + +function_conversion_exprs( //dir=expr + unique int id: @function_conversion_expr +); + +in_out_to_pointer_exprs( //dir=expr + unique int id: @in_out_to_pointer_expr +); + +inject_into_optional_exprs( //dir=expr + unique int id: @inject_into_optional_expr +); + +interpolated_string_literal_exprs( //dir=expr + unique int id: @interpolated_string_literal_expr +); + +#keyset[id] +interpolated_string_literal_expr_interpolation_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int interpolation_expr: @opaque_value_expr_or_none ref +); + +#keyset[id] +interpolated_string_literal_expr_appending_exprs( //dir=expr + int id: @interpolated_string_literal_expr ref, + int appending_expr: @tap_expr_or_none ref +); + +linear_function_exprs( //dir=expr + unique int id: @linear_function_expr +); + +linear_function_extract_original_exprs( //dir=expr + unique int id: @linear_function_extract_original_expr +); + +linear_to_differentiable_function_exprs( //dir=expr + unique int id: @linear_to_differentiable_function_expr +); + +load_exprs( //dir=expr + unique int id: @load_expr +); + +member_ref_exprs( //dir=expr + unique int id: @member_ref_expr +); + +#keyset[id] +member_ref_expr_has_direct_to_storage_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_ordinary_semantics( //dir=expr + int id: @member_ref_expr ref +); + +#keyset[id] +member_ref_expr_has_distributed_thunk_semantics( //dir=expr + int id: @member_ref_expr ref +); + +metatype_conversion_exprs( //dir=expr + unique int id: @metatype_conversion_expr +); + +nil_literal_exprs( //dir=expr + unique int id: @nil_literal_expr +); + +object_literal_exprs( //dir=expr + unique int id: @object_literal_expr, + int kind: int ref +); + +#keyset[id, index] +object_literal_expr_arguments( //dir=expr + int id: @object_literal_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +optional_try_exprs( //dir=expr + unique int id: @optional_try_expr +); + +paren_exprs( //dir=expr + unique int id: @paren_expr +); + +pointer_to_pointer_exprs( //dir=expr + unique int id: @pointer_to_pointer_expr +); + +postfix_unary_exprs( //dir=expr + unique int id: @postfix_unary_expr +); + +prefix_unary_exprs( //dir=expr + unique int id: @prefix_unary_expr +); + +protocol_metatype_to_object_exprs( //dir=expr + unique int id: @protocol_metatype_to_object_expr +); + +regex_literal_exprs( //dir=expr + unique int id: @regex_literal_expr, + string pattern: string ref, + int version: int ref +); + +@self_apply_expr = + @dot_syntax_call_expr +| @initializer_ref_call_expr +; + +#keyset[id] +self_apply_exprs( //dir=expr + int id: @self_apply_expr ref, + int base: @expr_or_none ref +); + +string_to_pointer_exprs( //dir=expr + unique int id: @string_to_pointer_expr +); + +subscript_exprs( //dir=expr + unique int id: @subscript_expr +); + +#keyset[id, index] +subscript_expr_arguments( //dir=expr + int id: @subscript_expr ref, + int index: int ref, + int argument: @argument_or_none ref +); + +#keyset[id] +subscript_expr_has_direct_to_storage_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_direct_to_implementation_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_ordinary_semantics( //dir=expr + int id: @subscript_expr ref +); + +#keyset[id] +subscript_expr_has_distributed_thunk_semantics( //dir=expr + int id: @subscript_expr ref +); + +try_exprs( //dir=expr + unique int id: @try_expr +); + +underlying_to_opaque_exprs( //dir=expr + unique int id: @underlying_to_opaque_expr +); + +unevaluated_instance_exprs( //dir=expr + unique int id: @unevaluated_instance_expr +); + +unreachable_exprs( //dir=expr + unique int id: @unreachable_expr +); + +unresolved_member_chain_result_exprs( //dir=expr + unique int id: @unresolved_member_chain_result_expr +); + +unresolved_type_conversion_exprs( //dir=expr + unique int id: @unresolved_type_conversion_expr +); + +boolean_literal_exprs( //dir=expr + unique int id: @boolean_literal_expr, + boolean value: boolean ref +); + +conditional_checked_cast_exprs( //dir=expr + unique int id: @conditional_checked_cast_expr +); + +dot_syntax_call_exprs( //dir=expr + unique int id: @dot_syntax_call_expr +); + +dynamic_member_ref_exprs( //dir=expr + unique int id: @dynamic_member_ref_expr +); + +dynamic_subscript_exprs( //dir=expr + unique int id: @dynamic_subscript_expr +); + +forced_checked_cast_exprs( //dir=expr + unique int id: @forced_checked_cast_expr +); + +initializer_ref_call_exprs( //dir=expr + unique int id: @initializer_ref_call_expr +); + +is_exprs( //dir=expr + unique int id: @is_expr +); + +magic_identifier_literal_exprs( //dir=expr + unique int id: @magic_identifier_literal_expr, + string kind: string ref +); + +@number_literal_expr = + @float_literal_expr +| @integer_literal_expr +; + +string_literal_exprs( //dir=expr + unique int id: @string_literal_expr, + string value: string ref +); + +float_literal_exprs( //dir=expr + unique int id: @float_literal_expr, + string string_value: string ref +); + +integer_literal_exprs( //dir=expr + unique int id: @integer_literal_expr, + string string_value: string ref +); + +@pattern = + @any_pattern +| @binding_pattern +| @bool_pattern +| @enum_element_pattern +| @expr_pattern +| @is_pattern +| @named_pattern +| @optional_some_pattern +| @paren_pattern +| @tuple_pattern +| @typed_pattern +; + +#keyset[id] +pattern_types( //dir=pattern + int id: @pattern ref, + int type_: @type_or_none ref +); + +any_patterns( //dir=pattern + unique int id: @any_pattern +); + +binding_patterns( //dir=pattern + unique int id: @binding_pattern, + int sub_pattern: @pattern_or_none ref +); + +bool_patterns( //dir=pattern + unique int id: @bool_pattern, + boolean value: boolean ref +); + +enum_element_patterns( //dir=pattern + unique int id: @enum_element_pattern, + int element: @enum_element_decl_or_none ref +); + +#keyset[id] +enum_element_pattern_sub_patterns( //dir=pattern + int id: @enum_element_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +expr_patterns( //dir=pattern + unique int id: @expr_pattern, + int sub_expr: @expr_or_none ref +); + +is_patterns( //dir=pattern + unique int id: @is_pattern +); + +#keyset[id] +is_pattern_cast_type_reprs( //dir=pattern + int id: @is_pattern ref, + int cast_type_repr: @type_repr_or_none ref +); + +#keyset[id] +is_pattern_sub_patterns( //dir=pattern + int id: @is_pattern ref, + int sub_pattern: @pattern_or_none ref +); + +named_patterns( //dir=pattern + unique int id: @named_pattern, + int var_decl: @var_decl_or_none ref +); + +optional_some_patterns( //dir=pattern + unique int id: @optional_some_pattern, + int sub_pattern: @pattern_or_none ref +); + +paren_patterns( //dir=pattern + unique int id: @paren_pattern, + int sub_pattern: @pattern_or_none ref +); + +tuple_patterns( //dir=pattern + unique int id: @tuple_pattern +); + +#keyset[id, index] +tuple_pattern_elements( //dir=pattern + int id: @tuple_pattern ref, + int index: int ref, + int element: @pattern_or_none ref +); + +typed_patterns( //dir=pattern + unique int id: @typed_pattern, + int sub_pattern: @pattern_or_none ref +); + +#keyset[id] +typed_pattern_type_reprs( //dir=pattern + int id: @typed_pattern ref, + int type_repr: @type_repr_or_none ref +); + +case_label_items( //dir=stmt + unique int id: @case_label_item, + int pattern: @pattern_or_none ref +); + +#keyset[id] +case_label_item_guards( //dir=stmt + int id: @case_label_item ref, + int guard: @expr_or_none ref +); + +condition_elements( //dir=stmt + unique int id: @condition_element +); + +#keyset[id] +condition_element_booleans( //dir=stmt + int id: @condition_element ref, + int boolean_: @expr_or_none ref +); + +#keyset[id] +condition_element_patterns( //dir=stmt + int id: @condition_element ref, + int pattern: @pattern_or_none ref +); + +#keyset[id] +condition_element_initializers( //dir=stmt + int id: @condition_element ref, + int initializer: @expr_or_none ref +); + +#keyset[id] +condition_element_availabilities( //dir=stmt + int id: @condition_element ref, + int availability: @availability_info_or_none ref +); + +@stmt = + @brace_stmt +| @break_stmt +| @case_stmt +| @continue_stmt +| @defer_stmt +| @discard_stmt +| @fail_stmt +| @fallthrough_stmt +| @labeled_stmt +| @pound_assert_stmt +| @return_stmt +| @then_stmt +| @throw_stmt +| @yield_stmt +; + +stmt_conditions( //dir=stmt + unique int id: @stmt_condition +); + +#keyset[id, index] +stmt_condition_elements( //dir=stmt + int id: @stmt_condition ref, + int index: int ref, + int element: @condition_element_or_none ref +); + +brace_stmts( //dir=stmt + unique int id: @brace_stmt +); + +#keyset[id, index] +brace_stmt_elements( //dir=stmt + int id: @brace_stmt ref, + int index: int ref, + int element: @ast_node_or_none ref +); + +break_stmts( //dir=stmt + unique int id: @break_stmt +); + +#keyset[id] +break_stmt_target_names( //dir=stmt + int id: @break_stmt ref, + string target_name: string ref +); + +#keyset[id] +break_stmt_targets( //dir=stmt + int id: @break_stmt ref, + int target: @stmt_or_none ref +); + +case_stmts( //dir=stmt + unique int id: @case_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +case_stmt_labels( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int label: @case_label_item_or_none ref +); + +#keyset[id, index] +case_stmt_variables( //dir=stmt + int id: @case_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +continue_stmts( //dir=stmt + unique int id: @continue_stmt +); + +#keyset[id] +continue_stmt_target_names( //dir=stmt + int id: @continue_stmt ref, + string target_name: string ref +); + +#keyset[id] +continue_stmt_targets( //dir=stmt + int id: @continue_stmt ref, + int target: @stmt_or_none ref +); + +defer_stmts( //dir=stmt + unique int id: @defer_stmt, + int body: @brace_stmt_or_none ref +); + +discard_stmts( //dir=stmt + unique int id: @discard_stmt, + int sub_expr: @expr_or_none ref +); + +fail_stmts( //dir=stmt + unique int id: @fail_stmt +); + +fallthrough_stmts( //dir=stmt + unique int id: @fallthrough_stmt, + int fallthrough_source: @case_stmt_or_none ref, + int fallthrough_dest: @case_stmt_or_none ref +); + +@labeled_stmt = + @do_catch_stmt +| @do_stmt +| @for_each_stmt +| @labeled_conditional_stmt +| @repeat_while_stmt +| @switch_stmt +; + +#keyset[id] +labeled_stmt_labels( //dir=stmt + int id: @labeled_stmt ref, + string label: string ref +); + +pound_assert_stmts( //dir=stmt + unique int id: @pound_assert_stmt, + int condition: @expr_or_none ref, + string message: string ref +); + +return_stmts( //dir=stmt + unique int id: @return_stmt +); + +#keyset[id] +return_stmt_results( //dir=stmt + int id: @return_stmt ref, + int result: @expr_or_none ref +); + +then_stmts( //dir=stmt + unique int id: @then_stmt, + int result: @expr_or_none ref +); + +throw_stmts( //dir=stmt + unique int id: @throw_stmt, + int sub_expr: @expr_or_none ref +); + +yield_stmts( //dir=stmt + unique int id: @yield_stmt +); + +#keyset[id, index] +yield_stmt_results( //dir=stmt + int id: @yield_stmt ref, + int index: int ref, + int result: @expr_or_none ref +); + +do_catch_stmts( //dir=stmt + unique int id: @do_catch_stmt, + int body: @stmt_or_none ref +); + +#keyset[id, index] +do_catch_stmt_catches( //dir=stmt + int id: @do_catch_stmt ref, + int index: int ref, + int catch: @case_stmt_or_none ref +); + +do_stmts( //dir=stmt + unique int id: @do_stmt, + int body: @brace_stmt_or_none ref +); + +for_each_stmts( //dir=stmt + unique int id: @for_each_stmt, + int pattern: @pattern_or_none ref, + int body: @brace_stmt_or_none ref +); + +#keyset[id, index] +for_each_stmt_variables( //dir=stmt + int id: @for_each_stmt ref, + int index: int ref, + int variable: @var_decl_or_none ref +); + +#keyset[id] +for_each_stmt_wheres( //dir=stmt + int id: @for_each_stmt ref, + int where: @expr_or_none ref +); + +#keyset[id] +for_each_stmt_iterator_vars( //dir=stmt + int id: @for_each_stmt ref, + int iteratorVar: @pattern_binding_decl_or_none ref +); + +#keyset[id] +for_each_stmt_next_calls( //dir=stmt + int id: @for_each_stmt ref, + int nextCall: @expr_or_none ref +); + +@labeled_conditional_stmt = + @guard_stmt +| @if_stmt +| @while_stmt +; + +#keyset[id] +labeled_conditional_stmts( //dir=stmt + int id: @labeled_conditional_stmt ref, + int condition: @stmt_condition_or_none ref +); + +repeat_while_stmts( //dir=stmt + unique int id: @repeat_while_stmt, + int condition: @expr_or_none ref, + int body: @stmt_or_none ref +); + +switch_stmts( //dir=stmt + unique int id: @switch_stmt, + int expr: @expr_or_none ref +); + +#keyset[id, index] +switch_stmt_cases( //dir=stmt + int id: @switch_stmt ref, + int index: int ref, + int case_: @case_stmt_or_none ref +); + +guard_stmts( //dir=stmt + unique int id: @guard_stmt, + int body: @brace_stmt_or_none ref +); + +if_stmts( //dir=stmt + unique int id: @if_stmt, + int then: @stmt_or_none ref +); + +#keyset[id] +if_stmt_elses( //dir=stmt + int id: @if_stmt ref, + int else: @stmt_or_none ref +); + +while_stmts( //dir=stmt + unique int id: @while_stmt, + int body: @stmt_or_none ref +); + +@type = + @any_function_type +| @any_generic_type +| @any_metatype_type +| @builtin_type +| @dependent_member_type +| @dynamic_self_type +| @error_type +| @existential_type +| @in_out_type +| @l_value_type +| @module_type +| @pack_element_type +| @pack_expansion_type +| @pack_type +| @parameterized_protocol_type +| @protocol_composition_type +| @reference_storage_type +| @substitutable_type +| @sugar_type +| @tuple_type +| @unresolved_type +; + +#keyset[id] +types( //dir=type + int id: @type ref, + string name: string ref, + int canonical_type: @type_or_none ref +); + +type_reprs( //dir=type + unique int id: @type_repr, + int type_: @type_or_none ref +); + +@any_function_type = + @function_type +| @generic_function_type +; + +#keyset[id] +any_function_types( //dir=type + int id: @any_function_type ref, + int result: @type_or_none ref +); + +#keyset[id, index] +any_function_type_param_types( //dir=type + int id: @any_function_type ref, + int index: int ref, + int param_type: @type_or_none ref +); + +#keyset[id] +any_function_type_is_throwing( //dir=type + int id: @any_function_type ref +); + +#keyset[id] +any_function_type_is_async( //dir=type + int id: @any_function_type ref +); + +@any_generic_type = + @nominal_or_bound_generic_nominal_type +| @unbound_generic_type +; + +#keyset[id] +any_generic_types( //dir=type + int id: @any_generic_type ref, + int declaration: @generic_type_decl_or_none ref +); + +#keyset[id] +any_generic_type_parents( //dir=type + int id: @any_generic_type ref, + int parent: @type_or_none ref +); + +@any_metatype_type = + @existential_metatype_type +| @metatype_type +; + +@builtin_type = + @any_builtin_integer_type +| @builtin_bridge_object_type +| @builtin_default_actor_storage_type +| @builtin_executor_type +| @builtin_float_type +| @builtin_job_type +| @builtin_native_object_type +| @builtin_raw_pointer_type +| @builtin_raw_unsafe_continuation_type +| @builtin_unsafe_value_buffer_type +| @builtin_vector_type +; + +dependent_member_types( //dir=type + unique int id: @dependent_member_type, + int base_type: @type_or_none ref, + int associated_type_decl: @associated_type_decl_or_none ref +); + +dynamic_self_types( //dir=type + unique int id: @dynamic_self_type, + int static_self_type: @type_or_none ref +); + +error_types( //dir=type + unique int id: @error_type +); + +existential_types( //dir=type + unique int id: @existential_type, + int constraint: @type_or_none ref +); + +in_out_types( //dir=type + unique int id: @in_out_type, + int object_type: @type_or_none ref +); + +l_value_types( //dir=type + unique int id: @l_value_type, + int object_type: @type_or_none ref +); + +module_types( //dir=type + unique int id: @module_type, + int module: @module_decl_or_none ref +); + +pack_element_types( //dir=type + unique int id: @pack_element_type, + int pack_type: @type_or_none ref +); + +pack_expansion_types( //dir=type + unique int id: @pack_expansion_type, + int pattern_type: @type_or_none ref, + int count_type: @type_or_none ref +); + +pack_types( //dir=type + unique int id: @pack_type +); + +#keyset[id, index] +pack_type_elements( //dir=type + int id: @pack_type ref, + int index: int ref, + int element: @type_or_none ref +); + +parameterized_protocol_types( //dir=type + unique int id: @parameterized_protocol_type, + int base: @protocol_type_or_none ref +); + +#keyset[id, index] +parameterized_protocol_type_args( //dir=type + int id: @parameterized_protocol_type ref, + int index: int ref, + int arg: @type_or_none ref +); + +protocol_composition_types( //dir=type + unique int id: @protocol_composition_type +); + +#keyset[id, index] +protocol_composition_type_members( //dir=type + int id: @protocol_composition_type ref, + int index: int ref, + int member: @type_or_none ref +); + +@reference_storage_type = + @unmanaged_storage_type +| @unowned_storage_type +| @weak_storage_type +; + +#keyset[id] +reference_storage_types( //dir=type + int id: @reference_storage_type ref, + int referent_type: @type_or_none ref +); + +@substitutable_type = + @archetype_type +| @generic_type_param_type +; + +@sugar_type = + @paren_type +| @syntax_sugar_type +| @type_alias_type +; + +tuple_types( //dir=type + unique int id: @tuple_type +); + +#keyset[id, index] +tuple_type_types( //dir=type + int id: @tuple_type ref, + int index: int ref, + int type_: @type_or_none ref +); + +#keyset[id, index] +tuple_type_names( //dir=type + int id: @tuple_type ref, + int index: int ref, + string name: string ref +); + +unresolved_types( //dir=type + unique int id: @unresolved_type +); + +@any_builtin_integer_type = + @builtin_integer_literal_type +| @builtin_integer_type +; + +@archetype_type = + @local_archetype_type +| @opaque_type_archetype_type +| @pack_archetype_type +| @primary_archetype_type +; + +#keyset[id] +archetype_types( //dir=type + int id: @archetype_type ref, + int interface_type: @type_or_none ref +); + +#keyset[id] +archetype_type_superclasses( //dir=type + int id: @archetype_type ref, + int superclass: @type_or_none ref +); + +#keyset[id, index] +archetype_type_protocols( //dir=type + int id: @archetype_type ref, + int index: int ref, + int protocol: @protocol_decl_or_none ref +); + +builtin_bridge_object_types( //dir=type + unique int id: @builtin_bridge_object_type +); + +builtin_default_actor_storage_types( //dir=type + unique int id: @builtin_default_actor_storage_type +); + +builtin_executor_types( //dir=type + unique int id: @builtin_executor_type +); + +builtin_float_types( //dir=type + unique int id: @builtin_float_type +); + +builtin_job_types( //dir=type + unique int id: @builtin_job_type +); + +builtin_native_object_types( //dir=type + unique int id: @builtin_native_object_type +); + +builtin_raw_pointer_types( //dir=type + unique int id: @builtin_raw_pointer_type +); + +builtin_raw_unsafe_continuation_types( //dir=type + unique int id: @builtin_raw_unsafe_continuation_type +); + +builtin_unsafe_value_buffer_types( //dir=type + unique int id: @builtin_unsafe_value_buffer_type +); + +builtin_vector_types( //dir=type + unique int id: @builtin_vector_type +); + +existential_metatype_types( //dir=type + unique int id: @existential_metatype_type +); + +function_types( //dir=type + unique int id: @function_type +); + +generic_function_types( //dir=type + unique int id: @generic_function_type +); + +#keyset[id, index] +generic_function_type_generic_params( //dir=type + int id: @generic_function_type ref, + int index: int ref, + int generic_param: @generic_type_param_type_or_none ref +); + +generic_type_param_types( //dir=type + unique int id: @generic_type_param_type +); + +metatype_types( //dir=type + unique int id: @metatype_type +); + +@nominal_or_bound_generic_nominal_type = + @bound_generic_type +| @nominal_type +; + +paren_types( //dir=type + unique int id: @paren_type, + int type_: @type_or_none ref +); + +@syntax_sugar_type = + @dictionary_type +| @unary_syntax_sugar_type +; + +type_alias_types( //dir=type + unique int id: @type_alias_type, + int decl: @type_alias_decl_or_none ref +); + +unbound_generic_types( //dir=type + unique int id: @unbound_generic_type +); + +unmanaged_storage_types( //dir=type + unique int id: @unmanaged_storage_type +); + +unowned_storage_types( //dir=type + unique int id: @unowned_storage_type +); + +weak_storage_types( //dir=type + unique int id: @weak_storage_type +); + +@bound_generic_type = + @bound_generic_class_type +| @bound_generic_enum_type +| @bound_generic_struct_type +; + +#keyset[id, index] +bound_generic_type_arg_types( //dir=type + int id: @bound_generic_type ref, + int index: int ref, + int arg_type: @type_or_none ref +); + +builtin_integer_literal_types( //dir=type + unique int id: @builtin_integer_literal_type +); + +builtin_integer_types( //dir=type + unique int id: @builtin_integer_type +); + +#keyset[id] +builtin_integer_type_widths( //dir=type + int id: @builtin_integer_type ref, + int width: int ref +); + +dictionary_types( //dir=type + unique int id: @dictionary_type, + int key_type: @type_or_none ref, + int value_type: @type_or_none ref +); + +@local_archetype_type = + @element_archetype_type +| @opened_archetype_type +; + +@nominal_type = + @class_type +| @enum_type +| @protocol_type +| @struct_type +; + +opaque_type_archetype_types( //dir=type + unique int id: @opaque_type_archetype_type, + int declaration: @opaque_type_decl_or_none ref +); + +pack_archetype_types( //dir=type + unique int id: @pack_archetype_type +); + +primary_archetype_types( //dir=type + unique int id: @primary_archetype_type +); + +@unary_syntax_sugar_type = + @array_slice_type +| @optional_type +| @variadic_sequence_type +; + +#keyset[id] +unary_syntax_sugar_types( //dir=type + int id: @unary_syntax_sugar_type ref, + int base_type: @type_or_none ref +); + +array_slice_types( //dir=type + unique int id: @array_slice_type +); + +bound_generic_class_types( //dir=type + unique int id: @bound_generic_class_type +); + +bound_generic_enum_types( //dir=type + unique int id: @bound_generic_enum_type +); + +bound_generic_struct_types( //dir=type + unique int id: @bound_generic_struct_type +); + +class_types( //dir=type + unique int id: @class_type +); + +element_archetype_types( //dir=type + unique int id: @element_archetype_type +); + +enum_types( //dir=type + unique int id: @enum_type +); + +opened_archetype_types( //dir=type + unique int id: @opened_archetype_type +); + +optional_types( //dir=type + unique int id: @optional_type +); + +protocol_types( //dir=type + unique int id: @protocol_type +); + +struct_types( //dir=type + unique int id: @struct_type +); + +variadic_sequence_types( //dir=type + unique int id: @variadic_sequence_type +); + +@accessor_or_none = + @accessor +| @unspecified_element +; + +@argument_or_none = + @argument +| @unspecified_element +; + +@associated_type_decl_or_none = + @associated_type_decl +| @unspecified_element +; + +@ast_node_or_none = + @ast_node +| @unspecified_element +; + +@availability_info_or_none = + @availability_info +| @unspecified_element +; + +@availability_spec_or_none = + @availability_spec +| @unspecified_element +; + +@brace_stmt_or_none = + @brace_stmt +| @unspecified_element +; + +@captured_decl_or_none = + @captured_decl +| @unspecified_element +; + +@case_label_item_or_none = + @case_label_item +| @unspecified_element +; + +@case_stmt_or_none = + @case_stmt +| @unspecified_element +; + +@closure_expr_or_none = + @closure_expr +| @unspecified_element +; + +@condition_element_or_none = + @condition_element +| @unspecified_element +; + +@decl_or_none = + @decl +| @unspecified_element +; + +@enum_element_decl_or_none = + @enum_element_decl +| @unspecified_element +; + +@expr_or_none = + @expr +| @unspecified_element +; + +@file_or_none = + @file +| @unspecified_element +; + +@function_or_none = + @function +| @unspecified_element +; + +@generic_type_decl_or_none = + @generic_type_decl +| @unspecified_element +; + +@generic_type_param_decl_or_none = + @generic_type_param_decl +| @unspecified_element +; + +@generic_type_param_type_or_none = + @generic_type_param_type +| @unspecified_element +; + +@initializer_or_none = + @initializer +| @unspecified_element +; + +@key_path_component_or_none = + @key_path_component +| @unspecified_element +; + +@location_or_none = + @location +| @unspecified_element +; + +@macro_role_or_none = + @macro_role +| @unspecified_element +; + +@module_decl_or_none = + @module_decl +| @unspecified_element +; + +@nominal_type_decl_or_none = + @nominal_type_decl +| @unspecified_element +; + +@opaque_type_decl_or_none = + @opaque_type_decl +| @unspecified_element +; + +@opaque_value_expr_or_none = + @opaque_value_expr +| @unspecified_element +; + +@param_decl_or_none = + @param_decl +| @unspecified_element +; + +@pattern_or_none = + @pattern +| @unspecified_element +; + +@pattern_binding_decl_or_none = + @pattern_binding_decl +| @unspecified_element +; + +@precedence_group_decl_or_none = + @precedence_group_decl +| @unspecified_element +; + +@protocol_decl_or_none = + @protocol_decl +| @unspecified_element +; + +@protocol_type_or_none = + @protocol_type +| @unspecified_element +; + +@stmt_or_none = + @stmt +| @unspecified_element +; + +@stmt_condition_or_none = + @stmt_condition +| @unspecified_element +; + +@string_literal_expr_or_none = + @string_literal_expr +| @unspecified_element +; + +@tap_expr_or_none = + @tap_expr +| @unspecified_element +; + +@type_or_none = + @type +| @unspecified_element +; + +@type_alias_decl_or_none = + @type_alias_decl +| @unspecified_element +; + +@type_repr_or_none = + @type_repr +| @unspecified_element +; + +@value_decl_or_none = + @unspecified_element +| @value_decl +; + +@var_decl_or_none = + @unspecified_element +| @var_decl +; diff --git a/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties new file mode 100644 index 00000000000..f08bdf09704 --- /dev/null +++ b/swift/ql/lib/upgrades/be2357fd0023261478871eff5df5c57df559aa3b/upgrade.properties @@ -0,0 +1,2 @@ +description: Upgrade to Swift 6.1 +compatibility: full From 8086ef48c7800f99ddee1bdd3455e027f9eeeefe Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 11:51:01 +0200 Subject: [PATCH 345/372] Swift: Add change note --- swift/ql/lib/change-notes/2025-04-23-swift-6.1.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 swift/ql/lib/change-notes/2025-04-23-swift-6.1.md diff --git a/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md b/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md new file mode 100644 index 00000000000..272c8ce6ca3 --- /dev/null +++ b/swift/ql/lib/change-notes/2025-04-23-swift-6.1.md @@ -0,0 +1,4 @@ +--- +category: majorAnalysis +--- +* Upgraded to allow analysis of Swift 6.1. From cad695868d9d83a9c0f5cb22688da8a36e6b89b3 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 23 Apr 2025 16:54:41 +0200 Subject: [PATCH 346/372] C++: Add change note --- cpp/ql/lib/change-notes/2025-04-23-typeof.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cpp/ql/lib/change-notes/2025-04-23-typeof.md diff --git a/cpp/ql/lib/change-notes/2025-04-23-typeof.md b/cpp/ql/lib/change-notes/2025-04-23-typeof.md new file mode 100644 index 00000000000..eb41e3b52bd --- /dev/null +++ b/cpp/ql/lib/change-notes/2025-04-23-typeof.md @@ -0,0 +1,5 @@ +--- +category: feature +--- +* New classes `TypeofType`, `TypeofExprType`, and `TypeofTypeType` were introduced, which represent the C23 `typeof` and `typeof_unqual` operators. The `TypeofExprType` class represents the variant taking an expression as its argument. The `TypeofTypeType` class represents the variant taking a type as its argument. +* A new class `IntrinsicTransformedType` was introduced, which represents the type transforming intrinsics supported by clang, gcc, and MSVC. From 68f93492b12249716d8c82c67a6745db0afc6ca8 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 28 Mar 2025 15:11:00 +0100 Subject: [PATCH 347/372] C#: Add cs/invalid-string-formatting to the codeql quality suite. --- csharp/ql/src/codeql-suites/csharp-code-quality.qls | 1 + 1 file changed, 1 insertion(+) diff --git a/csharp/ql/src/codeql-suites/csharp-code-quality.qls b/csharp/ql/src/codeql-suites/csharp-code-quality.qls index a7cfd44d734..64a100acda2 100644 --- a/csharp/ql/src/codeql-suites/csharp-code-quality.qls +++ b/csharp/ql/src/codeql-suites/csharp-code-quality.qls @@ -13,3 +13,4 @@ - cs/useless-gethashcode-call - cs/non-short-circuit - cs/useless-assignment-to-local + - cs/invalid-string-formatting From 9cfd6e30b9b23a1888191cc775b7ac776b8cf837 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 3 Apr 2025 15:00:04 +0200 Subject: [PATCH 348/372] C#: Convert testing of cs/invalid-string-formatting to inline expectations and adjust some of the testcases. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 92 +++++------ .../FormatInvalid/FormatInvalid.expected | 150 +++++++++--------- .../FormatInvalid/FormatInvalid.qlref | 3 +- .../FormatInvalid/FormatInvalidBad.cs | 2 +- .../FormatInvalid/FormatMissingArgument.cs | 10 +- .../FormatInvalid/FormatMissingArgumentBad.cs | 4 +- .../FormatInvalid/FormatUnusedArgument.cs | 14 +- .../FormatInvalid/FormatUnusedArgumentBad.cs | 6 +- 8 files changed, 139 insertions(+), 142 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index 4789da9cf6b..d65870f3a32 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -24,38 +24,38 @@ class FormatInvalid String.Format("{0, -10 :0.000}", 1); // BAD: Invalid format string - String.Format("{ 0}", 1); + String.Format("{ 0}", 1); // $ Alert // BAD: Invalid format string - String.Format("{0,--1}", 1); + String.Format("{0,--1}", 1); // $ Alert // BAD: Invalid format string - String.Format("{0:{}}", 1); + String.Format("{0:{}}", 1); // $ Alert // BAD: Invalid format string - String.Format("%d", 1); + String.Format("%d", 1); // $ Alert Sink // BAD: } { in the middle. - String.Format("{{0}-{1}}", 0, 1); + String.Format("{{0}-{1}}", 0, 1); // $ Alert // BAD: This is invalid - String.Format("{0}}", 0, 1); + String.Format("{0}}", 0, 1); // $ Alert // BAD: Invalid - string.Format("{foo{0}}", 0); + string.Format("{foo{0}}", 0); // $ Alert // GOOD: {{ is output as { - String.Format("{{sdc}}", 0); + String.Format("{{sdc}}{0}", 0); // BAD: Invalid: Stray } - String.Format("}", 0); + String.Format("}{0}", 0); // $ Alert // GOOD: {{ output as { - String.Format("new {0} ({1} => {{", 0); + String.Format("new {0} ({1} => {{", 0, 1); // GOOD: Literal {{ and }} - String.Format("{{", ""); - String.Format("{{{{}}", ""); + String.Format("{0}{{", 0); + String.Format("{0}{{{{}}", 0); } IFormatProvider fp; @@ -72,49 +72,49 @@ class FormatInvalid Format("}", 0); // BAD: All of these are format methods with an invalid string. - String.Format("}", 0); - String.Format("}", ps); - String.Format(fp, "}", ps); - String.Format("}", 0, 1); - String.Format("}", 0, 1, 2); - String.Format("}", 0, 1, 2, 3); + String.Format("}", 0); // $ Alert + String.Format("}", ps); // $ Alert + String.Format(fp, "}", ps); // $ Alert + String.Format("}", 0, 1); // $ Alert + String.Format("}", 0, 1, 2); // $ Alert + String.Format("}", 0, 1, 2, 3); // $ Alert - sb.AppendFormat("}", 0); - sb.AppendFormat("}", ps); - sb.AppendFormat(fp, "}", ps); - sb.AppendFormat("}", 0, 1); - sb.AppendFormat("}", 0, 1, 2); - sb.AppendFormat("}", 0, 1, 2, 3); + sb.AppendFormat("}", 0); // $ Alert + sb.AppendFormat("}", ps); // $ Alert + sb.AppendFormat(fp, "}", ps); // $ Alert + sb.AppendFormat("}", 0, 1); // $ Alert + sb.AppendFormat("}", 0, 1, 2); // $ Alert + sb.AppendFormat("}", 0, 1, 2, 3); // $ Alert - Console.WriteLine("}", 0); - Console.WriteLine("}", ps); - Console.WriteLine("}", 0, 1); - Console.WriteLine("}", 0, 1, 2); - Console.WriteLine("}", 0, 1, 2, 3); + Console.WriteLine("}", 0); // $ Alert + Console.WriteLine("}", ps); // $ Alert + Console.WriteLine("}", 0, 1); // $ Alert + Console.WriteLine("}", 0, 1, 2); // $ Alert + Console.WriteLine("}", 0, 1, 2, 3); // $ Alert - tw.WriteLine("}", 0); - tw.WriteLine("}", ps); - tw.WriteLine("}", 0, 1); - tw.WriteLine("}", 0, 1, 2); - tw.WriteLine("}", 0, 1, 2, 3); + tw.WriteLine("}", 0); // $ Alert + tw.WriteLine("}", ps); // $ Alert + tw.WriteLine("}", 0, 1); // $ Alert + tw.WriteLine("}", 0, 1, 2); // $ Alert + tw.WriteLine("}", 0, 1, 2, 3); // $ Alert - System.Diagnostics.Debug.WriteLine("}", ps); - System.Diagnostics.Trace.TraceError("}", 0); - System.Diagnostics.Trace.TraceInformation("}", 0); - System.Diagnostics.Trace.TraceWarning("}", 0); - ts.TraceInformation("}", 0); + System.Diagnostics.Debug.WriteLine("}", ps); // $ Alert + System.Diagnostics.Trace.TraceError("}", 0); // $ Alert + System.Diagnostics.Trace.TraceInformation("}", 0); // $ Alert + System.Diagnostics.Trace.TraceWarning("}", 0); // $ Alert + ts.TraceInformation("}", 0); // $ Alert - Console.Write("}", 0); - Console.Write("}", 0, 1); - Console.Write("}", 0, 1, 2); - Console.Write("}", 0, 1, 2, 3); + Console.Write("}", 0); // $ Alert + Console.Write("}", 0, 1); // $ Alert + Console.Write("}", 0, 1, 2); // $ Alert + Console.Write("}", 0, 1, 2, 3); // $ Alert System.Diagnostics.Debug.WriteLine("}", ""); // GOOD System.Diagnostics.Debug.Write("}", ""); // GOOD - System.Diagnostics.Debug.Assert(true, "Error", "}", ps); - sw.Write("}", 0); - System.Diagnostics.Debug.Print("}", ps); + System.Diagnostics.Debug.Assert(true, "Error", "}", ps); // $ Alert + sw.Write("}", 0); // $ Alert + System.Diagnostics.Debug.Print("}", ps); // $ Alert Console.WriteLine("}"); // GOOD } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index a1c5e925437..b23ee42559b 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -1,3 +1,72 @@ +#select +| FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:27:9:27:32 | call to method Format | this | FormatInvalid.cs:27:9:27:32 | call to method Format | this | +| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:30:9:30:35 | call to method Format | this | FormatInvalid.cs:30:9:30:35 | call to method Format | this | +| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:33:9:33:34 | call to method Format | this | FormatInvalid.cs:33:9:33:34 | call to method Format | this | +| FormatInvalid.cs:36:9:36:30 | call to method Format | FormatInvalid.cs:36:23:36:26 | "%d" | FormatInvalid.cs:36:23:36:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:36:23:36:26 | "%d" | format string | FormatInvalid.cs:36:29:36:29 | (...) ... | this supplied value | +| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:39:9:39:40 | call to method Format | this | FormatInvalid.cs:39:9:39:40 | call to method Format | this | +| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | +| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | +| FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | +| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this | +| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this | +| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this | +| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this | +| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this | +| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this | +| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | +| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | +| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | +| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | +| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | +| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | +| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | +| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | +| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | +| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | +| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | +| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | +| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | +| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | +| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | +| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | +| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | +| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | +| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | +| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | +| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | +| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this | +| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this | +| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this | +| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this | +| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | +| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this | +| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this | +| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | +| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | +| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | +| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | +| FormatMissingArgument.cs:25:9:25:32 | call to method WriteLine | FormatMissingArgument.cs:25:27:25:31 | "{0}" | FormatMissingArgument.cs:25:27:25:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | +| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | +| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:31:31:31:31 | (...) ... | this supplied value | +| FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | +| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | +| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | +| FormatUnusedArgument.cs:11:9:11:29 | call to method Format | FormatUnusedArgument.cs:11:23:11:25 | "X" | FormatUnusedArgument.cs:11:23:11:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:11:23:11:25 | "X" | format string | FormatUnusedArgument.cs:11:28:11:28 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:14:9:14:34 | call to method Format | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | format string | FormatUnusedArgument.cs:14:33:14:33 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:17:9:17:38 | call to method Format | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:17:37:17:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:20:9:20:38 | call to method Format | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:20:34:20:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:34:23:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:37:23:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:40:23:40 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:26:9:26:35 | call to method Format | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:26:34:26:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:38:9:38:33 | call to method Format | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | format string | FormatUnusedArgument.cs:38:32:38:32 | (...) ... | this supplied value | +| FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | +| FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | +| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | +| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:24:28:29 | format : String | provenance | | | FormatMissingArgument.cs:28:24:28:29 | format : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | provenance | | @@ -15,11 +84,11 @@ nodes | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | | FormatInvalid.cs:42:23:42:28 | "{0}}" | semmle.label | "{0}}" | | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | -| FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | -| FormatInvalid.cs:51:23:51:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:48:23:48:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | +| FormatInvalid.cs:51:23:51:28 | "}{0}" | semmle.label | "}{0}" | | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | -| FormatInvalid.cs:57:23:57:26 | "{{" | semmle.label | "{{" | -| FormatInvalid.cs:58:23:58:30 | "{{{{}}" | semmle.label | "{{{{}}" | +| FormatInvalid.cs:57:23:57:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:77:27:77:29 | "}" | semmle.label | "}" | @@ -85,76 +154,3 @@ nodes | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -#select -| FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:27:9:27:32 | call to method Format | this | FormatInvalid.cs:27:9:27:32 | call to method Format | this | -| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:30:9:30:35 | call to method Format | this | FormatInvalid.cs:30:9:30:35 | call to method Format | this | -| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:33:9:33:34 | call to method Format | this | FormatInvalid.cs:33:9:33:34 | call to method Format | this | -| FormatInvalid.cs:36:9:36:30 | call to method Format | FormatInvalid.cs:36:23:36:26 | "%d" | FormatInvalid.cs:36:23:36:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:36:23:36:26 | "%d" | format string | FormatInvalid.cs:36:29:36:29 | (...) ... | this supplied value | -| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:39:9:39:40 | call to method Format | this | FormatInvalid.cs:39:9:39:40 | call to method Format | this | -| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | -| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | -| FormatInvalid.cs:48:9:48:35 | call to method Format | FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | The $@ ignores $@. | FormatInvalid.cs:48:23:48:31 | "{{sdc}}" | format string | FormatInvalid.cs:48:34:48:34 | (...) ... | this supplied value | -| FormatInvalid.cs:51:23:51:25 | "}" | FormatInvalid.cs:51:23:51:25 | "}" | FormatInvalid.cs:51:23:51:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:29 | call to method Format | this | FormatInvalid.cs:51:9:51:29 | call to method Format | this | -| FormatInvalid.cs:54:9:54:46 | call to method Format | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | Argument '{1}' has not been supplied to $@ format string. | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | this | FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | this | -| FormatInvalid.cs:57:9:57:31 | call to method Format | FormatInvalid.cs:57:23:57:26 | "{{" | FormatInvalid.cs:57:23:57:26 | "{{" | The $@ ignores $@. | FormatInvalid.cs:57:23:57:26 | "{{" | format string | FormatInvalid.cs:57:29:57:30 | "" | this supplied value | -| FormatInvalid.cs:58:9:58:35 | call to method Format | FormatInvalid.cs:58:23:58:30 | "{{{{}}" | FormatInvalid.cs:58:23:58:30 | "{{{{}}" | The $@ ignores $@. | FormatInvalid.cs:58:23:58:30 | "{{{{}}" | format string | FormatInvalid.cs:58:33:58:34 | "" | this supplied value | -| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this | -| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this | -| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this | -| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this | -| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this | -| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this | -| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | -| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | -| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | -| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | -| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | -| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | -| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | -| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | -| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | -| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | -| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | -| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | -| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | -| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | -| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | -| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | -| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | -| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | -| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | -| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | -| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | -| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this | -| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this | -| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this | -| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this | -| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | -| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this | -| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this | -| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:25:9:25:32 | call to method WriteLine | FormatMissingArgument.cs:25:27:25:31 | "{0}" | FormatMissingArgument.cs:25:27:25:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:31:31:31:31 | (...) ... | this supplied value | -| FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | -| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | -| FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | -| FormatUnusedArgument.cs:11:9:11:29 | call to method Format | FormatUnusedArgument.cs:11:23:11:25 | "X" | FormatUnusedArgument.cs:11:23:11:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:11:23:11:25 | "X" | format string | FormatUnusedArgument.cs:11:28:11:28 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:14:9:14:34 | call to method Format | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | format string | FormatUnusedArgument.cs:14:33:14:33 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:17:9:17:38 | call to method Format | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:17:37:17:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:20:9:20:38 | call to method Format | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:20:34:20:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:34:23:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:37:23:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:40:23:40 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:26:9:26:35 | call to method Format | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:26:34:26:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:38:9:38:33 | call to method Format | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | format string | FormatUnusedArgument.cs:38:32:38:32 | (...) ... | this supplied value | -| FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | -| FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | -| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | -| FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref index 75f1d04fe14..9c660b69de5 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.qlref @@ -1 +1,2 @@ -API Abuse/FormatInvalid.ql \ No newline at end of file +query: API Abuse/FormatInvalid.ql +postprocess: utils/test/InlineExpectationsTestQuery.ql diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs index ec3df72655d..424781b80bc 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalidBad.cs @@ -4,6 +4,6 @@ class Bad1 { string GenerateEmptyClass(string c) { - return string.Format("class {0} { }", "C"); + return string.Format("class {0} { }", "C"); // $ Alert } } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index 94201c0ddf8..fa046a6fc7c 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -8,10 +8,10 @@ class Class1 String.Format("{0}", 0); // BAD: Missing {1} - String.Format("{1}", 0); + String.Format("{1}", 0); // $ Alert Sink // BAD: Missing {2} and {3} - String.Format("{2} {3}", 0, 1); + String.Format("{2} {3}", 0, 1); // $ Alert Sink // GOOD: An array has been supplied. String.Format("{0} {1} {2}", args); @@ -19,16 +19,16 @@ class Class1 // GOOD: All arguments supplied to params String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); - helper("{1}"); + helper("{1}"); // $ Source // BAD: Missing {0} - Console.WriteLine("{0}"); + Console.WriteLine("{0}"); // $ Alert Sink } void helper(string format) { // BAD: Missing {1} - String.Format(format, 0); + String.Format(format, 0); // $ Alert Sink } object[] args; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs index a66eea4cf32..a3614a881b9 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs @@ -4,7 +4,7 @@ class Bad3 { void Hello(string first, string last) { - Console.WriteLine("Hello {0} {1}", first); - Console.WriteLine("Hello {1} {2}", first, last); + Console.WriteLine("Hello {0} {1}", first); // $ Alert Sink + Console.WriteLine("Hello {1} {2}", first, last); // $ Alert Sink } } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index 81842d1e19d..61f69184087 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -8,22 +8,22 @@ class C String.Format("{0} {1} {2}", 0, 1, 2); // BAD: Missing arg {0} - String.Format("X", 1); + String.Format("X", 1); // $ Alert Sink // BAD: Missing {1} - String.Format("{0}", 1, 2); + String.Format("{0}", 1, 2); // $ Alert Sink // BAD: Missing {1} - String.Format("{0} {0}", 1, 2); + String.Format("{0} {0}", 1, 2); // $ Alert Sink // BAD: Missing {0} - String.Format("{1} {1}", 1, 2); + String.Format("{1} {1}", 1, 2); // $ Alert Sink // BAD: Missing {0}, {1} and {2} - String.Format("abcdefg", 0, 1, 2); + String.Format("abcdefg", 0, 1, 2); // $ Alert Sink // BAD: {0} is unused - String.Format("{{sdc}}", 0); + String.Format("{{sdc}}", 0); // $ Alert Sink // GOOD: {0} is used String.Format("{{{0:D}}}", 0); @@ -35,7 +35,7 @@ class C String.Format("{0} {1} {2}", ps); // BAD: Would display "{0}" - String.Format("{{0}}", 1); + String.Format("{{0}}", 1); // $ Alert Sink // GOOD: Ignore the empty string as it's often used as the default value // of GetResource(). diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs index 25bce1a742e..5a951efa432 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs @@ -4,8 +4,8 @@ class Bad2 { void M(Exception ex) { - Console.WriteLine("Error processing file: {0}", ex, ex.HResult); - Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); - Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); + Console.WriteLine("Error processing file: {0}", ex, ex.HResult); // $ Alert Sink + Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); // $ Alert Sink + Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); // $ Alert Sink } } From 327ddb07a173f827c0316933a97472bac6ccdac5 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 12:59:17 +0200 Subject: [PATCH 349/372] C#: Re-factor FormatMethod. --- .../semmle/code/csharp/frameworks/Format.qll | 132 +++++++++++------- 1 file changed, 78 insertions(+), 54 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index f54476b9e4f..4fd273014eb 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -8,69 +8,93 @@ private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.Text /** A method that formats a string, for example `string.Format()`. */ -class FormatMethod extends Method { - FormatMethod() { - exists(Class declType | declType = this.getDeclaringType() | - this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and - this.getParameter(1).getType() instanceof StringType and - ( - this = any(SystemStringClass c).getFormatMethod() - or - this = any(SystemTextStringBuilderClass c).getAppendFormatMethod() - ) - or - this.getParameter(0).getType() instanceof StringType and - ( - this = any(SystemStringClass c).getFormatMethod() - or - this = any(SystemTextStringBuilderClass c).getAppendFormatMethod() - or - (this.hasName("Write") or this.hasName("WriteLine")) and - ( - declType.hasFullyQualifiedName("System", "Console") - or - declType.hasFullyQualifiedName("System.IO", "TextWriter") - or - declType.hasFullyQualifiedName("System.Diagnostics", "Debug") and - this.getParameter(1).getType() instanceof ArrayType - ) - or - declType.hasFullyQualifiedName("System.Diagnostics", "Trace") and - ( - this.hasName("TraceError") or - this.hasName("TraceInformation") or - this.hasName("TraceWarning") - ) - or - this.hasName("TraceInformation") and - declType.hasFullyQualifiedName("System.Diagnostics", "TraceSource") - or - this.hasName("Print") and - declType.hasFullyQualifiedName("System.Diagnostics", "Debug") - ) - or - this.hasName("Assert") and - declType.hasFullyQualifiedName("System.Diagnostics", "Debug") and - this.getNumberOfParameters() = 4 - ) - } - +abstract class FormatMethod extends Method { /** * Gets the argument containing the format string. For example, the argument of * `string.Format(IFormatProvider, String, Object)` is `1`. */ - int getFormatArgument() { + abstract int getFormatArgument(); +} + +private class StringAndStringBuilderFormatMethods extends FormatMethod { + StringAndStringBuilderFormatMethods() { + ( + this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and + this.getParameter(1).getType() instanceof StringType + or + this.getParameter(0).getType() instanceof StringType + ) and + ( + this = any(SystemStringClass c).getFormatMethod() + or + this = any(SystemTextStringBuilderClass c).getAppendFormatMethod() + ) + } + + override int getFormatArgument() { if this.getParameter(0).getType() instanceof SystemIFormatProviderInterface then result = 1 - else - if - this.hasName("Assert") and - this.getDeclaringType().hasFullyQualifiedName("System.Diagnostics", "Debug") - then result = 2 - else result = 0 + else result = 0 } } +private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { + SystemConsoleAndSystemIoTextWriterFormatMethods() { + this.getParameter(0).getType() instanceof StringType and + exists(Class declType | declType = this.getDeclaringType() | + this.hasName(["Write", "WriteLine"]) and + ( + declType.hasFullyQualifiedName("System", "Console") + or + declType.hasFullyQualifiedName("System.IO", "TextWriter") + ) + ) + } + + override int getFormatArgument() { result = 0 } +} + +private class SystemDiagnosticsDebugAssert extends FormatMethod { + SystemDiagnosticsDebugAssert() { + this.hasName("Assert") and + this.getDeclaringType().hasFullyQualifiedName("System.Diagnostics", "Debug") and + this.getNumberOfParameters() = 4 + } + + override int getFormatArgument() { result = 2 } +} + +private class SystemDiagnosticsFormatMethods extends FormatMethod { + SystemDiagnosticsFormatMethods() { + this.getParameter(0).getType() instanceof StringType and + exists(Class declType | + declType = this.getDeclaringType() and + declType.getNamespace().getFullName() = "System.Diagnostics" + | + declType.hasName("Trace") and + ( + this.hasName("TraceError") + or + this.hasName("TraceInformation") + or + this.hasName("TraceWarning") + ) + or + declType.hasName("TraceSource") and this.hasName("TraceInformation") + or + declType.hasName("Debug") and + ( + this.hasName("Print") + or + this.hasName(["Write", "WriteLine"]) and + this.getParameter(1).getType() instanceof ArrayType + ) + ) + } + + override int getFormatArgument() { result = 0 } +} + pragma[nomagic] private predicate parameterReadPostDominatesEntry(ParameterRead pr) { pr.getAControlFlowNode().postDominates(pr.getEnclosingCallable().getEntryPoint()) and From 175e4ecb743442e571dde3bf9769448144e2e41d Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:48:43 +0200 Subject: [PATCH 350/372] C#: Add more format testcases. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 15 ++ .../FormatInvalid/FormatInvalid.expected | 158 ++++++++++++------ 2 files changed, 119 insertions(+), 54 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index d65870f3a32..4072dfbd688 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -72,6 +72,7 @@ class FormatInvalid Format("}", 0); // BAD: All of these are format methods with an invalid string. + String.Format("}"); // $ Alert String.Format("}", 0); // $ Alert String.Format("}", ps); // $ Alert String.Format(fp, "}", ps); // $ Alert @@ -79,6 +80,7 @@ class FormatInvalid String.Format("}", 0, 1, 2); // $ Alert String.Format("}", 0, 1, 2, 3); // $ Alert + sb.AppendFormat("}"); // $ Alert sb.AppendFormat("}", 0); // $ Alert sb.AppendFormat("}", ps); // $ Alert sb.AppendFormat(fp, "}", ps); // $ Alert @@ -117,6 +119,19 @@ class FormatInvalid System.Diagnostics.Debug.Print("}", ps); // $ Alert Console.WriteLine("}"); // GOOD + + // The Following methods are not recognised as format methods. + Console.WriteLine("{0}"); // GOOD + Console.Write("{0}"); // GOOD + tw.WriteLine("{0}"); // GOOD + tw.Write("{0}"); // GOOD + System.Diagnostics.Debug.Print("{0}"); // GOOD + System.Diagnostics.Debug.WriteLine("{0}"); // GOOD + System.Diagnostics.Debug.Write("{0}"); // GOOD + System.Diagnostics.Trace.TraceError("{0}"); // GOOD + System.Diagnostics.Trace.TraceInformation("{0}"); // GOOD + System.Diagnostics.Trace.TraceWarning("{0}"); // GOOD + ts.TraceInformation("{0}"); // GOOD } System.IO.StringWriter sw; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index b23ee42559b..4a7730a26e8 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -7,40 +7,49 @@ | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | -| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:29 | call to method Format | this | FormatInvalid.cs:75:9:75:29 | call to method Format | this | -| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:30 | call to method Format | this | FormatInvalid.cs:76:9:76:30 | call to method Format | this | -| FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | FormatInvalid.cs:77:27:77:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:34 | call to method Format | this | FormatInvalid.cs:77:9:77:34 | call to method Format | this | -| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:32 | call to method Format | this | FormatInvalid.cs:78:9:78:32 | call to method Format | this | -| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:35 | call to method Format | this | FormatInvalid.cs:79:9:79:35 | call to method Format | this | -| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:38 | call to method Format | this | FormatInvalid.cs:80:9:80:38 | call to method Format | this | -| FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | FormatInvalid.cs:82:25:82:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | FormatInvalid.cs:82:9:82:31 | call to method AppendFormat | this | -| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:32 | call to method AppendFormat | this | -| FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | FormatInvalid.cs:84:29:84:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:36 | call to method AppendFormat | this | -| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:34 | call to method AppendFormat | this | -| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:37 | call to method AppendFormat | this | -| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:40 | call to method AppendFormat | this | -| FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | FormatInvalid.cs:89:27:89:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | FormatInvalid.cs:89:9:89:33 | call to method WriteLine | this | -| FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | FormatInvalid.cs:90:27:90:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | FormatInvalid.cs:90:9:90:34 | call to method WriteLine | this | -| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:36 | call to method WriteLine | this | -| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:39 | call to method WriteLine | this | -| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:42 | call to method WriteLine | this | -| FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | FormatInvalid.cs:95:22:95:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:28 | call to method WriteLine | this | -| FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | FormatInvalid.cs:96:22:96:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:29 | call to method WriteLine | this | -| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:31 | call to method WriteLine | this | -| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:34 | call to method WriteLine | this | -| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:37 | call to method WriteLine | this | -| FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | FormatInvalid.cs:101:44:101:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:51 | call to method WriteLine | this | -| FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | FormatInvalid.cs:102:45:102:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | FormatInvalid.cs:102:9:102:51 | call to method TraceError | this | -| FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | FormatInvalid.cs:103:51:103:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | FormatInvalid.cs:103:9:103:57 | call to method TraceInformation | this | -| FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | FormatInvalid.cs:104:47:104:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | FormatInvalid.cs:104:9:104:53 | call to method TraceWarning | this | -| FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | FormatInvalid.cs:105:29:105:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:35 | call to method TraceInformation | this | -| FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | FormatInvalid.cs:107:23:107:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:29 | call to method Write | this | FormatInvalid.cs:107:9:107:29 | call to method Write | this | -| FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | FormatInvalid.cs:108:23:108:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:32 | call to method Write | this | FormatInvalid.cs:108:9:108:32 | call to method Write | this | -| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:35 | call to method Write | this | FormatInvalid.cs:109:9:109:35 | call to method Write | this | -| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:38 | call to method Write | this | FormatInvalid.cs:110:9:110:38 | call to method Write | this | -| FormatInvalid.cs:115:56:115:58 | "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | FormatInvalid.cs:115:9:115:63 | call to method Assert | this | -| FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | FormatInvalid.cs:116:18:116:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:116:9:116:24 | call to method Write | this | FormatInvalid.cs:116:9:116:24 | call to method Write | this | -| FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | FormatInvalid.cs:117:40:117:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:47 | call to method Print | this | FormatInvalid.cs:117:9:117:47 | call to method Print | this | +| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this | +| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this | +| FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this | +| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this | +| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this | +| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this | +| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | +| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | +| FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | +| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | +| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | +| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | +| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | +| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | +| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | +| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | +| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | +| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | +| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | +| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | +| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | +| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | +| FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | +| FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | +| FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | +| FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | +| FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | +| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:29 | call to method Write | this | FormatInvalid.cs:109:9:109:29 | call to method Write | this | +| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:32 | call to method Write | this | FormatInvalid.cs:110:9:110:32 | call to method Write | this | +| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:35 | call to method Write | this | FormatInvalid.cs:111:9:111:35 | call to method Write | this | +| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:38 | call to method Write | this | FormatInvalid.cs:112:9:112:38 | call to method Write | this | +| FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | +| FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this | +| FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this | +| FormatInvalid.cs:124:9:124:32 | call to method WriteLine | FormatInvalid.cs:124:27:124:31 | "{0}" | FormatInvalid.cs:124:27:124:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:124:27:124:31 | "{0}" | this | FormatInvalid.cs:124:27:124:31 | "{0}" | this | +| FormatInvalid.cs:125:9:125:28 | call to method Write | FormatInvalid.cs:125:23:125:27 | "{0}" | FormatInvalid.cs:125:23:125:27 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:125:23:125:27 | "{0}" | this | FormatInvalid.cs:125:23:125:27 | "{0}" | this | +| FormatInvalid.cs:126:9:126:27 | call to method WriteLine | FormatInvalid.cs:126:22:126:26 | "{0}" | FormatInvalid.cs:126:22:126:26 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:126:22:126:26 | "{0}" | this | FormatInvalid.cs:126:22:126:26 | "{0}" | this | +| FormatInvalid.cs:127:9:127:23 | call to method Write | FormatInvalid.cs:127:18:127:22 | "{0}" | FormatInvalid.cs:127:18:127:22 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:127:18:127:22 | "{0}" | this | FormatInvalid.cs:127:18:127:22 | "{0}" | this | +| FormatInvalid.cs:128:9:128:45 | call to method Print | FormatInvalid.cs:128:40:128:44 | "{0}" | FormatInvalid.cs:128:40:128:44 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:128:40:128:44 | "{0}" | this | FormatInvalid.cs:128:40:128:44 | "{0}" | this | +| FormatInvalid.cs:131:9:131:50 | call to method TraceError | FormatInvalid.cs:131:45:131:49 | "{0}" | FormatInvalid.cs:131:45:131:49 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:131:45:131:49 | "{0}" | this | FormatInvalid.cs:131:45:131:49 | "{0}" | this | +| FormatInvalid.cs:132:9:132:56 | call to method TraceInformation | FormatInvalid.cs:132:51:132:55 | "{0}" | FormatInvalid.cs:132:51:132:55 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:132:51:132:55 | "{0}" | this | FormatInvalid.cs:132:51:132:55 | "{0}" | this | +| FormatInvalid.cs:133:9:133:52 | call to method TraceWarning | FormatInvalid.cs:133:47:133:51 | "{0}" | FormatInvalid.cs:133:47:133:51 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:133:47:133:51 | "{0}" | this | FormatInvalid.cs:133:47:133:51 | "{0}" | this | +| FormatInvalid.cs:134:9:134:34 | call to method TraceInformation | FormatInvalid.cs:134:29:134:33 | "{0}" | FormatInvalid.cs:134:29:134:33 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:134:29:134:33 | "{0}" | this | FormatInvalid.cs:134:29:134:33 | "{0}" | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | @@ -91,39 +100,50 @@ nodes | FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:77:27:77:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:78:27:78:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:79:23:79:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:82:25:82:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:83:25:83:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:84:29:84:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:86:29:86:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:87:25:87:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:89:27:89:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:90:27:90:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:91:27:91:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:95:22:95:24 | "}" | semmle.label | "}" | -| FormatInvalid.cs:96:22:96:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:97:22:97:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | -| FormatInvalid.cs:101:44:101:46 | "}" | semmle.label | "}" | -| FormatInvalid.cs:102:45:102:47 | "}" | semmle.label | "}" | -| FormatInvalid.cs:103:51:103:53 | "}" | semmle.label | "}" | -| FormatInvalid.cs:104:47:104:49 | "}" | semmle.label | "}" | -| FormatInvalid.cs:105:29:105:31 | "}" | semmle.label | "}" | -| FormatInvalid.cs:107:23:107:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:108:23:108:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:103:44:103:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:104:45:104:47 | "}" | semmle.label | "}" | +| FormatInvalid.cs:105:51:105:53 | "}" | semmle.label | "}" | +| FormatInvalid.cs:106:47:106:49 | "}" | semmle.label | "}" | +| FormatInvalid.cs:107:29:107:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:109:23:109:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:115:56:115:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | -| FormatInvalid.cs:116:18:116:20 | "}" | semmle.label | "}" | -| FormatInvalid.cs:117:40:117:42 | "}" | semmle.label | "}" | -| FormatInvalid.cs:119:27:119:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | +| FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" | +| FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:121:27:121:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:124:27:124:31 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:125:23:125:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:126:22:126:26 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:127:18:127:22 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:128:40:128:44 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:131:45:131:49 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:132:51:132:55 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:133:47:133:51 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:134:29:134:33 | "{0}" | semmle.label | "{0}" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | | FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" | @@ -154,3 +174,33 @@ nodes | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths +testFailures +| FormatInvalid.cs:75:29:75:38 | // ... | Missing result: Alert | +| FormatInvalid.cs:83:31:83:40 | // ... | Missing result: Alert | +| FormatInvalid.cs:124:9:124:32 | FormatInvalid.cs:124:27:124:31 | Unexpected result: Alert | +| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:125:9:125:28 | FormatInvalid.cs:125:23:125:27 | Unexpected result: Alert | +| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:126:9:126:27 | FormatInvalid.cs:126:22:126:26 | Unexpected result: Alert | +| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:127:9:127:23 | FormatInvalid.cs:127:18:127:22 | Unexpected result: Alert | +| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:128:9:128:45 | FormatInvalid.cs:128:40:128:44 | Unexpected result: Alert | +| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:131:9:131:50 | FormatInvalid.cs:131:45:131:49 | Unexpected result: Alert | +| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:132:9:132:56 | FormatInvalid.cs:132:51:132:55 | Unexpected result: Alert | +| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:133:9:133:52 | FormatInvalid.cs:133:47:133:51 | Unexpected result: Alert | +| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Sink | +| FormatInvalid.cs:134:9:134:34 | FormatInvalid.cs:134:29:134:33 | Unexpected result: Alert | +| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Alert | +| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Sink | From f73b7429c6dce48e45db5e6c737401722eca0b17 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:53:38 +0200 Subject: [PATCH 351/372] C#: Remove false positive example. --- .../API Abuse/FormatInvalid/FormatInvalid.expected | 14 ++++++-------- .../FormatInvalid/FormatMissingArgument.cs | 3 --- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 4a7730a26e8..57523031ece 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -57,9 +57,8 @@ | FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | | FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | | FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:25:9:25:32 | call to method WriteLine | FormatMissingArgument.cs:25:27:25:31 | "{0}" | FormatMissingArgument.cs:25:27:25:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | FormatMissingArgument.cs:25:27:25:31 | "{0}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | -| FormatMissingArgument.cs:31:9:31:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:31:31:31:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | +| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:28:31:28:31 | (...) ... | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | @@ -77,8 +76,8 @@ | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges -| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:24:28:29 | format : String | provenance | | -| FormatMissingArgument.cs:28:24:28:29 | format : String | FormatMissingArgument.cs:31:23:31:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:25:24:25:29 | format : String | provenance | | +| FormatMissingArgument.cs:25:24:25:29 | format : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | provenance | | nodes | FormatInvalid.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | | FormatInvalid.cs:12:23:12:29 | "{0,1}" | semmle.label | "{0,1}" | @@ -152,9 +151,8 @@ nodes | FormatMissingArgument.cs:17:23:17:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatMissingArgument.cs:20:23:20:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:25:27:25:31 | "{0}" | semmle.label | "{0}" | -| FormatMissingArgument.cs:28:24:28:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:31:23:31:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:25:24:25:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:28:23:28:28 | access to parameter format | semmle.label | access to parameter format | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | | FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index fa046a6fc7c..fabe7b239e4 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -20,9 +20,6 @@ class Class1 String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); helper("{1}"); // $ Source - - // BAD: Missing {0} - Console.WriteLine("{0}"); // $ Alert Sink } void helper(string format) From 1d9d8780b388e308d71dce43f885927b540f1e65 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:55:49 +0200 Subject: [PATCH 352/372] C#: Remove some false positives and add more true positives for cs/invalid-string-format. --- csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll | 2 ++ csharp/ql/src/API Abuse/FormatInvalid.ql | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index 4fd273014eb..db1d4e42d74 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -41,6 +41,7 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod { private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { SystemConsoleAndSystemIoTextWriterFormatMethods() { this.getParameter(0).getType() instanceof StringType and + this.getNumberOfParameters() > 1 and exists(Class declType | declType = this.getDeclaringType() | this.hasName(["Write", "WriteLine"]) and ( @@ -67,6 +68,7 @@ private class SystemDiagnosticsDebugAssert extends FormatMethod { private class SystemDiagnosticsFormatMethods extends FormatMethod { SystemDiagnosticsFormatMethods() { this.getParameter(0).getType() instanceof StringType and + this.getNumberOfParameters() > 1 and exists(Class declType | declType = this.getDeclaringType() and declType.getNamespace().getFullName() = "System.Diagnostics" diff --git a/csharp/ql/src/API Abuse/FormatInvalid.ql b/csharp/ql/src/API Abuse/FormatInvalid.ql index 235daa1ecc2..17923d5bc35 100644 --- a/csharp/ql/src/API Abuse/FormatInvalid.ql +++ b/csharp/ql/src/API Abuse/FormatInvalid.ql @@ -29,7 +29,6 @@ private predicate invalidFormatString( source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and FormatInvalid::flowPath(source, sink) and - call.hasInsertions() and msg = "Invalid format string used in $@ formatting call." and callString = "this" } From 8fb5fe97aaa8c07ee70fd8452936216f11709434 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Fri, 4 Apr 2025 15:57:00 +0200 Subject: [PATCH 353/372] C#: Update test expected output. --- .../FormatInvalid/FormatInvalid.expected | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 57523031ece..798102dc350 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -7,12 +7,14 @@ | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | +| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:26 | call to method Format | this | FormatInvalid.cs:75:9:75:26 | call to method Format | this | | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this | | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this | | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this | | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this | | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this | | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this | +| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | @@ -41,15 +43,6 @@ | FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this | | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this | -| FormatInvalid.cs:124:9:124:32 | call to method WriteLine | FormatInvalid.cs:124:27:124:31 | "{0}" | FormatInvalid.cs:124:27:124:31 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:124:27:124:31 | "{0}" | this | FormatInvalid.cs:124:27:124:31 | "{0}" | this | -| FormatInvalid.cs:125:9:125:28 | call to method Write | FormatInvalid.cs:125:23:125:27 | "{0}" | FormatInvalid.cs:125:23:125:27 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:125:23:125:27 | "{0}" | this | FormatInvalid.cs:125:23:125:27 | "{0}" | this | -| FormatInvalid.cs:126:9:126:27 | call to method WriteLine | FormatInvalid.cs:126:22:126:26 | "{0}" | FormatInvalid.cs:126:22:126:26 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:126:22:126:26 | "{0}" | this | FormatInvalid.cs:126:22:126:26 | "{0}" | this | -| FormatInvalid.cs:127:9:127:23 | call to method Write | FormatInvalid.cs:127:18:127:22 | "{0}" | FormatInvalid.cs:127:18:127:22 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:127:18:127:22 | "{0}" | this | FormatInvalid.cs:127:18:127:22 | "{0}" | this | -| FormatInvalid.cs:128:9:128:45 | call to method Print | FormatInvalid.cs:128:40:128:44 | "{0}" | FormatInvalid.cs:128:40:128:44 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:128:40:128:44 | "{0}" | this | FormatInvalid.cs:128:40:128:44 | "{0}" | this | -| FormatInvalid.cs:131:9:131:50 | call to method TraceError | FormatInvalid.cs:131:45:131:49 | "{0}" | FormatInvalid.cs:131:45:131:49 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:131:45:131:49 | "{0}" | this | FormatInvalid.cs:131:45:131:49 | "{0}" | this | -| FormatInvalid.cs:132:9:132:56 | call to method TraceInformation | FormatInvalid.cs:132:51:132:55 | "{0}" | FormatInvalid.cs:132:51:132:55 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:132:51:132:55 | "{0}" | this | FormatInvalid.cs:132:51:132:55 | "{0}" | this | -| FormatInvalid.cs:133:9:133:52 | call to method TraceWarning | FormatInvalid.cs:133:47:133:51 | "{0}" | FormatInvalid.cs:133:47:133:51 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:133:47:133:51 | "{0}" | this | FormatInvalid.cs:133:47:133:51 | "{0}" | this | -| FormatInvalid.cs:134:9:134:34 | call to method TraceInformation | FormatInvalid.cs:134:29:134:33 | "{0}" | FormatInvalid.cs:134:29:134:33 | "{0}" | Argument '{0}' has not been supplied to $@ format string. | FormatInvalid.cs:134:29:134:33 | "{0}" | this | FormatInvalid.cs:134:29:134:33 | "{0}" | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | | FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | @@ -133,16 +126,6 @@ nodes | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | | FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" | | FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" | -| FormatInvalid.cs:121:27:121:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:124:27:124:31 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:125:23:125:27 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:126:22:126:26 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:127:18:127:22 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:128:40:128:44 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:131:45:131:49 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:132:51:132:55 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:133:47:133:51 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:134:29:134:33 | "{0}" | semmle.label | "{0}" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | | FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" | @@ -172,33 +155,3 @@ nodes | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -testFailures -| FormatInvalid.cs:75:29:75:38 | // ... | Missing result: Alert | -| FormatInvalid.cs:83:31:83:40 | // ... | Missing result: Alert | -| FormatInvalid.cs:124:9:124:32 | FormatInvalid.cs:124:27:124:31 | Unexpected result: Alert | -| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:124:27:124:31 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:125:9:125:28 | FormatInvalid.cs:125:23:125:27 | Unexpected result: Alert | -| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:125:23:125:27 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:126:9:126:27 | FormatInvalid.cs:126:22:126:26 | Unexpected result: Alert | -| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:126:22:126:26 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:127:9:127:23 | FormatInvalid.cs:127:18:127:22 | Unexpected result: Alert | -| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:127:18:127:22 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:128:9:128:45 | FormatInvalid.cs:128:40:128:44 | Unexpected result: Alert | -| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:128:40:128:44 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:131:9:131:50 | FormatInvalid.cs:131:45:131:49 | Unexpected result: Alert | -| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:131:45:131:49 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:132:9:132:56 | FormatInvalid.cs:132:51:132:55 | Unexpected result: Alert | -| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:132:51:132:55 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:133:9:133:52 | FormatInvalid.cs:133:47:133:51 | Unexpected result: Alert | -| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:133:47:133:51 | "{0}" | Unexpected result: Sink | -| FormatInvalid.cs:134:9:134:34 | FormatInvalid.cs:134:29:134:33 | Unexpected result: Alert | -| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Alert | -| FormatInvalid.cs:134:29:134:33 | "{0}" | Unexpected result: Sink | From 11dffc6647736598bd0957d9dcbf82d1214d9091 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 14:41:21 +0200 Subject: [PATCH 354/372] C#: Add more invalid-string-formatting testcases. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 23 ++ .../FormatInvalid/FormatInvalid.expected | 281 ++++++++++-------- .../FormatInvalid/FormatMissingArgument.cs | 55 ++++ .../FormatInvalid/FormatUnusedArgument.cs | 42 +++ 4 files changed, 283 insertions(+), 118 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index 4072dfbd688..2690ec50890 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using System.Text; class FormatInvalid @@ -134,5 +135,27 @@ class FormatInvalid ts.TraceInformation("{0}"); // GOOD } + void CompositeFormatMethods() + { + var format = CompositeFormat.Parse("}"); // $ Alert + + // GOOD: Format is invalid and this flagged during parsing. + String.Format(null, format, ""); + String.Format(null, format, "", ""); + String.Format(null, format, "", "", ""); + + sb.AppendFormat(null, format, ""); + sb.AppendFormat(null, format, ""); + sb.AppendFormat(null, format, "", ""); + sb.AppendFormat(null, format, "", "", ""); + + + var span = new Span(); + span.TryWrite(null, format, out _); + span.TryWrite(null, format, out _, new object()); + span.TryWrite(null, format, out _, new object(), new object()); + span.TryWrite(null, format, out _, "", "", ""); + } + System.IO.StringWriter sw; } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 798102dc350..3d23145b406 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -1,157 +1,202 @@ #select -| FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | FormatInvalid.cs:27:23:27:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:27:9:27:32 | call to method Format | this | FormatInvalid.cs:27:9:27:32 | call to method Format | this | -| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | FormatInvalid.cs:30:23:30:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:30:9:30:35 | call to method Format | this | FormatInvalid.cs:30:9:30:35 | call to method Format | this | -| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | FormatInvalid.cs:33:23:33:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:33:9:33:34 | call to method Format | this | FormatInvalid.cs:33:9:33:34 | call to method Format | this | -| FormatInvalid.cs:36:9:36:30 | call to method Format | FormatInvalid.cs:36:23:36:26 | "%d" | FormatInvalid.cs:36:23:36:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:36:23:36:26 | "%d" | format string | FormatInvalid.cs:36:29:36:29 | (...) ... | this supplied value | -| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:39:9:39:40 | call to method Format | this | FormatInvalid.cs:39:9:39:40 | call to method Format | this | -| FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | FormatInvalid.cs:42:23:42:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:42:9:42:35 | call to method Format | this | FormatInvalid.cs:42:9:42:35 | call to method Format | this | -| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:45:9:45:36 | call to method Format | this | FormatInvalid.cs:45:9:45:36 | call to method Format | this | -| FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | FormatInvalid.cs:51:23:51:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:51:9:51:32 | call to method Format | this | FormatInvalid.cs:51:9:51:32 | call to method Format | this | -| FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | FormatInvalid.cs:75:23:75:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:75:9:75:26 | call to method Format | this | FormatInvalid.cs:75:9:75:26 | call to method Format | this | -| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:29 | call to method Format | this | FormatInvalid.cs:76:9:76:29 | call to method Format | this | -| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:30 | call to method Format | this | FormatInvalid.cs:77:9:77:30 | call to method Format | this | -| FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | FormatInvalid.cs:78:27:78:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:34 | call to method Format | this | FormatInvalid.cs:78:9:78:34 | call to method Format | this | -| FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | FormatInvalid.cs:79:23:79:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:32 | call to method Format | this | FormatInvalid.cs:79:9:79:32 | call to method Format | this | -| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:35 | call to method Format | this | FormatInvalid.cs:80:9:80:35 | call to method Format | this | -| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:38 | call to method Format | this | FormatInvalid.cs:81:9:81:38 | call to method Format | this | -| FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | FormatInvalid.cs:83:25:83:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | FormatInvalid.cs:83:9:83:28 | call to method AppendFormat | this | -| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:31 | call to method AppendFormat | this | -| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:32 | call to method AppendFormat | this | -| FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | FormatInvalid.cs:86:29:86:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:36 | call to method AppendFormat | this | -| FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | FormatInvalid.cs:87:25:87:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:34 | call to method AppendFormat | this | -| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:37 | call to method AppendFormat | this | -| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:40 | call to method AppendFormat | this | -| FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | FormatInvalid.cs:91:27:91:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | FormatInvalid.cs:91:9:91:33 | call to method WriteLine | this | -| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:34 | call to method WriteLine | this | -| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:36 | call to method WriteLine | this | -| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:39 | call to method WriteLine | this | -| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:42 | call to method WriteLine | this | -| FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | FormatInvalid.cs:97:22:97:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | FormatInvalid.cs:97:9:97:28 | call to method WriteLine | this | -| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:29 | call to method WriteLine | this | -| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:31 | call to method WriteLine | this | -| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:34 | call to method WriteLine | this | -| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:37 | call to method WriteLine | this | -| FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | FormatInvalid.cs:103:44:103:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | FormatInvalid.cs:103:9:103:51 | call to method WriteLine | this | -| FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | FormatInvalid.cs:104:45:104:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | FormatInvalid.cs:104:9:104:51 | call to method TraceError | this | -| FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | FormatInvalid.cs:105:51:105:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | FormatInvalid.cs:105:9:105:57 | call to method TraceInformation | this | -| FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | FormatInvalid.cs:106:47:106:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | FormatInvalid.cs:106:9:106:53 | call to method TraceWarning | this | -| FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | FormatInvalid.cs:107:29:107:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | FormatInvalid.cs:107:9:107:35 | call to method TraceInformation | this | -| FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | FormatInvalid.cs:109:23:109:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:109:9:109:29 | call to method Write | this | FormatInvalid.cs:109:9:109:29 | call to method Write | this | -| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:32 | call to method Write | this | FormatInvalid.cs:110:9:110:32 | call to method Write | this | -| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:35 | call to method Write | this | FormatInvalid.cs:111:9:111:35 | call to method Write | this | -| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:38 | call to method Write | this | FormatInvalid.cs:112:9:112:38 | call to method Write | this | -| FormatInvalid.cs:117:56:117:58 | "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | FormatInvalid.cs:117:9:117:63 | call to method Assert | this | -| FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | FormatInvalid.cs:118:18:118:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:24 | call to method Write | this | FormatInvalid.cs:118:9:118:24 | call to method Write | this | -| FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | FormatInvalid.cs:119:40:119:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:47 | call to method Print | this | FormatInvalid.cs:119:9:119:47 | call to method Print | this | +| FormatInvalid.cs:28:23:28:28 | "{ 0}" | FormatInvalid.cs:28:23:28:28 | "{ 0}" | FormatInvalid.cs:28:23:28:28 | "{ 0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:28:9:28:32 | call to method Format | this | FormatInvalid.cs:28:9:28:32 | call to method Format | this | +| FormatInvalid.cs:31:23:31:31 | "{0,--1}" | FormatInvalid.cs:31:23:31:31 | "{0,--1}" | FormatInvalid.cs:31:23:31:31 | "{0,--1}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:31:9:31:35 | call to method Format | this | FormatInvalid.cs:31:9:31:35 | call to method Format | this | +| FormatInvalid.cs:34:23:34:30 | "{0:{}}" | FormatInvalid.cs:34:23:34:30 | "{0:{}}" | FormatInvalid.cs:34:23:34:30 | "{0:{}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:34:9:34:34 | call to method Format | this | FormatInvalid.cs:34:9:34:34 | call to method Format | this | +| FormatInvalid.cs:37:9:37:30 | call to method Format | FormatInvalid.cs:37:23:37:26 | "%d" | FormatInvalid.cs:37:23:37:26 | "%d" | The $@ ignores $@. | FormatInvalid.cs:37:23:37:26 | "%d" | format string | FormatInvalid.cs:37:29:37:29 | (...) ... | this supplied value | +| FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:40:9:40:40 | call to method Format | this | FormatInvalid.cs:40:9:40:40 | call to method Format | this | +| FormatInvalid.cs:43:23:43:28 | "{0}}" | FormatInvalid.cs:43:23:43:28 | "{0}}" | FormatInvalid.cs:43:23:43:28 | "{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:43:9:43:35 | call to method Format | this | FormatInvalid.cs:43:9:43:35 | call to method Format | this | +| FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:46:9:46:36 | call to method Format | this | FormatInvalid.cs:46:9:46:36 | call to method Format | this | +| FormatInvalid.cs:52:23:52:28 | "}{0}" | FormatInvalid.cs:52:23:52:28 | "}{0}" | FormatInvalid.cs:52:23:52:28 | "}{0}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:52:9:52:32 | call to method Format | this | FormatInvalid.cs:52:9:52:32 | call to method Format | this | +| FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | FormatInvalid.cs:76:23:76:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:76:9:76:26 | call to method Format | this | FormatInvalid.cs:76:9:76:26 | call to method Format | this | +| FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | FormatInvalid.cs:77:23:77:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:77:9:77:29 | call to method Format | this | FormatInvalid.cs:77:9:77:29 | call to method Format | this | +| FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | FormatInvalid.cs:78:23:78:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:78:9:78:30 | call to method Format | this | FormatInvalid.cs:78:9:78:30 | call to method Format | this | +| FormatInvalid.cs:79:27:79:29 | "}" | FormatInvalid.cs:79:27:79:29 | "}" | FormatInvalid.cs:79:27:79:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:79:9:79:34 | call to method Format | this | FormatInvalid.cs:79:9:79:34 | call to method Format | this | +| FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | FormatInvalid.cs:80:23:80:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:80:9:80:32 | call to method Format | this | FormatInvalid.cs:80:9:80:32 | call to method Format | this | +| FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | FormatInvalid.cs:81:23:81:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:81:9:81:35 | call to method Format | this | FormatInvalid.cs:81:9:81:35 | call to method Format | this | +| FormatInvalid.cs:82:23:82:25 | "}" | FormatInvalid.cs:82:23:82:25 | "}" | FormatInvalid.cs:82:23:82:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:82:9:82:38 | call to method Format | this | FormatInvalid.cs:82:9:82:38 | call to method Format | this | +| FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | FormatInvalid.cs:84:25:84:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:84:9:84:28 | call to method AppendFormat | this | FormatInvalid.cs:84:9:84:28 | call to method AppendFormat | this | +| FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | FormatInvalid.cs:85:25:85:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:85:9:85:31 | call to method AppendFormat | this | FormatInvalid.cs:85:9:85:31 | call to method AppendFormat | this | +| FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | FormatInvalid.cs:86:25:86:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:86:9:86:32 | call to method AppendFormat | this | FormatInvalid.cs:86:9:86:32 | call to method AppendFormat | this | +| FormatInvalid.cs:87:29:87:31 | "}" | FormatInvalid.cs:87:29:87:31 | "}" | FormatInvalid.cs:87:29:87:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:87:9:87:36 | call to method AppendFormat | this | FormatInvalid.cs:87:9:87:36 | call to method AppendFormat | this | +| FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | FormatInvalid.cs:88:25:88:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:88:9:88:34 | call to method AppendFormat | this | FormatInvalid.cs:88:9:88:34 | call to method AppendFormat | this | +| FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | FormatInvalid.cs:89:25:89:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:89:9:89:37 | call to method AppendFormat | this | FormatInvalid.cs:89:9:89:37 | call to method AppendFormat | this | +| FormatInvalid.cs:90:25:90:27 | "}" | FormatInvalid.cs:90:25:90:27 | "}" | FormatInvalid.cs:90:25:90:27 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:90:9:90:40 | call to method AppendFormat | this | FormatInvalid.cs:90:9:90:40 | call to method AppendFormat | this | +| FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | FormatInvalid.cs:92:27:92:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:92:9:92:33 | call to method WriteLine | this | FormatInvalid.cs:92:9:92:33 | call to method WriteLine | this | +| FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | FormatInvalid.cs:93:27:93:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:93:9:93:34 | call to method WriteLine | this | FormatInvalid.cs:93:9:93:34 | call to method WriteLine | this | +| FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | FormatInvalid.cs:94:27:94:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:94:9:94:36 | call to method WriteLine | this | FormatInvalid.cs:94:9:94:36 | call to method WriteLine | this | +| FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | FormatInvalid.cs:95:27:95:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:95:9:95:39 | call to method WriteLine | this | FormatInvalid.cs:95:9:95:39 | call to method WriteLine | this | +| FormatInvalid.cs:96:27:96:29 | "}" | FormatInvalid.cs:96:27:96:29 | "}" | FormatInvalid.cs:96:27:96:29 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:96:9:96:42 | call to method WriteLine | this | FormatInvalid.cs:96:9:96:42 | call to method WriteLine | this | +| FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | FormatInvalid.cs:98:22:98:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:98:9:98:28 | call to method WriteLine | this | FormatInvalid.cs:98:9:98:28 | call to method WriteLine | this | +| FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | FormatInvalid.cs:99:22:99:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:99:9:99:29 | call to method WriteLine | this | FormatInvalid.cs:99:9:99:29 | call to method WriteLine | this | +| FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | FormatInvalid.cs:100:22:100:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:100:9:100:31 | call to method WriteLine | this | FormatInvalid.cs:100:9:100:31 | call to method WriteLine | this | +| FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | FormatInvalid.cs:101:22:101:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:101:9:101:34 | call to method WriteLine | this | FormatInvalid.cs:101:9:101:34 | call to method WriteLine | this | +| FormatInvalid.cs:102:22:102:24 | "}" | FormatInvalid.cs:102:22:102:24 | "}" | FormatInvalid.cs:102:22:102:24 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:102:9:102:37 | call to method WriteLine | this | FormatInvalid.cs:102:9:102:37 | call to method WriteLine | this | +| FormatInvalid.cs:104:44:104:46 | "}" | FormatInvalid.cs:104:44:104:46 | "}" | FormatInvalid.cs:104:44:104:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:104:9:104:51 | call to method WriteLine | this | FormatInvalid.cs:104:9:104:51 | call to method WriteLine | this | +| FormatInvalid.cs:105:45:105:47 | "}" | FormatInvalid.cs:105:45:105:47 | "}" | FormatInvalid.cs:105:45:105:47 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:105:9:105:51 | call to method TraceError | this | FormatInvalid.cs:105:9:105:51 | call to method TraceError | this | +| FormatInvalid.cs:106:51:106:53 | "}" | FormatInvalid.cs:106:51:106:53 | "}" | FormatInvalid.cs:106:51:106:53 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:106:9:106:57 | call to method TraceInformation | this | FormatInvalid.cs:106:9:106:57 | call to method TraceInformation | this | +| FormatInvalid.cs:107:47:107:49 | "}" | FormatInvalid.cs:107:47:107:49 | "}" | FormatInvalid.cs:107:47:107:49 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:107:9:107:53 | call to method TraceWarning | this | FormatInvalid.cs:107:9:107:53 | call to method TraceWarning | this | +| FormatInvalid.cs:108:29:108:31 | "}" | FormatInvalid.cs:108:29:108:31 | "}" | FormatInvalid.cs:108:29:108:31 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:108:9:108:35 | call to method TraceInformation | this | FormatInvalid.cs:108:9:108:35 | call to method TraceInformation | this | +| FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | FormatInvalid.cs:110:23:110:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:110:9:110:29 | call to method Write | this | FormatInvalid.cs:110:9:110:29 | call to method Write | this | +| FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | FormatInvalid.cs:111:23:111:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:111:9:111:32 | call to method Write | this | FormatInvalid.cs:111:9:111:32 | call to method Write | this | +| FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | FormatInvalid.cs:112:23:112:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:112:9:112:35 | call to method Write | this | FormatInvalid.cs:112:9:112:35 | call to method Write | this | +| FormatInvalid.cs:113:23:113:25 | "}" | FormatInvalid.cs:113:23:113:25 | "}" | FormatInvalid.cs:113:23:113:25 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:113:9:113:38 | call to method Write | this | FormatInvalid.cs:113:9:113:38 | call to method Write | this | +| FormatInvalid.cs:118:56:118:58 | "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | +| FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:24 | call to method Write | this | FormatInvalid.cs:119:9:119:24 | call to method Write | this | +| FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:120:9:120:47 | call to method Print | this | FormatInvalid.cs:120:9:120:47 | call to method Print | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | FormatMissingArgument.cs:11:23:11:27 | "{1}" | this | -| FormatMissingArgument.cs:11:9:11:31 | call to method Format | FormatMissingArgument.cs:11:23:11:27 | "{1}" | FormatMissingArgument.cs:11:23:11:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:11:23:11:27 | "{1}" | format string | FormatMissingArgument.cs:11:30:11:30 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | this | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:34:14:34 | (...) ... | this supplied value | -| FormatMissingArgument.cs:14:9:14:38 | call to method Format | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | format string | FormatMissingArgument.cs:14:37:14:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | FormatMissingArgument.cs:22:16:22:20 | "{1}" | this | -| FormatMissingArgument.cs:28:9:28:32 | call to method Format | FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:22:16:22:20 | "{1}" | format string | FormatMissingArgument.cs:28:31:28:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | +| FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | format string | FormatMissingArgument.cs:12:30:12:30 | (...) ... | this supplied value | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:34:15:34 | (...) ... | this supplied value | +| FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | +| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | +| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | format string | FormatMissingArgument.cs:29:31:29:31 | (...) ... | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | -| FormatUnusedArgument.cs:11:9:11:29 | call to method Format | FormatUnusedArgument.cs:11:23:11:25 | "X" | FormatUnusedArgument.cs:11:23:11:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:11:23:11:25 | "X" | format string | FormatUnusedArgument.cs:11:28:11:28 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:14:9:14:34 | call to method Format | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:14:23:14:27 | "{0}" | format string | FormatUnusedArgument.cs:14:33:14:33 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:17:9:17:38 | call to method Format | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:17:37:17:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:20:9:20:38 | call to method Format | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:20:34:20:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:34:23:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:37:23:37 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:23:9:23:41 | call to method Format | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | format string | FormatUnusedArgument.cs:23:40:23:40 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:26:9:26:35 | call to method Format | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:26:34:26:34 | (...) ... | this supplied value | -| FormatUnusedArgument.cs:38:9:38:33 | call to method Format | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | format string | FormatUnusedArgument.cs:38:32:38:32 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:12:9:12:29 | call to method Format | FormatUnusedArgument.cs:12:23:12:25 | "X" | FormatUnusedArgument.cs:12:23:12:25 | "X" | The $@ ignores $@. | FormatUnusedArgument.cs:12:23:12:25 | "X" | format string | FormatUnusedArgument.cs:12:28:12:28 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:15:9:15:34 | call to method Format | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | The $@ ignores $@. | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | format string | FormatUnusedArgument.cs:15:33:15:33 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:18:9:18:38 | call to method Format | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | The $@ ignores $@. | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | format string | FormatUnusedArgument.cs:18:37:18:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:21:9:21:38 | call to method Format | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | The $@ ignores $@. | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | format string | FormatUnusedArgument.cs:21:34:21:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:34:24:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:37:24:37 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:40:24:40 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:27:9:27:35 | call to method Format | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:27:34:27:34 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:39:9:39:33 | call to method Format | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | format string | FormatUnusedArgument.cs:39:32:39:32 | (...) ... | this supplied value | | FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | | FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges -| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | FormatMissingArgument.cs:25:24:25:29 | format : String | provenance | | -| FormatMissingArgument.cs:25:24:25:29 | format : String | FormatMissingArgument.cs:28:23:28:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | +| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | nodes -| FormatInvalid.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | -| FormatInvalid.cs:12:23:12:29 | "{0,1}" | semmle.label | "{0,1}" | -| FormatInvalid.cs:15:23:15:31 | "{0, 1}" | semmle.label | "{0, 1}" | -| FormatInvalid.cs:18:23:18:30 | "{0,-1}" | semmle.label | "{0,-1}" | -| FormatInvalid.cs:21:23:21:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | -| FormatInvalid.cs:24:23:24:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | -| FormatInvalid.cs:27:23:27:28 | "{ 0}" | semmle.label | "{ 0}" | -| FormatInvalid.cs:30:23:30:31 | "{0,--1}" | semmle.label | "{0,--1}" | -| FormatInvalid.cs:33:23:33:30 | "{0:{}}" | semmle.label | "{0:{}}" | -| FormatInvalid.cs:36:23:36:26 | "%d" | semmle.label | "%d" | -| FormatInvalid.cs:39:23:39:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | -| FormatInvalid.cs:42:23:42:28 | "{0}}" | semmle.label | "{0}}" | -| FormatInvalid.cs:45:23:45:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | -| FormatInvalid.cs:48:23:48:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | -| FormatInvalid.cs:51:23:51:28 | "}{0}" | semmle.label | "}{0}" | -| FormatInvalid.cs:54:23:54:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | -| FormatInvalid.cs:57:23:57:29 | "{0}{{" | semmle.label | "{0}{{" | -| FormatInvalid.cs:58:23:58:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | -| FormatInvalid.cs:75:23:75:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:10:23:10:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:13:23:13:29 | "{0,1}" | semmle.label | "{0,1}" | +| FormatInvalid.cs:16:23:16:31 | "{0, 1}" | semmle.label | "{0, 1}" | +| FormatInvalid.cs:19:23:19:30 | "{0,-1}" | semmle.label | "{0,-1}" | +| FormatInvalid.cs:22:23:22:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | +| FormatInvalid.cs:25:23:25:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | +| FormatInvalid.cs:28:23:28:28 | "{ 0}" | semmle.label | "{ 0}" | +| FormatInvalid.cs:31:23:31:31 | "{0,--1}" | semmle.label | "{0,--1}" | +| FormatInvalid.cs:34:23:34:30 | "{0:{}}" | semmle.label | "{0:{}}" | +| FormatInvalid.cs:37:23:37:26 | "%d" | semmle.label | "%d" | +| FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | +| FormatInvalid.cs:43:23:43:28 | "{0}}" | semmle.label | "{0}}" | +| FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | +| FormatInvalid.cs:49:23:49:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | +| FormatInvalid.cs:52:23:52:28 | "}{0}" | semmle.label | "}{0}" | +| FormatInvalid.cs:55:23:55:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | +| FormatInvalid.cs:58:23:58:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:59:23:59:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:78:27:78:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:79:23:79:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:79:27:79:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:83:25:83:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:82:23:82:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:86:29:86:31 | "}" | semmle.label | "}" | -| FormatInvalid.cs:87:25:87:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:87:29:87:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | -| FormatInvalid.cs:91:27:91:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:90:25:90:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | -| FormatInvalid.cs:97:22:97:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:96:27:96:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | -| FormatInvalid.cs:103:44:103:46 | "}" | semmle.label | "}" | -| FormatInvalid.cs:104:45:104:47 | "}" | semmle.label | "}" | -| FormatInvalid.cs:105:51:105:53 | "}" | semmle.label | "}" | -| FormatInvalid.cs:106:47:106:49 | "}" | semmle.label | "}" | -| FormatInvalid.cs:107:29:107:31 | "}" | semmle.label | "}" | -| FormatInvalid.cs:109:23:109:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:102:22:102:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:104:44:104:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:105:45:105:47 | "}" | semmle.label | "}" | +| FormatInvalid.cs:106:51:106:53 | "}" | semmle.label | "}" | +| FormatInvalid.cs:107:47:107:49 | "}" | semmle.label | "}" | +| FormatInvalid.cs:108:29:108:31 | "}" | semmle.label | "}" | | FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | -| FormatInvalid.cs:117:56:117:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | -| FormatInvalid.cs:118:18:118:20 | "}" | semmle.label | "}" | -| FormatInvalid.cs:119:40:119:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:113:23:113:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | +| FormatInvalid.cs:119:18:119:20 | "}" | semmle.label | "}" | +| FormatInvalid.cs:120:40:120:42 | "}" | semmle.label | "}" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | -| FormatMissingArgument.cs:8:23:8:27 | "{0}" | semmle.label | "{0}" | -| FormatMissingArgument.cs:11:23:11:27 | "{1}" | semmle.label | "{1}" | -| FormatMissingArgument.cs:14:23:14:31 | "{2} {3}" | semmle.label | "{2} {3}" | -| FormatMissingArgument.cs:17:23:17:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatMissingArgument.cs:20:23:20:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatMissingArgument.cs:22:16:22:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:25:24:25:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:28:23:28:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:12:23:12:27 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | +| FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | | FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | -| FormatUnusedArgument.cs:8:23:8:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatUnusedArgument.cs:11:23:11:25 | "X" | semmle.label | "X" | -| FormatUnusedArgument.cs:14:23:14:27 | "{0}" | semmle.label | "{0}" | -| FormatUnusedArgument.cs:17:23:17:31 | "{0} {0}" | semmle.label | "{0} {0}" | -| FormatUnusedArgument.cs:20:23:20:31 | "{1} {1}" | semmle.label | "{1} {1}" | -| FormatUnusedArgument.cs:23:23:23:31 | "abcdefg" | semmle.label | "abcdefg" | -| FormatUnusedArgument.cs:26:23:26:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | -| FormatUnusedArgument.cs:29:23:29:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | -| FormatUnusedArgument.cs:32:23:32:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatUnusedArgument.cs:35:23:35:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatUnusedArgument.cs:38:23:38:29 | "{{0}}" | semmle.label | "{{0}}" | -| FormatUnusedArgument.cs:42:23:42:24 | "" | semmle.label | "" | +| FormatUnusedArgument.cs:9:23:9:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:12:23:12:25 | "X" | semmle.label | "X" | +| FormatUnusedArgument.cs:15:23:15:27 | "{0}" | semmle.label | "{0}" | +| FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | semmle.label | "{0} {0}" | +| FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | semmle.label | "{1} {1}" | +| FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | semmle.label | "abcdefg" | +| FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | +| FormatUnusedArgument.cs:30:23:30:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | +| FormatUnusedArgument.cs:33:23:33:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatUnusedArgument.cs:36:23:36:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | semmle.label | "{{0}}" | +| FormatUnusedArgument.cs:43:23:43:24 | "" | semmle.label | "" | | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | semmle.label | "Error processing file: {0}" | | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths +testFailures +| FormatInvalid.cs:140:50:140:59 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:35:53:35:63 | // ... | Missing result: Source | +| FormatMissingArgument.cs:37:57:37:67 | // ... | Missing result: Source | +| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Sink | +| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Alert | +| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:48:50:48:60 | // ... | Missing result: Source | +| FormatUnusedArgument.cs:49:57:49:67 | // ... | Missing result: Source | +| FormatUnusedArgument.cs:50:57:50:67 | // ... | Missing result: Source | +| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Sink | +| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Alert | +| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Sink | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index fabe7b239e4..d059e7a5400 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -1,4 +1,5 @@ using System; +using System.Text; class Class1 { @@ -28,5 +29,59 @@ class Class1 String.Format(format, 0); // $ Alert Sink } + void TestCompositeFormatMissingArgument() + { + var format0 = CompositeFormat.Parse("{0}"); + var format1 = CompositeFormat.Parse("{1}"); // $ Source + var format01 = CompositeFormat.Parse("{0}{1}"); + var format23 = CompositeFormat.Parse("{2}{3}"); // $ Source + + // GOOD: All args supplied + String.Format(null, format0, ""); + + // BAD: Missing {1} + String.Format(null, format1, ""); // $ Alert Sink + + // GOOD: All args supplied + String.Format(null, format01, "", ""); + + // BAD: Missing {2} and {3} + String.Format(null, format23, "", ""); // $ Alert Sink + + + // GOOD: All arguments supplied + sb.AppendFormat(null, format0, ""); + sb.AppendFormat(null, format0, ""); + + // BAD: Missing {1} + sb.AppendFormat(null, format1, ""); // $ Alert Sink + sb.AppendFormat(null, format1, ""); // $ Alert Sink + + // GOOD: All args supplied + sb.AppendFormat(null, format01, "", ""); + + // BAD: Missing {2} and {3} + sb.AppendFormat(null, format23, "", ""); // $ Alert Sink + + + var span = new Span(); + + // GOOD: All args supplied + span.TryWrite(null, format0, out _, ""); + span.TryWrite(null, format0, out _, ""); + + // BAD: Missing {1} + span.TryWrite(null, format1, out _, ""); // $ Alert Sink + span.TryWrite(null, format1, out _, ""); // $ Alert Sink + + // GOOD: All args supplied + span.TryWrite(null, format01, out _, "", ""); + + // BAD: Missing {2} and {3} + span.TryWrite(null, format23, out _, "", ""); // $ Alert Sink + } + object[] args; + + StringBuilder sb; } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index 61f69184087..77ef70338db 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -1,4 +1,5 @@ using System; +using System.Text; class C { @@ -42,5 +43,46 @@ class C String.Format("", 1); } + void CompositeFormatTests() + { + var format = CompositeFormat.Parse("X"); // $ Source + var format00 = CompositeFormat.Parse("{0}{0}"); // $ Source + var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source + + // BAD: Unused arg {0} + String.Format(null, format, ""); // $ Alert Sink + + // BAD: Unused arg {1} + String.Format(null, format00, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + String.Format(null, format11, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + sb.AppendFormat(null, format, ""); // $ Alert Sink + sb.AppendFormat(null, format, ""); // $ Alert Sink + + // BAD: Unused arg {1} + sb.AppendFormat(null, format00, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + sb.AppendFormat(null, format11, "", ""); // $ Alert Sink + + var span = new Span(); + + // BAD: Unused arg {0} + span.TryWrite(null, format, out _, ""); // $ Alert Sink + span.TryWrite(null, format, out _, ""); // $ Alert Sink + + // BAD: Unused arg {1} + span.TryWrite(null, format00, out _, "", ""); // $ Alert Sink + + // BAD: Unused arg {0} + span.TryWrite(null, format11, out _, "", ""); // $ Alert Sink + + } + object[] ps; + + StringBuilder sb; } From f31235db437487454f40650be843a987e031a44e Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 8 Apr 2025 16:46:14 +0200 Subject: [PATCH 355/372] C#: Improve format logic to take CompositeFormat and generics into account. --- .../semmle/code/csharp/frameworks/Format.qll | 29 ++++++++- .../semmle/code/csharp/frameworks/System.qll | 14 +++- .../code/csharp/frameworks/system/Text.qll | 15 ++++- csharp/ql/src/API Abuse/FormatInvalid.ql | 64 +++++++++++++++---- 4 files changed, 106 insertions(+), 16 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index db1d4e42d74..7bccf3e0e6b 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -14,13 +14,26 @@ abstract class FormatMethod extends Method { * `string.Format(IFormatProvider, String, Object)` is `1`. */ abstract int getFormatArgument(); + + /** + * Gets the argument number of the first supplied insert. + */ + int getFirstArgument() { result = this.getFormatArgument() + 1 } +} + +/** A class of types used for formatting. */ +private class FormatType extends Type { + FormatType() { + this instanceof StringType or + this instanceof SystemTextCompositeFormatClass + } } private class StringAndStringBuilderFormatMethods extends FormatMethod { StringAndStringBuilderFormatMethods() { ( this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and - this.getParameter(1).getType() instanceof StringType + this.getParameter(1).getType() instanceof FormatType or this.getParameter(0).getType() instanceof StringType ) and @@ -38,6 +51,18 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod { } } +private class SystemMemoryExtensionsFormatMethods extends FormatMethod { + SystemMemoryExtensionsFormatMethods() { + this = any(SystemMemoryExtensionsClass c).getTryWriteMethod() and + this.getParameter(1).getType() instanceof SystemIFormatProviderInterface and + this.getParameter(2).getType() instanceof SystemTextCompositeFormatClass + } + + override int getFormatArgument() { result = 2 } + + override int getFirstArgument() { result = this.getFormatArgument() + 2 } +} + private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { SystemConsoleAndSystemIoTextWriterFormatMethods() { this.getParameter(0).getType() instanceof StringType and @@ -220,7 +245,7 @@ class FormatCall extends MethodCall { int getFormatArgument() { result = this.getTarget().(FormatMethod).getFormatArgument() } /** Gets the argument number of the first supplied insert. */ - int getFirstArgument() { result = this.getFormatArgument() + 1 } + int getFirstArgument() { result = this.getTarget().(FormatMethod).getFirstArgument() } /** Holds if this call has one or more insertions. */ predicate hasInsertions() { exists(this.getArgument(this.getFirstArgument())) } diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll index 678563589e8..2681b9437b6 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/System.qll @@ -365,7 +365,7 @@ class SystemStringClass extends StringType { /** Gets a `Format(...)` method. */ Method getFormatMethod() { result.getDeclaringType() = this and - result.hasName("Format") and + result.getName().regexpMatch("Format(<.*>)?") and result.getNumberOfParameters() in [2 .. 5] and result.getReturnType() instanceof StringType } @@ -751,6 +751,18 @@ class SystemNotImplementedExceptionClass extends SystemClass { SystemNotImplementedExceptionClass() { this.hasName("NotImplementedException") } } +/** The `System.MemoryExtensions` class. */ +class SystemMemoryExtensionsClass extends SystemClass { + SystemMemoryExtensionsClass() { this.hasName("MemoryExtensions") } + + /** Gets a `TryWrite` method. */ + Method getTryWriteMethod() { + result.getDeclaringType() = this and + result.getName().regexpMatch("TryWrite(<.*>)?") and + result.getParameter(0).getType().getUnboundDeclaration() instanceof SystemSpanStruct + } +} + /** The `System.DateTime` struct. */ class SystemDateTimeStruct extends SystemStruct { SystemDateTimeStruct() { this.hasName("DateTime") } diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll index fb4c37489af..c5d44c7c9ad 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/system/Text.qll @@ -22,7 +22,12 @@ class SystemTextStringBuilderClass extends SystemTextClass { SystemTextStringBuilderClass() { this.hasName("StringBuilder") } /** Gets the `AppendFormat` method. */ - Method getAppendFormatMethod() { result = this.getAMethod("AppendFormat") } + Method getAppendFormatMethod() { + exists(string name | + name.regexpMatch("AppendFormat(<.*>)?") and + result = this.getAMethod(name) + ) + } } /** The `System.Text.Encoding` class. */ @@ -38,3 +43,11 @@ class SystemTextEncodingClass extends SystemTextClass { /** Gets the `GetChars` method. */ Method getGetCharsMethod() { result = this.getAMethod("GetChars") } } + +/** The `System.Text.CompositeFormat` class */ +class SystemTextCompositeFormatClass extends SystemTextClass { + SystemTextCompositeFormatClass() { this.hasName("CompositeFormat") } + + /** Gets the `Parse` method. */ + Method getParseMethod() { result = this.getAMethod("Parse") } +} diff --git a/csharp/ql/src/API Abuse/FormatInvalid.ql b/csharp/ql/src/API Abuse/FormatInvalid.ql index 17923d5bc35..a2b8ef5e222 100644 --- a/csharp/ql/src/API Abuse/FormatInvalid.ql +++ b/csharp/ql/src/API Abuse/FormatInvalid.ql @@ -11,20 +11,59 @@ */ import csharp +import semmle.code.csharp.frameworks.system.Text import semmle.code.csharp.frameworks.Format -import FormatInvalid::PathGraph +import FormatFlow::PathGraph + +abstract class FormatStringParseCall extends MethodCall { + abstract Expr getFormatExpr(); +} + +class OrdinaryFormatCall extends FormatStringParseCall instanceof FormatCall { + override Expr getFormatExpr() { result = FormatCall.super.getFormatExpr() } +} + +class ParseFormatStringCall extends FormatStringParseCall { + ParseFormatStringCall() { + this.getTarget() = any(SystemTextCompositeFormatClass x).getParseMethod() + } + + override Expr getFormatExpr() { result = this.getArgument(0) } +} module FormatInvalidConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node n) { n.asExpr() instanceof StringLiteral } - predicate isSink(DataFlow::Node n) { exists(FormatCall c | n.asExpr() = c.getFormatExpr()) } + predicate isSink(DataFlow::Node n) { + exists(FormatStringParseCall c | n.asExpr() = c.getFormatExpr()) + } } module FormatInvalid = DataFlow::Global; +module FormatLiteralConfig implements DataFlow::ConfigSig { + predicate isSource(DataFlow::Node n) { n.asExpr() instanceof StringLiteral } + + predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) { + // Add flow via `System.Text.CompositeFormat.Parse`. + exists(ParseFormatStringCall call | + pred.asExpr() = call.getFormatExpr() and + succ.asExpr() = call + ) + } + + predicate isSink(DataFlow::Node n) { exists(FormatCall c | n.asExpr() = c.getFormatExpr()) } +} + +module FormatLiteral = DataFlow::Global; + +module FormatFlow = + DataFlow::MergePathGraph; + private predicate invalidFormatString( InvalidFormatString src, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, - FormatCall call, string callString + FormatStringParseCall call, string callString ) { source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and @@ -34,13 +73,13 @@ private predicate invalidFormatString( } private predicate unusedArgument( - FormatCall call, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, + FormatCall call, FormatLiteral::PathNode source, FormatLiteral::PathNode sink, string msg, ValidFormatString src, string srcString, Expr unusedExpr, string unusedString ) { exists(int unused | source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and - FormatInvalid::flowPath(source, sink) and + FormatLiteral::flowPath(source, sink) and unused = call.getASuppliedArgument() and not unused = src.getAnInsert() and not src.getValue() = "" and @@ -52,13 +91,13 @@ private predicate unusedArgument( } private predicate missingArgument( - FormatCall call, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, + FormatCall call, FormatLiteral::PathNode source, FormatLiteral::PathNode sink, string msg, ValidFormatString src, string srcString ) { exists(int used, int supplied | source.getNode().asExpr() = src and sink.getNode().asExpr() = call.getFormatExpr() and - FormatInvalid::flowPath(source, sink) and + FormatLiteral::flowPath(source, sink) and used = src.getAnInsert() and supplied = call.getSuppliedArguments() and used >= supplied and @@ -68,16 +107,17 @@ private predicate missingArgument( } from - Element alert, FormatInvalid::PathNode source, FormatInvalid::PathNode sink, string msg, - Element extra1, string extra1String, Element extra2, string extra2String + Element alert, FormatFlow::PathNode source, FormatFlow::PathNode sink, string msg, Element extra1, + string extra1String, Element extra2, string extra2String where - invalidFormatString(alert, source, sink, msg, extra1, extra1String) and + invalidFormatString(alert, source.asPathNode1(), sink.asPathNode1(), msg, extra1, extra1String) and extra2 = extra1 and extra2String = extra1String or - unusedArgument(alert, source, sink, msg, extra1, extra1String, extra2, extra2String) + unusedArgument(alert, source.asPathNode2(), sink.asPathNode2(), msg, extra1, extra1String, extra2, + extra2String) or - missingArgument(alert, source, sink, msg, extra1, extra1String) and + missingArgument(alert, source.asPathNode2(), sink.asPathNode2(), msg, extra1, extra1String) and extra2 = extra1 and extra2String = extra1String select alert, source, sink, msg, extra1, extra1String, extra2, extra2String From 39abd5c0047cf9219565f200799f76ddb1f6730c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 14:42:44 +0200 Subject: [PATCH 356/372] C#: Update test expected output. --- .../FormatInvalid/FormatInvalid.expected | 287 +++++++++++++++--- 1 file changed, 242 insertions(+), 45 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 3d23145b406..ddbdd5c4fb5 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -43,6 +43,7 @@ | FormatInvalid.cs:118:56:118:58 | "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | FormatInvalid.cs:118:9:118:63 | call to method Assert | this | | FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | FormatInvalid.cs:119:18:119:20 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:119:9:119:24 | call to method Write | this | FormatInvalid.cs:119:9:119:24 | call to method Write | this | | FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | FormatInvalid.cs:120:40:120:42 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:120:9:120:47 | call to method Print | this | FormatInvalid.cs:120:9:120:47 | call to method Print | this | +| FormatInvalid.cs:140:44:140:46 | "}" | FormatInvalid.cs:140:44:140:46 | "}" | FormatInvalid.cs:140:44:140:46 | "}" | Invalid format string used in $@ formatting call. | FormatInvalid.cs:140:22:140:47 | call to method Parse | this | FormatInvalid.cs:140:22:140:47 | call to method Parse | this | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | Invalid format string used in $@ formatting call. | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | FormatInvalidBad.cs:7:16:7:50 | call to method Format | this | | FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | FormatMissingArgument.cs:12:23:12:27 | "{1}" | this | | FormatMissingArgument.cs:12:9:12:31 | call to method Format | FormatMissingArgument.cs:12:23:12:27 | "{1}" | FormatMissingArgument.cs:12:23:12:27 | "{1}" | The $@ ignores $@. | FormatMissingArgument.cs:12:23:12:27 | "{1}" | format string | FormatMissingArgument.cs:12:30:12:30 | (...) ... | this supplied value | @@ -52,6 +53,28 @@ | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | | FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | | FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | format string | FormatMissingArgument.cs:29:31:29:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:43:46:43:47 | "" | this supplied value | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:55:49:56 | "" | this supplied value | +| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:59:49:60 | "" | this supplied value | +| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:57:40:57:41 | "" | this supplied value | +| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:58:48:58:49 | "" | this supplied value | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:57:64:58 | "" | this supplied value | +| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:61:64:62 | "" | this supplied value | +| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:74:45:74:46 | "" | this supplied value | +| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | +| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:75:53:75:54 | "" | this supplied value | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:62:81:63 | "" | this supplied value | +| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:66:81:67 | "" | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | @@ -64,139 +87,313 @@ | FormatUnusedArgument.cs:24:9:24:41 | call to method Format | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | The $@ ignores $@. | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | format string | FormatUnusedArgument.cs:24:40:24:40 | (...) ... | this supplied value | | FormatUnusedArgument.cs:27:9:27:35 | call to method Format | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | The $@ ignores $@. | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | format string | FormatUnusedArgument.cs:27:34:27:34 | (...) ... | this supplied value | | FormatUnusedArgument.cs:39:9:39:33 | call to method Format | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | The $@ ignores $@. | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | format string | FormatUnusedArgument.cs:39:32:39:32 | (...) ... | this supplied value | +| FormatUnusedArgument.cs:53:9:53:47 | call to method Format | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:53:45:53:46 | "" | this supplied value | +| FormatUnusedArgument.cs:56:9:56:61 | call to method Format | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:56:45:56:52 | access to local variable format00 | The $@ ignores $@. | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | format string | FormatUnusedArgument.cs:56:59:56:60 | "" | this supplied value | +| FormatUnusedArgument.cs:59:9:59:61 | call to method Format | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:59:45:59:52 | access to local variable format11 | The $@ ignores $@. | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | format string | FormatUnusedArgument.cs:59:55:59:56 | "" | this supplied value | +| FormatUnusedArgument.cs:62:9:62:41 | call to method AppendFormat | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:62:39:62:40 | "" | this supplied value | +| FormatUnusedArgument.cs:63:9:63:49 | call to method AppendFormat | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:63:47:63:48 | "" | this supplied value | +| FormatUnusedArgument.cs:66:9:66:63 | call to method AppendFormat | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:66:47:66:54 | access to local variable format00 | The $@ ignores $@. | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | format string | FormatUnusedArgument.cs:66:61:66:62 | "" | this supplied value | +| FormatUnusedArgument.cs:69:9:69:63 | call to method AppendFormat | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:69:47:69:54 | access to local variable format11 | The $@ ignores $@. | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | format string | FormatUnusedArgument.cs:69:57:69:58 | "" | this supplied value | +| FormatUnusedArgument.cs:74:9:74:46 | call to method TryWrite | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:74:29:74:34 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:74:44:74:45 | "" | this supplied value | +| FormatUnusedArgument.cs:75:9:75:54 | call to method TryWrite | FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:75:37:75:42 | access to local variable format | The $@ ignores $@. | FormatUnusedArgument.cs:48:44:48:46 | "X" | format string | FormatUnusedArgument.cs:75:52:75:53 | "" | this supplied value | +| FormatUnusedArgument.cs:78:9:78:68 | call to method TryWrite | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:78:45:78:52 | access to local variable format00 | The $@ ignores $@. | FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | format string | FormatUnusedArgument.cs:78:66:78:67 | "" | this supplied value | +| FormatUnusedArgument.cs:81:9:81:68 | call to method TryWrite | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:81:45:81:52 | access to local variable format11 | The $@ ignores $@. | FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | format string | FormatUnusedArgument.cs:81:62:81:63 | "" | this supplied value | | FormatUnusedArgumentBad.cs:7:9:7:71 | call to method WriteLine | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | format string | FormatUnusedArgumentBad.cs:7:61:7:70 | (...) ... | this supplied value | | FormatUnusedArgumentBad.cs:8:9:8:77 | call to method WriteLine | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | format string | FormatUnusedArgumentBad.cs:8:63:8:64 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:61:9:62 | access to parameter ex | this supplied value | | FormatUnusedArgumentBad.cs:9:9:9:75 | call to method WriteLine | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | The $@ ignores $@. | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | format string | FormatUnusedArgumentBad.cs:9:65:9:74 | (...) ... | this supplied value | edges +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:143:37:143:42 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:144:45:144:50 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:145:53:145:58 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:147:31:147:36 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:148:39:148:44 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:149:47:149:52 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:150:55:150:60 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:154:29:154:34 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:155:37:155:42 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:156:45:156:50 | access to local variable format | provenance | | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:157:53:157:58 | access to local variable format | provenance | | +| FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | provenance | | +| FormatInvalid.cs:140:44:140:46 | "}" : String | FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | | FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:74:29:74:34 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:75:37:75:42 | access to local variable format | provenance | | +| FormatUnusedArgument.cs:48:22:48:47 | call to method Parse : CompositeFormat | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | provenance | | +| FormatUnusedArgument.cs:48:44:48:46 | "X" : String | FormatUnusedArgument.cs:48:22:48:47 | call to method Parse : CompositeFormat | provenance | Config | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | FormatUnusedArgument.cs:56:45:56:52 | access to local variable format00 | provenance | | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | FormatUnusedArgument.cs:66:47:66:54 | access to local variable format00 | provenance | | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | FormatUnusedArgument.cs:78:45:78:52 | access to local variable format00 | provenance | | +| FormatUnusedArgument.cs:49:24:49:54 | call to method Parse : CompositeFormat | FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | provenance | | +| FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | FormatUnusedArgument.cs:49:24:49:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | FormatUnusedArgument.cs:59:45:59:52 | access to local variable format11 | provenance | | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | FormatUnusedArgument.cs:69:47:69:54 | access to local variable format11 | provenance | | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | FormatUnusedArgument.cs:81:45:81:52 | access to local variable format11 | provenance | | +| FormatUnusedArgument.cs:50:24:50:54 | call to method Parse : CompositeFormat | FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | provenance | | +| FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | FormatUnusedArgument.cs:50:24:50:54 | call to method Parse : CompositeFormat | provenance | Config | nodes | FormatInvalid.cs:10:23:10:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:10:23:10:27 | "{0}" | semmle.label | "{0}" | +| FormatInvalid.cs:13:23:13:29 | "{0,1}" | semmle.label | "{0,1}" | | FormatInvalid.cs:13:23:13:29 | "{0,1}" | semmle.label | "{0,1}" | | FormatInvalid.cs:16:23:16:31 | "{0, 1}" | semmle.label | "{0, 1}" | +| FormatInvalid.cs:16:23:16:31 | "{0, 1}" | semmle.label | "{0, 1}" | +| FormatInvalid.cs:19:23:19:30 | "{0,-1}" | semmle.label | "{0,-1}" | | FormatInvalid.cs:19:23:19:30 | "{0,-1}" | semmle.label | "{0,-1}" | | FormatInvalid.cs:22:23:22:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | +| FormatInvalid.cs:22:23:22:33 | "{0:0.000}" | semmle.label | "{0:0.000}" | +| FormatInvalid.cs:25:23:25:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | | FormatInvalid.cs:25:23:25:39 | "{0, -10 :0.000}" | semmle.label | "{0, -10 :0.000}" | | FormatInvalid.cs:28:23:28:28 | "{ 0}" | semmle.label | "{ 0}" | +| FormatInvalid.cs:28:23:28:28 | "{ 0}" | semmle.label | "{ 0}" | +| FormatInvalid.cs:31:23:31:31 | "{0,--1}" | semmle.label | "{0,--1}" | | FormatInvalid.cs:31:23:31:31 | "{0,--1}" | semmle.label | "{0,--1}" | | FormatInvalid.cs:34:23:34:30 | "{0:{}}" | semmle.label | "{0:{}}" | +| FormatInvalid.cs:34:23:34:30 | "{0:{}}" | semmle.label | "{0:{}}" | +| FormatInvalid.cs:37:23:37:26 | "%d" | semmle.label | "%d" | | FormatInvalid.cs:37:23:37:26 | "%d" | semmle.label | "%d" | | FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | +| FormatInvalid.cs:40:23:40:33 | "{{0}-{1}}" | semmle.label | "{{0}-{1}}" | +| FormatInvalid.cs:43:23:43:28 | "{0}}" | semmle.label | "{0}}" | | FormatInvalid.cs:43:23:43:28 | "{0}}" | semmle.label | "{0}}" | | FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | +| FormatInvalid.cs:46:23:46:32 | "{foo{0}}" | semmle.label | "{foo{0}}" | +| FormatInvalid.cs:49:23:49:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | | FormatInvalid.cs:49:23:49:34 | "{{sdc}}{0}" | semmle.label | "{{sdc}}{0}" | | FormatInvalid.cs:52:23:52:28 | "}{0}" | semmle.label | "}{0}" | +| FormatInvalid.cs:52:23:52:28 | "}{0}" | semmle.label | "}{0}" | +| FormatInvalid.cs:55:23:55:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | | FormatInvalid.cs:55:23:55:42 | "new {0} ({1} => {{" | semmle.label | "new {0} ({1} => {{" | | FormatInvalid.cs:58:23:58:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:58:23:58:29 | "{0}{{" | semmle.label | "{0}{{" | +| FormatInvalid.cs:59:23:59:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:59:23:59:33 | "{0}{{{{}}" | semmle.label | "{0}{{{{}}" | | FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:76:23:76:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:77:23:77:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:78:23:78:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:79:27:79:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:79:27:79:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:80:23:80:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:81:23:81:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:82:23:82:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:82:23:82:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:84:25:84:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:85:25:85:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:86:25:86:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:87:29:87:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:87:29:87:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:88:25:88:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:89:25:89:27 | "}" | semmle.label | "}" | +| FormatInvalid.cs:90:25:90:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:90:25:90:27 | "}" | semmle.label | "}" | | FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:92:27:92:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:93:27:93:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:94:27:94:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:95:27:95:29 | "}" | semmle.label | "}" | | FormatInvalid.cs:96:27:96:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:96:27:96:29 | "}" | semmle.label | "}" | +| FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:98:22:98:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:99:22:99:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:100:22:100:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:101:22:101:24 | "}" | semmle.label | "}" | +| FormatInvalid.cs:102:22:102:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:102:22:102:24 | "}" | semmle.label | "}" | | FormatInvalid.cs:104:44:104:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:104:44:104:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:105:45:105:47 | "}" | semmle.label | "}" | | FormatInvalid.cs:105:45:105:47 | "}" | semmle.label | "}" | | FormatInvalid.cs:106:51:106:53 | "}" | semmle.label | "}" | +| FormatInvalid.cs:106:51:106:53 | "}" | semmle.label | "}" | +| FormatInvalid.cs:107:47:107:49 | "}" | semmle.label | "}" | | FormatInvalid.cs:107:47:107:49 | "}" | semmle.label | "}" | | FormatInvalid.cs:108:29:108:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:108:29:108:31 | "}" | semmle.label | "}" | +| FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:110:23:110:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:111:23:111:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:112:23:112:25 | "}" | semmle.label | "}" | | FormatInvalid.cs:113:23:113:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:113:23:113:25 | "}" | semmle.label | "}" | +| FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | | FormatInvalid.cs:118:56:118:58 | [assertion success] "}" | semmle.label | [assertion success] "}" | | FormatInvalid.cs:119:18:119:20 | "}" | semmle.label | "}" | +| FormatInvalid.cs:119:18:119:20 | "}" | semmle.label | "}" | | FormatInvalid.cs:120:40:120:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:120:40:120:42 | "}" | semmle.label | "}" | +| FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | semmle.label | access to local variable format : CompositeFormat | +| FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatInvalid.cs:140:44:140:46 | "}" | semmle.label | "}" | +| FormatInvalid.cs:140:44:140:46 | "}" : String | semmle.label | "}" : String | +| FormatInvalid.cs:143:37:143:42 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:144:45:144:50 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:145:53:145:58 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:147:31:147:36 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:148:39:148:44 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:149:47:149:52 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:150:55:150:60 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:154:29:154:34 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:155:37:155:42 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:156:45:156:50 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalid.cs:157:53:157:58 | access to local variable format | semmle.label | access to local variable format | +| FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidBad.cs:7:30:7:44 | "class {0} { }" | semmle.label | "class {0} { }" | | FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | +| FormatInvalidGood.cs:7:30:7:46 | "class {0} {{ }}" | semmle.label | "class {0} {{ }}" | +| FormatMissingArgument.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | | FormatMissingArgument.cs:9:23:9:27 | "{0}" | semmle.label | "{0}" | | FormatMissingArgument.cs:12:23:12:27 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:12:23:12:27 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | | FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | | FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | | FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | semmle.label | access to local variable format0 : CompositeFormat | +| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:34:45:34:49 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | semmle.label | "{0}" : String | +| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | semmle.label | access to local variable format1 : CompositeFormat | +| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:35:45:35:49 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | semmle.label | access to local variable format01 : CompositeFormat | +| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" | semmle.label | "{0}{1}" | +| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | semmle.label | "{0}{1}" : String | +| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | semmle.label | access to local variable format23 : CompositeFormat | +| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | semmle.label | "{2}{3}" | +| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | semmle.label | "{2}{3}" : String | +| FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | +| FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | +| FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentGood.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatUnusedArgument.cs:9:23:9:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:9:23:9:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatUnusedArgument.cs:12:23:12:25 | "X" | semmle.label | "X" | | FormatUnusedArgument.cs:12:23:12:25 | "X" | semmle.label | "X" | | FormatUnusedArgument.cs:15:23:15:27 | "{0}" | semmle.label | "{0}" | +| FormatUnusedArgument.cs:15:23:15:27 | "{0}" | semmle.label | "{0}" | +| FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | semmle.label | "{0} {0}" | | FormatUnusedArgument.cs:18:23:18:31 | "{0} {0}" | semmle.label | "{0} {0}" | | FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | semmle.label | "{1} {1}" | +| FormatUnusedArgument.cs:21:23:21:31 | "{1} {1}" | semmle.label | "{1} {1}" | +| FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | semmle.label | "abcdefg" | | FormatUnusedArgument.cs:24:23:24:31 | "abcdefg" | semmle.label | "abcdefg" | | FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | +| FormatUnusedArgument.cs:27:23:27:31 | "{{sdc}}" | semmle.label | "{{sdc}}" | +| FormatUnusedArgument.cs:30:23:30:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | | FormatUnusedArgument.cs:30:23:30:33 | "{{{0:D}}}" | semmle.label | "{{{0:D}}}" | | FormatUnusedArgument.cs:33:23:33:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatUnusedArgument.cs:33:23:33:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatUnusedArgument.cs:36:23:36:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatUnusedArgument.cs:36:23:36:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | semmle.label | "{{0}}" | +| FormatUnusedArgument.cs:39:23:39:29 | "{{0}}" | semmle.label | "{{0}}" | | FormatUnusedArgument.cs:43:23:43:24 | "" | semmle.label | "" | +| FormatUnusedArgument.cs:43:23:43:24 | "" | semmle.label | "" | +| FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | semmle.label | access to local variable format : CompositeFormat | +| FormatUnusedArgument.cs:48:22:48:47 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatUnusedArgument.cs:48:44:48:46 | "X" | semmle.label | "X" | +| FormatUnusedArgument.cs:48:44:48:46 | "X" : String | semmle.label | "X" : String | +| FormatUnusedArgument.cs:49:13:49:20 | access to local variable format00 : CompositeFormat | semmle.label | access to local variable format00 : CompositeFormat | +| FormatUnusedArgument.cs:49:24:49:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" | semmle.label | "{0}{0}" | +| FormatUnusedArgument.cs:49:46:49:53 | "{0}{0}" : String | semmle.label | "{0}{0}" : String | +| FormatUnusedArgument.cs:50:13:50:20 | access to local variable format11 : CompositeFormat | semmle.label | access to local variable format11 : CompositeFormat | +| FormatUnusedArgument.cs:50:24:50:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" | semmle.label | "{1}{1}" | +| FormatUnusedArgument.cs:50:46:50:53 | "{1}{1}" : String | semmle.label | "{1}{1}" : String | +| FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:56:45:56:52 | access to local variable format00 | semmle.label | access to local variable format00 | +| FormatUnusedArgument.cs:59:45:59:52 | access to local variable format11 | semmle.label | access to local variable format11 | +| FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:66:47:66:54 | access to local variable format00 | semmle.label | access to local variable format00 | +| FormatUnusedArgument.cs:69:47:69:54 | access to local variable format11 | semmle.label | access to local variable format11 | +| FormatUnusedArgument.cs:74:29:74:34 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:75:37:75:42 | access to local variable format | semmle.label | access to local variable format | +| FormatUnusedArgument.cs:78:45:78:52 | access to local variable format00 | semmle.label | access to local variable format00 | +| FormatUnusedArgument.cs:81:45:81:52 | access to local variable format11 | semmle.label | access to local variable format11 | +| FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | semmle.label | "Error processing file: {0}" | | FormatUnusedArgumentBad.cs:7:27:7:54 | "Error processing file: {0}" | semmle.label | "Error processing file: {0}" | | FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | +| FormatUnusedArgumentBad.cs:8:27:8:60 | "Error processing file: {1} ({1})" | semmle.label | "Error processing file: {1} ({1})" | +| FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -testFailures -| FormatInvalid.cs:140:50:140:59 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:35:53:35:63 | // ... | Missing result: Source | -| FormatMissingArgument.cs:37:57:37:67 | // ... | Missing result: Source | -| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:43:51:43:65 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:49:64:49:78 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:57:45:57:59 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:58:53:58:67 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:64:66:64:80 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:74:50:74:64 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:75:58:75:72 | // ... | Missing result: Sink | -| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Alert | -| FormatMissingArgument.cs:81:71:81:85 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:48:50:48:60 | // ... | Missing result: Source | -| FormatUnusedArgument.cs:49:57:49:67 | // ... | Missing result: Source | -| FormatUnusedArgument.cs:50:57:50:67 | // ... | Missing result: Source | -| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:53:50:53:64 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:56:64:56:78 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:59:64:59:78 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:62:44:62:58 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:63:52:63:66 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:66:66:66:80 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:69:66:69:80 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:74:49:74:63 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:75:57:75:71 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:78:71:78:85 | // ... | Missing result: Sink | -| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Alert | -| FormatUnusedArgument.cs:81:71:81:85 | // ... | Missing result: Sink | From 930bb6b515e43a311fac91c33254d331833dbbd1 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:16:35 +0200 Subject: [PATCH 357/372] C#: Add FP for string.Format using params collection. --- .../FormatInvalid/FormatInvalid.expected | 192 +++++++++--------- .../FormatInvalid/FormatMissingArgument.cs | 3 + 2 files changed, 103 insertions(+), 92 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index ddbdd5c4fb5..566e47ac0e0 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -51,30 +51,32 @@ | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:34:15:34 | (...) ... | this supplied value | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | FormatMissingArgument.cs:23:16:23:20 | "{1}" | this | -| FormatMissingArgument.cs:29:9:29:32 | call to method Format | FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:23:16:23:20 | "{1}" | format string | FormatMissingArgument.cs:29:31:29:31 | (...) ... | this supplied value | -| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:43:9:43:48 | call to method Format | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:43:46:43:47 | "" | this supplied value | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:55:49:56 | "" | this supplied value | -| FormatMissingArgument.cs:49:9:49:61 | call to method Format | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:49:59:49:60 | "" | this supplied value | -| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:57:9:57:42 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:57:40:57:41 | "" | this supplied value | -| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:58:9:58:50 | call to method AppendFormat | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:58:48:58:49 | "" | this supplied value | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:57:64:58 | "" | this supplied value | -| FormatMissingArgument.cs:64:9:64:63 | call to method AppendFormat | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:64:61:64:62 | "" | this supplied value | -| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:74:9:74:47 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:74:45:74:46 | "" | this supplied value | -| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | FormatMissingArgument.cs:35:45:35:49 | "{1}" | this | -| FormatMissingArgument.cs:75:9:75:55 | call to method TryWrite | FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:35:45:35:49 | "{1}" | format string | FormatMissingArgument.cs:75:53:75:54 | "" | this supplied value | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | this | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:62:81:63 | "" | this supplied value | -| FormatMissingArgument.cs:81:9:81:68 | call to method TryWrite | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | format string | FormatMissingArgument.cs:81:66:81:67 | "" | this supplied value | +| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | +| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | +| FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | +| FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | format string | FormatMissingArgument.cs:32:31:32:31 | (...) ... | this supplied value | +| FormatMissingArgument.cs:46:9:46:48 | call to method Format | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:46:9:46:48 | call to method Format | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:46:46:46:47 | "" | this supplied value | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:52:55:52:56 | "" | this supplied value | +| FormatMissingArgument.cs:52:9:52:61 | call to method Format | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:52:59:52:60 | "" | this supplied value | +| FormatMissingArgument.cs:60:9:60:42 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:60:9:60:42 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:60:40:60:41 | "" | this supplied value | +| FormatMissingArgument.cs:61:9:61:50 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:61:9:61:50 | call to method AppendFormat | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:61:48:61:49 | "" | this supplied value | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:67:57:67:58 | "" | this supplied value | +| FormatMissingArgument.cs:67:9:67:63 | call to method AppendFormat | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:67:61:67:62 | "" | this supplied value | +| FormatMissingArgument.cs:77:9:77:47 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:77:9:77:47 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:77:45:77:46 | "" | this supplied value | +| FormatMissingArgument.cs:78:9:78:55 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | +| FormatMissingArgument.cs:78:9:78:55 | call to method TryWrite | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | The $@ ignores $@. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | format string | FormatMissingArgument.cs:78:53:78:54 | "" | this supplied value | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | this | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:84:62:84:63 | "" | this supplied value | +| FormatMissingArgument.cs:84:9:84:68 | call to method TryWrite | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | The $@ ignores $@. | FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | format string | FormatMissingArgument.cs:84:66:84:67 | "" | this supplied value | | FormatMissingArgumentBad.cs:7:9:7:49 | call to method WriteLine | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | this | | FormatMissingArgumentBad.cs:8:9:8:55 | call to method WriteLine | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | The $@ ignores $@. | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | format string | FormatMissingArgumentBad.cs:8:44:8:48 | access to parameter first | this supplied value | @@ -116,34 +118,34 @@ edges | FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | FormatInvalid.cs:157:53:157:58 | access to local variable format | provenance | | | FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | FormatInvalid.cs:140:13:140:18 | access to local variable format : CompositeFormat | provenance | | | FormatInvalid.cs:140:44:140:46 | "}" : String | FormatInvalid.cs:140:22:140:47 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | FormatMissingArgument.cs:26:24:26:29 | format : String | provenance | | -| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | -| FormatMissingArgument.cs:26:24:26:29 | format : String | FormatMissingArgument.cs:29:23:29:28 | access to parameter format | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | provenance | | -| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | provenance | | -| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | provenance | | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | provenance | | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | provenance | | -| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | provenance | Config | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | provenance | | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | provenance | | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | provenance | | -| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | provenance | | -| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:29:24:29:29 | format : String | provenance | | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:29:24:29:29 | format : String | provenance | | +| FormatMissingArgument.cs:29:24:29:29 | format : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:29:24:29:29 | format : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:43:37:43:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:56:31:56:37 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:57:39:57:45 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:73:29:73:35 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | FormatMissingArgument.cs:74:37:74:43 | access to local variable format0 | provenance | | +| FormatMissingArgument.cs:37:23:37:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:37:45:37:49 | "{0}" : String | FormatMissingArgument.cs:37:23:37:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | provenance | | +| FormatMissingArgument.cs:38:23:38:50 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:38:23:38:50 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:49:45:49:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:64:47:64:54 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | FormatMissingArgument.cs:81:45:81:52 | access to local variable format01 | provenance | | +| FormatMissingArgument.cs:39:24:39:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:39:46:39:53 | "{0}{1}" : String | FormatMissingArgument.cs:39:24:39:54 | call to method Parse : CompositeFormat | provenance | Config | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | provenance | | +| FormatMissingArgument.cs:40:24:40:54 | call to method Parse : CompositeFormat | FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | provenance | | +| FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | FormatMissingArgument.cs:40:24:40:54 | call to method Parse : CompositeFormat | provenance | Config | | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:53:37:53:42 | access to local variable format | provenance | | | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:62:31:62:36 | access to local variable format | provenance | | | FormatUnusedArgument.cs:48:13:48:18 | access to local variable format : CompositeFormat | FormatUnusedArgument.cs:63:39:63:44 | access to local variable format | provenance | | @@ -297,46 +299,48 @@ nodes | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | semmle.label | "{2} {3}" | | FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | | FormatMissingArgument.cs:18:23:18:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | -| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatMissingArgument.cs:21:23:21:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:23:16:23:20 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:26:24:26:29 | format : String | semmle.label | format : String | -| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | -| FormatMissingArgument.cs:29:23:29:28 | access to parameter format | semmle.label | access to parameter format | -| FormatMissingArgument.cs:34:13:34:19 | access to local variable format0 : CompositeFormat | semmle.label | access to local variable format0 : CompositeFormat | -| FormatMissingArgument.cs:34:23:34:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:34:45:34:49 | "{0}" | semmle.label | "{0}" | -| FormatMissingArgument.cs:34:45:34:49 | "{0}" : String | semmle.label | "{0}" : String | -| FormatMissingArgument.cs:35:13:35:19 | access to local variable format1 : CompositeFormat | semmle.label | access to local variable format1 : CompositeFormat | -| FormatMissingArgument.cs:35:23:35:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:35:45:35:49 | "{1}" | semmle.label | "{1}" | -| FormatMissingArgument.cs:35:45:35:49 | "{1}" : String | semmle.label | "{1}" : String | -| FormatMissingArgument.cs:36:13:36:20 | access to local variable format01 : CompositeFormat | semmle.label | access to local variable format01 : CompositeFormat | -| FormatMissingArgument.cs:36:24:36:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" | semmle.label | "{0}{1}" | -| FormatMissingArgument.cs:36:46:36:53 | "{0}{1}" : String | semmle.label | "{0}{1}" : String | -| FormatMissingArgument.cs:37:13:37:20 | access to local variable format23 : CompositeFormat | semmle.label | access to local variable format23 : CompositeFormat | -| FormatMissingArgument.cs:37:24:37:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | -| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" | semmle.label | "{2}{3}" | -| FormatMissingArgument.cs:37:46:37:53 | "{2}{3}" : String | semmle.label | "{2}{3}" : String | -| FormatMissingArgument.cs:40:37:40:43 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:43:37:43:43 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:46:45:46:52 | access to local variable format01 | semmle.label | access to local variable format01 | -| FormatMissingArgument.cs:49:45:49:52 | access to local variable format23 | semmle.label | access to local variable format23 | -| FormatMissingArgument.cs:53:31:53:37 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:54:39:54:45 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:57:31:57:37 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:58:39:58:45 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:61:47:61:54 | access to local variable format01 | semmle.label | access to local variable format01 | -| FormatMissingArgument.cs:64:47:64:54 | access to local variable format23 | semmle.label | access to local variable format23 | -| FormatMissingArgument.cs:70:29:70:35 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:71:37:71:43 | access to local variable format0 | semmle.label | access to local variable format0 | -| FormatMissingArgument.cs:74:29:74:35 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:75:37:75:43 | access to local variable format1 | semmle.label | access to local variable format1 | -| FormatMissingArgument.cs:78:45:78:52 | access to local variable format01 | semmle.label | access to local variable format01 | -| FormatMissingArgument.cs:81:45:81:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | semmle.label | "{0} {1} {2}" | +| FormatMissingArgument.cs:24:23:24:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatMissingArgument.cs:24:23:24:39 | "{0} {1} {2} {3}" | semmle.label | "{0} {1} {2} {3}" | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:29:24:29:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:29:24:29:29 | format : String | semmle.label | format : String | +| FormatMissingArgument.cs:32:23:32:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:32:23:32:28 | access to parameter format | semmle.label | access to parameter format | +| FormatMissingArgument.cs:37:13:37:19 | access to local variable format0 : CompositeFormat | semmle.label | access to local variable format0 : CompositeFormat | +| FormatMissingArgument.cs:37:23:37:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:37:45:37:49 | "{0}" | semmle.label | "{0}" | +| FormatMissingArgument.cs:37:45:37:49 | "{0}" : String | semmle.label | "{0}" : String | +| FormatMissingArgument.cs:38:13:38:19 | access to local variable format1 : CompositeFormat | semmle.label | access to local variable format1 : CompositeFormat | +| FormatMissingArgument.cs:38:23:38:50 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:38:45:38:49 | "{1}" | semmle.label | "{1}" | +| FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | semmle.label | "{1}" : String | +| FormatMissingArgument.cs:39:13:39:20 | access to local variable format01 : CompositeFormat | semmle.label | access to local variable format01 : CompositeFormat | +| FormatMissingArgument.cs:39:24:39:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:39:46:39:53 | "{0}{1}" | semmle.label | "{0}{1}" | +| FormatMissingArgument.cs:39:46:39:53 | "{0}{1}" : String | semmle.label | "{0}{1}" : String | +| FormatMissingArgument.cs:40:13:40:20 | access to local variable format23 : CompositeFormat | semmle.label | access to local variable format23 : CompositeFormat | +| FormatMissingArgument.cs:40:24:40:54 | call to method Parse : CompositeFormat | semmle.label | call to method Parse : CompositeFormat | +| FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" | semmle.label | "{2}{3}" | +| FormatMissingArgument.cs:40:46:40:53 | "{2}{3}" : String | semmle.label | "{2}{3}" : String | +| FormatMissingArgument.cs:43:37:43:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:49:45:49:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:52:45:52:52 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:56:31:56:37 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:57:39:57:45 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:60:31:60:37 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:61:39:61:45 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:64:47:64:54 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:67:47:67:54 | access to local variable format23 | semmle.label | access to local variable format23 | +| FormatMissingArgument.cs:73:29:73:35 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:74:37:74:43 | access to local variable format0 | semmle.label | access to local variable format0 | +| FormatMissingArgument.cs:77:29:77:35 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:78:37:78:43 | access to local variable format1 | semmle.label | access to local variable format1 | +| FormatMissingArgument.cs:81:45:81:52 | access to local variable format01 | semmle.label | access to local variable format01 | +| FormatMissingArgument.cs:84:45:84:52 | access to local variable format23 | semmle.label | access to local variable format23 | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:7:27:7:41 | "Hello {0} {1}" | semmle.label | "Hello {0} {1}" | | FormatMissingArgumentBad.cs:8:27:8:41 | "Hello {1} {2}" | semmle.label | "Hello {1} {2}" | @@ -397,3 +401,7 @@ nodes | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths +testFailures +| FormatMissingArgument.cs:21:9:21:47 | FormatMissingArgument.cs:21:23:21:35 | Unexpected result: Alert | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Alert | +| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Sink | diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index d059e7a5400..52aabd8cf2b 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -17,6 +17,9 @@ class Class1 // GOOD: An array has been supplied. String.Format("{0} {1} {2}", args); + // GOOD: A collection has been supplied. + String.Format("{0} {1} {2}", [0, 1, 2]); + // GOOD: All arguments supplied to params String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); From 042c7e518639fc62d4e3c48ac4745d00b3ad8c94 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:18:04 +0200 Subject: [PATCH 358/372] C#: Generalize array logic to params collection like types. --- .../semmle/code/csharp/commons/Collections.qll | 3 ++- .../semmle/code/csharp/frameworks/Format.qll | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll b/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll index 7a881981c1c..b33c0f73d60 100644 --- a/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll +++ b/csharp/ql/lib/semmle/code/csharp/commons/Collections.qll @@ -97,7 +97,8 @@ private class ParamsConstructedCollectionTypes extends ParamsCollectionTypeImpl unboundbase instanceof SystemCollectionsGenericIReadOnlyListTInterface or unboundbase instanceof SystemSpanStruct or unboundbase instanceof SystemReadOnlySpanStruct - ) + ) and + not this instanceof SystemStringClass } override Type getElementType() { result = base.getTypeArgument(0) } diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index 7bccf3e0e6b..eb9d5270263 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -250,19 +250,31 @@ class FormatCall extends MethodCall { /** Holds if this call has one or more insertions. */ predicate hasInsertions() { exists(this.getArgument(this.getFirstArgument())) } - /** Holds if the arguments are supplied in an array, not individually. */ - predicate hasArrayExpr() { + /** + * DEPRECATED: use `hasCollectionExpr` instead. + * + * Holds if the arguments are supplied in an array, not individually. + */ + deprecated predicate hasArrayExpr() { this.getNumberOfArguments() = this.getFirstArgument() + 1 and this.getArgument(this.getFirstArgument()).getType() instanceof ArrayType } + /** + * Holds if the arguments are supplied in a collection, not individually. + */ + predicate hasCollectionExpr() { + this.getNumberOfArguments() = this.getFirstArgument() + 1 and + this.getArgument(this.getFirstArgument()).getType() instanceof ParamsCollectionType + } + /** * Gets the number of supplied arguments (excluding the format string and format * provider). Does not return a value if the arguments are supplied in an array, * in which case we generally can't assess the size of the array. */ int getSuppliedArguments() { - not this.hasArrayExpr() and + not this.hasCollectionExpr() and result = this.getNumberOfArguments() - this.getFirstArgument() } From 6de5920172486837c16be70c405e9f4726209597 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:19:08 +0200 Subject: [PATCH 359/372] C#: Update test expected output. --- .../API Abuse/FormatInvalid/FormatInvalid.expected | 6 ------ 1 file changed, 6 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected index 566e47ac0e0..a33793ae461 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.expected @@ -51,8 +51,6 @@ | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | Argument '{3}' has not been supplied to $@ format string. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | this | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:34:15:34 | (...) ... | this supplied value | | FormatMissingArgument.cs:15:9:15:38 | call to method Format | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | The $@ ignores $@. | FormatMissingArgument.cs:15:23:15:31 | "{2} {3}" | format string | FormatMissingArgument.cs:15:37:15:37 | (...) ... | this supplied value | -| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | -| FormatMissingArgument.cs:21:9:21:47 | call to method Format | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Argument '{2}' has not been supplied to $@ format string. | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | this | | FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | FormatMissingArgument.cs:26:16:26:20 | "{1}" | this | | FormatMissingArgument.cs:32:9:32:32 | call to method Format | FormatMissingArgument.cs:26:16:26:20 | "{1}" : String | FormatMissingArgument.cs:32:23:32:28 | access to parameter format | The $@ ignores $@. | FormatMissingArgument.cs:26:16:26:20 | "{1}" | format string | FormatMissingArgument.cs:32:31:32:31 | (...) ... | this supplied value | | FormatMissingArgument.cs:46:9:46:48 | call to method Format | FormatMissingArgument.cs:38:45:38:49 | "{1}" : String | FormatMissingArgument.cs:46:37:46:43 | access to local variable format1 | Argument '{1}' has not been supplied to $@ format string. | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | FormatMissingArgument.cs:38:45:38:49 | "{1}" | this | @@ -401,7 +399,3 @@ nodes | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | | FormatUnusedArgumentBad.cs:9:27:9:58 | "Error processing file: %s (%d)" | semmle.label | "Error processing file: %s (%d)" | subpaths -testFailures -| FormatMissingArgument.cs:21:9:21:47 | FormatMissingArgument.cs:21:23:21:35 | Unexpected result: Alert | -| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Alert | -| FormatMissingArgument.cs:21:23:21:35 | "{0} {1} {2}" | Unexpected result: Sink | From f2dddd6d5c6d94e39113339dbf689eef69e32a18 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:23:37 +0200 Subject: [PATCH 360/372] C#: Hide the abstract FormatMethod class. --- .../lib/semmle/code/csharp/frameworks/Format.qll | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll index eb9d5270263..cf61a5d75aa 100644 --- a/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll +++ b/csharp/ql/lib/semmle/code/csharp/frameworks/Format.qll @@ -8,7 +8,7 @@ private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.system.Text /** A method that formats a string, for example `string.Format()`. */ -abstract class FormatMethod extends Method { +abstract private class FormatMethodImpl extends Method { /** * Gets the argument containing the format string. For example, the argument of * `string.Format(IFormatProvider, String, Object)` is `1`. @@ -21,6 +21,8 @@ abstract class FormatMethod extends Method { int getFirstArgument() { result = this.getFormatArgument() + 1 } } +final class FormatMethod = FormatMethodImpl; + /** A class of types used for formatting. */ private class FormatType extends Type { FormatType() { @@ -29,7 +31,7 @@ private class FormatType extends Type { } } -private class StringAndStringBuilderFormatMethods extends FormatMethod { +private class StringAndStringBuilderFormatMethods extends FormatMethodImpl { StringAndStringBuilderFormatMethods() { ( this.getParameter(0).getType() instanceof SystemIFormatProviderInterface and @@ -51,7 +53,7 @@ private class StringAndStringBuilderFormatMethods extends FormatMethod { } } -private class SystemMemoryExtensionsFormatMethods extends FormatMethod { +private class SystemMemoryExtensionsFormatMethods extends FormatMethodImpl { SystemMemoryExtensionsFormatMethods() { this = any(SystemMemoryExtensionsClass c).getTryWriteMethod() and this.getParameter(1).getType() instanceof SystemIFormatProviderInterface and @@ -63,7 +65,7 @@ private class SystemMemoryExtensionsFormatMethods extends FormatMethod { override int getFirstArgument() { result = this.getFormatArgument() + 2 } } -private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethod { +private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMethodImpl { SystemConsoleAndSystemIoTextWriterFormatMethods() { this.getParameter(0).getType() instanceof StringType and this.getNumberOfParameters() > 1 and @@ -80,7 +82,7 @@ private class SystemConsoleAndSystemIoTextWriterFormatMethods extends FormatMeth override int getFormatArgument() { result = 0 } } -private class SystemDiagnosticsDebugAssert extends FormatMethod { +private class SystemDiagnosticsDebugAssert extends FormatMethodImpl { SystemDiagnosticsDebugAssert() { this.hasName("Assert") and this.getDeclaringType().hasFullyQualifiedName("System.Diagnostics", "Debug") and @@ -90,7 +92,7 @@ private class SystemDiagnosticsDebugAssert extends FormatMethod { override int getFormatArgument() { result = 2 } } -private class SystemDiagnosticsFormatMethods extends FormatMethod { +private class SystemDiagnosticsFormatMethods extends FormatMethodImpl { SystemDiagnosticsFormatMethods() { this.getParameter(0).getType() instanceof StringType and this.getNumberOfParameters() > 1 and From 22ae3e799255a1c27386a28027aaba5a49e43c5b Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 9 Apr 2025 16:55:46 +0200 Subject: [PATCH 361/372] C#: Update string format item parameter expected test case. --- .../frameworks/format/StringFormatItemParameter.expected | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected b/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected index 692ec0529bb..dc3017a5f6f 100644 --- a/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected +++ b/csharp/ql/test/library-tests/frameworks/format/StringFormatItemParameter.expected @@ -17,6 +17,12 @@ | Debug | Assert(bool, string, string, params Object[]) | args | | Debug | Print(string, params Object[]) | args | | Debug | WriteLine(string, params Object[]) | args | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params Object[]) | args | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params Object[]) | charsWritten | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params ReadOnlySpan) | args | +| MemoryExtensions | TryWrite(Span, IFormatProvider, CompositeFormat, out int, params ReadOnlySpan) | charsWritten | +| StringBuilder | AppendFormat(IFormatProvider, CompositeFormat, params Object[]) | args | +| StringBuilder | AppendFormat(IFormatProvider, CompositeFormat, params ReadOnlySpan) | args | | StringBuilder | AppendFormat(IFormatProvider, string, object) | arg0 | | StringBuilder | AppendFormat(IFormatProvider, string, object, object) | arg0 | | StringBuilder | AppendFormat(IFormatProvider, string, object, object) | arg1 | @@ -51,6 +57,8 @@ | TextWriter | WriteLine(string, object, object, object) | arg2 | | TextWriter | WriteLine(string, params Object[]) | arg | | TextWriter | WriteLine(string, params ReadOnlySpan) | arg | +| string | Format(IFormatProvider, CompositeFormat, params Object[]) | args | +| string | Format(IFormatProvider, CompositeFormat, params ReadOnlySpan) | args | | string | Format(IFormatProvider, string, object) | arg0 | | string | Format(IFormatProvider, string, object, object) | arg0 | | string | Format(IFormatProvider, string, object, object) | arg1 | From b6d2f14b9b191e73e52a670118ebcc946759d430 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 10 Apr 2025 08:47:41 +0200 Subject: [PATCH 362/372] C#: Add change note. --- .../ql/src/change-notes/2025-04-10-invalid-string-format.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md diff --git a/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md b/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md new file mode 100644 index 00000000000..1d1d424d985 --- /dev/null +++ b/csharp/ql/src/change-notes/2025-04-10-invalid-string-format.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The precision of the query `cs/invalid-string-formatting` has been improved. More methods and more overloads of existing format like methods are taken into account by the query. From dcf11c2d4b6d4d34bd269e8ca4a63c752ae699cc Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 11:42:45 +0200 Subject: [PATCH 363/372] C#: Match up sources, alerts and sinks in the tests. --- .../FormatInvalid/FormatMissingArgument.cs | 24 +++++++-------- .../FormatInvalid/FormatUnusedArgument.cs | 29 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index 52aabd8cf2b..8460a456575 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -23,33 +23,33 @@ class Class1 // GOOD: All arguments supplied to params String.Format("{0} {1} {2} {3}", 0, 1, 2, 3); - helper("{1}"); // $ Source + helper("{1}"); // $ Source=source1 } void helper(string format) { // BAD: Missing {1} - String.Format(format, 0); // $ Alert Sink + String.Format(format, 0); // $ Alert=source1 Sink=source1 } void TestCompositeFormatMissingArgument() { var format0 = CompositeFormat.Parse("{0}"); - var format1 = CompositeFormat.Parse("{1}"); // $ Source + var format1 = CompositeFormat.Parse("{1}"); // $ Source=source2 var format01 = CompositeFormat.Parse("{0}{1}"); - var format23 = CompositeFormat.Parse("{2}{3}"); // $ Source + var format23 = CompositeFormat.Parse("{2}{3}"); // $ Source=source3 // GOOD: All args supplied String.Format(null, format0, ""); // BAD: Missing {1} - String.Format(null, format1, ""); // $ Alert Sink + String.Format(null, format1, ""); // $ Alert=source2 Sink=source2 // GOOD: All args supplied String.Format(null, format01, "", ""); // BAD: Missing {2} and {3} - String.Format(null, format23, "", ""); // $ Alert Sink + String.Format(null, format23, "", ""); // $ Alert=source3 Sink=source3 // GOOD: All arguments supplied @@ -57,14 +57,14 @@ class Class1 sb.AppendFormat(null, format0, ""); // BAD: Missing {1} - sb.AppendFormat(null, format1, ""); // $ Alert Sink - sb.AppendFormat(null, format1, ""); // $ Alert Sink + sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 + sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 // GOOD: All args supplied sb.AppendFormat(null, format01, "", ""); // BAD: Missing {2} and {3} - sb.AppendFormat(null, format23, "", ""); // $ Alert Sink + sb.AppendFormat(null, format23, "", ""); // $ Alert=source3 Sink=source3 var span = new Span(); @@ -74,14 +74,14 @@ class Class1 span.TryWrite(null, format0, out _, ""); // BAD: Missing {1} - span.TryWrite(null, format1, out _, ""); // $ Alert Sink - span.TryWrite(null, format1, out _, ""); // $ Alert Sink + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 // GOOD: All args supplied span.TryWrite(null, format01, out _, "", ""); // BAD: Missing {2} and {3} - span.TryWrite(null, format23, out _, "", ""); // $ Alert Sink + span.TryWrite(null, format23, out _, "", ""); // $ Alert=source3 Sink=source3 } object[] args; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index 77ef70338db..e1c7aa6bf15 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -45,41 +45,40 @@ class C void CompositeFormatTests() { - var format = CompositeFormat.Parse("X"); // $ Source - var format00 = CompositeFormat.Parse("{0}{0}"); // $ Source - var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source + var format = CompositeFormat.Parse("X"); // $ Source=source4 + var format00 = CompositeFormat.Parse("{0}{0}"); // $ Source=source5 + var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source=source6 // BAD: Unused arg {0} - String.Format(null, format, ""); // $ Alert Sink + String.Format(null, format, ""); // $ Alert=source4 Sink=source4 // BAD: Unused arg {1} - String.Format(null, format00, "", ""); // $ Alert Sink + String.Format(null, format00, "", ""); // $ Alert=source5 Sink=source5 // BAD: Unused arg {0} - String.Format(null, format11, "", ""); // $ Alert Sink + String.Format(null, format11, "", ""); // $ Alert=source6 Sink=source6 // BAD: Unused arg {0} - sb.AppendFormat(null, format, ""); // $ Alert Sink - sb.AppendFormat(null, format, ""); // $ Alert Sink + sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 + sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 // BAD: Unused arg {1} - sb.AppendFormat(null, format00, "", ""); // $ Alert Sink + sb.AppendFormat(null, format00, "", ""); // $ Alert=source5 Sink=source5 // BAD: Unused arg {0} - sb.AppendFormat(null, format11, "", ""); // $ Alert Sink + sb.AppendFormat(null, format11, "", ""); // $ Alert=source6 Sink=source6 var span = new Span(); // BAD: Unused arg {0} - span.TryWrite(null, format, out _, ""); // $ Alert Sink - span.TryWrite(null, format, out _, ""); // $ Alert Sink + span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 + span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 // BAD: Unused arg {1} - span.TryWrite(null, format00, out _, "", ""); // $ Alert Sink + span.TryWrite(null, format00, out _, "", ""); // $ Alert=source5 Sink=source5 // BAD: Unused arg {0} - span.TryWrite(null, format11, out _, "", ""); // $ Alert Sink - + span.TryWrite(null, format11, out _, "", ""); // $ Alert=source6 Sink=source6 } object[] ps; From 65ac951964a4c7d678ab2e1bd882fdfb9812a5d8 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 23 Apr 2025 12:59:29 +0200 Subject: [PATCH 364/372] C#: Remove all Sink tags after rebase. --- .../API Abuse/FormatInvalid/FormatInvalid.cs | 2 +- .../FormatInvalid/FormatMissingArgument.cs | 22 ++++++------ .../FormatInvalid/FormatMissingArgumentBad.cs | 4 +-- .../FormatInvalid/FormatUnusedArgument.cs | 36 +++++++++---------- .../FormatInvalid/FormatUnusedArgumentBad.cs | 6 ++-- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs index 2690ec50890..75fc5e4ec23 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatInvalid.cs @@ -34,7 +34,7 @@ class FormatInvalid String.Format("{0:{}}", 1); // $ Alert // BAD: Invalid format string - String.Format("%d", 1); // $ Alert Sink + String.Format("%d", 1); // $ Alert // BAD: } { in the middle. String.Format("{{0}-{1}}", 0, 1); // $ Alert diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs index 8460a456575..b5ff280d86d 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgument.cs @@ -9,10 +9,10 @@ class Class1 String.Format("{0}", 0); // BAD: Missing {1} - String.Format("{1}", 0); // $ Alert Sink + String.Format("{1}", 0); // $ Alert // BAD: Missing {2} and {3} - String.Format("{2} {3}", 0, 1); // $ Alert Sink + String.Format("{2} {3}", 0, 1); // $ Alert // GOOD: An array has been supplied. String.Format("{0} {1} {2}", args); @@ -29,7 +29,7 @@ class Class1 void helper(string format) { // BAD: Missing {1} - String.Format(format, 0); // $ Alert=source1 Sink=source1 + String.Format(format, 0); // $ Alert=source1 } void TestCompositeFormatMissingArgument() @@ -43,13 +43,13 @@ class Class1 String.Format(null, format0, ""); // BAD: Missing {1} - String.Format(null, format1, ""); // $ Alert=source2 Sink=source2 + String.Format(null, format1, ""); // $ Alert=source2 // GOOD: All args supplied String.Format(null, format01, "", ""); // BAD: Missing {2} and {3} - String.Format(null, format23, "", ""); // $ Alert=source3 Sink=source3 + String.Format(null, format23, "", ""); // $ Alert=source3 // GOOD: All arguments supplied @@ -57,14 +57,14 @@ class Class1 sb.AppendFormat(null, format0, ""); // BAD: Missing {1} - sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 - sb.AppendFormat(null, format1, ""); // $ Alert=source2 Sink=source2 + sb.AppendFormat(null, format1, ""); // $ Alert=source2 + sb.AppendFormat(null, format1, ""); // $ Alert=source2 // GOOD: All args supplied sb.AppendFormat(null, format01, "", ""); // BAD: Missing {2} and {3} - sb.AppendFormat(null, format23, "", ""); // $ Alert=source3 Sink=source3 + sb.AppendFormat(null, format23, "", ""); // $ Alert=source3 var span = new Span(); @@ -74,14 +74,14 @@ class Class1 span.TryWrite(null, format0, out _, ""); // BAD: Missing {1} - span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 - span.TryWrite(null, format1, out _, ""); // $ Alert=source2 Sink=source2 + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 + span.TryWrite(null, format1, out _, ""); // $ Alert=source2 // GOOD: All args supplied span.TryWrite(null, format01, out _, "", ""); // BAD: Missing {2} and {3} - span.TryWrite(null, format23, out _, "", ""); // $ Alert=source3 Sink=source3 + span.TryWrite(null, format23, out _, "", ""); // $ Alert=source3 } object[] args; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs index a3614a881b9..74c2ffd627a 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatMissingArgumentBad.cs @@ -4,7 +4,7 @@ class Bad3 { void Hello(string first, string last) { - Console.WriteLine("Hello {0} {1}", first); // $ Alert Sink - Console.WriteLine("Hello {1} {2}", first, last); // $ Alert Sink + Console.WriteLine("Hello {0} {1}", first); // $ Alert + Console.WriteLine("Hello {1} {2}", first, last); // $ Alert } } diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs index e1c7aa6bf15..c064025ed68 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgument.cs @@ -9,22 +9,22 @@ class C String.Format("{0} {1} {2}", 0, 1, 2); // BAD: Missing arg {0} - String.Format("X", 1); // $ Alert Sink + String.Format("X", 1); // $ Alert // BAD: Missing {1} - String.Format("{0}", 1, 2); // $ Alert Sink + String.Format("{0}", 1, 2); // $ Alert // BAD: Missing {1} - String.Format("{0} {0}", 1, 2); // $ Alert Sink + String.Format("{0} {0}", 1, 2); // $ Alert // BAD: Missing {0} - String.Format("{1} {1}", 1, 2); // $ Alert Sink + String.Format("{1} {1}", 1, 2); // $ Alert // BAD: Missing {0}, {1} and {2} - String.Format("abcdefg", 0, 1, 2); // $ Alert Sink + String.Format("abcdefg", 0, 1, 2); // $ Alert // BAD: {0} is unused - String.Format("{{sdc}}", 0); // $ Alert Sink + String.Format("{{sdc}}", 0); // $ Alert // GOOD: {0} is used String.Format("{{{0:D}}}", 0); @@ -36,7 +36,7 @@ class C String.Format("{0} {1} {2}", ps); // BAD: Would display "{0}" - String.Format("{{0}}", 1); // $ Alert Sink + String.Format("{{0}}", 1); // $ Alert // GOOD: Ignore the empty string as it's often used as the default value // of GetResource(). @@ -50,35 +50,35 @@ class C var format11 = CompositeFormat.Parse("{1}{1}"); // $ Source=source6 // BAD: Unused arg {0} - String.Format(null, format, ""); // $ Alert=source4 Sink=source4 + String.Format(null, format, ""); // $ Alert=source4 // BAD: Unused arg {1} - String.Format(null, format00, "", ""); // $ Alert=source5 Sink=source5 + String.Format(null, format00, "", ""); // $ Alert=source5 // BAD: Unused arg {0} - String.Format(null, format11, "", ""); // $ Alert=source6 Sink=source6 + String.Format(null, format11, "", ""); // $ Alert=source6 // BAD: Unused arg {0} - sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 - sb.AppendFormat(null, format, ""); // $ Alert=source4 Sink=source4 + sb.AppendFormat(null, format, ""); // $ Alert=source4 + sb.AppendFormat(null, format, ""); // $ Alert=source4 // BAD: Unused arg {1} - sb.AppendFormat(null, format00, "", ""); // $ Alert=source5 Sink=source5 + sb.AppendFormat(null, format00, "", ""); // $ Alert=source5 // BAD: Unused arg {0} - sb.AppendFormat(null, format11, "", ""); // $ Alert=source6 Sink=source6 + sb.AppendFormat(null, format11, "", ""); // $ Alert=source6 var span = new Span(); // BAD: Unused arg {0} - span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 - span.TryWrite(null, format, out _, ""); // $ Alert=source4 Sink=source4 + span.TryWrite(null, format, out _, ""); // $ Alert=source4 + span.TryWrite(null, format, out _, ""); // $ Alert=source4 // BAD: Unused arg {1} - span.TryWrite(null, format00, out _, "", ""); // $ Alert=source5 Sink=source5 + span.TryWrite(null, format00, out _, "", ""); // $ Alert=source5 // BAD: Unused arg {0} - span.TryWrite(null, format11, out _, "", ""); // $ Alert=source6 Sink=source6 + span.TryWrite(null, format11, out _, "", ""); // $ Alert=source6 } object[] ps; diff --git a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs index 5a951efa432..969c2b86e9f 100644 --- a/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs +++ b/csharp/ql/test/query-tests/API Abuse/FormatInvalid/FormatUnusedArgumentBad.cs @@ -4,8 +4,8 @@ class Bad2 { void M(Exception ex) { - Console.WriteLine("Error processing file: {0}", ex, ex.HResult); // $ Alert Sink - Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); // $ Alert Sink - Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); // $ Alert Sink + Console.WriteLine("Error processing file: {0}", ex, ex.HResult); // $ Alert + Console.WriteLine("Error processing file: {1} ({1})", ex, ex.HResult); // $ Alert + Console.WriteLine("Error processing file: %s (%d)", ex, ex.HResult); // $ Alert } } From 46b21af3ef7fea4a15991aadc790f9c404113d3e Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 10:58:02 +0200 Subject: [PATCH 365/372] Dataflow: Make default field flow branch limit configurable per language --- shared/dataflow/codeql/dataflow/DataFlow.qll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/DataFlow.qll b/shared/dataflow/codeql/dataflow/DataFlow.qll index 0d78d13c884..93327f5ad6a 100644 --- a/shared/dataflow/codeql/dataflow/DataFlow.qll +++ b/shared/dataflow/codeql/dataflow/DataFlow.qll @@ -342,6 +342,9 @@ signature module InputSig { any() } + /** Gets the default value for the `fieldFlowBranchLimit` */ + default int defaultFieldFlowBranchLimit() { result = 2 } + /** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */ default predicate ignoreFieldFlowBranchLimit(DataFlowCallable c) { none() } } @@ -399,7 +402,7 @@ module Configs Lang> { * This can be overridden to a smaller value to improve performance (a * value of 0 disables field flow), or a larger value to get more results. */ - default int fieldFlowBranchLimit() { result = 2 } + default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() } @@ -548,7 +551,7 @@ module Configs Lang> { * This can be overridden to a smaller value to improve performance (a * value of 0 disables field flow), or a larger value to get more results. */ - default int fieldFlowBranchLimit() { result = 2 } + default int fieldFlowBranchLimit() { result = Lang::defaultFieldFlowBranchLimit() } /** Gets the access path limit. */ default int accessPathLimit() { result = Lang::accessPathLimit() } From 0357f3959b61cc806905741500a7725161963ae0 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 11:28:09 +0200 Subject: [PATCH 366/372] Update list of supported platforms I've effectively sync'ed this with the list of runners that are publicly available. I did not yet add Windows 2025, as it is my understanding is that we haven't really done any testing on that yet. --- docs/codeql/reusables/supported-platforms.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/codeql/reusables/supported-platforms.rst b/docs/codeql/reusables/supported-platforms.rst index 78a8215bffc..216e4c6a7c2 100644 --- a/docs/codeql/reusables/supported-platforms.rst +++ b/docs/codeql/reusables/supported-platforms.rst @@ -4,17 +4,17 @@ :stub-columns: 1 Operating system,Supported versions,Supported CPU architectures - Linux,"Ubuntu 20.04 + Linux,"Ubuntu 22.04 - Ubuntu 21.04 - - Ubuntu 22.04","x86-64" + Ubuntu 24.04","x86-64" Windows,"Windows 10 / Windows Server 2019 Windows 11 / Windows Server 2022","x86-64" macOS,"macOS 13 Ventura - macOS 14 Sonoma","x86-64, arm64 (Apple Silicon) [1]_" + macOS 14 Sonoma + + macOS 15 Sequoia","x86-64, arm64 (Apple Silicon) [1]_" .. container:: footnote-group From 42c4252a3d1f7db54b6626e479b517fb691fe805 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 11:35:53 +0200 Subject: [PATCH 367/372] C++: Claim beta support for C23 and C++23 All features we can support, we currently do support. --- .../supported-versions-compilers.rst | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/codeql/reusables/supported-versions-compilers.rst b/docs/codeql/reusables/supported-versions-compilers.rst index bbefaf79cce..bb2d4a7416a 100644 --- a/docs/codeql/reusables/supported-versions-compilers.rst +++ b/docs/codeql/reusables/supported-versions-compilers.rst @@ -4,13 +4,13 @@ :stub-columns: 1 Language,Variants,Compilers,Extensions - C/C++,"C89, C99, C11, C17, C++98, C++03, C++11, C++14, C++17, C++20 [1]_ [2]_","Clang (including clang-cl [3]_ and armclang) extensions (up to Clang 17.0), + C/C++,"C89, C99, C11, C17, C23, C++98, C++03, C++11, C++14, C++17, C++20, C++23 [1]_ [2]_ [3]_","Clang (including clang-cl [4]_ and armclang) extensions (up to Clang 17.0), GNU extensions (up to GCC 13.2), Microsoft extensions (up to VS 2022), - Arm Compiler 5 [4]_","``.cpp``, ``.c++``, ``.cxx``, ``.hpp``, ``.hh``, ``.h++``, ``.hxx``, ``.c``, ``.cc``, ``.h``" + Arm Compiler 5 [5]_","``.cpp``, ``.c++``, ``.cxx``, ``.hpp``, ``.hh``, ``.h++``, ``.hxx``, ``.c``, ``.cc``, ``.h``" C#,C# up to 13,"Microsoft Visual Studio up to 2019 with .NET up to 4.8, .NET Core up to 3.1 @@ -18,26 +18,27 @@ .NET 5, .NET 6, .NET 7, .NET 8, .NET 9","``.sln``, ``.csproj``, ``.cs``, ``.cshtml``, ``.xaml``" GitHub Actions,"Not applicable",Not applicable,"``.github/workflows/*.yml``, ``.github/workflows/*.yaml``, ``**/action.yml``, ``**/action.yaml``" Go (aka Golang), "Go up to 1.24", "Go 1.11 or more recent", ``.go`` - Java,"Java 7 to 24 [5]_","javac (OpenJDK and Oracle JDK), + Java,"Java 7 to 24 [6]_","javac (OpenJDK and Oracle JDK), - Eclipse compiler for Java (ECJ) [6]_",``.java`` + Eclipse compiler for Java (ECJ) [7]_",``.java`` Kotlin,"Kotlin 1.5.0 to 2.1.2\ *x*","kotlinc",``.kt`` - JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [7]_" - Python [8]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13",Not applicable,``.py`` - Ruby [9]_,"up to 3.3",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``" - Swift [10]_,"Swift 5.4-6.0","Swift compiler","``.swift``" - TypeScript [11]_,"2.6-5.8",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``" + JavaScript,ECMAScript 2022 or lower,Not applicable,"``.js``, ``.jsx``, ``.mjs``, ``.es``, ``.es6``, ``.htm``, ``.html``, ``.xhtm``, ``.xhtml``, ``.vue``, ``.hbs``, ``.ejs``, ``.njk``, ``.json``, ``.yaml``, ``.yml``, ``.raml``, ``.xml`` [8]_" + Python [9]_,"2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13",Not applicable,``.py`` + Ruby [10]_,"up to 3.3",Not applicable,"``.rb``, ``.erb``, ``.gemspec``, ``Gemfile``" + Swift [11]_,"Swift 5.4-6.0","Swift compiler","``.swift``" + TypeScript [12]_,"2.6-5.8",Standard TypeScript compiler,"``.ts``, ``.tsx``, ``.mts``, ``.cts``" .. container:: footnote-group .. [1] C++20 modules are *not* supported. - .. [2] Objective-C, Objective-C++, C++/CLI, and C++/CX are not supported. - .. [3] Support for the clang-cl compiler is preliminary. - .. [4] Support for the Arm Compiler (armcc) is preliminary. - .. [5] Builds that execute on Java 7 to 24 can be analyzed. The analysis understands standard language features in Java 8 to 24; "preview" and "incubator" features are not supported. Source code using Java language versions older than Java 8 are analyzed as Java 8 code. - .. [6] ECJ is supported when the build invokes it via the Maven Compiler plugin or the Takari Lifecycle plugin. - .. [7] JSX and Flow code, YAML, JSON, HTML, and XML files may also be analyzed with JavaScript files. - .. [8] The extractor requires Python 3 to run. To analyze Python 2.7 you should install both versions of Python. - .. [9] Requires glibc 2.17. - .. [10] Support for the analysis of Swift requires macOS. - .. [11] TypeScript analysis is performed by running the JavaScript extractor with TypeScript enabled. This is the default. + .. [2] C23 and C++23 support is currently in beta. + .. [3] Objective-C, Objective-C++, C++/CLI, and C++/CX are not supported. + .. [4] Support for the clang-cl compiler is preliminary. + .. [5] Support for the Arm Compiler (armcc) is preliminary. + .. [6] Builds that execute on Java 7 to 24 can be analyzed. The analysis understands standard language features in Java 8 to 24; "preview" and "incubator" features are not supported. Source code using Java language versions older than Java 8 are analyzed as Java 8 code. + .. [7] ECJ is supported when the build invokes it via the Maven Compiler plugin or the Takari Lifecycle plugin. + .. [8] JSX and Flow code, YAML, JSON, HTML, and XML files may also be analyzed with JavaScript files. + .. [9] The extractor requires Python 3 to run. To analyze Python 2.7 you should install both versions of Python. + .. [10] Requires glibc 2.17. + .. [11] Support for the analysis of Swift requires macOS. + .. [12] TypeScript analysis is performed by running the JavaScript extractor with TypeScript enabled. This is the default. From 063bff073be875a9cc907b773d4b6a7cbea90648 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 24 Apr 2025 12:15:31 +0100 Subject: [PATCH 368/372] C++: Add checks for build mode in various queries Adds a check for the absence of build-mode-none in cpp/wrong-type-format-argument cpp/comparison-with-wider-type cpp/integer-multiplication-cast-to-long cpp/implicit-function-declaration cpp/suspicious-add-sizeof --- cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql | 1 + cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql | 1 + .../Underspecified Functions/ImplicitFunctionDeclaration.ql | 1 + cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql | 1 + cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql | 1 + 5 files changed, 5 insertions(+) diff --git a/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql b/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql index ba7a6b58aa0..7eb465d35a9 100644 --- a/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql +++ b/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql @@ -179,6 +179,7 @@ predicate overflows(MulExpr me, Type t) { from MulExpr me, Type t1, Type t2 where + not any(Compilation c).buildModeNone() and t1 = me.getType().getUnderlyingType() and t2 = me.getConversion().getType().getUnderlyingType() and t1.getSize() < t2.getSize() and diff --git a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql index 75fe855c6f9..02975d2bdca 100644 --- a/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql +++ b/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql @@ -154,6 +154,7 @@ int sizeof_IntType() { exists(IntType it | result = it.getSize()) } from FormattingFunctionCall ffc, int n, Expr arg, Type expected, Type actual where + not any(Compilation c).buildModeNone() and ( formattingFunctionCallExpectedType(ffc, n, expected) and formattingFunctionCallActualType(ffc, n, arg, actual) and diff --git a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql index a361a3401f3..aa9d5d43c73 100644 --- a/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql +++ b/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql @@ -38,6 +38,7 @@ predicate isCompiledAsC(File f) { from FunctionDeclarationEntry fdeIm, FunctionCall fc where + not any(Compilation c).buildModeNone() and isCompiledAsC(fdeIm.getFile()) and not isFromMacroDefinition(fc) and fdeIm.isImplicit() and diff --git a/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql b/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql index 7d9ef88adea..021be5d091b 100644 --- a/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql +++ b/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql @@ -51,6 +51,7 @@ int getComparisonSizeAdjustment(Expr e) { from Loop l, RelationalOperation rel, VariableAccess small, Expr large where + not any(Compilation c).buildModeNone() and small = rel.getLesserOperand() and large = rel.getGreaterOperand() and rel = l.getCondition().getAChild*() and diff --git a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql index 4ac00fc42c6..11b7779118f 100644 --- a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql +++ b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql @@ -24,6 +24,7 @@ private predicate isCharSzPtrExpr(Expr e) { from Expr sizeofExpr, Expr e where + not any(Compilation c).buildModeNone() and // If we see an addWithSizeof then we expect the type of // the pointer expression to be `char*` or `void*`. Otherwise it // is probably a mistake. From 0cd859c5593949c4413c65b953450d6b8a50d886 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 24 Apr 2025 12:48:21 +0100 Subject: [PATCH 369/372] C++: qlformat --- cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql index 11b7779118f..da92c792432 100644 --- a/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql +++ b/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql @@ -28,7 +28,8 @@ where // If we see an addWithSizeof then we expect the type of // the pointer expression to be `char*` or `void*`. Otherwise it // is probably a mistake. - addWithSizeof(e, sizeofExpr, _) and not isCharSzPtrExpr(e) + addWithSizeof(e, sizeofExpr, _) and + not isCharSzPtrExpr(e) select sizeofExpr, "Suspicious sizeof offset in a pointer arithmetic expression. The type of the pointer is $@.", e.getFullyConverted().getType() as t, t.toString() From 69b87a63b851a64c4a89c495f3f58ae6e5a40c8d Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Thu, 24 Apr 2025 14:41:05 +0200 Subject: [PATCH 370/372] Go: remove invalid toolchain version diagnostics This diagnostic was introduced by https://github.com/github/codeql/pull/15979. However in the meantime the Go team [has backtracked](https://github.com/golang/go/issues/62278#issuecomment-2062002018) on their decision, which leads to confusing alerts for user (e.g. https://github.com/github/codeql-action/issues/2868). Even using Go toolchains from 1.21 to 1.22 we weren't immediately able to reproduce the problem that this diagnostics was meant to guard against. Therefore it was deemed simpler to just remove it. _En passant_ the `Makefile` now accepts `rtjo` not being set. --- go/Makefile | 2 ++ .../cli/go-autobuilder/go-autobuilder.go | 2 +- go/extractor/diagnostics/diagnostics.go | 15 -------- go/extractor/project/project.go | 34 +++++-------------- go/extractor/project/project_test.go | 29 ---------------- .../build_environment.expected | 5 --- .../diagnostics.expected | 31 ----------------- .../invalid-toolchain-version/src/go.mod | 3 -- .../invalid-toolchain-version/src/main.go | 5 --- .../invalid-toolchain-version/test.py | 6 ---- .../go-version-bump/diagnostics.expected | 17 ---------- .../newer-go-needed/diagnostics.expected | 17 ---------- 12 files changed, 11 insertions(+), 155 deletions(-) delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go delete mode 100644 go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py diff --git a/go/Makefile b/go/Makefile index b32b61bc5c3..5bf6d70e0e6 100644 --- a/go/Makefile +++ b/go/Makefile @@ -5,6 +5,8 @@ # and that we actually get are too big, the build fails on CI. BAZEL := $(shell bash -c "which bazel") +rtjo ?= none + all: gen extractor EXTRACTOR_PACK_OUT = extractor-pack diff --git a/go/extractor/cli/go-autobuilder/go-autobuilder.go b/go/extractor/cli/go-autobuilder/go-autobuilder.go index aeff4f0bd6e..50118c8dc9f 100644 --- a/go/extractor/cli/go-autobuilder/go-autobuilder.go +++ b/go/extractor/cli/go-autobuilder/go-autobuilder.go @@ -425,7 +425,7 @@ func installDependencies(workspace project.GoWorkspace) { } else { if workspace.Modules == nil { project.InitGoModForLegacyProject(workspace.BaseDir) - workspace.Modules = project.LoadGoModules(true, []string{filepath.Join(workspace.BaseDir, "go.mod")}) + workspace.Modules = project.LoadGoModules([]string{filepath.Join(workspace.BaseDir, "go.mod")}) } // get dependencies for all modules diff --git a/go/extractor/diagnostics/diagnostics.go b/go/extractor/diagnostics/diagnostics.go index 385c611aac8..00179b98cca 100644 --- a/go/extractor/diagnostics/diagnostics.go +++ b/go/extractor/diagnostics/diagnostics.go @@ -508,18 +508,3 @@ func EmitExtractionFailedForProjects(path []string) { noLocation, ) } - -func EmitInvalidToolchainVersion(goModPath string, version string) { - emitDiagnostic( - "go/autobuilder/invalid-go-toolchain-version", - "Invalid Go toolchain version", - strings.Join([]string{ - "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).", - fmt.Sprintf("`%s` in `%s` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", version, goModPath), - }, - "\n\n"), - severityWarning, - fullVisibility, - &locationStruct{File: goModPath}, - ) -} diff --git a/go/extractor/project/project.go b/go/extractor/project/project.go index eff69c0e9ca..1377b251341 100644 --- a/go/extractor/project/project.go +++ b/go/extractor/project/project.go @@ -192,20 +192,10 @@ func findGoModFiles(root string) []string { return util.FindAllFilesWithName(root, "go.mod", util.SkipVendorChecks...) } -// A regular expression for the Go toolchain version syntax. -var toolchainVersionRe *regexp.Regexp = regexp.MustCompile(`(?m)^([0-9]+\.[0-9]+(\.[0-9]+|rc[0-9]+))$`) - -// Returns true if the `go.mod` file specifies a Go language version, that version is `1.21` or greater, and -// there is no `toolchain` directive, and the Go language version is not a valid toolchain version. -func hasInvalidToolchainVersion(modFile *modfile.File) bool { - return modFile.Toolchain == nil && modFile.Go != nil && - !toolchainVersionRe.Match([]byte(modFile.Go.Version)) && util.NewSemVer(modFile.Go.Version).IsAtLeast(toolchain.V1_21) -} - // Given a list of `go.mod` file paths, try to parse them all. The resulting array of `GoModule` objects // will be the same length as the input array and the objects will contain at least the `go.mod` path. // If parsing the corresponding file is successful, then the parsed contents will also be available. -func LoadGoModules(emitDiagnostics bool, goModFilePaths []string) []*GoModule { +func LoadGoModules(goModFilePaths []string) []*GoModule { results := make([]*GoModule, len(goModFilePaths)) for i, goModFilePath := range goModFilePaths { @@ -227,14 +217,6 @@ func LoadGoModules(emitDiagnostics bool, goModFilePaths []string) []*GoModule { } results[i].Module = modFile - - // If this `go.mod` file specifies a Go language version, that version is `1.21` or greater, and - // there is no `toolchain` directive, check that it is a valid Go toolchain version. Otherwise, - // `go` commands which try to download the right version of the Go toolchain will fail. We detect - // this situation and emit a diagnostic. - if hasInvalidToolchainVersion(modFile) { - diagnostics.EmitInvalidToolchainVersion(goModFilePath, modFile.Go.Version) - } } return results @@ -243,7 +225,7 @@ func LoadGoModules(emitDiagnostics bool, goModFilePaths []string) []*GoModule { // Given a path to a `go.work` file, this function attempts to parse the `go.work` file. If unsuccessful, // we attempt to discover `go.mod` files within subdirectories of the directory containing the `go.work` // file ourselves. -func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { +func discoverWorkspace(workFilePath string) GoWorkspace { log.Printf("Loading %s...\n", workFilePath) baseDir := filepath.Dir(workFilePath) workFileSrc, err := os.ReadFile(workFilePath) @@ -257,7 +239,7 @@ func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { return GoWorkspace{ BaseDir: baseDir, - Modules: LoadGoModules(emitDiagnostics, goModFilePaths), + Modules: LoadGoModules(goModFilePaths), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, baseDir), } @@ -274,7 +256,7 @@ func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { return GoWorkspace{ BaseDir: baseDir, - Modules: LoadGoModules(emitDiagnostics, goModFilePaths), + Modules: LoadGoModules(goModFilePaths), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, baseDir), } @@ -297,7 +279,7 @@ func discoverWorkspace(emitDiagnostics bool, workFilePath string) GoWorkspace { return GoWorkspace{ BaseDir: baseDir, WorkspaceFile: workFile, - Modules: LoadGoModules(emitDiagnostics, goModFilePaths), + Modules: LoadGoModules(goModFilePaths), DepMode: GoGetWithModules, ModMode: ModReadonly, // Workspaces only support "readonly" } @@ -325,7 +307,7 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace { for i, goModFile := range goModFiles { results[i] = GoWorkspace{ BaseDir: filepath.Dir(goModFile), - Modules: LoadGoModules(emitDiagnostics, []string{goModFile}), + Modules: LoadGoModules([]string{goModFile}), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, filepath.Dir(goModFile)), } @@ -342,7 +324,7 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace { results := make([]GoWorkspace, len(goWorkFiles)) for i, workFilePath := range goWorkFiles { - results[i] = discoverWorkspace(emitDiagnostics, workFilePath) + results[i] = discoverWorkspace(workFilePath) } // Add all stray `go.mod` files (i.e. those not referenced by `go.work` files) @@ -374,7 +356,7 @@ func discoverWorkspaces(emitDiagnostics bool) []GoWorkspace { log.Printf("Module %s is not referenced by any go.work file; adding it separately.\n", goModFile) results = append(results, GoWorkspace{ BaseDir: filepath.Dir(goModFile), - Modules: LoadGoModules(emitDiagnostics, []string{goModFile}), + Modules: LoadGoModules([]string{goModFile}), DepMode: GoGetWithModules, ModMode: getModMode(GoGetWithModules, filepath.Dir(goModFile)), }) diff --git a/go/extractor/project/project_test.go b/go/extractor/project/project_test.go index 149a9723ec2..55cb163e919 100644 --- a/go/extractor/project/project_test.go +++ b/go/extractor/project/project_test.go @@ -39,35 +39,6 @@ func parseModFile(t *testing.T, contents string) *modfile.File { return modFile } -func testHasInvalidToolchainVersion(t *testing.T, contents string) bool { - return hasInvalidToolchainVersion(parseModFile(t, contents)) -} - -func TestHasInvalidToolchainVersion(t *testing.T) { - invalid := []string{ - "go 1.21\n", - "go 1.22\n", - } - - for _, v := range invalid { - if !testHasInvalidToolchainVersion(t, v) { - t.Errorf("Expected testHasInvalidToolchainVersion(\"%s\") to be true, but got false", v) - } - } - - valid := []string{ - "go 1.20\n", - "go 1.21.1\n", - "go 1.22\n\ntoolchain go1.22.0\n", - } - - for _, v := range valid { - if testHasInvalidToolchainVersion(t, v) { - t.Errorf("Expected testHasInvalidToolchainVersion(\"%s\") to be false, but got true", v) - } - } -} - func parseWorkFile(t *testing.T, contents string) *modfile.WorkFile { workFile, err := modfile.ParseWork("go.work", []byte(contents), nil) diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected deleted file mode 100644 index 0b225ce0085..00000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/build_environment.expected +++ /dev/null @@ -1,5 +0,0 @@ -{ - "configuration" : { - "go" : { } - } -} diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected deleted file mode 100644 index 2e5d732e53e..00000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/diagnostics.expected +++ /dev/null @@ -1,31 +0,0 @@ -{ - "location": { - "file": "go.mod" - }, - "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", - "severity": "warning", - "source": { - "extractorName": "go", - "id": "go/autobuilder/invalid-go-toolchain-version", - "name": "Invalid Go toolchain version" - }, - "visibility": { - "cliSummaryTable": true, - "statusPage": true, - "telemetry": true - } -} -{ - "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", - "severity": "note", - "source": { - "extractorName": "go", - "id": "go/autobuilder/single-root-go-mod-found", - "name": "A single `go.mod` file was found in the root" - }, - "visibility": { - "cliSummaryTable": false, - "statusPage": false, - "telemetry": true - } -} diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod deleted file mode 100644 index bee3365b899..00000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -go 1.21 - -module example diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go deleted file mode 100644 index 79058077776..00000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/src/main.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func main() { - -} diff --git a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py b/go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py deleted file mode 100644 index 44aa92d6758..00000000000 --- a/go/ql/integration-tests/diagnostics/invalid-toolchain-version/test.py +++ /dev/null @@ -1,6 +0,0 @@ -import os - - -def test(codeql, go): - os.environ["LGTM_INDEX_IMPORT_PATH"] = "test" - codeql.database.create(source_root="src") diff --git a/go/ql/integration-tests/go-version-bump/diagnostics.expected b/go/ql/integration-tests/go-version-bump/diagnostics.expected index 2e5d732e53e..56d774b7037 100644 --- a/go/ql/integration-tests/go-version-bump/diagnostics.expected +++ b/go/ql/integration-tests/go-version-bump/diagnostics.expected @@ -1,20 +1,3 @@ -{ - "location": { - "file": "go.mod" - }, - "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.21` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", - "severity": "warning", - "source": { - "extractorName": "go", - "id": "go/autobuilder/invalid-go-toolchain-version", - "name": "Invalid Go toolchain version" - }, - "visibility": { - "cliSummaryTable": true, - "statusPage": true, - "telemetry": true - } -} { "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", "severity": "note", diff --git a/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected b/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected index b64c1397938..56d774b7037 100644 --- a/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected +++ b/go/ql/integration-tests/resolve-build-environment/newer-go-needed/diagnostics.expected @@ -1,20 +1,3 @@ -{ - "location": { - "file": "go.mod" - }, - "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.22` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", - "severity": "warning", - "source": { - "extractorName": "go", - "id": "go/autobuilder/invalid-go-toolchain-version", - "name": "Invalid Go toolchain version" - }, - "visibility": { - "cliSummaryTable": true, - "statusPage": true, - "telemetry": true - } -} { "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", "severity": "note", From a5a21b1dddc7a4fa6755034adff7766e6e1c03c2 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 24 Apr 2025 17:40:49 +0200 Subject: [PATCH 371/372] Swift: Guard 'getCaptures' in `fillClosureExpr` --- swift/extractor/translators/ExprTranslator.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/swift/extractor/translators/ExprTranslator.cpp b/swift/extractor/translators/ExprTranslator.cpp index c57cfd5b9ee..0f7d5d0c915 100644 --- a/swift/extractor/translators/ExprTranslator.cpp +++ b/swift/extractor/translators/ExprTranslator.cpp @@ -477,7 +477,11 @@ codeql::ErrorExpr ExprTranslator::translateErrorExpr(const swift::ErrorExpr& exp void ExprTranslator::fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry) { entry.body = dispatcher.fetchLabel(expr.getBody()); - entry.captures = dispatcher.fetchRepeatedLabels(expr.getCaptureInfo().getCaptures()); + if (expr.getCaptureInfo().hasBeenComputed()) { + entry.captures = dispatcher.fetchRepeatedLabels(expr.getCaptureInfo().getCaptures()); + } else { + LOG_ERROR("Unable to get CaptureInfo"); + } CODEQL_EXPECT_OR(return, expr.getParameters(), "AbstractClosureExpr has null getParameters()"); entry.params = dispatcher.fetchRepeatedLabels(*expr.getParameters()); } From e8eac810b42e65d2b8518baccfa304bcff17e40b Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Fri, 25 Apr 2025 11:56:28 +0200 Subject: [PATCH 372/372] Swift: Commit external sources to git LFS --- swift/third_party/load.bzl | 4 ---- swift/third_party/resources/resource-dir-linux.zip | 4 ++-- swift/third_party/resources/resource-dir-macos.zip | 4 ++-- swift/third_party/resources/swift-prebuilt-linux.tar.zst | 4 ++-- swift/third_party/resources/swift-prebuilt-macos.tar.zst | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/swift/third_party/load.bzl b/swift/third_party/load.bzl index 8c891a26fc3..d19345a1880 100644 --- a/swift/third_party/load.bzl +++ b/swift/third_party/load.bzl @@ -5,10 +5,6 @@ load("//misc/bazel:lfs.bzl", "lfs_archive", "lfs_files") _override = { # these are used to test new artifacts. Must be empty before merging to main - "swift-prebuilt-macOS-swift-6.1-RELEASE-78.tar.zst": "4dcfe858b5519327c9b0c99735b47fe75c7a5090793d917de1ba6e42795aa86d", - "swift-prebuilt-Linux-swift-6.1-RELEASE-78.tar.zst": "d01b90bccfec46995bdf98a59339bd94e64257da99b4963148869c4a108bc2a9", - "resource-dir-macOS-swift-6.1-RELEASE-91.zip": "12bef89163486ac24d9ca00a5cc6ef3851b633e6fa63b7493c518e4d426e036c", - "resource-dir-Linux-swift-6.1-RELEASE-91.zip": "874932f93c4ca6269ae3a9e9c841916b3fd88f65f5018eec8777a52dde56901d", } _staging_url = "https://github.com/dsp-testing/codeql-swift-artifacts/releases/download/staging-{}/{}" diff --git a/swift/third_party/resources/resource-dir-linux.zip b/swift/third_party/resources/resource-dir-linux.zip index 2c45df3aa03..8697b7c7afc 100644 --- a/swift/third_party/resources/resource-dir-linux.zip +++ b/swift/third_party/resources/resource-dir-linux.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:403374c72e20299951c2c37185404500d15340baaa52bb2d06f8815b03f8071e -size 318874108 +oid sha256:874932f93c4ca6269ae3a9e9c841916b3fd88f65f5018eec8777a52dde56901d +size 293646067 diff --git a/swift/third_party/resources/resource-dir-macos.zip b/swift/third_party/resources/resource-dir-macos.zip index c358585ea65..95ffbc2e02f 100644 --- a/swift/third_party/resources/resource-dir-macos.zip +++ b/swift/third_party/resources/resource-dir-macos.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:38f48790fea144b7cf5918b885f32a0f68e21aa5f3c2f0a5722573cc9e950639 -size 653096176 +oid sha256:12bef89163486ac24d9ca00a5cc6ef3851b633e6fa63b7493c518e4d426e036c +size 595744464 diff --git a/swift/third_party/resources/swift-prebuilt-linux.tar.zst b/swift/third_party/resources/swift-prebuilt-linux.tar.zst index 0a1fe2b3f4d..03490187210 100644 --- a/swift/third_party/resources/swift-prebuilt-linux.tar.zst +++ b/swift/third_party/resources/swift-prebuilt-linux.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af1e3355fb476538449424a74f15ce21a0f877c7f85a568e736f0bd6c0239a8f -size 118694583 +oid sha256:d01b90bccfec46995bdf98a59339bd94e64257da99b4963148869c4a108bc2a9 +size 124360007 diff --git a/swift/third_party/resources/swift-prebuilt-macos.tar.zst b/swift/third_party/resources/swift-prebuilt-macos.tar.zst index f69024bd10d..692a8b05dc3 100644 --- a/swift/third_party/resources/swift-prebuilt-macos.tar.zst +++ b/swift/third_party/resources/swift-prebuilt-macos.tar.zst @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c81917da67ff2bb642ef2e34e005466b06f756c958702ec070bcacdb83c2f76 -size 101405609 +oid sha256:4dcfe858b5519327c9b0c99735b47fe75c7a5090793d917de1ba6e42795aa86d +size 105011965