Merge branch 'main' into gen2

This commit is contained in:
Geoffrey White
2025-10-28 09:26:13 +00:00
120 changed files with 12760 additions and 871 deletions

View File

@@ -1,10 +1,10 @@
import cpp
/**
* Describes whether a relation is 'strict' (that is, a `<` or `>`
* The strictness of a relation. Either 'strict' (that is, a `<` or `>`
* relation) or 'non-strict' (a `<=` or `>=` relation).
*/
newtype RelationStrictness =
newtype TRelationStrictness =
/**
* Represents that a relation is 'strict' (that is, a `<` or `>` relation).
*/
@@ -14,6 +14,19 @@ newtype RelationStrictness =
*/
Nonstrict()
/**
* The strictness of a relation. Either 'strict' (that is, a `<` or `>`
* relation) or 'non-strict' (a `<=` or `>=` relation).
*/
class RelationStrictness extends TRelationStrictness {
/** Gets the string representation of this relation strictness. */
string toString() {
this = Strict() and result = "strict"
or
this = Nonstrict() and result = "non-strict"
}
}
/**
* Describes whether a relation is 'greater' (that is, a `>` or `>=`
* relation) or 'lesser' (a `<` or `<=` relation).
@@ -105,10 +118,10 @@ predicate relOpWithSwap(
*
* This allows for the relation to be either as written, or with its
* arguments reversed; for example, if `rel` is `x < 5` then
* `relOpWithSwapAndNegate(rel, x, 5, Lesser(), Strict(), true)`,
* `relOpWithSwapAndNegate(rel, 5, x, Greater(), Strict(), true)`,
* `relOpWithSwapAndNegate(rel, x, 5, Greater(), Nonstrict(), false)` and
* `relOpWithSwapAndNegate(rel, 5, x, Lesser(), Nonstrict(), false)` hold.
* - `relOpWithSwapAndNegate(rel, x, 5, Lesser(), Strict(), true)`,
* - `relOpWithSwapAndNegate(rel, 5, x, Greater(), Strict(), true)`,
* - `relOpWithSwapAndNegate(rel, x, 5, Greater(), Nonstrict(), false)` and
* - `relOpWithSwapAndNegate(rel, 5, x, Lesser(), Nonstrict(), false)` hold.
*/
predicate relOpWithSwapAndNegate(
RelationalOperation rel, Expr a, Expr b, RelationDirection dir, RelationStrictness strict,

View File

@@ -111,25 +111,24 @@ float widenUpperBound(Type type, float ub) {
* compilation units, which doesn't necessarily have a getValue() result from the extractor.
*/
private string getValue(Expr e) {
if exists(e.getValue())
then result = e.getValue()
else
/*
* It should be safe to propagate the initialization value to a variable if:
* The type of v is const, and
* The type of v is not volatile, and
* Either:
* v is a local/global variable, or
* v is a static member variable
*/
result = e.getValue()
or
not exists(e.getValue()) and
/*
* It should be safe to propagate the initialization value to a variable if:
* The type of v is const, and
* The type of v is not volatile, and
* Either:
* v is a local/global variable, or
* v is a static member variable
*/
exists(VariableAccess access, StaticStorageDurationVariable v |
not v.getUnderlyingType().isVolatile() and
v.getUnderlyingType().isConst() and
e = access and
v = access.getTarget() and
result = getValue(v.getAnAssignedValue())
)
exists(StaticStorageDurationVariable v |
not v.getUnderlyingType().isVolatile() and
v.getUnderlyingType().isConst() and
v = e.(VariableAccess).getTarget() and
result = getValue(v.getAnAssignedValue())
)
}
/**
@@ -1214,7 +1213,7 @@ private float getLowerBoundsImpl(Expr expr) {
// equal to `min(-y + 1,y - 1)`.
exists(float childLB |
childLB = getFullyConvertedLowerBounds(remExpr.getAnOperand()) and
not childLB >= 0
childLB < 0
|
result = getFullyConvertedLowerBounds(remExpr.getRightOperand()) - 1
or
@@ -1426,8 +1425,7 @@ private float getUpperBoundsImpl(Expr expr) {
// adding `-rhsLB` to the set of upper bounds.
exists(float rhsLB |
rhsLB = getFullyConvertedLowerBounds(remExpr.getRightOperand()) and
not rhsLB >= 0
|
rhsLB < 0 and
result = -rhsLB + 1
)
)
@@ -1572,8 +1570,7 @@ private float getPhiLowerBounds(StackVariable v, RangeSsaDefinition phi) {
exists(VariableAccess access, Expr guard, boolean branch, float defLB, float guardLB |
phi.isGuardPhi(v, access, guard, branch) and
lowerBoundFromGuard(guard, access, guardLB, branch) and
defLB = getFullyConvertedLowerBounds(access)
|
defLB = getFullyConvertedLowerBounds(access) and
// Compute the maximum of `guardLB` and `defLB`.
if guardLB > defLB then result = guardLB else result = defLB
)
@@ -1597,8 +1594,7 @@ private float getPhiUpperBounds(StackVariable v, RangeSsaDefinition phi) {
exists(VariableAccess access, Expr guard, boolean branch, float defUB, float guardUB |
phi.isGuardPhi(v, access, guard, branch) and
upperBoundFromGuard(guard, access, guardUB, branch) and
defUB = getFullyConvertedUpperBounds(access)
|
defUB = getFullyConvertedUpperBounds(access) and
// Compute the minimum of `guardUB` and `defUB`.
if guardUB < defUB then result = guardUB else result = defUB
)
@@ -1762,8 +1758,7 @@ private predicate upperBoundFromGuard(Expr guard, VariableAccess v, float ub, bo
}
/**
* This predicate simplifies the results returned by
* `linearBoundFromGuard`.
* This predicate simplifies the results returned by `linearBoundFromGuard`.
*/
private predicate boundFromGuard(
Expr guard, VariableAccess v, float boundValue, boolean isLowerBound,
@@ -1771,22 +1766,10 @@ private predicate boundFromGuard(
) {
exists(float p, float q, float r, boolean isLB |
linearBoundFromGuard(guard, v, p, q, r, isLB, strictness, branch) and
boundValue = (r - q) / p
|
boundValue = (r - q) / p and
// If the multiplier is negative then the direction of the comparison
// needs to be flipped.
p > 0 and isLowerBound = isLB
or
p < 0 and isLowerBound = isLB.booleanNot()
)
or
// When `!e` is true, we know that `0 <= e <= 0`
exists(float p, float q, Expr e |
linearAccess(e, v, p, q) and
eqZeroWithNegate(guard, e, true, branch) and
boundValue = (0.0 - q) / p and
isLowerBound = [false, true] and
strictness = Nonstrict()
if p < 0 then isLowerBound = isLB.booleanNot() else isLowerBound = isLB
)
}
@@ -1796,54 +1779,57 @@ private predicate boundFromGuard(
* lower or upper bound for `v`.
*/
private predicate linearBoundFromGuard(
ComparisonOperation guard, VariableAccess v, float p, float q, float boundValue,
Expr guard, VariableAccess v, float p, float q, float r,
boolean isLowerBound, // Is this a lower or an upper bound?
RelationStrictness strictness, boolean branch // Which control-flow branch is this bound valid on?
) {
// For the comparison x < RHS, we create two bounds:
//
// 1. x < upperbound(RHS)
// 2. x >= typeLowerBound(RHS.getUnspecifiedType())
//
exists(Expr lhs, Expr rhs, RelationDirection dir, RelationStrictness st |
linearAccess(lhs, v, p, q) and
relOpWithSwapAndNegate(guard, lhs, rhs, dir, st, branch)
|
isLowerBound = directionIsGreater(dir) and
strictness = st and
getBounds(rhs, boundValue, isLowerBound)
exists(Expr lhs | linearAccess(lhs, v, p, q) |
// For the comparison x < RHS, we create the following bounds:
// 1. x < upperbound(RHS)
// 2. x >= typeLowerBound(RHS.getUnspecifiedType())
exists(Expr rhs, RelationDirection dir, RelationStrictness st |
relOpWithSwapAndNegate(guard, lhs, rhs, dir, st, branch)
|
isLowerBound = directionIsGreater(dir) and
strictness = st and
r = getBounds(rhs, isLowerBound)
or
isLowerBound = directionIsLesser(dir) and
strictness = Nonstrict() and
r = getExprTypeBounds(rhs, isLowerBound)
)
or
isLowerBound = directionIsLesser(dir) and
strictness = Nonstrict() and
exprTypeBounds(rhs, boundValue, isLowerBound)
)
or
// For x == RHS, we create the following bounds:
//
// 1. x <= upperbound(RHS)
// 2. x >= lowerbound(RHS)
//
exists(Expr lhs, Expr rhs |
linearAccess(lhs, v, p, q) and
eqOpWithSwapAndNegate(guard, lhs, rhs, true, branch) and
getBounds(rhs, boundValue, isLowerBound) and
// For x == RHS, we create the following bounds:
// 1. x <= upperbound(RHS)
// 2. x >= lowerbound(RHS)
exists(Expr rhs |
eqOpWithSwapAndNegate(guard, lhs, rhs, true, branch) and
r = getBounds(rhs, isLowerBound) and
strictness = Nonstrict()
)
or
// When `x` is equal to 0 we create the following bounds:
// 1. x <= 0
// 2. x >= 0
eqZeroWithNegate(guard, lhs, true, branch) and
r = 0.0 and
isLowerBound = [false, true] and
strictness = Nonstrict()
)
// x != RHS and !x are handled elsewhere
}
/** Get the fully converted lower or upper bounds of `expr` based on `isLowerBound`. */
private float getBounds(Expr expr, boolean isLowerBound) {
isLowerBound = true and result = getFullyConvertedLowerBounds(expr)
or
isLowerBound = false and result = getFullyConvertedUpperBounds(expr)
}
/** Utility for `linearBoundFromGuard`. */
private predicate getBounds(Expr expr, float boundValue, boolean isLowerBound) {
isLowerBound = true and boundValue = getFullyConvertedLowerBounds(expr)
private float getExprTypeBounds(Expr expr, boolean isLowerBound) {
isLowerBound = true and result = exprMinVal(expr.getFullyConverted())
or
isLowerBound = false and boundValue = getFullyConvertedUpperBounds(expr)
}
/** Utility for `linearBoundFromGuard`. */
private predicate exprTypeBounds(Expr expr, float boundValue, boolean isLowerBound) {
isLowerBound = true and boundValue = exprMinVal(expr.getFullyConverted())
or
isLowerBound = false and boundValue = exprMaxVal(expr.getFullyConverted())
isLowerBound = false and result = exprMaxVal(expr.getFullyConverted())
}
/**

View File

@@ -914,7 +914,7 @@ void guard_with_exit(int x, int y) {
// This test ensures that we correctly identify
// that the upper bound for y is max_int when calling `out(y)`.
// The RangeSsa will place guardPhy on `out(y)`, and consequently there is no
// The RangeSsa will place guardPhi on `out(y)`, and consequently there is no
// frontier phi node at out(y).
}
@@ -922,7 +922,7 @@ void test(int x) {
if (x >= 10) {
return;
}
// The basic below has two predecessors.
// The basic block below has two predecessors.
label:
out(x);
goto label;

View File

@@ -16,6 +16,17 @@ import csharp
import semmle.code.asp.WebConfig
import semmle.code.csharp.frameworks.system.Web
XmlElement getAWebConfigRoot(WebConfigXml webConfig) {
result = webConfig.getARootElement()
or
result = webConfig.getARootElement().getAChild("location") and
(
not result.hasAttribute("path") // equivalent to path="."
or
result.getAttributeValue("path") = ["", "."]
)
}
/**
* Holds if the `Web.config` file `webConfig` adds an `X-Frame-Options` header.
*/
@@ -30,8 +41,8 @@ predicate hasWebConfigXFrameOptions(WebConfigXml webConfig) {
// </httpProtocol>
// </system.webServer>
// ```
webConfig
.getARootElement()
// This can also be in a `location`
getAWebConfigRoot(webConfig)
.getAChild("system.webServer")
.getAChild("httpProtocol")
.getAChild("customHeaders")

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* the `cs/web/missing-x-frame-options` query now correctly handles configuration nested in root `<location>` elements.

View File

@@ -0,0 +1,18 @@
using System;
using System.Web;
public class AddXFrameOptions : IHttpHandler
{
public void ProcessRequest(HttpContext ctx)
{
}
public bool IsReusable
{
get
{
return true;
}
}
}

View File

@@ -0,0 +1 @@
Security Features/CWE-451/MissingXFrameOptions.ql

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location>
</configuration>

View File

@@ -0,0 +1,3 @@
semmle-extractor-options: /nostdlib /noconfig
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj
semmle-extractor-options: ${testdir}/../../../../../resources/stubs/System.Web.cs

View File

@@ -0,0 +1,287 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.1.1
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
JAVA_HOME="`/usr/libexec/java_home`"; export JAVA_HOME
else
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`\\unset -f command; \\command -v java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
printf '%s' "$(cd "$basedir"; pwd)"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
BASE_DIR=$(find_maven_basedir "$(dirname $0)")
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
else
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;;
esac
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $wrapperUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
fi
if command -v wget > /dev/null; then
QUIET="--quiet"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
QUIET=""
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath"
else
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath"
fi
[ $? -eq 0 ] || rm -f "$wrapperJarPath"
elif command -v curl > /dev/null; then
QUIET="--silent"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
QUIET=""
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L
else
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L
fi
[ $? -eq 0 ] || rm -f "$wrapperJarPath"
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaSource="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaSource=`cygpath --path --windows "$javaSource"`
javaClass=`cygpath --path --windows "$javaClass"`
fi
if [ -e "$javaSource" ]; then
if [ ! -e "$javaClass" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaSource")
fi
if [ -e "$javaClass" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

View File

@@ -0,0 +1,187 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.1.1
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %WRAPPER_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>maven-wrapper-missing-properties-test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,4 @@
.mvn/wrapper/maven-wrapper.properties
pom.xml
src/main/java/com/example/Hello.java
target/maven-archiver/pom.properties

View File

@@ -0,0 +1,7 @@
package com.example;
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

View File

@@ -0,0 +1,2 @@
def test(codeql, java):
codeql.database.create(build_mode="autobuild")

View File

@@ -271,10 +271,6 @@ 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

View File

@@ -12,6 +12,7 @@ private class ShortStringLiteral extends StringLiteral {
/**
* A string literal that may refer to a broken or risky cryptographic algorithm.
*/
overlay[local?]
class BrokenAlgoLiteral extends ShortStringLiteral {
BrokenAlgoLiteral() {
this.getValue().regexpMatch(getInsecureAlgorithmRegex()) and

View File

@@ -33,6 +33,7 @@ private class StaticByteArrayCreation extends ArrayCreationExpr {
}
/** An expression that updates `array`. */
overlay[local?]
private class ArrayUpdate extends Expr {
Expr array;

View File

@@ -69,6 +69,7 @@ private class FollowsBarrierPrefix extends UrlForwardBarrier {
FollowsBarrierPrefix() { this.asExpr() = any(BarrierPrefix fp).getAnAppendedExpression() }
}
overlay[local?]
private class BarrierPrefix extends InterestingPrefix {
int offset;

View File

@@ -1,27 +0,0 @@
/**
* @name An SSA variable without a unique 'toString()'
* @description An ambiguous 'toString()' indicates overlap in the defining
* sub-classes of 'SsaVariable'.
* @kind problem
* @problem.severity error
* @id java/consistency/non-unique-ssa-tostring
* @tags consistency
*/
import java
import semmle.code.java.dataflow.SSA
predicate noToString(SsaVariable v) { not exists(v.toString()) }
predicate multipleToString(SsaVariable v) { 1 < count(v.toString()) }
from SsaVariable ssa, ControlFlowNode n, Variable v, string problem
where
(
noToString(ssa) and problem = "SSA variable without 'toString()' for "
or
multipleToString(ssa) and problem = "SSA variable with multiple 'toString()' results for "
) and
n = ssa.getCfgNode() and
v = ssa.getSourceVariable().getVariable()
select n, problem + v

View File

@@ -1,17 +0,0 @@
/**
* @name A phi node without two or more inputs
* @description A phi node should have at least two inputs.
* @kind problem
* @problem.severity error
* @id java/consistency/too-few-phi-inputs
* @tags consistency
*/
import java
import semmle.code.java.dataflow.SSA
from SsaPhiNode phi, int inputs
where
inputs = count(SsaVariable v | v = phi.getAPhiInput()) and
inputs < 2
select phi, "Phi node for " + phi.getSourceVariable() + " has only " + inputs + " inputs."

View File

@@ -1,26 +0,0 @@
/**
* @name An uncertain SSA update without a prior definition
* @description An uncertain SSA update may retain its previous value
* and should therefore have a prior definition.
* @kind problem
* @problem.severity error
* @id java/consistency/uncertain-ssa-update-without-prior-def
* @tags consistency
*/
import java
import semmle.code.java.dataflow.SSA
predicate live(SsaVariable v) {
exists(v.getAUse())
or
exists(SsaPhiNode phi | live(phi) and phi.getAPhiInput() = v)
or
exists(SsaUncertainImplicitUpdate upd | live(upd) and upd.getPriorDef() = v)
}
from SsaUncertainImplicitUpdate upd
where
live(upd) and
not exists(upd.getPriorDef())
select upd, "No prior definition of " + upd

View File

@@ -1,52 +0,0 @@
/**
* @name A variable use without a unique SSA variable
* @description Every variable use that is sufficiently trackable
* should have a unique associated SSA variable.
* @kind problem
* @problem.severity error
* @id java/consistency/use-without-unique-ssa-variable
* @tags consistency
*/
import java
import semmle.code.java.dataflow.SSA
class SsaConvertibleReadAccess extends VarRead {
SsaConvertibleReadAccess() {
this.getEnclosingCallable().getBody().getBasicBlock().getASuccessor*() = this.getBasicBlock() and
(
not exists(this.getQualifier())
or
this.getVariable() instanceof LocalScopeVariable
or
this.getVariable().(Field).isStatic()
or
exists(Expr q | q = this.getQualifier() |
q instanceof ThisAccess or
q instanceof SuperAccess or
q instanceof SsaConvertibleReadAccess
)
)
}
}
predicate accessWithoutSourceVariable(SsaConvertibleReadAccess va) {
not exists(SsaSourceVariable v | v.getAnAccess() = va)
}
predicate readAccessWithoutSsaVariable(SsaConvertibleReadAccess va) {
not exists(SsaVariable v | v.getAUse() = va)
}
predicate readAccessWithAmbiguousSsaVariable(SsaConvertibleReadAccess va) {
1 < strictcount(SsaVariable v | v.getAUse() = va)
}
from SsaConvertibleReadAccess va, string problem
where
accessWithoutSourceVariable(va) and problem = "No source variable"
or
readAccessWithoutSsaVariable(va) and problem = "No SSA variable"
or
readAccessWithAmbiguousSsaVariable(va) and problem = "Multiple SSA variables"
select va, problem

View File

@@ -247,10 +247,24 @@ module CleartextLogging {
reduceCall.getABoundCallbackParameter(0, 1) = name
|
reduceCall.getReceiver+().(DataFlow::MethodCallNode).getMethodName() = "filter"
or
isArrayOfConstants(reduceCall.getReceiver+())
)
or
exists(StringOps::RegExpTest test | test.getStringOperand().getALocalSource() = name)
or
exists(MembershipCandidate test | test.getAMemberNode().getALocalSource() = name)
}
private predicate isArrayOfConstants(DataFlow::ArrayCreationNode array) {
forex(DataFlow::Node node |
node =
[
array.getAnElement(), array.getAPropertyWrite().getRhs(),
array.getAMethodCall("push").getArgument(0)
]
|
exists(node.getStringValue())
)
}
}

View File

@@ -1,3 +1,7 @@
#select
| build-leaks.js:4:39:6:1 | {\\n " ... leak]\\n} | build-leaks.js:5:35:5:45 | process.env | build-leaks.js:4:39:6:1 | {\\n " ... leak]\\n} | This creates a build artifact that depends on $@. | build-leaks.js:5:35:5:45 | process.env | sensitive data returned byprocess environment |
| build-leaks.js:34:26:34:57 | getEnv( ... ngified | build-leaks.js:15:24:15:34 | process.env | build-leaks.js:34:26:34:57 | getEnv( ... ngified | This creates a build artifact that depends on $@. | build-leaks.js:15:24:15:34 | process.env | sensitive data returned byprocess environment |
| build-leaks.js:41:43:41:86 | { "proc ... y(pw) } | build-leaks.js:40:14:40:60 | url.par ... assword | build-leaks.js:41:43:41:86 | { "proc ... y(pw) } | This creates a build artifact that depends on $@. | build-leaks.js:40:14:40:60 | url.par ... assword | sensitive data returned byan access to current_password |
edges
| build-leaks.js:5:20:5:46 | JSON.st ... ss.env) | build-leaks.js:4:39:6:1 | {\\n " ... leak]\\n} | provenance | |
| build-leaks.js:5:35:5:45 | process.env | build-leaks.js:5:20:5:46 | JSON.st ... ss.env) | provenance | |
@@ -53,7 +57,3 @@ nodes
subpaths
| build-leaks.js:22:36:22:38 | raw | build-leaks.js:22:49:22:51 | env | build-leaks.js:24:20:24:22 | env | build-leaks.js:22:24:25:14 | Object. ... }, {}) |
| build-leaks.js:22:36:22:38 | raw | build-leaks.js:23:39:23:41 | raw | build-leaks.js:24:20:24:22 | env | build-leaks.js:22:24:25:14 | Object. ... }, {}) |
#select
| build-leaks.js:4:39:6:1 | {\\n " ... leak]\\n} | build-leaks.js:5:35:5:45 | process.env | build-leaks.js:4:39:6:1 | {\\n " ... leak]\\n} | This creates a build artifact that depends on $@. | build-leaks.js:5:35:5:45 | process.env | sensitive data returned byprocess environment |
| build-leaks.js:34:26:34:57 | getEnv( ... ngified | build-leaks.js:15:24:15:34 | process.env | build-leaks.js:34:26:34:57 | getEnv( ... ngified | This creates a build artifact that depends on $@. | build-leaks.js:15:24:15:34 | process.env | sensitive data returned byprocess environment |
| build-leaks.js:41:43:41:86 | { "proc ... y(pw) } | build-leaks.js:40:14:40:60 | url.par ... assword | build-leaks.js:41:43:41:86 | { "proc ... y(pw) } | This creates a build artifact that depends on $@. | build-leaks.js:40:14:40:60 | url.par ... assword | sensitive data returned byan access to current_password |

View File

@@ -1 +1,2 @@
query: Security/CWE-312/BuildArtifactLeak.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql

View File

@@ -90,4 +90,14 @@ var server = https.createServer(function (req, res) {
}
new webpack.DefinePlugin(getOnlyReactVariables3());
})();
function getFilteredEnv4() {
return ["FOO", "BAR", "BAZ"]
.reduce((env, key) => {
env[key] = JSON.stringify(process.env[key]);
return env;
}, {});
}
new webpack.DefinePlugin(getFilteredEnv4());
})();

View File

@@ -3,12 +3,11 @@ Wrappers and helpers around `rules_pkg` to build codeql packs.
"""
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_skylib//rules:native_binary.bzl", "native_test")
load("@rules_pkg//pkg:install.bzl", "pkg_install")
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", _strip_prefix = "strip_prefix")
load("@rules_pkg//pkg:pkg.bzl", "pkg_zip")
load("@rules_pkg//pkg:providers.bzl", "PackageFilegroupInfo", "PackageFilesInfo")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:defs.bzl", "py_binary", "py_test")
load("//misc/bazel:os.bzl", "OS_DETECTION_ATTRS", "os_select")
def _make_internal(name):
@@ -366,28 +365,29 @@ def _codeql_pack_install(name, srcs, install_dest = None, build_file_label = Non
] if build_file_label else []) + (
["--destdir", "\"%s\"" % install_dest] if install_dest else []
)
py_binary(
name = name,
installer_args = dict(
srcs = [Label("//misc/bazel/internal:install.py")],
main = Label("//misc/bazel/internal:install.py"),
deps = ["@rules_python//python/runfiles"],
data = data,
args = args,
)
py_binary(
name = name,
**installer_args
)
# this hack is meant to be an optimization when using install for tests, where
# the install step is skipped if nothing changed. If the installation directory
# is somehow messed up, `bazel run` can be used to force install
native_test(
py_test(
name = internal("as", "test"),
src = name,
tags = [
"manual", # avoid having this picked up by `...`, `:all` or `:*`
"local", # make sure installation does not run sandboxed
],
data = data,
args = args,
size = "small",
**installer_args
)
def codeql_pack_group(name, srcs, visibility = None, skip_installer = False, prefix = "", install_dest = None, build_file_label = None, compression_level = 6):

View File

@@ -58,6 +58,11 @@
for example if parts of the session are memoized. Calling
<code>protect_from_forgery with: :exception</code> can help to avoid this
by raising an exception on an invalid CSRF token instead.
Note this remains true even in Rails version 5 and later: these versions
automatically run <code>protect_from_forgery with: :exception</code>
by default, but manually calling <code>protect_from_forgery</code> with
no <code>with</code> argument will still downgrade protection to provide an
empty session rather than raise an exception.
</p>
</example>

View File

@@ -42,6 +42,12 @@
vulnerability - for example if parts of the session are memoized. Calling
<code>protect_from_forgery with: :exception</code> can help to avoid this
by raising an exception on an invalid CSRF token instead.
Note that Rails versions 5 and later
automatically run <code>protect_from_forgery with: :exception</code>
by default, but manually calling <code>protect_from_forgery</code> with
no <code>with</code> argument will downgrade protection to provide an empty
session rather than raise an exception.
</p>
</recommendation>

View File

@@ -0,0 +1,16 @@
class AvailabilitySpec extends @availability_spec {
string toString() { none() }
}
query predicate new_other_availability_specs(AvailabilitySpec id) {
availability_specs(id) and
availability_spec_is_wildcard(id)
}
query predicate new_platform_version_availability_specs(
AvailabilitySpec id, string platform, string version
) {
availability_specs(id) and
availability_spec_platforms(id, platform) and
availability_spec_versions(id, version)
}

View File

@@ -0,0 +1,57 @@
class KeyPathComponent extends @key_path_component {
string toString() { none() }
}
class Element extends @element {
string toString() { none() }
}
class ArgumentOrNone extends @argument_or_none {
string toString() { none() }
}
class TypeOrNone extends @type_or_none {
string toString() { none() }
}
class ValueDeclOrNone extends @value_decl_or_none {
string toString() { none() }
}
predicate isKeyPathComponentWithNewKind(KeyPathComponent id) {
key_path_components(id, 3, _) or key_path_components(id, 4, _)
}
query predicate new_key_path_components(KeyPathComponent id, int kind, TypeOrNone component_type) {
exists(int old_kind |
key_path_components(id, old_kind, component_type) and
not isKeyPathComponentWithNewKind(id) and
if old_kind < 5 then kind = old_kind else kind = old_kind - 2
)
}
query predicate new_key_path_component_subscript_arguments(
KeyPathComponent id, int index, ArgumentOrNone subscript_argument
) {
key_path_component_subscript_arguments(id, index, subscript_argument) and
not isKeyPathComponentWithNewKind(id)
}
query predicate new_key_path_component_tuple_indices(KeyPathComponent id, int tuple_index) {
key_path_component_tuple_indices(id, tuple_index) and
not isKeyPathComponentWithNewKind(id)
}
query predicate new_key_path_component_decl_refs(KeyPathComponent id, ValueDeclOrNone decl_ref) {
key_path_component_decl_refs(id, decl_ref) and
not isKeyPathComponentWithNewKind(id)
}
query predicate new_unspecified_elements(Element id, string property, string error) {
unspecified_elements(id, property, error)
or
isKeyPathComponentWithNewKind(id) and
property = "" and
error =
"UnresolvedApply and Apply KeyPathComponents removed during database downgrade. Please update your CodeQL."
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
class ExistentialArchetypeType extends @existential_archetype_type {
string toString() { none() }
}
from ExistentialArchetypeType id
where existential_archetype_types(id)
select id

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
description: Upgrade to Swift 6.2
compatibility: partial
availability_specs.rel: delete
availability_spec_platforms.rel: delete
availability_spec_versions.rel: delete
availability_spec_is_wildcard.rel: delete
other_availability_specs.rel: run availability_specs.qlo new_other_availability_specs
platform_version_availability_specs.rel: run availability_specs.qlo new_platform_version_availability_specs
existential_archetype_types.rel: delete
opened_archetype_types.rel: run opened_archetype_types.qlo
key_path_components.rel: run key_path_components.qlo new_key_path_components
key_path_component_subscript_arguments.rel: run key_path_components.qlo new_key_path_component_subscript_arguments
key_path_component_tuple_indices.rel: run key_path_components.qlo new_key_path_component_tuple_indices
key_path_component_decl_refs.rel: run key_path_components.qlo new_key_path_component_decl_refs
unspecified_elements.rel: run key_path_components.qlo new_unspecified_elements

View File

@@ -170,7 +170,7 @@ static std::unordered_set<swift::ModuleDecl*> extractDeclarations(
bodyEmissionStrategy);
auto topLevelDecls = getTopLevelDecls(module, primaryFile, lazyDeclaration);
for (auto decl : topLevelDecls) {
if (swift::AvailableAttr::isUnavailable(decl)) {
if (decl->isUnavailable() && !llvm::isa<swift::NominalTypeDecl>(decl)) {
continue;
}
visitor.extract(decl);

View File

@@ -12,8 +12,7 @@ using namespace codeql;
// same module one by one. In this mode, we restrict emission only to the same file ignoring
// all the other files.
bool SwiftBodyEmissionStrategy::shouldEmitDeclBody(const swift::Decl& decl) {
auto module = decl.getModuleContext();
if (module != &currentModule) {
if (!currentTopLevelDecls.contains(&decl) && decl.getModuleContext() != &currentModule) {
return false;
}
if (currentLazyDeclaration && currentLazyDeclaration != &decl) {

View File

@@ -12,13 +12,19 @@ class SwiftBodyEmissionStrategy {
const swift::Decl* currentLazyDeclaration)
: currentModule(currentModule),
currentPrimarySourceFile(currentPrimarySourceFile),
currentLazyDeclaration(currentLazyDeclaration) {}
currentLazyDeclaration(currentLazyDeclaration) {
llvm::SmallVector<swift::Decl*> decls;
currentModule.getTopLevelDecls(decls);
currentTopLevelDecls.insert(decls.begin(), decls.end());
}
bool shouldEmitDeclBody(const swift::Decl& decl);
private:
swift::ModuleDecl& currentModule;
swift::SourceFile* currentPrimarySourceFile;
const swift::Decl* currentLazyDeclaration;
std::unordered_set<const swift::Decl*> currentTopLevelDecls;
};
} // namespace codeql

View File

@@ -29,7 +29,14 @@ void SwiftLocationExtractor::attachLocationImpl(const swift::SourceManager& sour
entry.file = fetchFileLabel(file);
std::tie(entry.start_line, entry.start_column) =
sourceManager.getLineAndColumnInBuffer(range.Start);
std::tie(entry.end_line, entry.end_column) = sourceManager.getLineAndColumnInBuffer(range.End);
if (sourceManager.getLineAndColumnInBuffer(range.End) >=
sourceManager.getLineAndColumnInBuffer(range.Start)) {
std::tie(entry.end_line, entry.end_column) = sourceManager.getLineAndColumnInBuffer(range.End);
} else {
// the compiler may generate source ranges that go backwards
entry.end_line = entry.start_line;
entry.end_column = entry.start_column;
}
SwiftMangledName locName{"loc", entry.file, ':', entry.start_line, ':', entry.start_column,
':', entry.end_line, ':', entry.end_column};
entry.id = trap.createTypedLabel<DbLocationTag>(locName);

View File

@@ -102,8 +102,9 @@ MAP(swift::Expr, ExprTag)
MAP(swift::IdentityExpr, IdentityExprTag)
MAP(swift::ParenExpr, ParenExprTag)
MAP(swift::DotSelfExpr, DotSelfExprTag)
MAP(swift::BorrowExpr, BorrowExprTag)
MAP(swift::AwaitExpr, AwaitExprTag)
MAP(swift::UnsafeExpr, void) // TODO: Swift 6.2
MAP(swift::BorrowExpr, BorrowExprTag)
MAP(swift::UnresolvedMemberChainResultExpr, UnresolvedMemberChainResultExprTag)
MAP(swift::AnyTryExpr, AnyTryExprTag)
MAP(swift::TryExpr, TryExprTag)
@@ -195,7 +196,6 @@ MAP(swift::Expr, ExprTag)
MAP(swift::ObjCSelectorExpr, ObjCSelectorExprTag)
MAP(swift::KeyPathExpr, KeyPathExprTag)
MAP(swift::KeyPathDotExpr, KeyPathDotExprTag)
MAP(swift::OneWayExpr, OneWayExprTag)
MAP(swift::TapExpr, TapExprTag)
MAP(swift::TypeJoinExpr, void) // does not appear in a visible AST, skipping
MAP(swift::MacroExpansionExpr, void) // unexpanded macro in an expr context, skipping
@@ -237,11 +237,11 @@ MAP(swift::Decl, DeclTag)
MAP(swift::ExtensionDecl, ExtensionDeclTag)
MAP(swift::TopLevelCodeDecl, TopLevelCodeDeclTag)
MAP(swift::ImportDecl, ImportDeclTag)
MAP(swift::PoundDiagnosticDecl, PoundDiagnosticDeclTag)
MAP(swift::PrecedenceGroupDecl, PrecedenceGroupDeclTag)
MAP(swift::MissingMemberDecl, MissingMemberDeclTag)
MAP(swift::PatternBindingDecl, PatternBindingDeclTag)
MAP(swift::EnumCaseDecl, EnumCaseDeclTag)
MAP(swift::UsingDecl, void) // TODO: Swift 6.2
MAP(swift::OperatorDecl, OperatorDeclTag)
MAP(swift::InfixOperatorDecl, InfixOperatorDeclTag)
MAP(swift::PrefixOperatorDecl, PrefixOperatorDeclTag)
@@ -315,7 +315,7 @@ MAP(swift::TypeBase, TypeTag)
MAP(swift::PrimaryArchetypeType, PrimaryArchetypeTypeTag)
MAP(swift::OpaqueTypeArchetypeType, OpaqueTypeArchetypeTypeTag)
MAP(swift::LocalArchetypeType, LocalArchetypeTypeTag)
MAP(swift::OpenedArchetypeType, OpenedArchetypeTypeTag)
MAP(swift::ExistentialArchetypeType, ExistentialArchetypeTypeTag)
MAP(swift::ElementArchetypeType, ElementArchetypeTypeTag)
MAP(swift::PackArchetypeType, PackArchetypeTypeTag)
MAP(swift::GenericTypeParamType, GenericTypeParamTypeTag)
@@ -342,16 +342,16 @@ MAP(swift::TypeBase, TypeTag)
MAP(swift::IntegerType, IntegerTypeTag)
MAP(swift::SugarType, SugarTypeTag)
MAP(swift::TypeAliasType, TypeAliasTypeTag)
MAP(swift::LocatableType, void) // TODO: Swift 6.2
MAP(swift::SyntaxSugarType, SyntaxSugarTypeTag)
MAP(swift::UnarySyntaxSugarType, UnarySyntaxSugarTypeTag)
MAP(swift::ArraySliceType, ArraySliceTypeTag)
MAP(swift::OptionalType, OptionalTypeTag)
MAP(swift::VariadicSequenceType, VariadicSequenceTypeTag)
MAP(swift::InlineArrayType, void) // TODO: Swift 6.2
MAP(swift::DictionaryType, DictionaryTypeTag)
MAP(swift::AvailabilitySpec, AvailabilitySpecTag)
MAP(swift::PlatformVersionConstraintAvailabilitySpec, PlatformVersionAvailabilitySpecTag)
MAP(swift::OtherPlatformAvailabilitySpec, OtherAvailabilitySpecTag)
MAP(swift::PoundAvailableInfo, AvailabilityInfoTag)
MAP(swift::MacroRoleAttr, MacroRoleTag)

View File

@@ -8,6 +8,8 @@
#include <swift/AST/ASTContext.h>
#include <swift/AST/GenericEnvironment.h>
#include <swift/AST/GenericParamList.h>
#include <swift/AST/ClangModuleLoader.h>
#include <clang/Basic/Module.h>
using namespace codeql;
@@ -38,6 +40,9 @@ std::string_view getTypeKindStr(const swift::TypeBase* type) {
} // namespace
std::unordered_map<const swift::Decl*, SwiftMangler::ExtensionIndex>
SwiftMangler::preloadedExtensionIndexes;
SwiftMangledName SwiftMangler::initMangled(const swift::TypeBase* type) {
return {getTypeKindStr(type), '_'};
}
@@ -100,41 +105,67 @@ SwiftMangledName SwiftMangler::visitExtensionDecl(const swift::ExtensionDecl* de
auto parent = getParent(decl);
auto target = decl->getExtendedType();
return initMangled(decl) << fetch(target) << getExtensionIndex(decl, parent);
auto index = getExtensionIndex(decl, parent);
return initMangled(decl) << fetch(target) << index.index
<< (index.kind == ExtensionKind::clang ? "_clang" : "");
}
unsigned SwiftMangler::getExtensionIndex(const swift::ExtensionDecl* decl,
const swift::Decl* parent) {
SwiftMangler::ExtensionIndex SwiftMangler::getExtensionIndex(const swift::ExtensionDecl* decl,
const swift::Decl* parent) {
// to avoid iterating multiple times on the parent of multiple extensions, we preload extension
// indexes once for each encountered parent into the `preloadedExtensionIndexes` mapping.
// Because we mangle declarations only once in a given trap/dispatcher context, we can safely
// discard preloaded indexes on use
if (auto found = preloadedExtensionIndexes.extract(decl)) {
return found.mapped();
if (auto found = SwiftMangler::preloadedExtensionIndexes.find(decl);
found != SwiftMangler::preloadedExtensionIndexes.end()) {
return found->second;
}
if (auto parentModule = llvm::dyn_cast<swift::ModuleDecl>(parent)) {
llvm::SmallVector<swift::Decl*> siblings;
parentModule->getTopLevelDecls(siblings);
indexExtensions(siblings);
if (auto clangModule = parentModule->findUnderlyingClangModule()) {
indexClangExtensions(clangModule, decl->getASTContext().getClangModuleLoader());
}
} else if (auto iterableParent = llvm::dyn_cast<swift::IterableDeclContext>(parent)) {
indexExtensions(iterableParent->getAllMembers());
} else {
// TODO use a generic logging handle for Swift entities here, once it's available
CODEQL_ASSERT(false, "non-local context must be module or iterable decl context");
}
auto found = preloadedExtensionIndexes.extract(decl);
auto found = SwiftMangler::preloadedExtensionIndexes.find(decl);
// TODO use a generic logging handle for Swift entities here, once it's available
CODEQL_ASSERT(found, "extension not found within parent");
return found.mapped();
CODEQL_ASSERT(found != SwiftMangler::preloadedExtensionIndexes.end(),
"extension not found within parent");
return found->second;
}
void SwiftMangler::indexExtensions(llvm::ArrayRef<swift::Decl*> siblings) {
auto index = 0u;
for (auto sibling : siblings) {
if (sibling->getKind() == swift::DeclKind::Extension) {
preloadedExtensionIndexes.emplace(sibling, index);
SwiftMangler::preloadedExtensionIndexes.try_emplace(sibling, ExtensionKind::swift, index);
index++;
}
}
}
void SwiftMangler::indexClangExtensions(const clang::Module* clangModule,
swift::ClangModuleLoader* moduleLoader) {
if (!moduleLoader) {
return;
}
auto index = 0u;
for (const auto& submodule : clangModule->submodules()) {
if (auto* swiftSubmodule = moduleLoader->getWrapperForModule(submodule)) {
llvm::SmallVector<swift::Decl*> children;
swiftSubmodule->getTopLevelDecls(children);
for (const auto child : children) {
if (child->getKind() == swift::DeclKind::Extension) {
SwiftMangler::preloadedExtensionIndexes.try_emplace(child, ExtensionKind::clang, index);
index++;
}
}
}
++index;
}
}
@@ -215,8 +246,8 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
if (flags.isSending()) {
ret << "_sending";
}
if (flags.isCompileTimeConst()) {
ret << "_compiletimeconst";
if (flags.isCompileTimeLiteral()) {
ret << "_compiletimeliteral";
}
if (flags.isNoDerivative()) {
ret << "_noderivative";
@@ -225,6 +256,40 @@ SwiftMangledName SwiftMangler::visitAnyFunctionType(const swift::AnyFunctionType
ret << "...";
}
}
if (type->hasLifetimeDependencies()) {
for (const auto& lifetime : type->getLifetimeDependencies()) {
auto addressable = lifetime.getAddressableIndices();
auto condAddressable = lifetime.getConditionallyAddressableIndices();
ret << "_lifetime";
auto addIndexes = [&](swift::IndexSubset* bitvector) {
for (unsigned i = 0; i < bitvector->getCapacity(); ++i) {
if (bitvector->contains(i)) {
if (addressable && addressable->contains(i)) {
ret << "_address";
} else if (condAddressable && condAddressable->contains(i)) {
ret << "_address_for_deps";
}
ret << "_" << i;
}
}
};
if (lifetime.hasInheritLifetimeParamIndices()) {
ret << "_copy";
addIndexes(lifetime.getInheritIndices());
}
if (lifetime.hasScopeLifetimeParamIndices()) {
ret << "_borrow";
addIndexes(lifetime.getScopeIndices());
}
if (lifetime.isImmortal()) {
ret << "_immortal";
}
}
}
ret << "->" << fetch(type->getResult());
if (type->isAsync()) {
ret << "_async";
@@ -361,7 +426,8 @@ SwiftMangledName SwiftMangler::visitOpaqueTypeArchetypeType(
return visitArchetypeType(type) << fetch(type->getDecl());
}
SwiftMangledName SwiftMangler::visitOpenedArchetypeType(const swift::OpenedArchetypeType* type) {
SwiftMangledName SwiftMangler::visitExistentialArchetypeType(
const swift::ExistentialArchetypeType* type) {
auto* env = type->getGenericEnvironment();
llvm::SmallVector<char> uuid;
env->getOpenedExistentialUUID().toString(uuid);

View File

@@ -93,7 +93,7 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
SwiftMangledName visitTypeAliasType(const swift::TypeAliasType* type);
SwiftMangledName visitArchetypeType(const swift::ArchetypeType* type);
SwiftMangledName visitOpaqueTypeArchetypeType(const swift::OpaqueTypeArchetypeType* type);
SwiftMangledName visitOpenedArchetypeType(const swift::OpenedArchetypeType* type);
SwiftMangledName visitExistentialArchetypeType(const swift::ExistentialArchetypeType* type);
SwiftMangledName visitProtocolCompositionType(const swift::ProtocolCompositionType* type);
SwiftMangledName visitLValueType(const swift::LValueType* type);
SwiftMangledName visitDynamicSelfType(const swift::DynamicSelfType* type);
@@ -106,14 +106,26 @@ class SwiftMangler : private swift::TypeVisitor<SwiftMangler, SwiftMangledName>,
SwiftMangledName visitPackExpansionType(const swift::PackExpansionType* type);
private:
std::unordered_map<const swift::Decl*, unsigned> preloadedExtensionIndexes;
enum class ExtensionKind : bool {
swift,
clang,
};
struct ExtensionIndex {
const ExtensionKind kind : 1;
const uint32_t index : 31;
};
static std::unordered_map<const swift::Decl*, ExtensionIndex> preloadedExtensionIndexes;
virtual SwiftMangledName fetch(const swift::Decl* decl) = 0;
virtual SwiftMangledName fetch(const swift::TypeBase* type) = 0;
SwiftMangledName fetch(swift::Type type) { return fetch(type.getPointer()); }
void indexExtensions(llvm::ArrayRef<swift::Decl*> siblings);
unsigned int getExtensionIndex(const swift::ExtensionDecl* decl, const swift::Decl* parent);
void indexClangExtensions(const clang::Module* clangModule,
swift::ClangModuleLoader* moduleLoader);
ExtensionIndex getExtensionIndex(const swift::ExtensionDecl* decl, const swift::Decl* parent);
static SwiftMangledName initMangled(const swift::TypeBase* type);
SwiftMangledName initMangled(const swift::Decl* decl);
SwiftMangledName visitTypeDiscriminatedValueDecl(const swift::ValueDecl* decl);

View File

@@ -197,6 +197,18 @@ codeql::Accessor DeclTranslator::translateAccessorDecl(const swift::AccessorDecl
case swift::AccessorKind::MutableAddress:
entry.is_unsafe_mutable_address = true;
break;
case swift::AccessorKind::DistributedGet:
// TODO: Swift 6.2
break;
case swift::AccessorKind::Read2:
// TODO: Swift 6.2
break;
case swift::AccessorKind::Modify2:
// TODO: Swift 6.2
break;
case swift::AccessorKind::Init:
// TODO: Swift 6.2
break;
}
fillFunction(decl, entry);
return entry;
@@ -280,7 +292,7 @@ void DeclTranslator::fillTypeDecl(const swift::TypeDecl& decl, codeql::TypeDecl&
void DeclTranslator::fillIterableDeclContext(const swift::IterableDeclContext& decl,
codeql::Decl& entry) {
for (auto member : decl.getMembers()) {
if (swift::AvailableAttr::isUnavailable(member)) {
if (member->isUnavailable()) {
continue;
}
entry.members.emplace_back(dispatcher.fetchLabel(member));
@@ -342,14 +354,6 @@ codeql::OpaqueTypeDecl DeclTranslator::translateOpaqueTypeDecl(const swift::Opaq
return entry;
}
codeql::PoundDiagnosticDecl DeclTranslator::translatePoundDiagnosticDecl(
const swift::PoundDiagnosticDecl& decl) {
auto entry = createEntry(decl);
entry.kind = translateDiagnosticsKind(decl.getKind());
entry.message = dispatcher.fetchLabel(decl.getMessage());
return entry;
}
codeql::MissingMemberDecl DeclTranslator::translateMissingMemberDecl(
const swift::MissingMemberDecl& decl) {
auto entry = createEntry(decl);

View File

@@ -45,7 +45,6 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
codeql::ImportDecl translateImportDecl(const swift::ImportDecl& decl);
codeql::ModuleDecl translateModuleDecl(const swift::ModuleDecl& decl);
codeql::OpaqueTypeDecl translateOpaqueTypeDecl(const swift::OpaqueTypeDecl& decl);
codeql::PoundDiagnosticDecl translatePoundDiagnosticDecl(const swift::PoundDiagnosticDecl& decl);
codeql::MissingMemberDecl translateMissingMemberDecl(const swift::MissingMemberDecl& decl);
codeql::CapturedDecl translateCapturedValue(const swift::CapturedValue& capture);
codeql::MacroDecl translateMacroDecl(const swift::MacroDecl& decl);

View File

@@ -185,12 +185,6 @@ codeql::ObjCSelectorExpr ExprTranslator::translateObjCSelectorExpr(
return entry;
}
codeql::OneWayExpr ExprTranslator::translateOneWayExpr(const swift::OneWayExpr& expr) {
auto entry = createExprEntry(expr);
entry.sub_expr = dispatcher.fetchLabel(expr.getSubExpr());
return entry;
}
codeql::OpenExistentialExpr ExprTranslator::translateOpenExistentialExpr(
const swift::OpenExistentialExpr& expr) {
auto entry = createExprEntry(expr);
@@ -498,7 +492,7 @@ TrapLabel<KeyPathComponentTag> ExprTranslator::emitKeyPathComponent(
const swift::KeyPathExpr::Component& component) {
auto entry = dispatcher.createUncachedEntry(component);
entry.kind = static_cast<int>(component.getKind());
if (auto subscript_args = component.getSubscriptArgs()) {
if (auto subscript_args = component.getArgs()) {
for (const auto& arg : *subscript_args) {
entry.subscript_arguments.push_back(emitArgument(arg));
}
@@ -691,8 +685,8 @@ codeql::CurrentContextIsolationExpr ExprTranslator::translateCurrentContextIsola
codeql::TypeValueExpr ExprTranslator::translateTypeValueExpr(const swift::TypeValueExpr& expr) {
auto entry = createExprEntry(expr);
if (expr.getParamTypeRepr() && expr.getParamType()) {
entry.type_repr = dispatcher.fetchLabel(expr.getParamTypeRepr(), expr.getParamType());
if (expr.getRepr() && expr.getParamType()) {
entry.type_repr = dispatcher.fetchLabel(expr.getRepr(), expr.getParamType());
}
return entry;
}

View File

@@ -37,7 +37,6 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
codeql::MakeTemporarilyEscapableExpr translateMakeTemporarilyEscapableExpr(
const swift::MakeTemporarilyEscapableExpr& expr);
codeql::ObjCSelectorExpr translateObjCSelectorExpr(const swift::ObjCSelectorExpr& expr);
codeql::OneWayExpr translateOneWayExpr(const swift::OneWayExpr& expr);
codeql::OpenExistentialExpr translateOpenExistentialExpr(const swift::OpenExistentialExpr& expr);
codeql::OptionalEvaluationExpr translateOptionalEvaluationExpr(
const swift::OptionalEvaluationExpr& expr);

View File

@@ -36,25 +36,17 @@ void StmtTranslator::translateAndEmit(const swift::PoundAvailableInfo& availabil
}
void StmtTranslator::translateAndEmit(const swift::AvailabilitySpec& spec) {
if (llvm::isa<swift::PlatformVersionConstraintAvailabilitySpec>(spec)) {
translateAndEmit(llvm::cast<swift::PlatformVersionConstraintAvailabilitySpec>(spec));
} else if (llvm::isa<swift::OtherPlatformAvailabilitySpec>(spec)) {
translateAndEmit(llvm::cast<swift::OtherPlatformAvailabilitySpec>(spec));
}
}
void StmtTranslator::translateAndEmit(
const swift::PlatformVersionConstraintAvailabilitySpec& spec) {
auto entry = dispatcher.createEntry(spec);
entry.platform = swift::platformString(spec.getPlatform()).str();
entry.version = spec.getVersion().getAsString();
entry.is_wildcard = spec.isWildcard();
if (!spec.isWildcard()) {
auto domain = spec.getDomainOrIdentifier().getAsDomain();
entry.platform =
swift::platformString(domain ? domain->getPlatformKind() : swift::PlatformKind::none).str();
entry.version = spec.getRawVersion().getAsString();
}
dispatcher.emit(entry);
}
void StmtTranslator::translateAndEmit(const swift::OtherPlatformAvailabilitySpec& spec) {
dispatcher.emit(dispatcher.createEntry(spec));
}
codeql::BraceStmt StmtTranslator::translateBraceStmt(const swift::BraceStmt& stmt) {
auto entry = dispatcher.createEntry(stmt);
entry.elements = dispatcher.fetchRepeatedLabels(stmt.getElements());

View File

@@ -17,8 +17,6 @@ class StmtTranslator : public AstTranslatorBase<StmtTranslator> {
void translateAndEmit(const swift::CaseLabelItem& labelItem);
void translateAndEmit(const swift::PoundAvailableInfo& availability);
void translateAndEmit(const swift::AvailabilitySpec& spec);
void translateAndEmit(const swift::PlatformVersionConstraintAvailabilitySpec& spec);
void translateAndEmit(const swift::OtherPlatformAvailabilitySpec& spec);
codeql::BraceStmt translateBraceStmt(const swift::BraceStmt& stmt);
codeql::ReturnStmt translateReturnStmt(const swift::ReturnStmt& stmt);

View File

@@ -225,8 +225,8 @@ codeql::BuiltinIntegerType TypeTranslator::translateBuiltinIntegerType(
return entry;
}
codeql::OpenedArchetypeType TypeTranslator::translateOpenedArchetypeType(
const swift::OpenedArchetypeType& type) {
codeql::ExistentialArchetypeType TypeTranslator::translateExistentialArchetypeType(
const swift::ExistentialArchetypeType& type) {
auto entry = createTypeEntry(type);
fillArchetypeType(type, entry);
return entry;

View File

@@ -68,7 +68,8 @@ class TypeTranslator : public TypeTranslatorBase<TypeTranslator> {
codeql::BuiltinIntegerLiteralType translateBuiltinIntegerLiteralType(
const swift::BuiltinIntegerLiteralType& type);
codeql::BuiltinIntegerType translateBuiltinIntegerType(const swift::BuiltinIntegerType& type);
codeql::OpenedArchetypeType translateOpenedArchetypeType(const swift::OpenedArchetypeType& type);
codeql::ExistentialArchetypeType translateExistentialArchetypeType(
const swift::ExistentialArchetypeType& type);
codeql::ModuleType translateModuleType(const swift::ModuleType& type);
codeql::OpaqueTypeArchetypeType translateOpaqueTypeArchetypeType(
const swift::OpaqueTypeArchetypeType& type);

View File

@@ -13,8 +13,6 @@ lib/codeql/swift/elements/KeyPathComponent.qll cc64d5a3cc6e6aa12faee7dfc95e6b5e1
lib/codeql/swift/elements/Locatable.qll a4e01abd3f337a60e3741705cede50be974ccffcb707a53f2b378972838c5977 89ba4dbebcfa291797407c27087d91a18b1ec1bc97140a14ec08dbb12cef7395
lib/codeql/swift/elements/Location.qll db213e8e27f8d732ad472c16929f2c503634c622d4d7b6b6977ed8b7b3c71c5b 9b951af94891848ecea9a690741e4a401c4b7ad676fd1fcee703fce4dcee2da4
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
lib/codeql/swift/elements/UnknownLocation.qll a03b4ff4f3505a35fbf25e150944e217030d187b8ab314bf0657bcab67ea40cc 2e3a1271f0df925c1deae232b26ba031322611f87f0326fe747475445c0e2485
lib/codeql/swift/elements/UnspecifiedElement.qll b1f597cae6585531aec383b669bda76b710dc2b61caf352347786584faf63ff4 858a15ed565231c15d09aa2e15acd4842a23ef8b0f76de792297fa8062e2f287
@@ -433,7 +431,7 @@ lib/codeql/swift/elements/expr/internal/UnsafeCastExprConstructor.qll f8771eb8f6
lib/codeql/swift/elements/expr/internal/UnsafeCastExprImpl.qll 787104ce97d702c0c3efa81a0f8416584f35c454d3b2ffe7bd0917861589612b 50496a0f3f3a9e3d5a2e6cbcd5eb16b634cf3fd5e0878bdf017678243dbfd8a0
lib/codeql/swift/elements/expr/internal/VarargExpansionExprConstructor.qll 917701083da11fce895c53d5f3e0a52b8e3142e9aacdf1d8536a4216ef377b16 b72ca103ced9cbb45f2ef9387387b8aaf3134e358ae5a03fa3ea242896954c81
lib/codeql/swift/elements/internal/AvailabilityInfoConstructor.qll 89c731f266122a3434b88dfd573d68c50b5c4fa5e13c2443c54f78e682190d1e 86beb6f684e08b6f557b7d67bc164113e9f5270c09bbe95fbd81c558d77f7f84
lib/codeql/swift/elements/internal/AvailabilitySpecImpl.qll 9ac9285e731938747c574c3f270aaead323656162bd34a6630c1babfaaf25a6a 900b2e638639f427506b2d0eb2806b6ee119ea63ea4ce44758e0c36f2ce915ac
lib/codeql/swift/elements/internal/AvailabilitySpecConstructor.qll cca46cd2908923a08b7f6a8bea0c0c11071523bcc421bfe141d0e0bafd8dfcb4 cbb1494346379083c0f275111eca78617591568894258a6b73efda34f3fba1ba
lib/codeql/swift/elements/internal/CommentConstructor.qll 46891994c032546e7323f343947fd57cabb6c0e2ad1ca78f113c5b04436be203 e05b3ba3e00437488fdf53361211c6e5c3ae14ad1fdaf32093b02bdea2076abe
lib/codeql/swift/elements/internal/DbFileConstructor.qll b5b680f255180d0d38223d6ac4422f192271573dca62f2967dde874147e710df a9c8d1c7abb5516c1d22ee9e020266297e52a2cd84f892792c1e6476517a6737
lib/codeql/swift/elements/internal/DbFileImpl.qll 09cbe97ad1d1d464bd9a374111e4e6bee0781595e5474809c415aade04431d90 b204d164e7a10ec4a77e0052710339a2c96ba6d42da547cc03cd23c1bd898261
@@ -443,8 +441,6 @@ lib/codeql/swift/elements/internal/DiagnosticsConstructor.qll 5212997161b95b0b10
lib/codeql/swift/elements/internal/ErrorElementImpl.qll 4ddf6e99bec6125bc5b24bc65d83cca131dd05748f71a85c8f0284659c3a0c49 db606ce97fdf2d2f38a66c7a4ef1437c8a3f6a57b71e426ec2bb0329d9e8a193
lib/codeql/swift/elements/internal/KeyPathComponentConstructor.qll ff71795157639520f56ce99ed49bf25486c125a0f27a3bb3ba2c8492feca13b2 5875187267cf91e37426d817a6c0c5e7ba9ddb0bd840ad358338ba003e0a877c
lib/codeql/swift/elements/internal/MacroRoleConstructor.qll c45c189fd441e2c23b1c94dec9f357192f5e392051e0becf52c020d830e38e54 e281ef4ba76a6e4b2b689e00f542ef585cec7a540911ccd7fbb59f3232f08a3d
lib/codeql/swift/elements/internal/OtherAvailabilitySpecConstructor.qll c5638ae4f3993c7a111fb2a516667190642c1948f18806cf29f78b7067021d10 cc93ac54741ba952b32385db0fe072576a9c8697cd793bcb8faed98f0fb6bda0
lib/codeql/swift/elements/internal/PlatformVersionAvailabilitySpecConstructor.qll 015280737e71fe1084da6056410fd73dc4473a3b3296d0e46c0ca64f07dd5b7f c735c42e45ebdc308a1f02ff15d65d4d1154071e55645a9ae763d6c021d7f601
lib/codeql/swift/elements/internal/UnspecifiedElementConstructor.qll f7e232dae7362d0c3f9f33f952d9106da3d273f16b124008919fba6e40a944b6 eb30f05ae09f2c7bc93d758c0870b63f16bf61d0d2446ed827250f89772596ab
lib/codeql/swift/elements/pattern/AnyPattern.qll b0ccc58de123e61705dde8bb655da0cb02ea981fcb4d4f8d0e205dfbd2a9bedc 55751b143f758968cd006cc70f1d90a9917d9ac7eb319364b2485282944d2835
lib/codeql/swift/elements/pattern/BindingPattern.qll eca835e58ecbb2096615c88b659c8782158c636501e7f21d38e303fff7a6a2fe 8cc4040c7c5357904389b61e98837d9da2c4aad65039b99ade3f4f9fac4d4479
@@ -555,6 +551,7 @@ lib/codeql/swift/elements/type/DynamicSelfType.qll c7eecfd41722f2fadc7de0783a8e7
lib/codeql/swift/elements/type/ElementArchetypeType.qll aa920ff09b80d5a4ff5fae22a975ba5debceef3f8953e536e06aba486edbebba 390a084f6b08c232d93ea1a590d1ca73585faa44ba4eb90b7c51e3ecf24cb4c7
lib/codeql/swift/elements/type/EnumType.qll f6d0174ba79d36d7c1b9d5dc0ede4400a40e7f427e1198721c1774c768ad3927 07f3390dbd2c4040d9fff8df2bde8c3611cb1e72a9d8e663331a96dded353a0a
lib/codeql/swift/elements/type/ErrorType.qll 4867f96662daa7e667e92fa939889e4ba54d6e139088a640a5472a9c2169e193 b41bebd9ef623d318e39610b5c193648c9b1d36d68770abce995492f0f507415
lib/codeql/swift/elements/type/ExistentialArchetypeType.qll 79e9d421457aee301bdfeb289240419e11dd5c9e3b5656f742b57cedc2de0ae0 0df3e401c0ec4d8e5ffae7bf879a8006a7e538dd76cf3cbe3a8650d5facde5ec
lib/codeql/swift/elements/type/ExistentialMetatypeType.qll 08c5cfc4deaf241861a800a0293a90beba953a5176dc9ec16e73aeb11ffeb6e0 6ecafdd2412b0060ad6b040587ae1e6e66597f2e20e452de4e66f3444376e527
lib/codeql/swift/elements/type/ExistentialType.qll a334e666928a0c50c9ae2f4b7cc891466254954a755c10a19b2b82b8544902ab 57c7ebf1263a8ec399fbdaa1b7eee2e81f633cd020032e2f575ab9d7fe7f4b97
lib/codeql/swift/elements/type/FunctionType.qll 1a64eb24e8baa74ef2a8e4451f97442aa6f86dd8160eb1f7c4fcd62342ef9ec5 3549451d8443215a5342e3c1b1e3910e71c217a382e42c8916c9435525c49940
@@ -569,7 +566,6 @@ lib/codeql/swift/elements/type/ModuleType.qll b37f2a919271463a1317e2933d078d3c72
lib/codeql/swift/elements/type/NominalOrBoundGenericNominalType.qll d41c27edffe38a8dd0e5fc17e0f9b355e7ecfdc80765fa36f4f00545af47d5c9 83a2f9ff32fec675f011683f64969ce42e2cf2301f48611ecc056242b0116bef
lib/codeql/swift/elements/type/NominalType.qll 5071658ee2aad7f9008248bc632873695150d95ed6260eecbc5c7c0394823bb9 e7664bde6757e207191348d031c27dda9b614628ff7b85e897d9942907f24ea2
lib/codeql/swift/elements/type/OpaqueTypeArchetypeType.qll ba746e5ee3e9723cd279b94b4608f10670a26a80d1db5e721eaaacd049160772 7fecafbdf1b1a60200dad6bbcef099470e1f2d34638bb6be6580f11f47e63fa4
lib/codeql/swift/elements/type/OpenedArchetypeType.qll e902fc1f2ca854a5601dbe6d3e1c1178729f3a38f739335c85355cd3823f79bb 2b16f97a51adad24dcd2c27b1bbedde9e6794920afaec38cd6bf6a769daee15b
lib/codeql/swift/elements/type/OptionalType.qll 55fff926b9bbe5b2c3ca0963750f71809425578f3fe08de86fe7f25f5729eb53 5aa94f386dd3b251e7ea739c26d3c3fca8f98409627be24765b124d97e70bfa8
lib/codeql/swift/elements/type/PackArchetypeType.qll 74a688b176c41a2caed819dccda6f450d9b171f5ab65480073866a217d3c6b39 a5dda9d35b8024665765bc773d071b396837ca49b827ed3d8200cb8a1bdff87c
lib/codeql/swift/elements/type/PackElementType.qll 696ce6efe66eae0554e9919e13cb8e5dcb6c8c218bcb6b8abbcb4bc3f9cbcff8 9fb68c75c11573fcd0fd1048ed1eeec8d5974fafa66e69d8515181c72d5d1230
@@ -650,6 +646,8 @@ lib/codeql/swift/elements/type/internal/EnumTypeConstructor.qll 42082a8131a1d23a
lib/codeql/swift/elements/type/internal/EnumTypeImpl.qll e1882e9bf4a5758d931066d21af82b10de241593fc632844db4220dfa1b40051 7903e471170bad4ac51971c614c3d5aec81453630f9d74792a6a782f76aa6491
lib/codeql/swift/elements/type/internal/ErrorTypeConstructor.qll b9c8b309ccc948b5956355b3d3398c1e52317b3c0dfbef0683b2dc62fe2e5054 e30fd9785602b50081917e82b03776bd98774fe45ff35734497cc0816f284cd4
lib/codeql/swift/elements/type/internal/ErrorTypeImpl.qll c04c074586ee94c721c8ee4c75f2213098a004a69df08d5585d9b3c2a52ae44c 1fcd9cdadbddfd1f89d9cb0962fd767ccf920b26975a9557c4d758933ebd27b3
lib/codeql/swift/elements/type/internal/ExistentialArchetypeTypeConstructor.qll 135a26bed100d6aae55925fbff1769cb61069488d8b7a19462429d0ebba9d0bb bcff385e197dbff3855f492b6c1d25bd5db2eb6a7cb66ccce80309e9c8f403bb
lib/codeql/swift/elements/type/internal/ExistentialArchetypeTypeImpl.qll 7c78ae15e6428b8ed103d2d28f719eff388a21615bf68b777a83e22c62aa70aa ab76d66eda10dc4af67eab6ba0757f2f452b75354f9f5d788fe3671d8dc7724f
lib/codeql/swift/elements/type/internal/ExistentialMetatypeTypeConstructor.qll 4055299dc6cf43e7a12f325913fd84b58761dcbfc14aaa27dd494eae1c282a99 c28e1ef4c8da26eaca30726bf3a81547bf3996cdfdf4b35cfc062d574e791d86
lib/codeql/swift/elements/type/internal/ExistentialMetatypeTypeImpl.qll 5aeaabe063cd7d9950a46fa4821f8d950c7583a4652f7e2741d81e19281aa873 c5ad2564888f6c10ac2478d72c5a436cec111824781b992adb9bddc723f13faf
lib/codeql/swift/elements/type/internal/ExistentialTypeConstructor.qll 65aeccb1d9b403e4efee678c7af1e8bb1359f6ffed7a2e75945330a19276b25e b2da77005c4cc9dc8dad8864b222de781863f93996b0128346a0464a7cacdd8b
@@ -673,8 +671,6 @@ lib/codeql/swift/elements/type/internal/ModuleTypeImpl.qll d13df337e9b7873c3db9c
lib/codeql/swift/elements/type/internal/NominalOrBoundGenericNominalTypeImpl.qll 6da77c694a1d7e3e3ab889b9fa5bbc0c5940b7ce3e2ea1170f78566589b8275d 5ba1224ee1a942e5d5453effe5434d5b3d7dd5e68979e7c1ea3bab7ff3030484
lib/codeql/swift/elements/type/internal/OpaqueTypeArchetypeTypeConstructor.qll f33bf566ae7881e6b4c5327602bfd4275bd5344d0f9fb764ebe02b9673ab29ed 88ad64e4c114f34a952701fff67386d43982dacd2845eead408230447d3c0506
lib/codeql/swift/elements/type/internal/OpaqueTypeArchetypeTypeImpl.qll 402568a45ebe986f2086c765649414b218a262e103ed19d73de3754cc84327d8 b7ef0cbfdd74083403ace6e0d8e6b0502fba1267d04a16c7465fa8b5dbce4138
lib/codeql/swift/elements/type/internal/OpenedArchetypeTypeConstructor.qll 729a7f0545d9aa3449e92f60f1ff780188135c861cdd119a678569d27684f4c0 e6f51320aec9202d97695228b684cd35ed5f26cdc8576621ad74ca0a5f707fc6
lib/codeql/swift/elements/type/internal/OpenedArchetypeTypeImpl.qll c8d7f2493f1fd23f2e5c1707ff5209e7345e939b8e9a499f8df28dd4fca77bd2 616ac345e28f858cd1f3571662cda187e2368cf19af6456675dcdac9eb30b714
lib/codeql/swift/elements/type/internal/OptionalTypeConstructor.qll 648493a385d8a95b665fff776f52e23ecdc2a4baa355328fbb218a1510ff807f 4249552ad87c3e474e32c89e6bf6302d7de5d15980c550f97ec8576a5801770b
lib/codeql/swift/elements/type/internal/OptionalTypeImpl.qll ac452e2c2883cd9aa7e460032a6f920e10c34a7e04a306b0c6b7a9c637f5b9d1 2513c2da982ed0a11687b5d3938de9e029742ecc1b6942b28e443aafe951f7e6
lib/codeql/swift/elements/type/internal/PackArchetypeTypeConstructor.qll 11ceeb4d0d337cde182804dc1b56f24ae624b74b55f62979c166172b53497a11 b46528bc0673a80a3d5ce29c358105b876967b73ae4a5596e6d7cf82e2292144
@@ -716,10 +712,10 @@ 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 2c093130866888903f5a97cc41072ad94c795d296fca6492d6db481b1ca39d94 2c093130866888903f5a97cc41072ad94c795d296fca6492d6db481b1ca39d94
lib/codeql/swift/elements.qll 84a5704b697f4a3f224ec2b99d49f4d2a6ee2655aa86c72ea1cbc901b8231879 84a5704b697f4a3f224ec2b99d49f4d2a6ee2655aa86c72ea1cbc901b8231879
lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99
lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de
lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119
lib/codeql/swift/generated/AvailabilitySpec.qll 1bd2a0ee085f802c99090e681ab3339fc5013024d79deef39f376de12ab76d37 658f2eb51860726cfa6808b3e3501d624e0734750d1420f7a25c89782f1f6c7e
lib/codeql/swift/generated/Callable.qll 6213871affd0e1fb176a36b28ae5d0c1af9f9927428d07c23660cde9e3b0bf64 02eaaef87c919f9ceb92e59fa895f5133904bce6d23ea9381e1210377573ddf4
lib/codeql/swift/generated/Comment.qll 64625f47ebddb1ec7e1c81790dd8120087a76958cba5cebe31f8d1f221740cb9 4d87eed099c645b43272ae806106a8d787e84e5e55ea4f1bbc7b79bf0b127d15
lib/codeql/swift/generated/DbFile.qll cc0d2b9efbee36080bde2e26e424a40efb763eaee55874fb6c4a5db36938f3df 33e215d838cfa36e3dd0e62879e896d988430d1470a87ce1bb45aad70886212b
@@ -728,17 +724,15 @@ lib/codeql/swift/generated/Diagnostics.qll 03ea201db80d33b18f7f6c71267044c695c25
lib/codeql/swift/generated/Element.qll bf8f688e05f44f18384067c3cab7f05796764e2b4cce7ff24da419c3dae26194 820390ffbb1012f73267668626f7d0ccd368500331c91bbc276fcb1c25037e41
lib/codeql/swift/generated/ErrorElement.qll b39bd7c8b4e2011f4a6889e073ebf5b628db32f36f50b067250ae730d9f26561 fd859ec969ba434049e7ba4e78271cc8cebc8b058d2e96e4d47a22064cbb5a21
lib/codeql/swift/generated/File.qll 476ac95566ef0080e0ad8c3da144b1be1d945d2f33a24f0864d85ff7c56a09b1 3134018bb50166cbf2690f64bba551cace350e4a7e6e25bcded18f997ad1835b
lib/codeql/swift/generated/KeyPathComponent.qll 5276acdc9a4ff0ec0cc8af615c04043391fb99613731ddcc86db4e47b37c8c5a ccc0931bbd6cc2cfae5037c2ee17bbdcbd87536f5fed90d07e73065c016c4382
lib/codeql/swift/generated/KeyPathComponent.qll 99d1699394bb7f9ff904e2d44149f20d3e08e35df171a6141f111c9ac9138b62 d8f62f60cc2c1e73146af79e5567c04cd273b73bfb5202bda964ec15032cb040
lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fda2d2008700f955ad82ce109a7 e97d4d4fb8a4800e0008cc00f60c8ed9b1ebd5f1140fd85e68b034616178d721
lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa
lib/codeql/swift/generated/MacroRole.qll facf907e75490d69cd401c491215e4719324d751f40ea46c86ccf24cf3663c1f 969d8d4b44e3f1a9c193a152a4d83a303e56d2dbb871fc920c47a33f699cf018
lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f
lib/codeql/swift/generated/ParentChild.qll 86a6c9ba4c79d72bf7a0786274f6fba49e6f37cf82de0451a6dad0d319224ebd f7b99ceb052a23d7c25d1615d1453d421b5ddddcec60b7d8d6f956d0d3fd7a2d
lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec
lib/codeql/swift/generated/ParentChild.qll 88a8941821b1f511925eb8955ff25065a6004c61aa866854ee941d7556b1eb6d 6e32b4902cea8a78a9b2775826d64300987932c406212d841deeab7c48a5ef8b
lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4
lib/codeql/swift/generated/Raw.qll 96d5f8778f25cd396b5cc56c38dce597c5a9a5c2b1e9ed8b9a4d2eca89e49323 d65072b5c508dad1dd813e19f7431087d8bfc0e5d85aa3d19beffbcbbec585ec
lib/codeql/swift/generated/Synth.qll 2b0f1a8911c1981ff50b78331bdd1f3f6023ad87a4ae3a92088901f493bb62c0 bc94ca1d86033e04b0999da84b61955ea1d8f4ac2379be527802512a42a16964
lib/codeql/swift/generated/SynthConstructors.qll d30b83f9d8d310414bb1261af386b70502df48159d06579bb2610e18ef546c3d d30b83f9d8d310414bb1261af386b70502df48159d06579bb2610e18ef546c3d
lib/codeql/swift/generated/Raw.qll aa47e81ab3004a0049da3a85f25456bba15ed37329622153c154a296024077f3 46e9fb37fadc23d168fd43cbe77a792ba8e56aab7f4a3a984add1928efd4ac78
lib/codeql/swift/generated/Synth.qll a472fca73084eedab9ca8bb2fb82e7573d525444bb8d3729a3d18e06647fd96d b19984583774e30dae481d3d5cc95ebf2843c04dd952eb16cbf8a702ae52bbd8
lib/codeql/swift/generated/SynthConstructors.qll f3687a56d2fd9bc38d95d9ca335f558a91c865bd0bd1c7c73affedefd7514183 f3687a56d2fd9bc38d95d9ca335f558a91c865bd0bd1c7c73affedefd7514183
lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d
lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd
lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022
@@ -991,6 +985,7 @@ lib/codeql/swift/generated/type/DynamicSelfType.qll 999b59b887b6d550645832bb12ab
lib/codeql/swift/generated/type/ElementArchetypeType.qll a3cc0d5c0feb8bc446c19f97d311da3a964af6a1d4275496bb506c6094cb6f55 5f8f73bd2b524c3ffd0eaedba90c348d8743add15d1004b4da3a6ffbf6ec3919
lib/codeql/swift/generated/type/EnumType.qll 258be7d8b1a17ba0c7253b12603c607a2f241b274b329c9124a8158128e77a47 11ac74f5da5dbb5d80efd86c0ffd127f673233fe0e25da68cf691fa2839baab6
lib/codeql/swift/generated/type/ErrorType.qll d6d3b9457d40d762f9441daf434062a0b2133dc9ef3aa221a655269c5522dcc5 c0c06692f37132098f5306f8c061d71140692a23a5e2a376350aae99854119eb
lib/codeql/swift/generated/type/ExistentialArchetypeType.qll 54bc16dcf5da69fb444493738ffda37e0e7d85102a6fc5de39329b12e6d5aa70 d56e7bdd2853911dc38387be408dbc1b4430eb4b9284496545e2052f325315e4
lib/codeql/swift/generated/type/ExistentialMetatypeType.qll 7d497d364ba6d9416bd2fdb561332d7038a36cc3d887a08638b389c74de59159 29dde0610dc53b2c14fd1d6ec4014ffb9979195e8e8487b32a982317609f3476
lib/codeql/swift/generated/type/ExistentialType.qll dc6e1afb4134e6bb5c63fb86ace78b695224a7bee1fb813799bfb36521e2dabd ef33867f67867021739ae021c6ed763e397f1f299145ff3076980c9dfcbe7a12
lib/codeql/swift/generated/type/FunctionType.qll 739192b77787905a66d9c9970dc077c3fb458afc038b3b8d8f12f965b2cad1ad 4952c360a7277972bdadbdb9d8dc475153d0c6de50f7b8e7de4c7259abf2541b
@@ -1005,7 +1000,6 @@ lib/codeql/swift/generated/type/ModuleType.qll e4d7d1e1b0854b56e86b2e6d73b06c5e4
lib/codeql/swift/generated/type/NominalOrBoundGenericNominalType.qll 992bc2e47d0659b8c92a8907614e3d940310befd35767d8a19c70c2db034e36b bba0cf99f299271c893e482881f586e298a35ad48c59ba1a07d216fd5f731a99
lib/codeql/swift/generated/type/NominalType.qll a1d4865e7c4cc8362c16ed728429851660c84c5d30622c43502f046aa5adf507 337d377662ba3a5232124c80ee008a0d1c56635c1bd59a35cbe82fbb54c0a6cc
lib/codeql/swift/generated/type/OpaqueTypeArchetypeType.qll 64b1f4b6c76b89e3b11eb3f811f8f1664685980db605721b28a2d503a1c9e972 6acfc69f609e1a0873a2a4d5ad5665c1012a0e89eb3459be35d3a48ef5a304f4
lib/codeql/swift/generated/type/OpenedArchetypeType.qll 74dcbbf286185787526552c624c740de59cb55b774640492797b58532bb1fb1d 298f136e82ab66af6894db33881fd8a2ddefaa99b3cb522b0f342b6fd3f6ec48
lib/codeql/swift/generated/type/OptionalType.qll f708e44e676d72274bcb823028aec6122875443de309e2c4e0ca04a18cb4a741 3c2a350fbd32b3297161ca14e050c7d75d3d5606be8adab59a4f53d514794e9d
lib/codeql/swift/generated/type/PackArchetypeType.qll cc561152cbf2eae8482a82997fe1725dccd172ee93d091df47d620f5c7cca2fe 278bf4d686f9b977882f98de695ac41575ba589d7838ad077dcb04ba1f95598e
lib/codeql/swift/generated/type/PackElementType.qll 997dae178f56757eb1e0c2ea6496dcaf9886e37d7b6b92bd849807beac630b9f 924e898526b3bf758f339e384025dc87fb64e0b0ce8526d63cbe7170d7e6ec73
@@ -1033,12 +1027,11 @@ lib/codeql/swift/generated/type/UnresolvedType.qll 3b99e19ca7177619fb79e6e8511df
lib/codeql/swift/generated/type/VariadicSequenceType.qll 7ece2c953e24d1c51715610f2813bd97f6d9fc6e58e5df0aacadad31e1fd1d8f be0005d973fd7c4c937fc340711fafe7ceba592ac407b88731bc35a1c2800aeb
lib/codeql/swift/generated/type/WeakStorageType.qll d46b67f2b7bcc8aa7599e38506e91c219f894df4668ff1f0b5b66c1858040f5b c8e34ec9df085d938e36492d172fbf84ca56fc9d805713b8ada92e1b4c7bef54
test/extractor-tests/generated/AvailabilityInfo/AvailabilityInfo.ql 0bb0cfe3f8c38af3b870f8c404c16a5715e80d5ea8fd7939cc13032d7b824809 142ae1e76138b287aa66e091683aae545d139ef2971624e2dfdd3ea454bc2d05
test/extractor-tests/generated/AvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/Comment/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/Diagnostics/Diagnostics.ql c1f8be2c283e13c1a4dadaa008e42f660ea09d9ee1de22b0e8493ef76384546e d84efa40eaecbce6b928a5b235e10bf1e4409a9d0778c365ec19d2fade7ab3ab
test/extractor-tests/generated/File/File.ql a1385ef2080e04e8757f61b8e1d0129df9f955edf03fbb3b83cc9cb5498b4e95 0364d8c7f108d01b2641f996efedab7084956307e875e6bc078ea677d04267e0
test/extractor-tests/generated/KeyPathComponent/KeyPathComponent.ql 3fa617f8ed1b308d0c56f429ee8abe6d33ef60bf57d87f6dc89fdc8fe969a102 c2fa3153077dbe9e0fc608524dc03c82ff4ed460364d341ee6a817b0d75291c3
test/extractor-tests/generated/OtherAvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/PlatformVersionAvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/decl/Accessor/Accessor.ql 7e50dd3c4119162bbfa3e2461300d876c60321d4b6473ddd35e0cb992108570e eb81ed8db92bff46974079e0f1100cf94bd639191a36db45ee9e65467abb6e38
test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl.ql 55a78a6b96a17532178a39bd39aa4df23295f98019bb00de041ba15dfd4f84d9 51dbcd86203d5d031d748f77943a81c2c50de4ff559af20a4a1a682a19978d4f
test/extractor-tests/generated/decl/CapturedDecl/CapturedDecl.ql fd62be6c38d39f371c20e8c2f233e37a9da5aa234588920634f5db67e8beb3bd d51d35d4fd6a21cd596e064e0221d0c86e36312412a9bd4e64f431c123f3019a
@@ -1188,6 +1181,7 @@ test/extractor-tests/generated/type/DependentMemberType/MISSING_SOURCE.txt 35fb3
test/extractor-tests/generated/type/DictionaryType/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/type/DynamicSelfType/DynamicSelfType.ql 62da270e23b080f8ceb9ec5c130f84ccd779c43cf30c88db526ef061269c5ce9 390cb48fd7873210f5f5b4e8f275347348336a1e8161c72d3fafa5f7fee90f93
test/extractor-tests/generated/type/EnumType/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/type/ExistentialArchetypeType/ExistentialArchetypeType.ql b2f71d888599d3df876dd65dfb4e2e0314f6f1354945b8d467fbe04430d155f8 7e35aec4e133bb76d1fbd87a715014b81b39021ee3f66f49e25292c1388628a0
test/extractor-tests/generated/type/ExistentialMetatypeType/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/type/ExistentialType/ExistentialType.ql 7e09bbea166a4f269ecef1113229e98dfd7ea68ea5d4025af492fcce48698420 a4d00ff4100138020af51e8264d1d243156e52ab417bb150d33e9e1cc8cb0a69
test/extractor-tests/generated/type/FunctionType/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
@@ -1199,7 +1193,6 @@ test/extractor-tests/generated/type/LValueType/MISSING_SOURCE.txt 35fb32ea539315
test/extractor-tests/generated/type/MetatypeType/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/type/ModuleType/ModuleType.ql 7d78142dc82b06e454b9875a47890d5c2364e51f6e496640d6c4d20327f535b7 cecd45f6a4b0f137cdd7e694259044016ab01da6a42e73c3a361b4d00b594133
test/extractor-tests/generated/type/OpaqueTypeArchetypeType/OpaqueTypeArchetypeType.ql 86bc4823c19da17cbcebe3a4634eccff0a96cbebd174d8d4b1610e3fda3f8bdb 82179cb6e188a3a271428de4631c2a6fa4cec2e65a628fb56c2cbcff8a6a13d3
test/extractor-tests/generated/type/OpenedArchetypeType/OpenedArchetypeType.ql fdbbc1cffb209097480596d3be405188d045758da03a7980511d56874690b9c4 9ba8ffc028988a21cd751d25f0c363c3c37dfc0a13629379c8ca94b6b066bb7d
test/extractor-tests/generated/type/OptionalType/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
test/extractor-tests/generated/type/PackType/ElementArchetypeType.ql d4d695dcd0e723cdc9f196d828e22a3650ac751f0488e257f3bc2e2afbc343ec ff20bf849e18621b6193699bf58b3d6d127c29113dc996100bc18938fdf4658c
test/extractor-tests/generated/type/PackType/PackArchetypeType.ql 56e7f72a2d6f03e394a5e7103e337aee06b8e1fa9198d8f6123c44c4e33d5b57 e7259313ade883242bffb8e812da64c77108b55acbf39d7b8cda47251ee5f5d3

21
swift/ql/.gitattributes generated vendored
View File

@@ -15,8 +15,6 @@
/lib/codeql/swift/elements/Locatable.qll linguist-generated
/lib/codeql/swift/elements/Location.qll linguist-generated
/lib/codeql/swift/elements/MacroRole.qll linguist-generated
/lib/codeql/swift/elements/OtherAvailabilitySpec.qll linguist-generated
/lib/codeql/swift/elements/PlatformVersionAvailabilitySpec.qll linguist-generated
/lib/codeql/swift/elements/UnknownFile.qll linguist-generated
/lib/codeql/swift/elements/UnknownLocation.qll linguist-generated
/lib/codeql/swift/elements/UnspecifiedElement.qll linguist-generated
@@ -435,7 +433,7 @@
/lib/codeql/swift/elements/expr/internal/UnsafeCastExprImpl.qll linguist-generated
/lib/codeql/swift/elements/expr/internal/VarargExpansionExprConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/AvailabilityInfoConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/AvailabilitySpecImpl.qll linguist-generated
/lib/codeql/swift/elements/internal/AvailabilitySpecConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/CommentConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/DbFileConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/DbFileImpl.qll linguist-generated
@@ -445,8 +443,6 @@
/lib/codeql/swift/elements/internal/ErrorElementImpl.qll linguist-generated
/lib/codeql/swift/elements/internal/KeyPathComponentConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/MacroRoleConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/OtherAvailabilitySpecConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/PlatformVersionAvailabilitySpecConstructor.qll linguist-generated
/lib/codeql/swift/elements/internal/UnspecifiedElementConstructor.qll linguist-generated
/lib/codeql/swift/elements/pattern/AnyPattern.qll linguist-generated
/lib/codeql/swift/elements/pattern/BindingPattern.qll linguist-generated
@@ -557,6 +553,7 @@
/lib/codeql/swift/elements/type/ElementArchetypeType.qll linguist-generated
/lib/codeql/swift/elements/type/EnumType.qll linguist-generated
/lib/codeql/swift/elements/type/ErrorType.qll linguist-generated
/lib/codeql/swift/elements/type/ExistentialArchetypeType.qll linguist-generated
/lib/codeql/swift/elements/type/ExistentialMetatypeType.qll linguist-generated
/lib/codeql/swift/elements/type/ExistentialType.qll linguist-generated
/lib/codeql/swift/elements/type/FunctionType.qll linguist-generated
@@ -571,7 +568,6 @@
/lib/codeql/swift/elements/type/NominalOrBoundGenericNominalType.qll linguist-generated
/lib/codeql/swift/elements/type/NominalType.qll linguist-generated
/lib/codeql/swift/elements/type/OpaqueTypeArchetypeType.qll linguist-generated
/lib/codeql/swift/elements/type/OpenedArchetypeType.qll linguist-generated
/lib/codeql/swift/elements/type/OptionalType.qll linguist-generated
/lib/codeql/swift/elements/type/PackArchetypeType.qll linguist-generated
/lib/codeql/swift/elements/type/PackElementType.qll linguist-generated
@@ -652,6 +648,8 @@
/lib/codeql/swift/elements/type/internal/EnumTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ErrorTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ErrorTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ExistentialArchetypeTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ExistentialArchetypeTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ExistentialMetatypeTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ExistentialMetatypeTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/ExistentialTypeConstructor.qll linguist-generated
@@ -675,8 +673,6 @@
/lib/codeql/swift/elements/type/internal/NominalOrBoundGenericNominalTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/OpaqueTypeArchetypeTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/OpaqueTypeArchetypeTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/OpenedArchetypeTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/OpenedArchetypeTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/OptionalTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/OptionalTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/PackArchetypeTypeConstructor.qll linguist-generated
@@ -734,9 +730,7 @@
/lib/codeql/swift/generated/Locatable.qll linguist-generated
/lib/codeql/swift/generated/Location.qll linguist-generated
/lib/codeql/swift/generated/MacroRole.qll linguist-generated
/lib/codeql/swift/generated/OtherAvailabilitySpec.qll linguist-generated
/lib/codeql/swift/generated/ParentChild.qll linguist-generated
/lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll linguist-generated
/lib/codeql/swift/generated/PureSynthConstructors.qll linguist-generated
/lib/codeql/swift/generated/Raw.qll linguist-generated
/lib/codeql/swift/generated/Synth.qll linguist-generated
@@ -993,6 +987,7 @@
/lib/codeql/swift/generated/type/ElementArchetypeType.qll linguist-generated
/lib/codeql/swift/generated/type/EnumType.qll linguist-generated
/lib/codeql/swift/generated/type/ErrorType.qll linguist-generated
/lib/codeql/swift/generated/type/ExistentialArchetypeType.qll linguist-generated
/lib/codeql/swift/generated/type/ExistentialMetatypeType.qll linguist-generated
/lib/codeql/swift/generated/type/ExistentialType.qll linguist-generated
/lib/codeql/swift/generated/type/FunctionType.qll linguist-generated
@@ -1007,7 +1002,6 @@
/lib/codeql/swift/generated/type/NominalOrBoundGenericNominalType.qll linguist-generated
/lib/codeql/swift/generated/type/NominalType.qll linguist-generated
/lib/codeql/swift/generated/type/OpaqueTypeArchetypeType.qll linguist-generated
/lib/codeql/swift/generated/type/OpenedArchetypeType.qll linguist-generated
/lib/codeql/swift/generated/type/OptionalType.qll linguist-generated
/lib/codeql/swift/generated/type/PackArchetypeType.qll linguist-generated
/lib/codeql/swift/generated/type/PackElementType.qll linguist-generated
@@ -1035,12 +1029,11 @@
/lib/codeql/swift/generated/type/VariadicSequenceType.qll linguist-generated
/lib/codeql/swift/generated/type/WeakStorageType.qll linguist-generated
/test/extractor-tests/generated/AvailabilityInfo/AvailabilityInfo.ql linguist-generated
/test/extractor-tests/generated/AvailabilitySpec/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/Comment/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/Diagnostics/Diagnostics.ql linguist-generated
/test/extractor-tests/generated/File/File.ql linguist-generated
/test/extractor-tests/generated/KeyPathComponent/KeyPathComponent.ql linguist-generated
/test/extractor-tests/generated/OtherAvailabilitySpec/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/PlatformVersionAvailabilitySpec/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/decl/Accessor/Accessor.ql linguist-generated
/test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl.ql linguist-generated
/test/extractor-tests/generated/decl/CapturedDecl/CapturedDecl.ql linguist-generated
@@ -1190,6 +1183,7 @@
/test/extractor-tests/generated/type/DictionaryType/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/type/DynamicSelfType/DynamicSelfType.ql linguist-generated
/test/extractor-tests/generated/type/EnumType/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/type/ExistentialArchetypeType/ExistentialArchetypeType.ql linguist-generated
/test/extractor-tests/generated/type/ExistentialMetatypeType/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/type/ExistentialType/ExistentialType.ql linguist-generated
/test/extractor-tests/generated/type/FunctionType/MISSING_SOURCE.txt linguist-generated
@@ -1201,7 +1195,6 @@
/test/extractor-tests/generated/type/MetatypeType/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/type/ModuleType/ModuleType.ql linguist-generated
/test/extractor-tests/generated/type/OpaqueTypeArchetypeType/OpaqueTypeArchetypeType.ql linguist-generated
/test/extractor-tests/generated/type/OpenedArchetypeType/OpenedArchetypeType.ql linguist-generated
/test/extractor-tests/generated/type/OptionalType/MISSING_SOURCE.txt linguist-generated
/test/extractor-tests/generated/type/PackType/ElementArchetypeType.ql linguist-generated
/test/extractor-tests/generated/type/PackType/PackArchetypeType.ql linguist-generated

View File

@@ -0,0 +1,3 @@
| Package.swift:0:0:0:0 | Package.swift |
| Sources/hello-world/hello_world.swift:0:0:0:0 | Sources/hello-world/hello_world.swift |
| file://:0:0:0:0 | |

View File

@@ -3,6 +3,7 @@ import pytest
@runs_on.macos
@pytest.mark.ql_test("DB-CHECK", xfail=True)
@pytest.mark.ql_test("DB-CHECK", xfail=not runs_on.macos_26)
@pytest.mark.ql_test("*", expected=f"{'.macos_26' if runs_on.macos_26 else ''}.expected")
def test(codeql, swift):
codeql.database.create()

View File

@@ -2,6 +2,8 @@
| Builtin.Executor | BuiltinExecutorType |
| Builtin.FPIEEE32 | BuiltinFloatType |
| Builtin.FPIEEE64 | BuiltinFloatType |
| Builtin.FixedArray<\u03c4_0_0, \u03c4_0_1> | BuiltinFixedArrayType |
| Builtin.FixedArray<count, Element> | BuiltinFixedArrayType |
| Builtin.Int1 | BuiltinIntegerType |
| Builtin.Int8 | BuiltinIntegerType |
| Builtin.Int16 | BuiltinIntegerType |

View File

@@ -0,0 +1,6 @@
---
category: breaking
---
* The `OpenedArchetypeType` class has been renamed as `ExistentialArchetypeType`.
* The `OtherAvailabilitySpec` class has been removed. Use `AvailabilitySpec::isWildcard` instead.
* The `PlatformVersionAvailabilitySpec` has been removed. Use `AvailabilitySpec::getPlatform` and `AvailabilitySpec::getVersion` instead.

View File

@@ -0,0 +1,4 @@
---
category: majorAnalysis
---
* Upgraded to allow analysis of Swift 6.2.

View File

@@ -18,8 +18,6 @@ import codeql.swift.elements.KeyPathComponent
import codeql.swift.elements.Locatable
import codeql.swift.elements.Location
import codeql.swift.elements.MacroRole
import codeql.swift.elements.OtherAvailabilitySpec
import codeql.swift.elements.PlatformVersionAvailabilitySpec
import codeql.swift.elements.UnknownFile
import codeql.swift.elements.UnknownLocation
import codeql.swift.elements.UnspecifiedElement
@@ -268,6 +266,7 @@ import codeql.swift.elements.type.DynamicSelfType
import codeql.swift.elements.type.ElementArchetypeType
import codeql.swift.elements.type.EnumType
import codeql.swift.elements.type.ErrorType
import codeql.swift.elements.type.ExistentialArchetypeType
import codeql.swift.elements.type.ExistentialMetatypeType
import codeql.swift.elements.type.ExistentialType
import codeql.swift.elements.type.FunctionType
@@ -282,7 +281,6 @@ import codeql.swift.elements.type.ModuleType
import codeql.swift.elements.type.NominalOrBoundGenericNominalType
import codeql.swift.elements.type.NominalType
import codeql.swift.elements.type.OpaqueTypeArchetypeType
import codeql.swift.elements.type.OpenedArchetypeType
import codeql.swift.elements.type.OptionalType
import codeql.swift.elements.type.PackArchetypeType
import codeql.swift.elements.type.PackElementType

View File

@@ -1,12 +0,0 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the public class `OtherAvailabilitySpec`.
*/
private import internal.OtherAvailabilitySpecImpl
import codeql.swift.elements.AvailabilitySpec
/**
* A wildcard availability spec `*`
*/
final class OtherAvailabilitySpec = Impl::OtherAvailabilitySpec;

View File

@@ -1,12 +0,0 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the public class `PlatformVersionAvailabilitySpec`.
*/
private import internal.PlatformVersionAvailabilitySpecImpl
import codeql.swift.elements.AvailabilitySpec
/**
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
*/
final class PlatformVersionAvailabilitySpec = Impl::PlatformVersionAvailabilitySpec;

View File

@@ -1,14 +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
* `OpenedArchetypeType` synthesized instances.
* `AvailabilitySpec` synthesized instances.
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.Raw
/**
* The characteristic predicate of `OpenedArchetypeType` synthesized instances.
* The characteristic predicate of `AvailabilitySpec` synthesized instances.
* INTERNAL: Do not use.
*/
predicate constructOpenedArchetypeType(Raw::OpenedArchetypeType id) { any() }
predicate constructAvailabilitySpec(Raw::AvailabilitySpec id) { any() }

View File

@@ -1,10 +1,3 @@
// 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 `AvailabilitySpec`.
*
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.AvailabilitySpec
/**
@@ -12,11 +5,18 @@ private import codeql.swift.generated.AvailabilitySpec
* be referenced directly.
*/
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* An availability spec, that is, part of an `AvailabilityInfo` condition. For example `iOS 12` and `*` in:
* ```
* if #available(iOS 12, *)
* ```
*/
class AvailabilitySpec extends Generated::AvailabilitySpec { }
class AvailabilitySpec extends Generated::AvailabilitySpec {
override string toStringImpl() {
if this.isWildcard()
then result = "*"
else result = this.getPlatform() + " " + this.getVersion()
}
}
}

View File

@@ -10,37 +10,37 @@ module Impl {
/**
* Property access like `.bar` in `\Foo.bar`.
*/
predicate isProperty() { this.getKind() = 3 }
predicate isProperty() { this.getKind() = 5 }
/**
* Array or dictionary subscript like `[1]` or `["a", "b"]`.
*/
predicate isSubscript() { this.getKind() = 4 }
predicate isSubscript() { this.getKind() = 6 }
/**
* Optional forcing `!`.
*/
predicate isOptionalForcing() { this.getKind() = 5 }
predicate isOptionalForcing() { this.getKind() = 7 }
/**
* Optional chaining `?`.
*/
predicate isOptionalChaining() { this.getKind() = 6 }
predicate isOptionalChaining() { this.getKind() = 8 }
/**
* Implicit optional wrapping component inserted by the compiler when an optional chain ends in a non-optional value.
*/
predicate isOptionalWrapping() { this.getKind() = 7 }
predicate isOptionalWrapping() { this.getKind() = 9 }
/**
* Reference to the entire object; the `self` in `\Foo.self`.
*/
predicate isSelf() { this.getKind() = 8 }
predicate isSelf() { this.getKind() = 10 }
/**
* Tuple indexing like `.1`.
*/
predicate isTupleIndexing() { this.getKind() = 9 }
predicate isTupleIndexing() { this.getKind() = 11 }
/** Gets the underlying key-path expression which this is a component of. */
KeyPathExpr getKeyPathExpr() { result.getAComponent() = this }

View File

@@ -1,11 +0,0 @@
private import codeql.swift.generated.OtherAvailabilitySpec
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A wildcard availability spec `*`
*/
class OtherAvailabilitySpec extends Generated::OtherAvailabilitySpec {
override string toStringImpl() { result = "*" }
}
}

View File

@@ -1,16 +0,0 @@
// 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
* `PlatformVersionAvailabilitySpec` synthesized instances.
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.Raw
/**
* The characteristic predicate of `PlatformVersionAvailabilitySpec` synthesized instances.
* INTERNAL: Do not use.
*/
predicate constructPlatformVersionAvailabilitySpec(Raw::PlatformVersionAvailabilitySpec id) {
any()
}

View File

@@ -1,11 +0,0 @@
private import codeql.swift.generated.PlatformVersionAvailabilitySpec
module Impl {
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
*/
class PlatformVersionAvailabilitySpec extends Generated::PlatformVersionAvailabilitySpec {
override string toStringImpl() { result = this.getPlatform() + " " + this.getVersion() }
}
}

View File

@@ -0,0 +1,9 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the public class `ExistentialArchetypeType`.
*/
private import internal.ExistentialArchetypeTypeImpl
import codeql.swift.elements.type.LocalArchetypeType
final class ExistentialArchetypeType = Impl::ExistentialArchetypeType;

View File

@@ -1,9 +0,0 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the public class `OpenedArchetypeType`.
*/
private import internal.OpenedArchetypeTypeImpl
import codeql.swift.elements.type.LocalArchetypeType
final class OpenedArchetypeType = Impl::OpenedArchetypeType;

View File

@@ -1,14 +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
* `OtherAvailabilitySpec` synthesized instances.
* `ExistentialArchetypeType` synthesized instances.
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.Raw
/**
* The characteristic predicate of `OtherAvailabilitySpec` synthesized instances.
* The characteristic predicate of `ExistentialArchetypeType` synthesized instances.
* INTERNAL: Do not use.
*/
predicate constructOtherAvailabilitySpec(Raw::OtherAvailabilitySpec id) { any() }
predicate constructExistentialArchetypeType(Raw::ExistentialArchetypeType id) { any() }

View File

@@ -1,16 +1,16 @@
// 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 `OpenedArchetypeType`.
* This module provides a hand-modifiable wrapper around the generated class `ExistentialArchetypeType`.
*
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.type.OpenedArchetypeType
private import codeql.swift.generated.type.ExistentialArchetypeType
/**
* INTERNAL: This module contains the customizable definition of `OpenedArchetypeType` and should not
* INTERNAL: This module contains the customizable definition of `ExistentialArchetypeType` and should not
* be referenced directly.
*/
module Impl {
class OpenedArchetypeType extends Generated::OpenedArchetypeType { }
class ExistentialArchetypeType extends Generated::ExistentialArchetypeType { }
}

View File

@@ -21,5 +21,38 @@ module Generated {
* INTERNAL: Do not reference the `Generated::AvailabilitySpec` class directly.
* Use the subclass `AvailabilitySpec`, where the following predicates are available.
*/
class AvailabilitySpec extends Synth::TAvailabilitySpec, AstNodeImpl::AstNode { }
class AvailabilitySpec extends Synth::TAvailabilitySpec, AstNodeImpl::AstNode {
override string getAPrimaryQlClass() { result = "AvailabilitySpec" }
/**
* Gets the platform of this availability spec, if it exists.
*/
string getPlatform() {
result = Synth::convertAvailabilitySpecToRaw(this).(Raw::AvailabilitySpec).getPlatform()
}
/**
* Holds if `getPlatform()` exists.
*/
final predicate hasPlatform() { exists(this.getPlatform()) }
/**
* Gets the version of this availability spec, if it exists.
*/
string getVersion() {
result = Synth::convertAvailabilitySpecToRaw(this).(Raw::AvailabilitySpec).getVersion()
}
/**
* Holds if `getVersion()` exists.
*/
final predicate hasVersion() { exists(this.getVersion()) }
/**
* Holds if this availability spec is wildcard.
*/
predicate isWildcard() {
Synth::convertAvailabilitySpecToRaw(this).(Raw::AvailabilitySpec).isWildcard()
}
}
}

View File

@@ -29,12 +29,14 @@ module Generated {
*
* INTERNAL: Do not use.
*
* This is 3 for properties, 4 for array and dictionary subscripts, 5 for optional forcing
* (`!`), 6 for optional chaining (`?`), 7 for implicit optional wrapping, 8 for `self`,
* and 9 for tuple element indexing.
* TODO: Swift 6.2 update with UnresolvedApply and Apply
*
* The following values should not appear: 0 for invalid components, 1 for unresolved
* properties, 2 for unresolved subscripts, 10 for #keyPath dictionary keys, and 11 for
* This is 5 for properties, 6 for array and dictionary subscripts, 7 for optional forcing
* (`!`), 8 for optional chaining (`?`), 9 for implicit optional wrapping, 10 for `self`,
* and 11 for tuple element indexing.
*
* The following values should not appear: 0 for invalid components, 2 for unresolved
* properties, 3 for unresolved subscripts, 12 for #keyPath dictionary keys, and 13 for
* implicit IDE code completion data.
*/
int getKind() {

View File

@@ -1,26 +0,0 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the generated definition of `OtherAvailabilitySpec`.
* INTERNAL: Do not import directly.
*/
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.internal.AvailabilitySpecImpl::Impl as AvailabilitySpecImpl
/**
* INTERNAL: This module contains the fully generated definition of `OtherAvailabilitySpec` and should not
* be referenced directly.
*/
module Generated {
/**
* A wildcard availability spec `*`
* INTERNAL: Do not reference the `Generated::OtherAvailabilitySpec` class directly.
* Use the subclass `OtherAvailabilitySpec`, where the following predicates are available.
*/
class OtherAvailabilitySpec extends Synth::TOtherAvailabilitySpec,
AvailabilitySpecImpl::AvailabilitySpec
{
override string getAPrimaryQlClass() { result = "OtherAvailabilitySpec" }
}
}

View File

@@ -55,6 +55,12 @@ private module Impl {
)
}
private Element getImmediateChildOfAvailabilitySpec(
AvailabilitySpec e, int index, string partialPredicateCall
) {
none()
}
private Element getImmediateChildOfKeyPathComponent(
KeyPathComponent e, int index, string partialPredicateCall
) {
@@ -89,18 +95,6 @@ private module Impl {
)
}
private Element getImmediateChildOfOtherAvailabilitySpec(
OtherAvailabilitySpec e, int index, string partialPredicateCall
) {
none()
}
private Element getImmediateChildOfPlatformVersionAvailabilitySpec(
PlatformVersionAvailabilitySpec e, int index, string partialPredicateCall
) {
none()
}
private Element getImmediateChildOfCapturedDecl(
CapturedDecl e, int index, string partialPredicateCall
) {
@@ -3140,8 +3134,8 @@ private module Impl {
none()
}
private Element getImmediateChildOfOpenedArchetypeType(
OpenedArchetypeType e, int index, string partialPredicateCall
private Element getImmediateChildOfExistentialArchetypeType(
ExistentialArchetypeType e, int index, string partialPredicateCall
) {
none()
}
@@ -3188,16 +3182,14 @@ private module Impl {
or
result = getImmediateChildOfAvailabilityInfo(e, index, partialAccessor)
or
result = getImmediateChildOfAvailabilitySpec(e, index, partialAccessor)
or
result = getImmediateChildOfKeyPathComponent(e, index, partialAccessor)
or
result = getImmediateChildOfMacroRole(e, index, partialAccessor)
or
result = getImmediateChildOfUnspecifiedElement(e, index, partialAccessor)
or
result = getImmediateChildOfOtherAvailabilitySpec(e, index, partialAccessor)
or
result = getImmediateChildOfPlatformVersionAvailabilitySpec(e, index, partialAccessor)
or
result = getImmediateChildOfCapturedDecl(e, index, partialAccessor)
or
result = getImmediateChildOfEnumCaseDecl(e, index, partialAccessor)
@@ -3674,7 +3666,7 @@ private module Impl {
or
result = getImmediateChildOfEnumType(e, index, partialAccessor)
or
result = getImmediateChildOfOpenedArchetypeType(e, index, partialAccessor)
result = getImmediateChildOfExistentialArchetypeType(e, index, partialAccessor)
or
result = getImmediateChildOfOptionalType(e, index, partialAccessor)
or

View File

@@ -1,46 +0,0 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the generated definition of `PlatformVersionAvailabilitySpec`.
* INTERNAL: Do not import directly.
*/
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.internal.AvailabilitySpecImpl::Impl as AvailabilitySpecImpl
/**
* INTERNAL: This module contains the fully generated definition of `PlatformVersionAvailabilitySpec` and should not
* be referenced directly.
*/
module Generated {
/**
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
* INTERNAL: Do not reference the `Generated::PlatformVersionAvailabilitySpec` class directly.
* Use the subclass `PlatformVersionAvailabilitySpec`, where the following predicates are available.
*/
class PlatformVersionAvailabilitySpec extends Synth::TPlatformVersionAvailabilitySpec,
AvailabilitySpecImpl::AvailabilitySpec
{
override string getAPrimaryQlClass() { result = "PlatformVersionAvailabilitySpec" }
/**
* Gets the platform of this platform version availability spec.
*/
string getPlatform() {
result =
Synth::convertPlatformVersionAvailabilitySpecToRaw(this)
.(Raw::PlatformVersionAvailabilitySpec)
.getPlatform()
}
/**
* Gets the version of this platform version availability spec.
*/
string getVersion() {
result =
Synth::convertPlatformVersionAvailabilitySpecToRaw(this)
.(Raw::PlatformVersionAvailabilitySpec)
.getVersion()
}
}
}

View File

@@ -161,7 +161,24 @@ module Raw {
* if #available(iOS 12, *)
* ```
*/
class AvailabilitySpec extends @availability_spec, AstNode { }
class AvailabilitySpec extends @availability_spec, AstNode {
override string toString() { result = "AvailabilitySpec" }
/**
* Gets the platform of this availability spec, if it exists.
*/
string getPlatform() { availability_spec_platforms(this, result) }
/**
* Gets the version of this availability spec, if it exists.
*/
string getVersion() { availability_spec_versions(this, result) }
/**
* Holds if this availability spec is wildcard.
*/
predicate isWildcard() { availability_spec_is_wildcard(this) }
}
/**
* INTERNAL: Do not use.
@@ -209,12 +226,14 @@ module Raw {
*
* INTERNAL: Do not use.
*
* This is 3 for properties, 4 for array and dictionary subscripts, 5 for optional forcing
* (`!`), 6 for optional chaining (`?`), 7 for implicit optional wrapping, 8 for `self`,
* and 9 for tuple element indexing.
* TODO: Swift 6.2 update with UnresolvedApply and Apply
*
* The following values should not appear: 0 for invalid components, 1 for unresolved
* properties, 2 for unresolved subscripts, 10 for #keyPath dictionary keys, and 11 for
* This is 5 for properties, 6 for array and dictionary subscripts, 7 for optional forcing
* (`!`), 8 for optional chaining (`?`), 9 for implicit optional wrapping, 10 for `self`,
* and 11 for tuple element indexing.
*
* The following values should not appear: 0 for invalid components, 2 for unresolved
* properties, 3 for unresolved subscripts, 12 for #keyPath dictionary keys, and 13 for
* implicit IDE code completion data.
*/
int getKind() { key_path_components(this, result, _) }
@@ -308,34 +327,6 @@ module Raw {
AstNode getChild(int index) { unspecified_element_children(this, index, result) }
}
/**
* INTERNAL: Do not use.
* A wildcard availability spec `*`
*/
class OtherAvailabilitySpec extends @other_availability_spec, AvailabilitySpec {
override string toString() { result = "OtherAvailabilitySpec" }
}
/**
* INTERNAL: Do not use.
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
*/
class PlatformVersionAvailabilitySpec extends @platform_version_availability_spec,
AvailabilitySpec
{
override string toString() { result = "PlatformVersionAvailabilitySpec" }
/**
* Gets the platform of this platform version availability spec.
*/
string getPlatform() { platform_version_availability_specs(this, result, _) }
/**
* Gets the version of this platform version availability spec.
*/
string getVersion() { platform_version_availability_specs(this, _, result) }
}
/**
* INTERNAL: Do not use.
*/
@@ -3859,8 +3850,8 @@ module Raw {
/**
* INTERNAL: Do not use.
*/
class OpenedArchetypeType extends @opened_archetype_type, LocalArchetypeType {
override string toString() { result = "OpenedArchetypeType" }
class ExistentialArchetypeType extends @existential_archetype_type, LocalArchetypeType {
override string toString() { result = "ExistentialArchetypeType" }
}
/**

View File

@@ -18,6 +18,10 @@ module Synth {
* INTERNAL: Do not use.
*/
TAvailabilityInfo(Raw::AvailabilityInfo id) { constructAvailabilityInfo(id) } or
/**
* INTERNAL: Do not use.
*/
TAvailabilitySpec(Raw::AvailabilitySpec id) { constructAvailabilitySpec(id) } or
/**
* INTERNAL: Do not use.
*/
@@ -42,16 +46,6 @@ module Synth {
* INTERNAL: Do not use.
*/
TMacroRole(Raw::MacroRole id) { constructMacroRole(id) } or
/**
* INTERNAL: Do not use.
*/
TOtherAvailabilitySpec(Raw::OtherAvailabilitySpec id) { constructOtherAvailabilitySpec(id) } or
/**
* INTERNAL: Do not use.
*/
TPlatformVersionAvailabilitySpec(Raw::PlatformVersionAvailabilitySpec id) {
constructPlatformVersionAvailabilitySpec(id)
} or
/**
* INTERNAL: Do not use.
*/
@@ -976,6 +970,12 @@ module Synth {
* INTERNAL: Do not use.
*/
TErrorType(Raw::ErrorType id) { constructErrorType(id) } or
/**
* INTERNAL: Do not use.
*/
TExistentialArchetypeType(Raw::ExistentialArchetypeType id) {
constructExistentialArchetypeType(id)
} or
/**
* INTERNAL: Do not use.
*/
@@ -1024,10 +1024,6 @@ module Synth {
TOpaqueTypeArchetypeType(Raw::OpaqueTypeArchetypeType id) {
constructOpaqueTypeArchetypeType(id)
} or
/**
* INTERNAL: Do not use.
*/
TOpenedArchetypeType(Raw::OpenedArchetypeType id) { constructOpenedArchetypeType(id) } or
/**
* INTERNAL: Do not use.
*/
@@ -1121,11 +1117,6 @@ module Synth {
TDecl or TExpr or TKeyPathComponent or TMacroRole or TPattern or TStmt or TStmtCondition or
TTypeRepr;
/**
* INTERNAL: Do not use.
*/
class TAvailabilitySpec = TOtherAvailabilitySpec or TPlatformVersionAvailabilitySpec;
/**
* INTERNAL: Do not use.
*/
@@ -1400,7 +1391,7 @@ module Synth {
/**
* INTERNAL: Do not use.
*/
class TLocalArchetypeType = TElementArchetypeType or TOpenedArchetypeType;
class TLocalArchetypeType = TElementArchetypeType or TExistentialArchetypeType;
/**
* INTERNAL: Do not use.
@@ -1453,6 +1444,12 @@ module Synth {
*/
TAvailabilityInfo convertAvailabilityInfoFromRaw(Raw::Element e) { result = TAvailabilityInfo(e) }
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TAvailabilitySpec`, if possible.
*/
TAvailabilitySpec convertAvailabilitySpecFromRaw(Raw::Element e) { result = TAvailabilitySpec(e) }
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TComment`, if possible.
@@ -1489,22 +1486,6 @@ module Synth {
*/
TMacroRole convertMacroRoleFromRaw(Raw::Element e) { result = TMacroRole(e) }
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TOtherAvailabilitySpec`, if possible.
*/
TOtherAvailabilitySpec convertOtherAvailabilitySpecFromRaw(Raw::Element e) {
result = TOtherAvailabilitySpec(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TPlatformVersionAvailabilitySpec`, if possible.
*/
TPlatformVersionAvailabilitySpec convertPlatformVersionAvailabilitySpecFromRaw(Raw::Element e) {
result = TPlatformVersionAvailabilitySpec(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TUnknownFile`, if possible.
@@ -2987,6 +2968,14 @@ module Synth {
*/
TErrorType convertErrorTypeFromRaw(Raw::Element e) { result = TErrorType(e) }
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TExistentialArchetypeType`, if possible.
*/
TExistentialArchetypeType convertExistentialArchetypeTypeFromRaw(Raw::Element e) {
result = TExistentialArchetypeType(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TExistentialMetatypeType`, if possible.
@@ -3061,14 +3050,6 @@ module Synth {
result = TOpaqueTypeArchetypeType(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TOpenedArchetypeType`, if possible.
*/
TOpenedArchetypeType convertOpenedArchetypeTypeFromRaw(Raw::Element e) {
result = TOpenedArchetypeType(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TOptionalType`, if possible.
@@ -3239,16 +3220,6 @@ module Synth {
result = convertTypeReprFromRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw DB element to a synthesized `TAvailabilitySpec`, if possible.
*/
TAvailabilitySpec convertAvailabilitySpecFromRaw(Raw::Element e) {
result = convertOtherAvailabilitySpecFromRaw(e)
or
result = convertPlatformVersionAvailabilitySpecFromRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw DB element to a synthesized `TCallable`, if possible.
@@ -4058,7 +4029,7 @@ module Synth {
TLocalArchetypeType convertLocalArchetypeTypeFromRaw(Raw::Element e) {
result = convertElementArchetypeTypeFromRaw(e)
or
result = convertOpenedArchetypeTypeFromRaw(e)
result = convertExistentialArchetypeTypeFromRaw(e)
}
/**
@@ -4197,6 +4168,12 @@ module Synth {
*/
Raw::Element convertAvailabilityInfoToRaw(TAvailabilityInfo e) { e = TAvailabilityInfo(result) }
/**
* INTERNAL: Do not use.
* Converts a synthesized `TAvailabilitySpec` to a raw DB element, if possible.
*/
Raw::Element convertAvailabilitySpecToRaw(TAvailabilitySpec e) { e = TAvailabilitySpec(result) }
/**
* INTERNAL: Do not use.
* Converts a synthesized `TComment` to a raw DB element, if possible.
@@ -4233,22 +4210,6 @@ module Synth {
*/
Raw::Element convertMacroRoleToRaw(TMacroRole e) { e = TMacroRole(result) }
/**
* INTERNAL: Do not use.
* Converts a synthesized `TOtherAvailabilitySpec` to a raw DB element, if possible.
*/
Raw::Element convertOtherAvailabilitySpecToRaw(TOtherAvailabilitySpec e) {
e = TOtherAvailabilitySpec(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TPlatformVersionAvailabilitySpec` to a raw DB element, if possible.
*/
Raw::Element convertPlatformVersionAvailabilitySpecToRaw(TPlatformVersionAvailabilitySpec e) {
e = TPlatformVersionAvailabilitySpec(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TUnknownFile` to a raw DB element, if possible.
@@ -5729,6 +5690,14 @@ module Synth {
*/
Raw::Element convertErrorTypeToRaw(TErrorType e) { e = TErrorType(result) }
/**
* INTERNAL: Do not use.
* Converts a synthesized `TExistentialArchetypeType` to a raw DB element, if possible.
*/
Raw::Element convertExistentialArchetypeTypeToRaw(TExistentialArchetypeType e) {
e = TExistentialArchetypeType(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TExistentialMetatypeType` to a raw DB element, if possible.
@@ -5803,14 +5772,6 @@ module Synth {
e = TOpaqueTypeArchetypeType(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TOpenedArchetypeType` to a raw DB element, if possible.
*/
Raw::Element convertOpenedArchetypeTypeToRaw(TOpenedArchetypeType e) {
e = TOpenedArchetypeType(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TOptionalType` to a raw DB element, if possible.
@@ -5981,16 +5942,6 @@ module Synth {
result = convertTypeReprToRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TAvailabilitySpec` to a raw DB element, if possible.
*/
Raw::Element convertAvailabilitySpecToRaw(TAvailabilitySpec e) {
result = convertOtherAvailabilitySpecToRaw(e)
or
result = convertPlatformVersionAvailabilitySpecToRaw(e)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TCallable` to a raw DB element, if possible.
@@ -6800,7 +6751,7 @@ module Synth {
Raw::Element convertLocalArchetypeTypeToRaw(TLocalArchetypeType e) {
result = convertElementArchetypeTypeToRaw(e)
or
result = convertOpenedArchetypeTypeToRaw(e)
result = convertExistentialArchetypeTypeToRaw(e)
}
/**

View File

@@ -4,14 +4,13 @@
*/
import codeql.swift.elements.internal.AvailabilityInfoConstructor
import codeql.swift.elements.internal.AvailabilitySpecConstructor
import codeql.swift.elements.internal.CommentConstructor
import codeql.swift.elements.internal.DbFileConstructor
import codeql.swift.elements.internal.DbLocationConstructor
import codeql.swift.elements.internal.DiagnosticsConstructor
import codeql.swift.elements.internal.KeyPathComponentConstructor
import codeql.swift.elements.internal.MacroRoleConstructor
import codeql.swift.elements.internal.OtherAvailabilitySpecConstructor
import codeql.swift.elements.internal.PlatformVersionAvailabilitySpecConstructor
import codeql.swift.elements.internal.UnspecifiedElementConstructor
import codeql.swift.elements.decl.internal.AccessorConstructor
import codeql.swift.elements.decl.internal.AssociatedTypeDeclConstructor
@@ -224,6 +223,7 @@ import codeql.swift.elements.type.internal.DynamicSelfTypeConstructor
import codeql.swift.elements.type.internal.ElementArchetypeTypeConstructor
import codeql.swift.elements.type.internal.EnumTypeConstructor
import codeql.swift.elements.type.internal.ErrorTypeConstructor
import codeql.swift.elements.type.internal.ExistentialArchetypeTypeConstructor
import codeql.swift.elements.type.internal.ExistentialMetatypeTypeConstructor
import codeql.swift.elements.type.internal.ExistentialTypeConstructor
import codeql.swift.elements.type.internal.FunctionTypeConstructor
@@ -235,7 +235,6 @@ import codeql.swift.elements.type.internal.LValueTypeConstructor
import codeql.swift.elements.type.internal.MetatypeTypeConstructor
import codeql.swift.elements.type.internal.ModuleTypeConstructor
import codeql.swift.elements.type.internal.OpaqueTypeArchetypeTypeConstructor
import codeql.swift.elements.type.internal.OpenedArchetypeTypeConstructor
import codeql.swift.elements.type.internal.OptionalTypeConstructor
import codeql.swift.elements.type.internal.PackArchetypeTypeConstructor
import codeql.swift.elements.type.internal.PackElementTypeConstructor

View File

@@ -0,0 +1,25 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the generated definition of `ExistentialArchetypeType`.
* INTERNAL: Do not import directly.
*/
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.type.internal.LocalArchetypeTypeImpl::Impl as LocalArchetypeTypeImpl
/**
* INTERNAL: This module contains the fully generated definition of `ExistentialArchetypeType` and should not
* be referenced directly.
*/
module Generated {
/**
* INTERNAL: Do not reference the `Generated::ExistentialArchetypeType` class directly.
* Use the subclass `ExistentialArchetypeType`, where the following predicates are available.
*/
class ExistentialArchetypeType extends Synth::TExistentialArchetypeType,
LocalArchetypeTypeImpl::LocalArchetypeType
{
override string getAPrimaryQlClass() { result = "ExistentialArchetypeType" }
}
}

View File

@@ -1,25 +0,0 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the generated definition of `OpenedArchetypeType`.
* INTERNAL: Do not import directly.
*/
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.type.internal.LocalArchetypeTypeImpl::Impl as LocalArchetypeTypeImpl
/**
* INTERNAL: This module contains the fully generated definition of `OpenedArchetypeType` and should not
* be referenced directly.
*/
module Generated {
/**
* INTERNAL: Do not reference the `Generated::OpenedArchetypeType` class directly.
* Use the subclass `OpenedArchetypeType`, where the following predicates are available.
*/
class OpenedArchetypeType extends Synth::TOpenedArchetypeType,
LocalArchetypeTypeImpl::LocalArchetypeType
{
override string getAPrimaryQlClass() { result = "OpenedArchetypeType" }
}
}

View File

@@ -133,10 +133,26 @@ availability_info_specs(
int spec: @availability_spec_or_none ref
);
@availability_spec =
@other_availability_spec
| @platform_version_availability_spec
;
availability_specs(
unique int id: @availability_spec
);
#keyset[id]
availability_spec_platforms(
int id: @availability_spec ref,
string platform: string ref
);
#keyset[id]
availability_spec_versions(
int id: @availability_spec ref,
string version: string ref
);
#keyset[id]
availability_spec_is_wildcard(
int id: @availability_spec ref
);
@callable =
@closure_expr
@@ -245,16 +261,6 @@ unspecified_element_children(
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
@@ -2533,7 +2539,7 @@ dictionary_types( //dir=type
@local_archetype_type =
@element_archetype_type
| @opened_archetype_type
| @existential_archetype_type
;
@nominal_type =
@@ -2596,8 +2602,8 @@ enum_types( //dir=type
unique int id: @enum_type
);
opened_archetype_types( //dir=type
unique int id: @opened_archetype_type
existential_archetype_types( //dir=type
unique int id: @existential_archetype_type
);
optional_types( //dir=type

View File

@@ -0,0 +1,21 @@
class AvailabilitySpec extends @availability_spec {
string toString() { none() }
}
query predicate new_availability_specs(AvailabilitySpec id) {
platform_version_availability_specs(id, _, _)
or
other_availability_specs(id)
}
query predicate new_availability_spec_platforms(AvailabilitySpec id, string platform) {
platform_version_availability_specs(id, platform, _)
}
query predicate new_availability_spec_versions(AvailabilitySpec id, string version) {
platform_version_availability_specs(id, _, version)
}
query predicate new_availability_spec_is_wildcard(AvailabilitySpec id) {
other_availability_specs(id)
}

View File

@@ -0,0 +1,7 @@
class OpenedArchetypeType extends @opened_archetype_type {
string toString() { none() }
}
from OpenedArchetypeType id
where opened_archetype_types(id)
select id

View File

@@ -0,0 +1,13 @@
class KeyPathComponent extends @key_path_component {
string toString() { none() }
}
class TypeOrNone extends @type_or_none {
string toString() { none() }
}
from KeyPathComponent id, int kind, int new_kind, TypeOrNone component_type
where
key_path_components(id, kind, component_type) and
if kind < 3 then new_kind = kind else new_kind = kind + 2
select id, new_kind, component_type

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
description: Upgrade to Swift 6.2
compatibility: full
availability_specs.rel: run availability_specs.qlo new_availability_specs
availability_spec_platforms.rel: run availability_specs.qlo new_availability_spec_platforms
availability_spec_versions.rel: run availability_specs.qlo new_availability_spec_versions
availability_spec_is_wildcard.rel: run availability_specs.qlo new_availability_spec_is_wildcard
existential_archetype_types.rel: run existential_archetype_types.qlo
key_path_components.rel: run key_path_components.qlo
opened_archetype_types.rel: delete
other_availability_specs.rel: delete
platform_version_availability_specs.rel: delete

View File

@@ -6,12 +6,13 @@
| expressions.swift:6:9:6:9 | hello world | StringLiteralExpr |
| expressions.swift:7:10:7:10 | "..." | InterpolatedStringLiteralExpr |
| expressions.swift:7:10:7:10 | OpaqueValueExpr | OpaqueValueExpr |
| expressions.swift:7:10:7:10 | appendLiteral(_:) | DeclRefExpr |
| expressions.swift:7:10:7:10 | hello | StringLiteralExpr |
| expressions.swift:7:10:7:21 | TapExpr | TapExpr |
| expressions.swift:7:11:7:10 | call to appendLiteral(_:) | CallExpr |
| expressions.swift:7:11:7:11 | $interpolation | DeclRefExpr |
| expressions.swift:7:11:7:11 | &... | InOutExpr |
| expressions.swift:7:11:7:11 | .appendLiteral(_:) | MethodLookupExpr |
| expressions.swift:7:11:7:11 | call to appendLiteral(_:) | CallExpr |
| expressions.swift:7:18:7:18 | $interpolation | DeclRefExpr |
| expressions.swift:7:18:7:18 | &... | InOutExpr |
| expressions.swift:7:18:7:18 | .appendInterpolation(_:) | MethodLookupExpr |
@@ -22,6 +23,7 @@
| expressions.swift:7:21:7:21 | $interpolation | DeclRefExpr |
| expressions.swift:7:21:7:21 | &... | InOutExpr |
| expressions.swift:7:21:7:21 | .appendLiteral(_:) | MethodLookupExpr |
| expressions.swift:7:21:7:21 | appendLiteral(_:) | DeclRefExpr |
| expressions.swift:7:21:7:21 | call to appendLiteral(_:) | CallExpr |
| expressions.swift:8:15:8:15 | nil | NilLiteralExpr |
| expressions.swift:15:9:15:9 | x | DeclRefExpr |

View File

@@ -1,8 +1,10 @@
| expressions.swift:7:10:7:10 | appendLiteral(_:) | OrdinarySemantics |
| expressions.swift:7:11:7:11 | $interpolation | OrdinarySemantics |
| expressions.swift:7:18:7:18 | $interpolation | OrdinarySemantics |
| expressions.swift:7:18:7:18 | appendInterpolation(_:) | OrdinarySemantics |
| expressions.swift:7:19:7:19 | a | OrdinarySemantics |
| expressions.swift:7:21:7:21 | $interpolation | OrdinarySemantics |
| expressions.swift:7:21:7:21 | appendLiteral(_:) | OrdinarySemantics |
| expressions.swift:15:9:15:9 | x | OrdinarySemantics |
| expressions.swift:15:11:15:11 | !=(_:_:) | OrdinarySemantics |
| expressions.swift:16:19:16:19 | failed | OrdinarySemantics |

View File

@@ -1,18 +1,18 @@
instances
| file://:0:0:0:0 | KeyPathComponent | getKind: | 7 | getComponentType: | Int? |
| key_path_expr.swift:11:17:11:17 | KeyPathComponent | getKind: | 3 | getComponentType: | Int |
| key_path_expr.swift:12:24:12:26 | KeyPathComponent | getKind: | 4 | getComponentType: | Int |
| key_path_expr.swift:13:34:13:38 | KeyPathComponent | getKind: | 4 | getComponentType: | Int? |
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 5 | getComponentType: | Int |
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 8 | getComponentType: | Int? |
| key_path_expr.swift:15:21:15:21 | KeyPathComponent | getKind: | 3 | getComponentType: | Bar? |
| key_path_expr.swift:15:24:15:24 | KeyPathComponent | getKind: | 6 | getComponentType: | Bar |
| key_path_expr.swift:15:26:15:26 | KeyPathComponent | getKind: | 3 | getComponentType: | Int? |
| key_path_expr.swift:16:25:16:25 | KeyPathComponent | getKind: | 3 | getComponentType: | Bar? |
| key_path_expr.swift:16:28:16:28 | KeyPathComponent | getKind: | 6 | getComponentType: | Bar |
| key_path_expr.swift:16:30:16:30 | KeyPathComponent | getKind: | 3 | getComponentType: | Int |
| key_path_expr.swift:17:16:17:16 | KeyPathComponent | getKind: | 8 | getComponentType: | Int |
| key_path_expr.swift:18:32:18:32 | KeyPathComponent | getKind: | 9 | getComponentType: | Int |
| file://:0:0:0:0 | KeyPathComponent | getKind: | 9 | getComponentType: | Int? |
| key_path_expr.swift:11:17:11:17 | KeyPathComponent | getKind: | 5 | getComponentType: | Int |
| key_path_expr.swift:12:24:12:26 | KeyPathComponent | getKind: | 6 | getComponentType: | Int |
| key_path_expr.swift:13:34:13:38 | KeyPathComponent | getKind: | 6 | getComponentType: | Int? |
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 7 | getComponentType: | Int |
| key_path_expr.swift:14:31:14:31 | KeyPathComponent | getKind: | 10 | getComponentType: | Int? |
| key_path_expr.swift:15:21:15:21 | KeyPathComponent | getKind: | 5 | getComponentType: | Bar? |
| key_path_expr.swift:15:24:15:24 | KeyPathComponent | getKind: | 8 | getComponentType: | Bar |
| key_path_expr.swift:15:26:15:26 | KeyPathComponent | getKind: | 5 | getComponentType: | Int? |
| key_path_expr.swift:16:25:16:25 | KeyPathComponent | getKind: | 5 | getComponentType: | Bar? |
| key_path_expr.swift:16:28:16:28 | KeyPathComponent | getKind: | 8 | getComponentType: | Bar |
| key_path_expr.swift:16:30:16:30 | KeyPathComponent | getKind: | 5 | getComponentType: | Int |
| key_path_expr.swift:17:16:17:16 | KeyPathComponent | getKind: | 10 | getComponentType: | Int |
| key_path_expr.swift:18:32:18:32 | KeyPathComponent | getKind: | 11 | getComponentType: | Int |
getSubscriptArgument
| key_path_expr.swift:12:24:12:26 | KeyPathComponent | 0 | key_path_expr.swift:12:25:12:25 | : 0 |
| key_path_expr.swift:13:34:13:38 | KeyPathComponent | 0 | key_path_expr.swift:13:35:13:35 | : a |

View File

@@ -1,4 +0,0 @@
// generated by codegen/codegen.py, do not edit
After a source file is added in this directory and codegen/codegen.py is run again, test queries
will appear and this file will be deleted

View File

@@ -222,14 +222,16 @@ closures.swift:
# 39| getExpr(): [IntegerLiteralExpr] 1
# 39| getResult().getFullyConverted(): [AwaitExpr] await ...
# 39| getCapture(0): [CapturedDecl] callback
# 41| getElement(1): [CallExpr] call to Task<Success, Never>.init(priority:operation:)
# 41| getFunction(): [MethodLookupExpr] Task<Success, Never>.init(priority:operation:)
# 41| getElement(1): [CallExpr] call to Task<Success, Never>.init(name:priority:operation:)
# 41| getFunction(): [MethodLookupExpr] Task<Success, Never>.init(name:priority:operation:)
# 41| getBase(): [TypeExpr] Task<(), Never>.Type
# 41| getTypeRepr(): [TypeRepr] Task<(), Never>
# 41| getMethodRef(): [DeclRefExpr] Task<Success, Never>.init(priority:operation:)
# 41| getArgument(0): [Argument] priority: default priority
# 41| getMethodRef(): [DeclRefExpr] Task<Success, Never>.init(name:priority:operation:)
# 41| getArgument(0): [Argument] name: default name
# 41| getExpr(): [DefaultArgumentExpr] default name
# 41| getArgument(1): [Argument] priority: default priority
# 41| getExpr(): [DefaultArgumentExpr] default priority
# 41| getArgument(1): [Argument] operation: { ... }
# 41| getArgument(2): [Argument] operation: { ... }
# 41| getExpr(): [ExplicitClosureExpr] { ... }
# 41| getBody(): [BraceStmt] { ... }
# 42| getElement(0): [ReturnStmt] return ...
@@ -270,6 +272,7 @@ closures.swift:
# 46| getArgument(1): [Argument] : 1
# 46| getExpr(): [IntegerLiteralExpr] 1
# 41| [NilLiteralExpr] nil
# 41| [NilLiteralExpr] nil
# 50| [NamedFunction] foo()
# 50| InterfaceType = () -> Int
# 50| getBody(): [BraceStmt] { ... }

View File

@@ -103,7 +103,7 @@ getParentPattern
| var_decls.swift:65:19:65:19 | case_variable | var_decls.swift:65:8:65:35 | .value(...) |
| var_decls.swift:67:22:67:22 | unused_case_variable | var_decls.swift:67:8:67:42 | .value(...) |
getParentInitializer
| var_decls.swift:2:12:2:12 | $i$generator | var_decls.swift:2:12:2:16 | call to makeIterator() |
| var_decls.swift:2:12:2:12 | $i$generator | var_decls.swift:2:12:2:12 | call to makeIterator() |
| var_decls.swift:4:7:4:7 | i | var_decls.swift:4:11:4:11 | 0 |
| var_decls.swift:7:5:7:5 | numbers | var_decls.swift:7:15:7:18 | [...] |
| var_decls.swift:10:12:10:12 | numbers | var_decls.swift:10:22:10:35 | [...] |

View File

@@ -15,6 +15,7 @@ instances
| file://:0:0:0:0 | @attached(memberAttribute) | getKind: | 8 | getMacroSyntax: | 1 |
| file://:0:0:0:0 | @attached(peer) | getKind: | 32 | getMacroSyntax: | 1 |
| file://:0:0:0:0 | @attached(peer) | getKind: | 32 | getMacroSyntax: | 1 |
| file://:0:0:0:0 | @attached(peer) | getKind: | 32 | getMacroSyntax: | 1 |
| test.swift:1:2:1:26 | #freestanding(declaration) | getKind: | 2 | getMacroSyntax: | 0 |
| test.swift:3:2:3:25 | #freestanding(expression) | getKind: | 1 | getMacroSyntax: | 0 |
| test.swift:5:2:5:17 | @attached(member) | getKind: | 16 | getMacroSyntax: | 1 |
@@ -22,4 +23,5 @@ instances
getConformance
getName
| file://:0:0:0:0 | @attached(peer) | 0 | $() |
| file://:0:0:0:0 | @attached(peer) | 0 | _() |
| file://:0:0:0:0 | @attached(peer) | 0 | _lldb_summary() |

View File

@@ -47,6 +47,6 @@ func closures() {
func f2(
@Wrapper p1: Int,
@WrapperWithInit p2: Int,
// @WrapperWithProjected p3: Int, // Disabled causes crashes with Swift 6.1
// @WrapperWithProjectedAndInit p4: Int // Disabled causes crashes with Swift 6.1
// @WrapperWithProjected p3: Int, // Disabled causes crashes with Swift 6.1/6.2
// @WrapperWithProjectedAndInit p4: Int // Disabled causes crashes with Swift 6.1/6.2
) {}

View File

@@ -1,4 +1,2 @@
instances
| diagnostics.swift:2:1:2:25 | #warning(...) | getModule: | file://:0:0:0:0 | diagnostics | getKind: | 2 | getMessage: | diagnostics.swift:2:10:2:10 | I'm a warning |
| diagnostics.swift:3:1:3:26 | #error(...) | getModule: | file://:0:0:0:0 | diagnostics | getKind: | 1 | getMessage: | diagnostics.swift:3:8:3:8 | And I'm an error |
getMember

View File

@@ -10,7 +10,7 @@
}
func foo(
// @Wrapper x: Int // Disabled causes crashes with Swift 6.1
// @Wrapper x: Int // Disabled causes crashes with Swift 6.1/6.2
) {}
// foo(x: 42)
@@ -18,7 +18,7 @@ func foo(
let closure = {
(
// @Wrapper y: Int // Disabled causes crashes with Swift 6.1
// @Wrapper y: Int // Disabled causes crashes with Swift 6.1/6.2
) in return
}

Some files were not shown because too many files have changed in this diff Show More