Great!  That was it.  The only change I made was to the line where I
declared jump:

let jump:Instruction = worker.Create( OpCodes.Brtrue,
worker.Create(OpCodes.Nop))

I left the line at the end where I set jump's operand to an
Instruction(OpCodes.Ret) alone.

Thanks for your help and for this great framework.
Mike Kohout

On Sat, Jan 9, 2010 at 6:19 AM, Jb Evain <[email protected]> wrote:

> On Sat, Jan 9, 2010 at 1:08 PM, Michael Kohout <[email protected]> wrote:
> > Thanks for your reply.  I'm a bit confused.  Wouldn't the last line in
> the
> > block:
> >               jump.Operand <- e   //this sets the jump instruction's
> operand
> > to the instruction for OpCodes.Ret
> > do the same thing?
>
> Well, one will throw and the other won't? :)
>
> You can pass a dummy instruction to jump if you don't want to define
> the branch at creation time, but you have to pass something. It's just
> a requirement of the cil worker api.
>
> --
> Jb Evain  <[email protected]>
>
> --
> --
> mono-cecil
>
-- 
--
mono-cecil

Reply via email to