@@ -2682,22 +2682,24 @@ and GenEventPass3 cenv env (md: ILEventDef) =
26822682
26832683let rec GetResourceAsManifestResourceRow cenv r =
26842684let data , impl =
2685- match r.Locationwith
2686- | ILResourceLocation.LocalIn_
2687- | ILResourceLocation.LocalOut_ ->
2688- let bytes = 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- let offset = cenv.resources.Position
2692- let alignedOffset = ( align0x8 offset)
2693- let pad = alignedOffset- offset
2694- let resourceSize = 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+ let embedManagedResources ( 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+ let offset = cenv.resources.Position
2689+ let alignedOffset = ( align0x8 offset)
2690+ let pad = alignedOffset- offset
2691+ let resourceSize = 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 )