diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 76bf5019cd8ed..6d255bdbc9f2a 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -90,9 +90,9 @@
2f4ef297939628143389ddeea569874ded0b1c1b
-
+
https://github.com/dotnet/emsdk
- abfa03c97f4175d4d209435cd0e71f558e36c3fd
+ 66dbaefff04250dc72849f0172e0c53bcfb3ab38
@@ -107,79 +107,79 @@
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/xliff-tasks
- 493329204079519072f0241ed26f692bdee0d60c
+ 649a1e75101b701d753ee41efbe9038f9b23a0db
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
https://github.com/dotnet/runtime-assets
@@ -330,9 +330,9 @@
https://github.com/dotnet/xharness
480b9159eb7e69b182a87581d5a336e97e0b6dae
-
+
https://github.com/dotnet/arcade
- 9b2af35a6702526dc8a7c5fcadcc44efd0dca170
+ 46ff142f43e887d5f9a4d87ef39d72166f61db8d
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
diff --git a/eng/Versions.props b/eng/Versions.props
index 3cccff5761371..fd3e699e21403 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -7,12 +7,14 @@
0
0
8.0.100
- 7.0.8
+ 7.0.11
6.0.$([MSBuild]::Add($([System.Version]::Parse('$(PackageVersionNet7)').Build),11))
rc
1
-$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)
$(SdkBandVersion)$(WorkloadVersionSuffix)
+
+ false
$(MajorVersion).$(MinorVersion).0.0
@@ -83,21 +85,21 @@
8.0.100-preview.7.23329.3
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 2.5.1-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
- 8.0.0-beta.23411.1
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 2.5.1-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
+ 8.0.0-beta.23415.4
6.0.0-preview.1.102
@@ -238,7 +240,7 @@
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-8_0_100_Transport
-->
- 8.0.0-rc.1.23411.2
+ 8.0.0-rc.1.23415.5
$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)
1.1.87-gba258badda
diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1
index 2dc86ea2cdda1..6c65e81925f2a 100644
--- a/eng/common/SetupNugetSources.ps1
+++ b/eng/common/SetupNugetSources.ps1
@@ -2,7 +2,7 @@
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
-# under for each Maestro managed private feed. Two additional credential
+# under for each Maestro managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
#
# This script needs to be called in every job that will restore packages and which the base repo has
@@ -37,7 +37,7 @@ Set-StrictMode -Version 2.0
# Add source entry to PackageSources
function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $Password) {
$packageSource = $sources.SelectSingleNode("add[@key='$SourceName']")
-
+
if ($packageSource -eq $null)
{
$packageSource = $doc.CreateElement("add")
@@ -48,7 +48,7 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Usern
else {
Write-Host "Package source $SourceName already present."
}
-
+
AddCredential -Creds $creds -Source $SourceName -Username $Username -Password $Password
}
@@ -89,7 +89,7 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Passw
$maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]")
Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds."
-
+
ForEach ($PackageSource in $maestroPrivateSources) {
Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key
AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -Password $Password
diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh
index a8bb8acd3be18..d387c7eac95e5 100644
--- a/eng/common/SetupNugetSources.sh
+++ b/eng/common/SetupNugetSources.sh
@@ -4,7 +4,7 @@
# This file should be removed as part of this issue: https://github.com/dotnet/arcade/issues/4080
#
# What the script does is iterate over all package sources in the pointed NuGet.config and add a credential entry
-# under for each Maestro's managed private feed. Two additional credential
+# under for each Maestro's managed private feed. Two additional credential
# entries are also added for the two private static internal feeds: dotnet3-internal and dotnet3-internal-transport.
#
# This script needs to be called in every job that will restore packages and which the base repo has
@@ -68,7 +68,7 @@ if [ "$?" != "0" ]; then
sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" $ConfigFile
fi
-# Ensure there is a ... section.
+# Ensure there is a ... section.
grep -i "" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding ... section."
@@ -142,7 +142,7 @@ IFS=$PrevIFS
for FeedName in ${PackageSources[@]} ; do
# Check if there is no existing credential for this FeedName
- grep -i "<$FeedName>" $ConfigFile
+ grep -i "<$FeedName>" $ConfigFile
if [ "$?" != "0" ]; then
echo "Adding credentials for $FeedName."
diff --git a/eng/common/native/init-distro-rid.sh b/eng/common/native/init-distro-rid.sh
index aba9fe24028b0..de1687b2ccbe7 100644
--- a/eng/common/native/init-distro-rid.sh
+++ b/eng/common/native/init-distro-rid.sh
@@ -79,7 +79,6 @@ getNonPortableDistroRid()
# Input:
# os: (str)
# arch: (str)
-# isPortable: (int)
# rootfsDir?: (nullable:string)
#
# Return:
@@ -97,10 +96,9 @@ initDistroRidGlobal()
{
local targetOs="$1"
local targetArch="$2"
- local isPortable="$3"
local rootfsDir=""
- if [ "$#" -ge 4 ]; then
- rootfsDir="$4"
+ if [ "$#" -ge 3 ]; then
+ rootfsDir="$3"
fi
if [ -n "${rootfsDir}" ]; then
diff --git a/eng/common/sdl/trim-assets-version.ps1 b/eng/common/sdl/trim-assets-version.ps1
new file mode 100644
index 0000000000000..d8cfec910c77e
--- /dev/null
+++ b/eng/common/sdl/trim-assets-version.ps1
@@ -0,0 +1,75 @@
+<#
+.SYNOPSIS
+Install and run the 'Microsoft.DotNet.VersionTools.Cli' tool with the 'trim-artifacts-version' command to trim the version from the NuGet assets file name.
+
+.PARAMETER InputPath
+Full path to directory where artifact packages are stored
+
+.PARAMETER Recursive
+Search for NuGet packages recursively
+
+#>
+
+Param(
+ [string] $InputPath,
+ [bool] $Recursive = $true
+)
+
+$CliToolName = "Microsoft.DotNet.VersionTools.Cli"
+
+function Install-VersionTools-Cli {
+ param(
+ [Parameter(Mandatory=$true)][string]$Version
+ )
+
+ Write-Host "Installing the package '$CliToolName' with a version of '$version' ..."
+ $feed = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json"
+
+ $argumentList = @("tool", "install", "--local", "$CliToolName", "--add-source $feed", "--no-cache", "--version $Version")
+ Start-Process "$dotnet" -Verbose -ArgumentList $argumentList -NoNewWindow -Wait
+}
+
+# -------------------------------------------------------------------
+
+if (!(Test-Path $InputPath)) {
+ Write-Host "Input Path '$InputPath' does not exist"
+ ExitWithExitCode 1
+}
+
+$ErrorActionPreference = 'Stop'
+Set-StrictMode -Version 2.0
+
+$disableConfigureToolsetImport = $true
+$global:LASTEXITCODE = 0
+
+# `tools.ps1` checks $ci to perform some actions. Since the SDL
+# scripts don't necessarily execute in the same agent that run the
+# build.ps1/sh script this variable isn't automatically set.
+$ci = $true
+. $PSScriptRoot\..\tools.ps1
+
+try {
+ $dotnetRoot = InitializeDotNetCli -install:$true
+ $dotnet = "$dotnetRoot\dotnet.exe"
+
+ $toolsetVersion = Read-ArcadeSdkVersion
+ Install-VersionTools-Cli -Version $toolsetVersion
+
+ $cliToolFound = (& "$dotnet" tool list --local | Where-Object {$_.Split(' ')[0] -eq $CliToolName})
+ if ($null -eq $cliToolFound) {
+ Write-PipelineTelemetryError -Force -Category 'Sdl' -Message "The '$CliToolName' tool is not installed."
+ ExitWithExitCode 1
+ }
+
+ Exec-BlockVerbosely {
+ & "$dotnet" $CliToolName trim-assets-version `
+ --assets-path $InputPath `
+ --recursive $Recursive
+ Exit-IfNZEC "Sdl"
+ }
+}
+catch {
+ Write-Host $_
+ Write-PipelineTelemetryError -Force -Category 'Sdl' -Message $_
+ ExitWithExitCode 1
+}
\ No newline at end of file
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index c9eced9f7df4c..aa74ab4a81e78 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -671,6 +671,10 @@ function InitializeNativeTools() {
}
}
+function Read-ArcadeSdkVersion() {
+ return $GlobalJson.'msbuild-sdks'.'Microsoft.DotNet.Arcade.Sdk'
+}
+
function InitializeToolset() {
if (Test-Path variable:global:_ToolsetBuildProj) {
return $global:_ToolsetBuildProj
@@ -678,7 +682,7 @@ function InitializeToolset() {
$nugetCache = GetNuGetPackageCachePath
- $toolsetVersion = $GlobalJson.'msbuild-sdks'.'Microsoft.DotNet.Arcade.Sdk'
+ $toolsetVersion = Read-ArcadeSdkVersion
$toolsetLocationFile = Join-Path $ToolsetDir "$toolsetVersion.txt"
if (Test-Path $toolsetLocationFile) {
diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml
index 7e24fd3d045d5..b870ba34757c2 100644
--- a/eng/pipelines/common/global-build-job.yml
+++ b/eng/pipelines/common/global-build-job.yml
@@ -147,7 +147,10 @@ jobs:
steps:
- checkout: self
clean: true
- fetchDepth: $(checkoutFetchDepth)
+ # If running in source build mode, a git stash will be used for the inner clone. Avoid setting a fetch depth,
+ # as a stash of a shallow cloned repo is not currently supported.
+ ${{ if ne(parameters.isSourceBuild, true) }}:
+ fetchDepth: $(checkoutFetchDepth)
- ${{ if and(eq(parameters.isOfficialBuild, true), notin(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator')) }}:
- template: /eng/pipelines/common/restore-internal-tools.yml
diff --git a/global.json b/global.json
index b4ca83d356c28..cf4ac698e3e8c 100644
--- a/global.json
+++ b/global.json
@@ -8,9 +8,9 @@
"dotnet": "8.0.100-preview.7.23376.3"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23411.1",
- "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23411.1",
- "Microsoft.DotNet.SharedFramework.Sdk": "8.0.0-beta.23411.1",
+ "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23415.4",
+ "Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23415.4",
+ "Microsoft.DotNet.SharedFramework.Sdk": "8.0.0-beta.23415.4",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0",
"Microsoft.NET.Sdk.IL": "8.0.0-rc.1.23406.6"
diff --git a/src/coreclr/ilasm/assem.cpp b/src/coreclr/ilasm/assem.cpp
index dd2c91ac093ac..2bd90fadb8f91 100644
--- a/src/coreclr/ilasm/assem.cpp
+++ b/src/coreclr/ilasm/assem.cpp
@@ -1324,7 +1324,12 @@ OPCODE Assembler::DecodeOpcode(const BYTE *pCode, DWORD *pdwLen)
char* Assembler::ReflectionNotation(mdToken tk)
{
+ // We break the global static `wzUniBuf` into 2 equal parts: the first part is used for a Unicode
+ // string, the second part is used for a converted-into-multibyte (MB) string. Note that the MB string
+ // length is in bytes.
char *sz = (char*)&wzUniBuf[dwUniBuf>>1], *pc;
+ const size_t szSizeBytes = (dwUniBuf * sizeof(WCHAR)) / 2; // sizeof(WCHAR) is 2, so this is just `dwUniBuf`
+ const size_t cchUniBuf = dwUniBuf / 2; // only use the first 1/2 of wzUniBuf
*sz=0;
switch(TypeFromToken(tk))
{
@@ -1333,7 +1338,7 @@ char* Assembler::ReflectionNotation(mdToken tk)
Class *pClass = m_lstClass.PEEK(RidFromToken(tk)-1);
if(pClass)
{
- strcpy_s(sz,dwUniBuf>>1,pClass->m_szFQN);
+ strcpy_s(sz,szSizeBytes,pClass->m_szFQN);
pc = sz;
while((pc = strchr(pc,NESTING_SEP)) != NULL)
{
@@ -1348,31 +1353,80 @@ char* Assembler::ReflectionNotation(mdToken tk)
{
ULONG N;
mdToken tkResScope;
- if(SUCCEEDED(m_pImporter->GetTypeRefProps(tk,&tkResScope,wzUniBuf,dwUniBuf>>1,&N)))
+ if(SUCCEEDED(m_pImporter->GetTypeRefProps(tk,&tkResScope,wzUniBuf,cchUniBuf,&N)))
{
- WszWideCharToMultiByte(CP_UTF8,0,wzUniBuf,-1,sz,dwUniBuf>>1,NULL,NULL);
+ int ret = WszWideCharToMultiByte(CP_UTF8,0,wzUniBuf,-1,sz,szSizeBytes,NULL,NULL);
if(TypeFromToken(tkResScope)==mdtAssemblyRef)
{
AsmManAssembly *pAsmRef = m_pManifest->m_AsmRefLst.PEEK(RidFromToken(tkResScope)-1);
if(pAsmRef)
{
- pc = &sz[strlen(sz)];
- pc+=sprintf_s(pc,(dwUniBuf >> 1),", %s, Version=%d.%d.%d.%d, Culture=",pAsmRef->szName,
+ // We assume below that if sprintf_s fails due to buffer overrun,
+ // execution fails fast and sprintf_s doesn't return.
+ int sprintf_ret;
+ const size_t szLen = strlen(sz);
+ pc = &sz[szLen];
+ size_t szRemainingSizeBytes = szSizeBytes - szLen;
+
+ sprintf_ret = sprintf_s(pc,szRemainingSizeBytes,", %s, Version=%d.%d.%d.%d, Culture=",pAsmRef->szName,
pAsmRef->usVerMajor,pAsmRef->usVerMinor,pAsmRef->usBuild,pAsmRef->usRevision);
- ULONG L=0;
- if(pAsmRef->pLocale && (L=pAsmRef->pLocale->length()))
+ pc += sprintf_ret;
+ szRemainingSizeBytes -= (size_t)sprintf_ret;
+
+ unsigned L=0;
+ if(pAsmRef->pLocale && ((L=pAsmRef->pLocale->length()) > 0))
+ {
+ // L is in bytes and doesn't include the terminating null.
+ if (L > (cchUniBuf - 1) * sizeof(WCHAR))
+ {
+ report->error("Locale too long (%d characters, %d allowed).\n",L / sizeof(WCHAR), cchUniBuf - 1);
+ *sz=0;
+ break;
+ }
+ else if (szRemainingSizeBytes == 0)
+ {
+ report->error("TypeRef too long.\n");
+ *sz=0;
+ break;
+ }
+
+ if (szRemainingSizeBytes > 0)
+ {
+ memcpy(wzUniBuf,pAsmRef->pLocale->ptr(),L);
+ wzUniBuf[L>>1] = 0;
+ ret = WszWideCharToMultiByte(CP_UTF8,0,wzUniBuf,-1,pc,(int)szRemainingSizeBytes,NULL,NULL);
+ if (ret <= 0)
+ {
+ report->error("Locale too long.\n");
+ *sz=0;
+ break;
+ }
+ else
+ {
+ pc += ret;
+ szRemainingSizeBytes -= (size_t)ret;
+ }
+ }
+ }
+ else
{
- memcpy(wzUniBuf,pAsmRef->pLocale->ptr(),L);
- wzUniBuf[L>>1] = 0;
- WszWideCharToMultiByte(CP_UTF8,0,wzUniBuf,-1,pc,dwUniBuf>>1,NULL,NULL);
+ sprintf_ret = sprintf_s(pc,szRemainingSizeBytes,"neutral");
+ pc += sprintf_ret;
+ szRemainingSizeBytes -= (size_t)sprintf_ret;
}
- else pc+=sprintf_s(pc,(dwUniBuf >> 1),"neutral");
- pc = &sz[strlen(sz)];
- if(pAsmRef->pPublicKeyToken && (L=pAsmRef->pPublicKeyToken->length()))
+ if(pAsmRef->pPublicKeyToken && ((L=pAsmRef->pPublicKeyToken->length()) > 0))
{
- pc+=sprintf_s(pc,(dwUniBuf >> 1),", Publickeytoken=");
+ sprintf_ret = sprintf_s(pc,szRemainingSizeBytes,", Publickeytoken=");
+ pc += sprintf_ret;
+ szRemainingSizeBytes -= (size_t)sprintf_ret;
+
BYTE* pb = (BYTE*)(pAsmRef->pPublicKeyToken->ptr());
- for(N=0; N> 1),"%2.2x",*pb);
+ for(unsigned i=0; i RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework");
+
+ ///
+ /// Helper for AOT tests that verifies that the compile succeeds, or throws PlatformNotSupported
+ /// when AOT is enabled.
+ ///
+ public static void ThrowsOnAot(Action action)
+ where T : Exception
+ {
+#if NETCOREAPP // Dynamic code is always supported on .NET Framework
+ if (!RuntimeFeature.IsDynamicCodeSupported)
+ {
+ Assert.Throws(action);
+ }
+ else
+#endif
+ {
+ action();
+ }
+ }
+
public static void Throws(Action action, string expectedMessage)
where T : Exception
{
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs
index c28b9f00bb4e7..670c62ee2f69a 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs
@@ -123,6 +123,15 @@ static MethodInfo GetArrayEmptyMethodInfo(Type elementType)
return ServiceLookupHelpers.GetArrayEmptyMethodInfo(elementType);
}
+ [UnconditionalSuppressMessage("AotAnalysis", "IL3050:RequiresDynamicCode",
+ Justification = "VerifyAotCompatibility ensures elementType is not a ValueType")]
+ static NewArrayExpression NewArrayInit(Type elementType, IEnumerable expr)
+ {
+ Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
+
+ return Expression.NewArrayInit(elementType, expr);
+ }
+
if (callSite.ServiceCallSites.Length == 0)
{
return Expression.Constant(
@@ -130,7 +139,7 @@ static MethodInfo GetArrayEmptyMethodInfo(Type elementType)
.Invoke(obj: null, parameters: Array.Empty