Skip to content

Commit 8e9bfc4

Browse files
committed
integrate visualfsharp master --> master
2 parents f7e00f7 + 92dc4a4 commit 8e9bfc4

File tree

16 files changed

+61441
-31
lines changed

16 files changed

+61441
-31
lines changed

src/absil/il.fs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4691,7 +4691,7 @@ type ILTypeSigParser(tstring : string) =
46914691
let ilty = x.ParseType()
46924692
ILAttribElem.Type(Some(ilty))
46934693

4694-
let decodeILAttribData ilg (ca: ILAttribute) scope =
4694+
let decodeILAttribData ilg (ca: ILAttribute) =
46954695
let bytes = ca.Data
46964696
let sigptr = 0
46974697
let bb0,sigptr = sigptr_get_byte bytes sigptr
@@ -4785,15 +4785,19 @@ let decodeILAttribData ilg (ca: ILAttribute) scope =
47854785
let et,sigptr = sigptr_get_u8 bytes sigptr
47864786
// We have a named value
47874787
let ty,sigptr =
4788-
// REVIEW: Post-M3, consider removing the restriction for scope - it's unnecessary
4789-
// because you can reconstruct scope using the qualified name from the CA Blob
4790-
if (0x50 = (int et) || 0x55 = (int et)) && Option.isSome scope then
4788+
if (0x50 = (int et) || 0x55 = (int et)) then
47914789
let qualified_tname,sigptr = sigptr_get_serstring bytes sigptr
4792-
// we're already getting the qualified name from the binary blob
4793-
// if we don't split out the unqualified name from the qualified name,
4794-
// we'll write the qualified assembly reference string twice to the binary blob
4795-
let unqualified_tname = qualified_tname.Split([|','|]).[0]
4796-
let scoref = Option.get scope
4790+
let unqualified_tname, rest =
4791+
let pieces = qualified_tname.Split(',')
4792+
if pieces.Length > 1 then
4793+
pieces.[0], Some (String.concat "," pieces.[1..])
4794+
else
4795+
pieces.[0], None
4796+
let scoref =
4797+
match rest with
4798+
| Some aname -> ILScopeRef.Assembly(ILAssemblyRef.FromAssemblyName(System.Reflection.AssemblyName(aname)))
4799+
| None -> ilg.traits.ScopeRef
4800+
47974801
let tref = mkILTyRef (scoref,unqualified_tname)
47984802
let tspec = mkILNonGenericTySpec tref
47994803
ILType.Value(tspec),sigptr

src/absil/il.fsi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,11 +1802,9 @@ val destTypeDefsWithGlobalFunctionsFirst: ILGlobals -> ILTypeDefs -> ILTypeDef l
18021802
/// Note: not all custom attribute data can be decoded without binding types. In particular
18031803
/// enums must be bound in order to discover the size of the underlying integer.
18041804
/// The following assumes enums have size int32.
1805-
/// It also does not completely decode System.Type attributes
18061805
val decodeILAttribData:
18071806
ILGlobals ->
18081807
ILAttribute ->
1809-
ILScopeRef option ->
18101808
ILAttribElem list * (* fixed args *)
18111809
ILAttributeNamedArg list (* named args: values and flags indicating if they are fields or properties *)
18121810

src/absil/ilmorph.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ let cattr_typ2typ ilg f c =
292292
// dev11 M3 defensive coding: if anything goes wrong with attribute decoding or encoding, then back out.
293293
if morphCustomAttributeData then
294294
try
295-
let elems,namedArgs = IL.decodeILAttribData ilg c (Some(meth.MethodRef.EnclosingTypeRef.Scope))
295+
let elems,namedArgs = IL.decodeILAttribData ilg c
296296
let elems = elems |> List.map (celem_typ2typ f)
297297
let namedArgs = namedArgs |> List.map (cnamedarg_typ2typ f)
298298
IL.mkILCustomAttribMethRef ilg (meth, elems, namedArgs)

0 commit comments

Comments
 (0)