Bugzilla – Bug 313842
the switch instruction supposes an empty stack
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by Manuel.Serrano@inria.fr 2004-02-09 04:08:11 MST ---- The .NET switch instruction supposes an empty stack. We are developping a compiler that produces sequences of bytecode such as: .method public virtual hidebysig instance class System.Object funcall1(class System.Object) cil managed { .maxstack 3 ldarg.0 ldarg.1 ldarg.0 ldfld int32 bigloo.procedure::'index' switch (L0,L1,err) err: call instance class System.Object bigloo.procedure::'funcall1'(class System.Object) ret L0: call class System.Object 'foo'::'BgL_zc3anonymousza31019ze3z83'(class 'bigloo.procedure',class System.Object) ret L1: call class System.Object 'foo'::'BgL_zc3anonymousza31007ze3z83'(class 'bigloo.procedure',class System.Object) ret } If this runs correctly with CLR, ROTOR and PNET, this crashes with MONO0.29. We have had to change of code generator for: .method public virtual hidebysig instance class System.Object funcall1(class System.Object) cil managed { .maxstack 3 ldarg.0 ldfld int32 bigloo.procedure::'index' switch (L0,L1,err) err: ldarg.0 ldarg.1 call instance class System.Object bigloo.procedure::'funcall1'(class System.Object) ret L0: ldarg.0 ldarg.1 call class System.Object 'foo'::'BgL_zc3anonymousza31019ze3z83'(class 'bigloo.procedure',class System.Object) ret L1: ldarg.0 ldarg.1 call class System.Object 'foo'::'BgL_zc3anonymousza31007ze3z83'(class 'bigloo.procedure',class System.Object) ret } I hope that this bug report will help. ---- Additional Comments From vargaz@freemail.hu 2004-02-10 14:28:47 MST ---- Fixed in CVS. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>Linux 2.4, gcc 3.3.2</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".