Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #16359 - correctly handle imports with 0 length public key tokens #16363

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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