@@ -2679,22 +2679,24 @@ and GenEventPass3 cenv env (md: ILEventDef) =
26792679
26802680let rec GetResourceAsManifestResourceRow cenv r =
26812681let data , impl =
2682- match r.Locationwith
2683- | ILResourceLocation.LocalIn_
2684- | ILResourceLocation.LocalOut_ ->
2685- let bytes = 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- 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- | ILResourceLocation.File( mref, offset) -> ULong offset, ( i_ File, GetModuleRefAsFileIdx cenv mref)
2697- | ILResourceLocation.Assembly aref-> ULong0x0 , ( i_ AssemblyRef, GetAssemblyRefAsIdx cenv aref)
2682+ let embedManagedResources ( 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+ let offset = cenv.resources.Position
2686+ let alignedOffset = ( align0x8 offset)
2687+ let pad = alignedOffset- offset
2688+ let resourceSize = 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 )