summaryrefslogtreecommitdiffhomepage
path: root/test/t/codegen.rb
diff options
context:
space:
mode:
authorBouke van der Bijl <[email protected]>2016-11-17 11:12:35 -0500
committerBouke van der Bijl <[email protected]>2016-11-24 10:09:37 -0500
commit75b31d743813dd078c5b5c2ee5115b07b0c14f32 (patch)
tree8eb7136e5f60090b3b680e515ebde2774a504f9c /test/t/codegen.rb
parenta630c4f413f6af764e68210430e8b61a435d38d7 (diff)
downloadmruby-75b31d743813dd078c5b5c2ee5115b07b0c14f32.tar.gz
mruby-75b31d743813dd078c5b5c2ee5115b07b0c14f32.zip
Fix segfault on method call with exactly 127 arguments
Reported by https://hackerone.com/dkasak
Diffstat (limited to 'test/t/codegen.rb')
-rw-r--r--test/t/codegen.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/t/codegen.rb b/test/t/codegen.rb
new file mode 100644
index 000000000..0690cef06
--- /dev/null
+++ b/test/t/codegen.rb
@@ -0,0 +1,17 @@
+##
+# Codegen tests
+
+assert('method call with exactly 127 arguments') do
+ def args_to_ary(*args)
+ args
+ end
+
+ assert_equal [0]*127, args_to_ary(
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ )
+end