-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I haven't looked into this yet, but came across this in a weird edge case where array expansion causes system stack error,.


- ------------ VERSION WITH ERROR ---------------------
def a( *arr )
  arr.inject(0){ |s,e| s+=e.size }
end

values = []
1_000_000.times { values << [ '123456', '6543231' ] }
result = a( *values )

1_000_000.times { values << [ '123456', '6543231' ] }
result = a( *values ) # => Stack Level Too Deep Error




- ------------ VERSION WITHOUT ERROR ---------------------
def a( arr )
  arr.inject(0){ |s,e| s+=e.size }
end

values = []
1_000_000.times { values << [ '123456', '6543231' ] }
result = a( values )

1_000_000.times { values << [ '123456', '6543231' ] }
result = a( values )

Zach
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFunkVMyx0fW1d8G0RAqGxAKCBMao2ridrSCNHSMmQih7piTjlTwCffem+
i4k6hq1M834Wg9zHX/vuo8s=
=1Ili
-----END PGP SIGNATURE-----