@@ -2679,22 +2679,24 @@ and GenEventPass3 cenv env (md: ILEventDef) =
26792679
26802680let rec GetResourceAsManifestResourceRow cenv r =
26812681 let data , impl =
2682- match r.Location with
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 = ( align 0x8 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 -> ULong 0x0 , ( 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 = ( align 0x8 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.Location with
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 -> ULong 0x0 , ( i_ AssemblyRef, GetAssemblyRefAsIdx cenv aref)
2699+
26982700 UnsharedRow
26992701 [| data
27002702 ULong ( match r.Access with ILResourceAccess.Public -> 0x01 | ILResourceAccess.Private -> 0x02 )
0 commit comments