Bug 318632 (MONO75691) - [GMCS] System.Array.ForEach contains invalid IL
Summary: [GMCS] System.Array.ForEach contains invalid IL
Status: RESOLVED FIXED
Alias: MONO75691
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-02 20:35 UTC by Kamil Skalski
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:26: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".