зеркало из https://github.com/mono/ikvm-fork.git
- Duplicated attributes (even unknown ones) must result in a parse error.
- Attributes must have a non-empty value.
This commit is contained in:
Родитель
351c13e056
Коммит
dd0b8dbc75
|
@ -301,6 +301,7 @@ namespace IKVM.Reflection
|
|||
}
|
||||
else
|
||||
{
|
||||
System.Collections.Generic.Dictionary<string, string> unknownAttributes = null;
|
||||
string[] parts = fullName.Substring(pos).Split(',');
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
{
|
||||
|
@ -351,6 +352,21 @@ namespace IKVM.Reflection
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (kv[1].Trim() == "")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (unknownAttributes == null)
|
||||
{
|
||||
unknownAttributes = new System.Collections.Generic.Dictionary<string, string>();
|
||||
}
|
||||
if (unknownAttributes.ContainsKey(kv[0].Trim().ToLowerInvariant()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
unknownAttributes.Add(kv[0].Trim().ToLowerInvariant(), null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче