Skip to content

Commit

Permalink
Check maximum number of formal arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Feb 6, 2017
1 parent 48e0bbb commit f2b18a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mrbgems/mruby-compiler/core/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ lambda_body(codegen_scope *s, node *tree, int blk)
ka = kd = 0;
ba = tree->car->cdr->cdr->cdr->cdr ? 1 : 0;

if (ma > 0x1f || oa > 0x1f || pa > 0x1f || ka > 0x1f) {
codegen_error(s, "too many formal arguments");
}
a = ((mrb_aspec)(ma & 0x1f) << 18)
| ((mrb_aspec)(oa & 0x1f) << 13)
| ((ra & 1) << 12)
Expand Down

0 comments on commit f2b18a6

Please sign in to comment.