Permalink
Browse files

resolve conflict; ref #3283

  • Loading branch information...
matz committed Nov 25, 2016
2 parents 9f7701e + 75b31d7 commit 30f12ba4bcfaf7dd4d0a02cb64c664fea804cf7d
Showing with 20 additions and 3 deletions.
  1. +5 −3 mrbgems/mruby-compiler/core/codegen.c
  2. +15 −0 test/t/codegen.rb
@@ -772,6 +772,8 @@ attrsym(codegen_scope *s, mrb_sym a)
return mrb_intern(s->mrb, name2, len+1);
}
#define CALL_MAXARGS 127
static int
gen_values(codegen_scope *s, node *t, int val)
{
@@ -780,7 +782,9 @@ gen_values(codegen_scope *s, node *t, int val)
while (t) {
is_splat = (intptr_t)t->car->car == NODE_SPLAT; /* splat mode */
if (n >= 127 || is_splat) {
if (
n >= CALL_MAXARGS - 1 /* need to subtract one because vm.c expects an array if n == CALL_MAXARGS */
|| is_splat) {
if (val) {
if (is_splat && n == 0 && (intptr_t)t->car->cdr->car == NODE_ARRAY) {
codegen(s, t->car->cdr, VAL);
@@ -831,8 +835,6 @@ gen_values(codegen_scope *s, node *t, int val)
return n;
}
#define CALL_MAXARGS 127
static void
gen_call(codegen_scope *s, node *tree, mrb_sym name, int sp, int val, int safe)
{
View
@@ -31,3 +31,18 @@ def method
end
end
end
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

0 comments on commit 30f12ba

Please sign in to comment.