mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
codegen.c: limit check was too restrictive in gen_values().
That can create unnecessary arrays when more than 12 arguments are given to a method.
This commit is contained in:
@@ -1551,7 +1551,7 @@ gen_values(codegen_scope *s, node *t, int val, int limit)
|
||||
while (t) {
|
||||
int is_splat = nint(t->car->car) == NODE_SPLAT;
|
||||
|
||||
if (is_splat || n >= limit-1 || cursp() >= slimit) { /* flush stack */
|
||||
if (is_splat || n > limit || cursp() >= slimit) { /* flush stack */
|
||||
pop_n(n);
|
||||
if (first) {
|
||||
if (n == 0) {
|
||||
|
||||
Reference in New Issue
Block a user