Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit173513e

Browse files
authored
Merge pull request #5098 from brettfo/type-provider-15.7
Cherry-pick type provider fixes to 15.7
2 parents1c56fef +b481145 commit173513e

File tree

3 files changed

+31
-25
lines changed

3 files changed

+31
-25
lines changed

‎src/absil/illib.fs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ module Shim =
12371237
interface IFileSystemwith
12381238

12391239
member__.AssemblyLoadFrom(fileName:string)=
1240-
Assembly.LoadFrom fileName
1240+
Assembly.UnsafeLoadFrom fileName
12411241

12421242
member__.AssemblyLoad(assemblyName:AssemblyName)=
12431243
Assembly.Load assemblyName

‎src/absil/ilread.fs‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,14 +3228,18 @@ and seekReadManifestResources (ctxt: ILMetadataReader) (mdv: BinaryView) (pectxt
32283228
letscoref= seekReadImplAsScopeRef ctxt mdv implIdx
32293229

32303230
letlocation=
3231-
match scorefwith
3232-
| ILScopeRef.Local->
3233-
letstart= pectxtEager.anyV2P("resource", offset+ pectxtEager.resourcesAddr)
3234-
letresourceLength= seekReadInt32 pevEager start
3235-
letoffsetOfBytesFromStartOfPhysicalPEFile= start+4
3236-
ILResourceLocation.LocalIn(ctxt.fileName, offsetOfBytesFromStartOfPhysicalPEFile, resourceLength)
3237-
| ILScopeRef.Module mref-> ILResourceLocation.File(mref, offset)
3238-
| ILScopeRef.Assembly aref-> ILResourceLocation.Assembly aref
3231+
match scorefwith
3232+
| ILScopeRef.Local->
3233+
letstart= pectxtEager.anyV2P("resource", offset+ pectxtEager.resourcesAddr)
3234+
letresourceLength= seekReadInt32 pevEager start
3235+
letoffsetOfBytesFromStartOfPhysicalPEFile= start+4
3236+
if pectxtEager.noFileOnDiskthen
3237+
ILResourceLocation.LocalOut(seekReadBytes pevEager offsetOfBytesFromStartOfPhysicalPEFile resourceLength)
3238+
else
3239+
ILResourceLocation.LocalIn(ctxt.fileName, offsetOfBytesFromStartOfPhysicalPEFile, resourceLength)
3240+
3241+
| ILScopeRef.Module mref-> ILResourceLocation.File(mref, offset)
3242+
| ILScopeRef.Assembly aref-> ILResourceLocation.Assembly aref
32393243

32403244
letr=
32413245
{ Name= readStringHeap ctxt nameIdx

‎src/absil/ilwrite.fs‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,22 +2679,24 @@ and GenEventPass3 cenv env (md: ILEventDef) =
26792679

26802680
let recGetResourceAsManifestResourceRow cenv r=
26812681
letdata,impl=
2682-
match r.Locationwith
2683-
| ILResourceLocation.LocalIn_
2684-
| ILResourceLocation.LocalOut_->
2685-
letbytes= r.GetBytes()
2686-
// Embedded managed resources must be word-aligned. However resource format is
2687-
// not specified in ECMA. Some mscorlib resources appear to be non-aligned - it seems it doesn't matter..
2688-
letoffset= cenv.resources.Position
2689-
letalignedOffset=(align0x8 offset)
2690-
letpad= alignedOffset- offset
2691-
letresourceSize= bytes.Length
2692-
cenv.resources.EmitPadding pad
2693-
cenv.resources.EmitInt32 resourceSize
2694-
cenv.resources.EmitBytes bytes
2695-
Data(alignedOffset,true),(i_File,0)
2696-
| ILResourceLocation.File(mref, offset)-> ULong offset,(i_File, GetModuleRefAsFileIdx cenv mref)
2697-
| ILResourceLocation.Assembly aref-> ULong0x0,(i_AssemblyRef, GetAssemblyRefAsIdx cenv aref)
2682+
letembedManagedResources(bytes:byte[])=
2683+
// Embedded managed resources must be word-aligned. However resource format is
2684+
// not specified in ECMA. Some mscorlib resources appear to be non-aligned - it seems it doesn't matter..
2685+
letoffset= cenv.resources.Position
2686+
letalignedOffset=(align0x8 offset)
2687+
letpad= alignedOffset- offset
2688+
letresourceSize= bytes.Length
2689+
cenv.resources.EmitPadding pad
2690+
cenv.resources.EmitInt32 resourceSize
2691+
cenv.resources.EmitBytes bytes
2692+
Data(alignedOffset,true),(i_File,0)
2693+
2694+
match r.Locationwith
2695+
| ILResourceLocation.LocalIn_-> embedManagedResources(r.GetBytes())
2696+
| ILResourceLocation.LocalOut bytes-> embedManagedResources bytes
2697+
| ILResourceLocation.File(mref, offset)-> ULong offset,(i_File, GetModuleRefAsFileIdx cenv mref)
2698+
| ILResourceLocation.Assembly aref-> ULong0x0,(i_AssemblyRef, GetAssemblyRefAsIdx cenv aref)
2699+
26982700
UnsharedRow
26992701
[| data
27002702
ULong(match r.Accesswith ILResourceAccess.Public->0x01| ILResourceAccess.Private->0x02)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp