mruby/mruby — pull request #2188 by takeru (2014-05-04 13:52:36+00:00)
Title: Don't reset ridx,eidx. And fix for #1949

To call mrb_toplevel_run recursive is breaks rescue/ensure stack.
It is from change https://github.com/mruby/mruby/issues/1949

Re-enter to mrb_toplevel_run example is:
load(https://github.com/mruby/mruby/pull/2169)
or Kernel.eval.

Code to see problem:
```
begin
ensure
puts "A"
end

begin
Kernel.eval "begin; ensure; puts 'B'; end"
ensure
puts 'C'
end

if true
# https://github.com/mruby/mruby/issues/1949
a = []
begin
a.push 0
Kernel.eval 'p "test"'
p a
ensure
a = nil
end
end

if true
begin
Kernel.eval "begin; rescue; end"
raise "zzzz"
rescue => e
puts "!!!!! should come here !!!!! e=#{e.inspect}"
end
end
```

Output(master)
```
% ../mruby/bin/mruby a.rb
A
B
"test"
[0]
TypeError: expected String
```

Output(fixed)
```
% ../mruby/bin/mruby a.rb
A
B
C
"test"
[0]
!!!!! should come here !!!!! e=a.rb:27: zzzz (RuntimeError)
```