diff options
author | Aleksey Kliger <aleksey@xamarin.com> | 2017-10-10 02:15:41 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-10-11 09:57:50 +0300 |
commit | 0c61eb1b122b8d98e2e3ad3f443c97bd21e471b2 (patch) | |
tree | 4e81a8106b0abec432a013ab03e977226bf06a75 /mcs/class/corlib/System/TypeSpec.cs | |
parent | e004f1ed5e1ee46344c2b5e291350e95d7877e24 (diff) |
[reflection] Throw TLE for Type.GetType("", true) (Fixes #59664)
In the C parser check for empty at the outset.
In the managed parser, copy an empty string component to the built-up TypeSpec
and handle it in the Type.GetType (..., asmResolver, typeResolver) implementation
Diffstat (limited to 'mcs/class/corlib/System/TypeSpec.cs')
-rw-r--r-- | mcs/class/corlib/System/TypeSpec.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/class/corlib/System/TypeSpec.cs b/mcs/class/corlib/System/TypeSpec.cs index f233bec088e..4436a77810f 100644 --- a/mcs/class/corlib/System/TypeSpec.cs +++ b/mcs/class/corlib/System/TypeSpec.cs @@ -455,7 +455,9 @@ namespace System { } if (name_start < pos) - data.AddName (name.Substring (name_start, pos - name_start)); + data.AddName (name.Substring (name_start, pos - name_start)); + else if (name_start == pos) + data.AddName (String.Empty); if (in_modifiers) { for (; pos < name.Length; ++pos) { |