From 4abe1cc13b91f3e87f96ad8f3205bd02dcdd5016 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 25 Jan 2024 12:30:26 +0100 Subject: [PATCH 1/3] try to take the stackguard depth for pushShadowedLocals from the environment --- src/Compiler/AbstractIL/ilwritepdb.fs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Compiler/AbstractIL/ilwritepdb.fs b/src/Compiler/AbstractIL/ilwritepdb.fs index 24082eea2b3..fd5ffad27ac 100644 --- a/src/Compiler/AbstractIL/ilwritepdb.fs +++ b/src/Compiler/AbstractIL/ilwritepdb.fs @@ -16,6 +16,7 @@ open Internal.Utilities open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.Support open Internal.Utilities.Library +open Internal.Utilities.Library.Extras open FSharp.Compiler.DiagnosticsLogger open FSharp.Compiler.IO open FSharp.Compiler.Text.Range @@ -1028,6 +1029,11 @@ let rec pushShadowedLocals (stackGuard: StackGuard) (localsToPush: PdbLocalVar[] // adding the text " (shadowed)" to the names of those with name conflicts. let unshadowScopes rootScope = // Avoid stack overflow when writing linearly nested scopes - let stackGuard = StackGuard(100, "ILPdbWriter.unshadowScopes") + let UnshadowScopesStackGuardDepth = + GetEnvInteger "FSHARP_ILPdb_UnshadowScopes_StackGuardDepth" 100 + + let stackGuard = + StackGuard(UnshadowScopesStackGuardDepth, "ILPdbWriter.unshadowScopes") + let result, _ = pushShadowedLocals stackGuard [||] rootScope result From beb776cd67b15f6e6300eea11b23e01e9444b924 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 25 Jan 2024 12:38:34 +0100 Subject: [PATCH 2/3] add release notes entry --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 8fa3c363b20..24cc6727780 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -6,6 +6,7 @@ ### Added +* The stackguard depth for ILPdbWriter.unshadowScopes can be modified via the environment variable `FSHARP_ILPdb_UnshadowScopes_StackGuardDepth`([PR #TODO](https://github.com/dotnet/fsharp/pull/TODO)) * Parser recovers on complex primary constructor patterns, better tree representation for primary constructor patterns. ([PR #16425](https://github.com/dotnet/fsharp/pull/16425)) * Name resolution: keep type vars in subsequent checks ([PR #16456](https://github.com/dotnet/fsharp/pull/16456)) * Higher-order-function-based API for working with the untyped abstract syntax tree. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462)) From fa696d178d503b09b4b47e9d5fcb39708cf38306 Mon Sep 17 00:00:00 2001 From: dawe Date: Thu, 25 Jan 2024 12:41:37 +0100 Subject: [PATCH 3/3] add PR number --- docs/release-notes/.FSharp.Compiler.Service/8.0.300.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 24cc6727780..35128d40ad0 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -6,7 +6,7 @@ ### Added -* The stackguard depth for ILPdbWriter.unshadowScopes can be modified via the environment variable `FSHARP_ILPdb_UnshadowScopes_StackGuardDepth`([PR #TODO](https://github.com/dotnet/fsharp/pull/TODO)) +* The stackguard depth for ILPdbWriter.unshadowScopes can be modified via the environment variable `FSHARP_ILPdb_UnshadowScopes_StackGuardDepth`([PR #16583](https://github.com/dotnet/fsharp/pull/16583)) * Parser recovers on complex primary constructor patterns, better tree representation for primary constructor patterns. ([PR #16425](https://github.com/dotnet/fsharp/pull/16425)) * Name resolution: keep type vars in subsequent checks ([PR #16456](https://github.com/dotnet/fsharp/pull/16456)) * Higher-order-function-based API for working with the untyped abstract syntax tree. ([PR #16462](https://github.com/dotnet/fsharp/pull/16462))