Skip to content

Commit

Permalink
Fixes #16359 - correctly handle imports with 0 length public key toke…
Browse files Browse the repository at this point in the history
…ns (#16363)
  • Loading branch information
KevinRansom authored Dec 1, 2023
1 parent fb767e9 commit 1af023b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/release-notes/FSharp.Compiler.Service/8.0.200.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Miscellaneous fixes to parens analysis - https://github.com/dotnet/fsharp/pull/16262
- Miscellaneous fixes to parens analysis - https://github.com/dotnet/fsharp/pull/16262
- Fixes #16359 - correctly handle imports with 0 length public key tokens - https://github.com/dotnet/fsharp/pull/16363
7 changes: 6 additions & 1 deletion src/Compiler/AbstractIL/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1946,7 +1946,12 @@ and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx =
Name = name
AuxModuleHashAlgorithm = hash
SecurityDeclsStored = ctxt.securityDeclsReader_Assembly
PublicKey = pubkey
PublicKey =
// The runtime and C# treat a 0 length publicKey as an unsigned assembly, so if a public record exists with a length of 0
// treat it as unsigned
match pubkey with
| Some pkBytes when pkBytes.Length > 0 -> pubkey
| _ -> None
Version = Some(ILVersionInfo(v1, v2, v3, v4))
Locale = readStringHeapOption ctxt localeIdx
CustomAttrsStored = ctxt.customAttrsReader_Assembly
Expand Down

0 comments on commit 1af023b

Please sign in to comment.