mruby/mruby — pull request #93 by k-tsj (2012-05-03 12:28:22+00:00)
Title: Fix SEGV caused by using the splat operator for non arrays

The following code causes SEGV.

$ bin/mruby -e 'm(*0)'

Note that ISO/IEC 30170 does not specify the case.
In CRuby, it converts an object to an array by calling #to_a if possible.
My patch simply returns an array containing an object.

$ cat t.rb
def m(*args)
p args
end

m(*0)
m(*{a: 0})

$ ruby -v t.rb
ruby 2.0.0dev (2012-05-02 trunk 35518) [x86_64-linux]
[0]
[[:a, 0]]

$ bin/mruby t.rb
[0]
[{:a=>0}]