Skip to content

Instantly share code, notes, and snippets.

@pd
Last active August 29, 2015 14:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pd/2381656ee73dcae70796 to your computer and use it in GitHub Desktop.
Save pd/2381656ee73dcae70796 to your computer and use it in GitHub Desktop.
rbx JIT/kwargs bug
def kw(a: 0); end
N = Integer(ARGV[0]) rescue 250_000
N.times { kw }
$ rbx -v
rubinius 2.3.0.n304 (2.1.0 f129cf10 2014-10-31 3.5.0 JI) [x86_64-darwin13.4.0]
$ rbx kw.rb
An exception occurred running kw.rb:
undefined method `to_hash' on 21474836793:Fixnum. (NoMethodError)
Backtrace:
Kernel(Fixnum)#to_hash (method_missing) at kernel/delta/kernel.rb:78
Object#kw at kw.rb:1
{ } in Object#__script__ at kw.rb:3
Integer(Fixnum)#times at kernel/common/integer.rb:196
Object#__script__ at kw.rb:3
Rubinius::CodeLoader#load_script at kernel/delta/code_loader.rb:66
Rubinius::CodeLoader.load_script at kernel/delta/code_loader.rb:152
Rubinius::Loader#script at kernel/loader.rb:645
Rubinius::Loader#main at kernel/loader.rb:799
$ RBXOPT='-Xint' rbx kw.rb
# runs fine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment