Bugzilla – Bug 318632
[GMCS] System.Array.ForEach contains invalid IL
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by nazgul@omega.pl 2005-08-02 13:35:18 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: I got error from runtime about invalid IL in System.Array.ForEach. Steps to reproduce the problem: 1. Compile following program class M { static void p (string x) { System.Console.WriteLine (x); } static void Main () { string[] arr = new string[] { "a", "b", "c" }; System.Array.ForEach (arr, p); } } 2. Run it Actual Results: ** ERROR **: Invalid IL code at IL0045 in System.Array:ForEach (string[],System.Action`1): IL_0045: pop Expected Results: a b c How often does this happen? Always Additional Information: ---- Additional Comments From atsushi@ximian.com 2005-08-30 16:34:49 MST ---- It seems the same runtime error happens when I run the executable compiled with csc, while when I compile it with gmcs it does not complain under .net 2.0 beta2. ---- Additional Comments From lupus@ximian.com 2005-09-06 04:40:01 MST ---- It works on the ms runtime because what gmcs miscompiles is the ForEach method in corlib: for some reason it inserts a pop after the call to the Action invoke method which returns void. ---- Additional Comments From martin@ximian.com 2005-10-04 07:26:51 MST ---- Fixed in SVN. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>mono svn</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".