Bug 54212

Summary: Mono allows casts of non-zero bound array to zero bound array
Product: [Mono] Runtime Reporter: Marek Safar <masafa>
Component: JITAssignee: Zoltan Varga <vargaz>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime
Priority: ---    
Version: master   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description Marek Safar 2017-03-29 12:54:00 UTC
using System;

	class Program
	{
		static void Main (string [] args)
		{
			int [] myLengthArray = new int [1] { 3 };
			int [] myBoundArray = new int [1] { 1 };
			Array a = Array.CreateInstance (typeof (String), myLengthArray, myBoundArray);
			var res = a as Object [];
			Console.WriteLine (res); // Needs to print nothing
			return;
		}
	}
Comment 1 Zoltan Varga 2017-04-03 14:32:38 UTC
https://github.com/mono/mono/pull/4633
Comment 2 Zoltan Varga 2017-04-03 16:31:11 UTC
-> FIXED.