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

Commit38924f3

Browse files
authored
Fix TypeProviders with managed resources (#5036)
* Fix TypeProviders with managed resources* Revert "Fix TypeProviders with managed resources"This reverts commit 6f925b323bbe2cf2e1a24d887cb47234389c9ef5.* Fix Type Providers still don't compile in 15.7.2 #4972
1 parent0b940a4 commit38924f3

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

‎src/absil/ilread.fs‎

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

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

32433247
letr=
32443248
{ Name= readStringHeap ctxt nameIdx

‎src/absil/ilwrite.fs‎

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp