[Mono-devel-list] Bug in mini

Don Roberts roberts at refactory.com
Fri May 2 22:31:01 EDT 2003


Let me preface this by saying that I'm not a mono developer, I'm in the
process of trying to get #Smalltalk to run under it, though. We ran into a
problem running our calculator example under mono. After many hours and
brain cells, I know why it doesn't work. Mini can't handle MSIL with the
following pattern:
                 ...some code...
                 br    LOOP_TEST
LOOP:            dup
                 ...code using stack value...
LOOP_TEST:       ldloc.0
                 ldc.i4 0xff
                 ble   LOOP

What happens is that mini creates the basic block for LOOP before it has
processed any of the in-edges (since the only in-edge comes from the ble
instruction). Therefore, it doesn't know how many arguments are on the
stack when it translates the DUP instruction and CHECK_STACK(1) fails.
I'm not a C hacker, so I'm not comfortable fixing this. When we did
similar things in the Typed Smalltalk compiler (which coincidently also
used SSA form), we made sure that we processed the BB's in topological
order.
Hope this helps,

Don Roberts
roberts at refactory.com





More information about the Mono-devel-list mailing list