mruby/mruby — pull request #1612 by h2so5 (2013-12-19 12:39:39+00:00)
Title: fix codegen bug in NODE_CASE

```
bin/mirb -v
mruby - Embeddable Ruby Copyright (c) 2010-2013 mruby developers
mirb - Embeddable Interactive Ruby Shell

This is a very early version, please test and report errors.
Thanks :)

> [] << case 1; when 1 then 1; end
NODE_SCOPE:
NODE_BEGIN:
NODE_CALL:
NODE_ARRAY:
method='<<' (137)
args:
NODE_CASE:
NODE_INT 1 base 10
case:
NODE_INT 1 base 10
body:
NODE_BEGIN:
NODE_INT 1 base 10
irep 0x7feed0e00030 nregs=4 nlocals=1 pools=0 syms=2 reps=0
000 OP_ARRAY	R1	R1	0
001 OP_LOADI	R2	1
002 OP_LOADI	R3	1
003 OP_MOVE	R4	R2
004 OP_SEND	R3	:===	1
005 OP_JMPIF	R3	007
006 OP_JMP	009
007 OP_LOADI	R3	1
008 OP_JMP	010
009 OP_LOADNIL	R3
010 OP_SEND	R2	:<<	1
011 OP_STOP

=> []
```

### fixed:

```
> [] << case 1; when 1 then 1; end
NODE_SCOPE:
NODE_BEGIN:
NODE_CALL:
NODE_ARRAY:
method='<<' (137)
args:
NODE_CASE:
NODE_INT 1 base 10
case:
NODE_INT 1 base 10
body:
NODE_BEGIN:
NODE_INT 1 base 10
irep 0x7fd642500040 nregs=4 nlocals=1 pools=0 syms=2 reps=0
000 OP_ARRAY	R1	R1	0
001 OP_LOADI	R2	1
002 OP_LOADI	R3	1
003 OP_MOVE	R4	R2
004 OP_SEND	R3	:===	1
005 OP_JMPIF	R3	007
006 OP_JMP	009
007 OP_LOADI	R3	1
008 OP_JMP	010
009 OP_LOADNIL	R3
010 OP_MOVE	R2	R3
011 OP_SEND	R1	:<<	1
012 OP_STOP

=> [1]
```