From 0c61eb1b122b8d98e2e3ad3f443c97bd21e471b2 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Mon, 9 Oct 2017 19:15:41 -0400 Subject: [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 --- mcs/class/corlib/System/TypeSpec.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mcs/class/corlib/System') 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) { -- cgit v1.2.3